Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
lawrence_shaun_introducing_net_maui_build_and_deploy_crosspl.pdf
Скачиваний:
46
Добавлен:
26.06.2023
Размер:
5.15 Mб
Скачать

Chapter 14 Releasing Our Application

App Center

App Center offers a wide range of features but the main one to focus on for here is the concept of collecting crash and analytical information. The website contains details on its usage and pricing: https://appcenter.ms.

Andreas Nesheim has written a great article on how you can get started with using App Center diagnostics in .NET MAUI: www.andreasnesheim. no/using-app-center-diagnostics-analytics-with-net-maui/.

Obfuscation

It is a very safe assumption that if you are providing a compiled application to user’s devices that any of the code in the application can be compromised, intellectual property (IP) can be stolen, or an attacker can learn about vulnerabilities in your application. If you really wish to retain your IP, then you likely want to keep it on a server-side component and have your application call it via a web API. That being said, there is still serious value in making use of tools that obfuscate the compiled codebase to make it more difficult for an attacker to decipher what the application is doing.

Let’s take a look at a simple class and how it will look when decompiled after obfuscation.

public class SomethingSecure

{

private string PrivateSecret { get; } = "abc"; internal string InternalSecret { get; } = "def"; public string PublicSecret { get; } = "ghi";

}

424

Chapter 14 Releasing Our Application

The code decompiled using ILSpy without being obfuscated first looks as follows:

using System;

public class SomethingSecure

{

private string PrivateSecret { get; } = "abc";

internal string InternalSecret { get; } = "def";

public string PublicSecret { get; } = "ghi";

}

If you run the original code through an obfuscation tool and then decompile the source, you will end up with something like the following:

// \u0008\u0002 using System;

[\u000f\u0002(1)]

[\u000e\u0002(0)]

public sealed class \u0008\u0002

{

private readonly string m_\u0002 = \u0002\u0003.\ u0002(-815072442);

private readonly string m_\u0003 = \u0002\u0003.\ u0002(-815072424);

private readonly string m_\u0005 = \u0002\u0003.\ u0002(-815072430);

private string \u0002()

{

return this.m_\u0002;

425