public static int GetEncryptedInt(string key, int defaultValue = 0) { string str = PlayerPrefs.GetString("ENC-" + SimpleEncryption.EncryptString(key)); if (!string.IsNullOrEmpty(str)) { return(SimpleEncryption.DecryptInt(str.Remove(0, 1))); } return(defaultValue); }
// Token: 0x06004DB3 RID: 19891 RVA: 0x001A10E8 File Offset: 0x0019F4E8 public static int GetEncryptedInt(string key, int defaultValue = 0) { string key2 = "ENC-" + SimpleEncryption.EncryptString(key); string text = PlayerPrefs.GetString(key2); if (!string.IsNullOrEmpty(text)) { text = text.Remove(0, 1); return(SimpleEncryption.DecryptInt(text)); } return(defaultValue); }
/// <summary> /// Encrypted version of PlayerPrefs.GetInt(), an unencrypted key is passed and the value is returned decrypted /// </summary> public static int GetEncryptedInt(string key, int defaultValue = 0) { // Encrypt and prefix the key so we can look it up from player prefs string encryptedKey = KEY_PREFIX + SimpleEncryption.EncryptString(key); // Look up the encrypted value string fetchedString = PlayerPrefs.GetString(encryptedKey); if (string.IsNullOrEmpty(fetchedString)) { return(defaultValue); } // Strip out the type identifier character fetchedString = fetchedString.Remove(0, 1); // Decrypt and return the int value return(SimpleEncryption.DecryptInt(fetchedString)); }