Esempio n. 1
0
    void rewriteXML()
    {
        XmlDocument xmlDoc = new XmlDocument();

        xmlDoc.InnerXml = B64X.Decrypt(PlayerPrefs.GetString("GSAGSAGSA"), "ZeFuTo!");

        if (score > maxScore)
        {
            xmlDoc.SelectSingleNode("Information/MaxScore").InnerText = score.ToString();
            maxScore = score;
        }

        xmlDoc.SelectSingleNode("Information/Gliders").InnerText  = gliders.ToString();
        xmlDoc.SelectSingleNode("Information/Attempts").InnerText = (++Attempts).ToString();
        xmlDoc.SelectSingleNode("Information/Scooters").InnerText = Scooters.ToString();
        xmlDoc.SelectSingleNode("Information/Ducks").InnerText    = Ducks.ToString();
        xmlDoc.SelectSingleNode("Information/Level").InnerText    = Level.ToString();

        //Carrots
        carrots     = B64X.Decrypt(carrots, key);
        gameCarrots = B64X.Decrypt(gameCarrots, key2);

        int money    = int.Parse(carrots); carrots = "";
        int newMoney = int.Parse(gameCarrots); gameCarrots = "";

        money += newMoney;

        xmlDoc.SelectSingleNode("Information/Money").InnerText = money.ToString(); money = -127;

        PlayerPrefs.SetString("GSAGSAGSA", B64X.Encrypt(xmlDoc.InnerXml, "ZeFuTo!"));
    }
Esempio n. 2
0
    private void queryInventorySucceededEvent(Inventory inventory)
    {
        if (inventory != null)
        {
            _inventory = inventory;
            Purchase mPurchase = inventory.GetPurchase(SKU);

            string rsaXml = B64X.Decrypt((Resources.Load("RSA") as TextAsset).text, "myRSA!!!xml");
            bool   check  = GooglePlayPurchaseGuard.Verify(mPurchase.OriginalJson, mPurchase.Signature, rsaXml);

            if (!check)
            {
                print("incorrect");
            }

            bool payed = (mPurchase != null && VerifyDeveloperPayload(mPurchase.DeveloperPayload) && check && mPurchase.PurchaseState == 0);

            string key = B64X.GetNewKey();
            menuManager.payed = B64X.Encrypt(payed.ToString(), key);
            menuManager.key2  = key;
        }
        else
        {
            print("Debil!");
        }
    }
Esempio n. 3
0
    public void LoadData()
    {
        XmlDocument xmlDoc   = new XmlDocument();
        TextAsset   xmlAsset = Resources.Load("PersData") as TextAsset;

        xmlDoc.LoadXml(B64X.Decrypt(xmlAsset.text, "_ip#X1zaMoQ#mSig!%9j"));

        LoadTree(xmlDoc.DocumentElement);
    }
Esempio n. 4
0
    public bool Payed()
    {
        payed = B64X.Decrypt(payed, key2);

        bool val = bool.Parse(payed);

        key2  = B64X.GetNewKey();
        payed = B64X.Encrypt(payed, key2);
        return(val);
    }
Esempio n. 5
0
    public int getMoney()
    {
        carrots = B64X.Decrypt(carrots, key);

        int money = int.Parse(carrots);

        key     = B64X.GetNewKey();
        carrots = B64X.Encrypt(carrots, key);
        return(money);
    }
Esempio n. 6
0
    public void AddCarrot()
    {
        gameCarrots = B64X.Decrypt(gameCarrots, key2);

        int money = int.Parse(gameCarrots);

        money += multiple;

        gameCarrots = money.ToString(); money = -127;

        CarrotsLabels[0].text = gameCarrots.ToString();
        CarrotsLabels[1].text = gameCarrots.ToString();
        CarrotsLabels[2].text = gameCarrots.ToString();

        key2        = B64X.GetNewKey();
        gameCarrots = B64X.Encrypt(gameCarrots, key2);
    }
Esempio n. 7
0
    private void readXMLBonusesDuration()
    {
        XmlTextReader reader = new XmlTextReader(B64X.Decrypt(PlayerPrefs.GetString("GSAGSAGSA"), "ZeFuTo!"), XmlNodeType.Document, null);

        while (reader.Read())
        {
            if (reader.Name == "BonusesDuration")
            {
                PlayerBonuses pb = player.GetComponent <PlayerBonuses>();
                for (int i = 0; i < reader.AttributeCount; i++)
                {
                    pb.bonuses[i].duration = float.Parse(reader.GetAttribute(i));
                }
            }
        }
        reader.Close();
    }
Esempio n. 8
0
    private void readXMLCloth()
    {
        XmlTextReader reader = new XmlTextReader(B64X.Decrypt(PlayerPrefs.GetString("GSAGSAGSA"), "ZeFuTo!"), XmlNodeType.Document, null);

        while (reader.Read())
        {
            if (reader.NodeType == XmlNodeType.Element && reader.Name == persName)
            {
                for (int i = 0; reader.MoveToNextAttribute(); i++)
                {
                    if (reader.Name != "opened")
                    {
                        clothData[i - 1] = reader.Value;
                    }
                }
                break;
            }
        }
        reader.Close();
    }
Esempio n. 9
0
    private void readXMLCloth()
    {
        XmlTextReader reader = new XmlTextReader(B64X.Decrypt(PlayerPrefs.GetString("GSAGSAGSA"), "ZeFuTo!"), XmlNodeType.Document, null);

        for (int j = 1; j <= PersCount; j++)
        {
            persName = parsePersName(j);
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element && reader.Name == persName)
                {
                    for (int i = 0; reader.MoveToNextAttribute(); i++)
                    {
                        if (reader.Name != "opened")
                        {
                            clothData[j - 1][i - 1] = reader.Value;
                        }
                        else
                        {
                            string line = reader.Value;
                            for (int pos = 0; pos < line.Length; pos++)
                            {
                                if (line[pos] == '1')
                                {
                                    openedCloth[j - 1][pos] = true;
                                }
                                else
                                {
                                    openedCloth[j - 1][pos] = false;
                                }
                            }
                        }
                    }
                    break;
                }
            }
        }
        reader.Close();
    }
Esempio n. 10
0
    public void changeMoney(int val, bool changeInTapjoy)
    {
        carrots = B64X.Decrypt(carrots, key);

        int money = int.Parse(carrots);

        money += val;

        carrots            = money.ToString(); money = -127;
        CarrotsLabel.text  = carrots.ToString();
        CarrotsLabel1.text = carrots.ToString();

        key     = B64X.GetNewKey();
        carrots = B64X.Encrypt(carrots, key);

#if UNITY_ANDROID
        if (changeInTapjoy)
        {
            mainTapjoy.ChangeMoney(val);
        }
#endif
    }
Esempio n. 11
0
    void rewriteXML()
    {
        XmlDocument xmlDoc = new XmlDocument();

        xmlDoc.InnerXml = B64X.Decrypt(PlayerPrefs.GetString("GSAGSAGSA"), "ZeFuTo!");

        xmlDoc.SelectSingleNode("Information/Pers").InnerText         = persName;
        xmlDoc.SelectSingleNode("Information/MusicEnabled").InnerText = musicEnabled.ToString();
        xmlDoc.SelectSingleNode("Information/Night").InnerText        = night.ToString();
        xmlDoc.SelectSingleNode("Information/StartRoute").InnerText   = inTheForest.ToString();
        xmlDoc.SelectSingleNode("Information/Gliders").InnerText      = gliders.ToString();

        string line = "";

        for (int i = 0; i < openedPers.Length; i++)
        {
            if (openedPers[i])
            {
                line += '1';
            }
            else
            {
                line += '0';
            }
        }
        xmlDoc.SelectSingleNode("Information/OpenedPers").InnerText = line;

        XmlNode node;

        for (int i = 0; i < PersCount; i++)
        {
            node = xmlDoc.SelectSingleNode("Information/Cloth/" + parsePersName(i + 1));

            line = "";
            for (int j = 0; j < openedCloth[i].Length; j++)
            {
                if (openedCloth[i][j])
                {
                    line += '1';
                }
                else
                {
                    line += '0';
                }
            }

            node.Attributes.Item(0).Value = line;

            for (int j = 0; j < 4; j++)
            {
                node.Attributes.Item(j + 1).Value = clothData[i][j];
            }
        }

        node = xmlDoc.SelectSingleNode("Information/BonusesDuration");
        for (int i = 0; i < 4; i++)
        {
            node.Attributes.Item(i).Value = BonusesDuration[i].ToString();
        }

        //Carrots
        xmlDoc.SelectSingleNode("Information/Money").InnerText = getMoney().ToString();

        //xmlDoc.Save("C:\\274.xml");

        PlayerPrefs.SetString("GSAGSAGSA", B64X.Encrypt(xmlDoc.InnerXml, "ZeFuTo!"));
    }
Esempio n. 12
0
    private void readXML()
    {
        XmlTextReader reader   = new XmlTextReader(B64X.Decrypt(PlayerPrefs.GetString("GSAGSAGSA"), "ZeFuTo!"), XmlNodeType.Document, null);
        string        NodeName = "";

        while (reader.Read())
        {
            /*if (reader.NodeType == XmlNodeType.Text && NodeName == "SoundEnabled")
             * {
             *  soundEnabled = bool.Parse(reader.Value);
             *  UImusicEnanled.isChecked = soundEnabled;
             *  OnSoundChange(soundEnabled);
             * }
             */
            if (reader.NodeType == XmlNodeType.Text && NodeName == "MusicEnabled")
            {
                musicEnabled             = bool.Parse(reader.Value);
                UImusicEnanled.isChecked = musicEnabled;
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "Night")
            {
                night             = bool.Parse(reader.Value);
                UInight.isChecked = night;
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "StartRoute")
            {
                inTheForest        = bool.Parse(reader.Value);
                UIForest.isChecked = inTheForest;
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "Gliders")
            {
                gliders           = int.Parse(reader.Value);
                glidersLabel.text = "Джетпаки: [990000]" + gliders.ToString() + "[000000] шт";
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "MaxScore")
            {
                maxScore           = int.Parse(reader.Value);
                MaxScoreLabel.text = maxScore.ToString();
                //break; //можно прервать цикл (нужно прочитать только одно значение)
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "Pers")
            {
                persName = reader.Value;
                SwitchStatePoint();
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "OpenedPers")
            {
                string line = reader.Value;
                for (int pos = 0; pos < line.Length; pos++)
                {
                    if (line[pos] == '1')
                    {
                        openedPers[pos] = true;
                    }
                    else
                    {
                        openedPers[pos] = false;
                    }
                }
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "Money")
            {
                key = B64X.GetNewKey();

                //if(reader.Value == "0")
                //carrots = B64X.Encrypt("70000", key);
                //else
                carrots = B64X.Encrypt(reader.Value, key);

                changeMoney(0, false);
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "Attempts")
            {
                int Attempts = int.Parse(reader.Value);
                AttemptsLabel.text = "Попыток: " + Attempts.ToString();
            }
            else if (reader.NodeType == XmlNodeType.Element && reader.Name == "BonusesDuration")
            {
                for (int i = 0; i < reader.AttributeCount; i++)
                {
                    BonusesDuration[i] = float.Parse(reader.GetAttribute(i));
                }

                jumpBTimeLabel.text   = "Время бонуса: [990000]" + BonusesDuration[0].ToString() + "[000000] сек.";
                galoshaTimeLabel.text = "Время бонуса: [990000]" + BonusesDuration[1].ToString() + "[000000] сек.";
                nonStopTimeLabel.text = "Время бонуса: [990000]" + BonusesDuration[2].ToString() + "[000000] сек.";
                gliderTimeLabel.text  = "Время бонуса: [990000]" + BonusesDuration[3].ToString() + "[000000] сек.";
            }
            else if (reader.NodeType == XmlNodeType.Element)
            {
                NodeName = reader.Name;
            }
        }
        reader.Close();
    }
Esempio n. 13
0
 private static string GetValue(string key)
 {
     return(PlayerPrefs.HasKey(key) ? B64X.Decrypt(PlayerPrefs.GetString(key), Md5.Encode(key + Password)) : null);
 }
Esempio n. 14
0
    private void readXML()
    {
        XmlTextReader reader   = new XmlTextReader(B64X.Decrypt(PlayerPrefs.GetString("GSAGSAGSA"), "ZeFuTo!"), XmlNodeType.Document, null);
        string        NodeName = "";

        while (reader.Read())
        {
            if (reader.NodeType == XmlNodeType.Text && NodeName == "MaxScore")
            {
                maxScore = int.Parse(reader.Value);

                for (int i = 0; i < MaxScoreLabels.Length; i++)
                {
                    MaxScoreLabels[i].text = maxScore.ToString();
                }
                //break; //можно прервать цикл (нужно прочитать только одно значение)
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "Pers")
            {
                persName = reader.Value;
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "Night")
            {
                night = bool.Parse(reader.Value);
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "StartRoute")
            {
                inTheForest = !bool.Parse(reader.Value);
            }
            //else if (reader.NodeType == XmlNodeType.Text && NodeName == "SoundEnabled")
            //{
            //soundEnabled = bool.Parse(reader.Value);
            //}
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "MusicEnabled")
            {
                musicEnabled = bool.Parse(reader.Value);
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "Money")
            {
                key     = B64X.GetNewKey();
                carrots = B64X.Encrypt(reader.Value, key);
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "Attempts")
            {
                Attempts = int.Parse(reader.Value);
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "Gliders")
            {
                gliders = int.Parse(reader.Value);

                if (persName == "gera" || persName == "ball" || persName == "kuritsa" || persName == "Bear" || persName == "Koza")
                {
                    if (gliders != 0)
                    {
                        EnableFlyButton();
                    }
                }
                string pickupName = "Монеты:";
                if (persName == "rabbit")
                {
                    pickupName = "Морковь:";
                }
                else if (persName == "kuritsa")
                {
                    pickupName = "Яйца:";
                }
                else if (persName == "dog")
                {
                    pickupName = "Косточки:";
                }
                else if (persName == "Bear")
                {
                    pickupName = "Малина:";
                }

                CarrotsTextLabels[0].text = pickupName;
                CarrotsTextLabels[1].text = pickupName;
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "Scooters")
            {
                Scooters = int.Parse(reader.Value);
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "Level")
            {
                Level = int.Parse(reader.Value);
            }
            else if (reader.NodeType == XmlNodeType.Text && NodeName == "Ducks")
            {
                Ducks = int.Parse(reader.Value);
            }
            else if (reader.NodeType == XmlNodeType.Element)
            {
                NodeName = reader.Name;
            }
        }
        reader.Close();
    }
Esempio n. 15
0
 public static string DecryptB64X(string value, string key)
 {
     return(B64X.Decrypt(value, key));
 }