Ejemplo n.º 1
0
    public void OnGenCipherButtonClick()
    {
        string path = FileBrowser.SaveFile("Save Result as .GKEY", "", "gibgibCipher", "GKEY");

        if (path.Length != 0)
        {
            string       fileName = Path.GetFileName(path);
            gibgibCipher cipher   = new gibgibCipher();
            gibgibCipherSystem.loadCipher(cipher);
            loadedCipherName   = fileName;
            lastKnowCipherName = loadedCipherName;
            updateLoadedCipherText();

            print(cipher.cipherArray.Length);

            //litJsonCipherArrayClass JSONClass = litJsonCipherArrayClass.CipherArrayToCipherList(cipher);
            //string fileContent = LitJson.JsonMapper.ToJson(JSONClass);

            //string fileContent;

            //File.WriteAllText(path, fileContent);

            CipherSaveLoadManager.saveNote(cipher, path);

            StartCoroutine(timer(3.0f, "Successful Generate " + fileName + " file"));
        }
        else
        {
            StartCoroutine(timer(3.0f, "you dont have any key input"));
        }
    }
Ejemplo n.º 2
0
    public void OnLoadCipherButtonClick()
    {
        string path = FileBrowser.OpenSingleFile("open .GKEY file", "", "GKEY");

        if (path.Length != 0)
        {
            //must use list
            //litJsonCipherArrayClass JSONClass = LitJson.JsonMapper.ToObject<litJsonCipherArrayClass>(fileContent.ToString());
            //gibgibCipher cipher = litJsonCipherArrayClass.CipherListToCipherArray(JSONClass);

            gibgibCipher cipher = CipherSaveLoadManager.LoadNote(path);

            gibgibCipherSystem.loadCipher(cipher);
            loadedCipherName   = Path.GetFileName(path);
            lastKnowCipherName = loadedCipherName;
            updateLoadedCipherText();
            StartCoroutine(timer(3.0f, "Successful Loaded "));
        }
    }