Exemplo n.º 1
0
        public static void SaveLicenseKey(String licenseKey)
        {
            String decryptedLicenseKey = DecryptStringAES(licenseKey, GetUserId());

            byte[] decryptedLicenseData = Encoding.UTF8.GetBytes(decryptedLicenseKey);
            byte[] encryptedLicenseData = Encoding.UTF8.GetBytes(licenseKey);
            IsolatedStorageHelper.Save(LICENSE_KEY_PATH, encryptedLicenseData);
        }
Exemplo n.º 2
0
        public static bool IsLicensed()
        {
            if (IsolatedStorageHelper.Exists(LICENSE_KEY_PATH))
            {
                byte[] encryptedLicenseData   = IsolatedStorageHelper.Load(LICENSE_KEY_PATH);
                String encryptedLicenseString = Encoding.UTF8.GetString(encryptedLicenseData);

                // right now it's not used, we don't check what's in
                // if the file exists and it decrypts without exceptions, we assume that it's ok
                // but this data can be used to store license date, user name, email and so on...
                String decryptedLicenseKey = DecryptStringAES(encryptedLicenseString, GetUserId());
                return(StringComparer.Ordinal.Equals(decryptedLicenseKey, "01'\"@'. *!@^@*&#%89~{]{~"));
            }

            return(false);
        }
Exemplo n.º 3
0
 public static void Clear()
 {
     _instance._results.Clear();
     IsolatedStorageHelper.Delete(_serializationPath);
 }
Exemplo n.º 4
0
 static ResultsStorage()
 {
     AppDomain.CurrentDomain.ProcessExit += (o, e) =>
                                            IsolatedStorageHelper.Save(_serializationPath, SerializationHelper.Serialize(_instance));
 }
Exemplo n.º 5
0
 public static bool RemoveLicenseKey()
 {
     return(IsolatedStorageHelper.Delete(LICENSE_KEY_PATH));
 }