diff options
Diffstat (limited to 'Decompiler/Gestor.Application.Helpers/ApplicationHelper.cs')
| -rw-r--r-- | Decompiler/Gestor.Application.Helpers/ApplicationHelper.cs | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Helpers/ApplicationHelper.cs b/Decompiler/Gestor.Application.Helpers/ApplicationHelper.cs new file mode 100644 index 0000000..97acd7d --- /dev/null +++ b/Decompiler/Gestor.Application.Helpers/ApplicationHelper.cs @@ -0,0 +1,54 @@ +using System; +using Agger.Registro; +using Gestor.Common.Helpers; + +namespace Gestor.Application.Helpers; + +public class ApplicationHelper +{ + private static string _numeroSerial; + + private const string ChaveSerial = "NS"; + + public static string NumeroSerial + { + get + { + return _numeroSerial ?? GetSerialNumber(); + } + set + { + _numeroSerial = value; + } + } + + public static bool Conectado { get; set; } = true; + + + public static bool Beta { get; set; } = false; + + + public static long IdFornecedor { get; set; } + + public static string Subkey { get; set; } + + public static DateTime ChecagemVersao { get; set; } = Funcoes.GetNetworkTime(); + + + public static Version Versao { get; set; } + + internal static string GetSerialNumber() + { + //IL_0005: Unknown result type (might be due to invalid IL or missing references) + try + { + string text = new RegistryHelper(Subkey).Read("NS", true); + NumeroSerial = (string.IsNullOrEmpty(text) ? null : EncryptionHelper.Decrypt(text)); + return NumeroSerial; + } + catch (Exception) + { + return null; + } + } +} |