static void LoadDll(ILRuntime.Runtime.Enviorment.AppDomain domain, string dllName, out MemoryStream dllStream)
        {
            TextAsset dllAsset = AssetDatabase.LoadAssetAtPath <TextAsset>(dllName);

            dllStream = new MemoryStream(EncryptionUtility.AESDecrypt(dllAsset.bytes));

            domain.LoadAssembly(dllStream);
        }
Esempio n. 2
0
    public override PurchasedItems GetPurchasedItems()
    {
        var json          = "{}";
        var encryptedText = PlayerPrefs.GetString(KeyPurchasedItemsName, "");
        var IV            = PlayerPrefs.GetString(KeyPurchasedItemsIVName, "");

        if (encryptedText.Length > 0 && IV.Length > 0)
        {
            json = EncryptionUtility.AESDecrypt(encryptedText, salt, IV);
        }
        Debug.Log("[" + Tag + "] Loading Items From Json: " + json);
        var result = JsonUtility.FromJson <PurchasedItems>(json);

        if (result == null)
        {
            result = new PurchasedItems();
        }
        return(result);
    }
Esempio n. 3
0
    public override int GetCurrency(string name)
    {
        if (!MonetizationManager.Currencies.ContainsKey(name))
        {
            return(0);
        }

        var result        = MonetizationManager.Currencies[name].startAmount;
        var encryptedText = PlayerPrefs.GetString(GetCurrencyKey(name), "");
        var IV            = PlayerPrefs.GetString(GetCurrencyIVKey(name), "");

        if (encryptedText.Length > 0 && IV.Length > 0)
        {
            var currencyText = EncryptionUtility.AESDecrypt(encryptedText, salt, IV);
            int.TryParse(currencyText, out result);
        }

        return(result);
    }