Initialize local project and fix ranch growth synchronization

This commit is contained in:
AttilaNet
2026-11-07 22:14:49 +08:00
commit 657f5f33b5
1417 changed files with 202171 additions and 0 deletions
@@ -0,0 +1,70 @@
package net.pixvi.myrcryptor
{
import com.adobe.crypto.MD5;
import flash.filesystem.File;
import flash.utils.ByteArray;
import flash.utils.Dictionary;
import net.pixvi.pfw.utils.core.Singleton;
import net.pixvi.pse.file.FileTools;
public class MYRCryptor extends Singleton
{
private static var bytearrUncompressDic:Dictionary = new Dictionary();
public function MYRCryptor()
{
super();
}
public static function getHashSrcBytes(path:String) : ByteArray
{
var file:File = null;
if(path.charAt(0) == "/")
{
path = path.slice(1);
}
path = getHashSrc(path);
if(path.indexOf("app-storage:/") == 0)
{
file = new File(path);
}
else
{
file = FileTools.applicationDirectory.resolvePath(path);
}
if(!file.exists)
{
return null;
}
return FileTools.readFileBytes(file);
}
public static function getHashSrc(src:String) : String
{
var prefix:String = "";
if(src.indexOf("app-storage:/") == 0)
{
src = src.replace("app-storage:/","");
prefix = "app-storage:/";
}
var md5:String = MD5.hash(src);
return prefix + "codes/" + md5;
}
public static function jsonDecodeHandler(bytearr:ByteArray) : Object
{
if(bytearrUncompressDic[bytearr] == null)
{
bytearr.uncompress();
bytearrUncompressDic[bytearr] = true;
}
else
{
bytearr.position = 0;
}
return bytearr.readObject();
}
}
}