Esempio n. 1
0
    static void CryFile(string path)
    {
        Debug.LogWarning("cry path =" + path);
        var b  = DWFileUtil.ReadFile(path);
        var cb = GlobalCrypto.Encrypte(b);

        File.WriteAllBytes(path, cb);
    }
Esempio n. 2
0
    static void EnDLL()
    {
        string inputPath = Application.dataPath + "/XGame/Script/Lua";

        ForeachFile(inputPath, (FileInfo f) => {
            var b  = DWFileUtil.ReadFile(f.FullName);
            var cb = GlobalCrypto.Encrypte(b);
            File.WriteAllBytes(Application.streamingAssetsPath + "/Lua/" + f.Name, cb);
        });
    }
Esempio n. 3
0
    public static string ReadLua(string key)
    {
        var    p    = EZFunTools.StreamPath + "/Table/" + key;
        string path = GetResPath(UpdateType.Table, p, "lbytes");

        Debug.LogWarning("readlua text:" + path);
        if (p.Equals(path))
        {
            byte[] b           = ReadFile(path + ".lbytes");
            int    len         = b.Length;
            byte[] decompressB = GlobalCrypto.Decrypte(b, out len);
            //byte[] data = GlobalCrypto.Decompress(decompressB);
            return(System.Text.Encoding.UTF8.GetString(decompressB, 0, len));
        }
        else
        {
            byte[] b   = ReadFileStream(path);
            int    len = b.Length;
            byte[] deB = GlobalCrypto.Decrypte(b, out len);
            //byte[] data = GlobalCrypto.Decompress(deB);
            return(System.Text.Encoding.UTF8.GetString(deB, 0, len));
        }
    }