少年修仙传客户端基础资源
hch
2024-05-17 0dbb961d8dc9a7fe65021916760c2d9eb8194972
0312 资源不混淆,还原
13个文件已修改
286 ■■■■■ 已修改文件
Assets/Editor/AssetBundleBrowser/AssetBundleBuildTab.cs 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/ScriptTemplate/ConfigDataTemplate.txt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/AssetBundleBuildExtersion.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/AssetsVersionCmpMaker.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/AssetsVersionMaker.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/BytesVersionMaker.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/ClientPackage.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/InGameDownTestWindow.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/TableTool.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Launch/AssetVersion.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Launch/InitialFunctionConfig.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Launch/LoadDll.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Launch/ResourcesModel.cs 91 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/AssetBundleBrowser/AssetBundleBuildTab.cs
@@ -670,7 +670,7 @@
            PrebuildCommand.GenerateAll();
            // 输出到AssetBundles目录
            var outputPath = Application.dataPath.Replace("Assets", m_UserData.m_OutputPath);
            outputPath = StringUtility.Contact(outputPath, "/daimazijie");
            outputPath = StringUtility.Contact(outputPath, "/logicbytes");
            if (Directory.Exists(outputPath))
                Directory.Delete(outputPath, true);
            //复制新生成的AOT dll到指定路径
@@ -692,7 +692,7 @@
            }
            // 输出到AssetBundles目录
            var outputPath = Application.dataPath.Replace("Assets", m_UserData.m_OutputPath);
            outputPath = StringUtility.Contact(outputPath, "/daimazijie");
            outputPath = StringUtility.Contact(outputPath, "/logicbytes");
            CopyHotUpdateDll(outputPath);
            MakeBytesVersionFile();
            AssetDatabase.Refresh();
@@ -700,8 +700,9 @@
        private void MakeBytesVersionFile()
        {
            ChangeBytes();
            var fileInfos = new List<FileInfo>();
            FileExtersion.GetAllDirectoryFileInfos(StringUtility.Contact(m_UserData.m_OutputPath, "/daimazijie"), fileInfos);
            FileExtersion.GetAllDirectoryFileInfos(StringUtility.Contact(m_UserData.m_OutputPath, "/logicbytes"), fileInfos);
            BytesVersionMaker.WriteAssetsVersionFile(Path.Combine(Directory.GetParent(Application.dataPath).FullName, m_UserData.m_OutputPath), fileInfos);
            Debug.Log("热更新代码更新完毕,生成md5文件");
        }
@@ -731,7 +732,7 @@
            for (int i = 0; i < AOTGenericReferences.PatchedAOTAssemblyList.Count; i++)
            {
                string dllFile = StringUtility.Contact(aotDir, AOTGenericReferences.PatchedAOTAssemblyList[i]);
                var outDllFile = outputPath + "/" + AssetVersionUtility.EncodeFileName(AOTGenericReferences.PatchedAOTAssemblyList[i]) + ".bytes";
                var outDllFile = outputPath + "/" + AOTGenericReferences.PatchedAOTAssemblyList[i] + ".bytes";
                if (!File.Exists(dllFile))
                {
                    DebugEx.LogErrorFormat("错误:{0} 不存在", dllFile);
@@ -739,8 +740,7 @@
                }
                FileExtersion.MakeSureDirectory(outDllFile);
                //File.Copy(dllFile, outDllFile, true);
                ChangeBytes(dllFile, outDllFile);
                File.Copy(dllFile, outDllFile, true);
            }
        }
@@ -770,8 +770,7 @@
                    return;
                }
                FileExtersion.MakeSureDirectory(outDllFile);
                //File.Copy(dllFile, outDllFile, true);
                ChangeBytes(dllFile, outDllFile);
                File.Copy(dllFile, outDllFile, true);
            }
            //HybridCLR的Settings面板上设置的要热更的DLL资源
@@ -786,8 +785,7 @@
                    return;
                }
                FileExtersion.MakeSureDirectory(outDllFile);
                //File.Copy(dllFile, outDllFile, true);
                ChangeBytes(dllFile, outDllFile);
                File.Copy(dllFile, outDllFile, true);
            }
            //HybridCLR的Settings面板上设置的预留的热更新dlls
@@ -802,8 +800,7 @@
                    continue;
                }
                FileExtersion.MakeSureDirectory(outDllFile);
                //File.Copy(dllFile, outDllFile, true);
                ChangeBytes(dllFile, outDllFile);
                File.Copy(dllFile, outDllFile, true);
            }
        }
@@ -915,24 +912,20 @@
            FileExtersion.GetAllDirectoryFileInfos(m_UserData.m_OutputPath, fileInfos);
            AssetsVersionMaker.WriteAssetsVersionFile(Path.Combine(Directory.GetParent(Application.dataPath).FullName, m_UserData.m_OutputPath), fileInfos);
            Debug.Log("AVersion.txt文件完毕");
            Debug.Log("生成AssetsVersion.txt文件完毕");
        }
        void ChangeBytes(string originalDllBytesFilePath, string outDllFile)
        void ChangeBytes()
        {
            string path = StringUtility.Contact(m_UserData.m_OutputPath, "/daimazijie/");
            string path = StringUtility.Contact(m_UserData.m_OutputPath, "/logicbytes/");
            // 原始DLL字节内容文件的路径
            string originalDllBytesFilePath = path + "Assembly-CSharp.dll.bytes";
            // 临时文件的路径,用于写入"abc"后再追加原始DLL字节内容  
            string tempFilePath = AssetVersionUtility.EncodeFileName(outDllFile);
            // 如果目标文件存在,则删除它
            if (File.Exists(tempFilePath))
            {
                File.Delete(tempFilePath);
            }
            string tempFilePath = path + "temp_Assembly-CSharp.dll.bytes";
            // 要写入的字符串"abc"  
            string contentToWrite = "cbg";
            string contentToWrite = "abc";
            // 将"abc"转换为字节数组  
            byte[] abcBytes = Encoding.ASCII.GetBytes(contentToWrite);
@@ -949,8 +942,26 @@
                fs.Write(originalDllBytes, 0, originalDllBytes.Length);
            }
            ReplaceFile(tempFilePath, originalDllBytesFilePath);
        }
        public void ReplaceFile(string sourceFile, string targetFile)
        {
            // 确保源文件存在
            if (!File.Exists(sourceFile))
            {
                throw new FileNotFoundException("源文件未找到:" + sourceFile);
            }
            // 如果目标文件存在,则删除它
            if (File.Exists(targetFile))
            {
                File.Delete(targetFile);
            }
            // 将源文件重命名为目标文件
            File.Move(sourceFile, targetFile);
        }
        static int packageIndex
Assets/Editor/ScriptTemplate/ConfigDataTemplate.txt
@@ -9,7 +9,6 @@
using System;
using UnityEngine;
using LitJson;
using System.Linq;
public partial class #ClassName#
{
@@ -126,10 +125,6 @@
                try 
                {
                    var line = lines[i];
                    if (!AssetSource.refdataFromEditor)
                    {
                        line = new string(line.Reverse().ToArray());
                    }
                    var index = line.IndexOf("\t");
                    if (index == -1)
                    {
@@ -157,7 +152,6 @@
        }
        else
        {
            bool isEditor = AssetSource.refdataFromEditor;
            ThreadPool.QueueUserWorkItem((object _object) =>
            {
                var lines = File.ReadAllLines(path);
@@ -170,10 +164,6 @@
                    try 
                    {
                        var line = lines[i];
                        if (!isEditor)
                        {
                            line = new string(line.Reverse().ToArray());
                        }
                        var index = line.IndexOf("\t");
                        if (index == -1)
                        {
Assets/Editor/Tool/AssetBundleBuildExtersion.cs
@@ -3,8 +3,6 @@
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Text;
using System.Linq;
public class AssetBundleBuildExtersion
{
@@ -44,17 +42,16 @@
        for (int i = 0; i < targetAssetBundles.Count; i++)
        {
            var assetBundleBuild = new AssetBundleBuild();
            assetBundleBuild.assetBundleName = AssetVersionUtility.EncodeFileName(targetAssetBundles[i]);
            assetBundleBuild.assetBundleName = targetAssetBundles[i];
            assetBundleBuild.assetNames = AssetDatabase.GetAssetPathsFromAssetBundle(targetAssetBundles[i]);
            assets.Add(assetBundleBuild);
        }
        var rootPath = StringUtility.Contact(output, Path.AltDirectorySeparatorChar, category);
        var mainFile = StringUtility.Contact(output, Path.AltDirectorySeparatorChar, GetMainFestFileName(buildTarget));//改名字前
        var mainFileRename = StringUtility.Contact(output, Path.AltDirectorySeparatorChar, AssetVersionUtility.EncodeFileName(category), "_abundle");//改名字后
        var mainFileRename = StringUtility.Contact(output, Path.AltDirectorySeparatorChar, category, "_assetbundle");//改名字后
        var manifest = StringUtility.Contact(output, Path.AltDirectorySeparatorChar, GetMainFestFileName(buildTarget), ".manifest");
        var manifestRename = StringUtility.Contact(output, Path.AltDirectorySeparatorChar, AssetVersionUtility.EncodeFileName(category), "_abundle.manifest");
        var manifestRename = StringUtility.Contact(output, Path.AltDirectorySeparatorChar, category, "_assetbundle.manifest");
        if (rebuild && Directory.Exists(rootPath))
            Directory.Delete(rootPath, true);
Assets/Editor/Tool/AssetsVersionCmpMaker.cs
@@ -19,12 +19,12 @@
        for (int i = 0; i < _fileInfos.Count; i++)
        {
            var fileInfo = _fileInfos[i];
            if (fileInfo.Name == "AVersion.txt")
            if (fileInfo.Name == "AssetsVersion.txt")
            {
                continue;
            }
            if (fileInfo.Name == "AVersionCmp.txt")
            if (fileInfo.Name == "AssetsVersionCmp.txt")
            {
                continue;
            }
@@ -38,7 +38,7 @@
            {
                continue;
            }
            if (fileInfo.FullName.Contains("daimazijie"))
            if (fileInfo.FullName.Contains("logicbytes"))
            {
                continue;
            }
@@ -51,7 +51,7 @@
            lines.Add(StringUtility.Contact(relativePath, "\t", extersion, "\t", fileSize, "\t", md5));
        }
        var assetVersionFile = StringUtility.Contact(Application.dataPath, "/Resources/AVersionCmp.txt");
        var assetVersionFile = StringUtility.Contact(Application.dataPath, "/Resources/AssetsVersionCmp.txt");
        if (File.Exists(assetVersionFile))
        {
            File.Delete(assetVersionFile);
Assets/Editor/Tool/AssetsVersionMaker.cs
@@ -16,11 +16,11 @@
        for (int i = 0; i < _fileInfos.Count; i++)
        {
            var fileInfo = _fileInfos[i];
            if (fileInfo.Name == "AVersion.txt")
            if (fileInfo.Name == "AssetsVersion.txt")
            {
                continue;
            }
            if (fileInfo.Name == "AVersionCmp.txt")
            if (fileInfo.Name == "AssetsVersionCmp.txt")
            {
                continue;
            }
@@ -29,7 +29,7 @@
            {
                continue;
            }
            if (fileInfo.FullName.Contains("daimazijie"))
            if (fileInfo.FullName.Contains("logicbytes"))
            {
                continue;
            }
@@ -42,13 +42,13 @@
            lines.Add(StringUtility.Contact(relativePath, "\t", extersion, "\t", fileSize, "\t", md5));
        }
        var assetVersionFile = StringUtility.Contact(_path, Path.DirectorySeparatorChar, "AVersion.txt");
        var assetVersionFile = StringUtility.Contact(_path, Path.DirectorySeparatorChar, "AssetsVersion.txt");
        if (File.Exists(assetVersionFile))
        {
            File.Delete(assetVersionFile);
        }
        File.WriteAllText(StringUtility.Contact(_path, Path.DirectorySeparatorChar, "AVersion.txt"), string.Join(FileExtersion.lineSplit, lines.ToArray()));
        File.WriteAllText(StringUtility.Contact(_path, Path.DirectorySeparatorChar, "AssetsVersion.txt"), string.Join(FileExtersion.lineSplit, lines.ToArray()));
    }
}
Assets/Editor/Tool/BytesVersionMaker.cs
@@ -16,7 +16,7 @@
        for (int i = 0; i < _fileInfos.Count; i++)
        {
            var fileInfo = _fileInfos[i];
            if (fileInfo.Name == "daimazijie.txt")
            if (fileInfo.Name == "logicbytes.txt")
            {
                continue;
            }
@@ -34,13 +34,13 @@
            lines.Add(StringUtility.Contact(relativePath, "\t", extersion, "\t", fileSize, "\t", md5));
        }
        var assetVersionFile = StringUtility.Contact(_path, Path.DirectorySeparatorChar, "daimazijie.txt");
        var assetVersionFile = StringUtility.Contact(_path, Path.DirectorySeparatorChar, "logicbytes.txt");
        if (File.Exists(assetVersionFile))
        {
            File.Delete(assetVersionFile);
        }
        File.WriteAllText(StringUtility.Contact(_path, Path.DirectorySeparatorChar, "daimazijie.txt"), string.Join(FileExtersion.lineSplit, lines.ToArray()));
        File.WriteAllText(StringUtility.Contact(_path, Path.DirectorySeparatorChar, "logicbytes.txt"), string.Join(FileExtersion.lineSplit, lines.ToArray()));
    }
}
Assets/Editor/Tool/ClientPackage.cs
@@ -16,26 +16,31 @@
    public static string auditOutTime = string.Empty;
    public static string SDK_PLUGIN_PROJECT {
    public static string SDK_PLUGIN_PROJECT
    {
        get { return LocalSave.GetString("SDK_PROJECT_PATH"); }
        set { LocalSave.SetString("SDK_PROJECT_PATH", value); }
    }
    public static bool obfuscatorEnabled {
    public static bool obfuscatorEnabled
    {
        get { return LocalSave.GetBool("obfuscatorEnabled", false); }
        set { LocalSave.SetBool("obfuscatorEnabled", value); }
    }
    public static bool includeConfig {
    public static bool includeConfig
    {
        get { return LocalSave.GetBool("client_pg_includeConfig", false); }
        set { LocalSave.SetBool("client_pg_includeConfig", value); }
    }
    public static bool includeUI {
    public static bool includeUI
    {
        get { return LocalSave.GetBool("client_pg_includeUI", false); }
        set { LocalSave.SetBool("client_pg_includeUI", value); }
    }
    public static int AssetPrior {
    public static int AssetPrior
    {
        get { return LocalSave.GetInt("HalfAssetPrior", 1); }
        set { LocalSave.SetInt("HalfAssetPrior", value); }
    }
@@ -199,7 +204,7 @@
            {
                var extersion = Path.GetExtension(file.FullName);
                var fileName = Path.GetFileNameWithoutExtension(file.FullName);
                var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Mob, AssetVersionUtility.DecodeFileName(fileName));
                var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Mob, fileName);
                if (prior > AssetPrior)
                {
                    excludeFileFullNames.Add(file.FullName);
@@ -212,7 +217,7 @@
            {
                var extersion = Path.GetExtension(file.FullName);
                var fileName = Path.GetFileNameWithoutExtension(file.FullName);
                var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Scene, AssetVersionUtility.DecodeFileName(fileName));
                var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Scene, fileName);
                if (prior > AssetPrior)
                {
                    excludeFileFullNames.Add(file.FullName);
@@ -225,7 +230,7 @@
            {
                var extersion = Path.GetExtension(file.FullName);
                var fileName = Path.GetFileNameWithoutExtension(file.FullName);
                var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Audio, AssetVersionUtility.DecodeFileName(fileName));
                var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Audio, fileName);
                if (prior > AssetPrior)
                {
                    excludeFileFullNames.Add(file.FullName);
@@ -238,7 +243,7 @@
            {
                var extersion = Path.GetExtension(file.FullName);
                var fileName = Path.GetFileNameWithoutExtension(file.FullName);
                var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Effect, AssetVersionUtility.DecodeFileName(fileName));
                var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Effect, fileName);
                if (prior > AssetPrior)
                {
                    excludeFileFullNames.Add(file.FullName);
@@ -255,7 +260,7 @@
                {
                    var extersion = Path.GetExtension(file.FullName);
                    var fileName = Path.GetFileNameWithoutExtension(file.FullName);
                    var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Video, AssetVersionUtility.DecodeFileName(fileName));
                    var prior = PriorBundleConfig.GetAssetPrior(AssetVersion.AssetCategory.Video, fileName);
                    if (prior > AssetPrior)
                    {
                        excludeFileFullNames.Add(file.FullName);
@@ -574,13 +579,13 @@
    //该文件在打包时生成 记录随包的所有资源的信息
    //该文件记录的资源在包中肯定存在,所以不用去取指定的资源文件获得FileInfo 计算MD5
    //通过文件和AssetsVersion.txt的文件做比较,来判断是否需要下载资源
    //daimazijie.txt 包含元数据和代码 如果不随包也要处理
    //logicbytes.txt 包含元数据和代码 如果不随包也要处理
    static void MakePackageMD5File()
    {
        var fileInfos = new List<FileInfo>();
        FileExtersion.GetAllDirectoryFileInfos(ResourcesPath.Instance.StreamingAssetPath, fileInfos);
        AssetsVersionCmpMaker.WriteAssetsVersionFile(ResourcesPath.Instance.StreamingAssetPath, fileInfos);
        Debug.Log("--生成AVersionCmp.txt文件完毕");
        Debug.Log("--生成AssetsVersionCmp.txt文件完毕");
    }
    private static void PreBuild(string _publisher, int _buildIndex)
@@ -622,7 +627,7 @@
        SetIconAndSplashImage(versionName);
        //SetCreateRoleAnimation();
        PlayerSettings.companyName = "desj";
        PlayerSettings.companyName = "SW";
        PlayerSettings.productName = newVersionConfig.productName;
        PlayerSettings.applicationIdentifier = newVersionConfig.bundleIdentifier;
        PlayerSettings.defaultInterfaceOrientation = UIOrientation.AutoRotation;
Assets/Editor/Tool/InGameDownTestWindow.cs
@@ -53,7 +53,7 @@
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        InGameDownTestUtility.isReadVesionEx = EditorGUILayout.Toggle("是否下载热更代码", InGameDownTestUtility.isReadVesionEx);
        EditorGUILayout.TextField("开启下载热更代码,会读取VersionConfigEx.txt 分支需配置正确, 检测daimazijie.txt");
        EditorGUILayout.TextField("开启下载热更代码,会读取VersionConfigEx.txt 分支需配置正确, 检测logicbytes.txt");
    }
}
Assets/Editor/Tool/TableTool.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using UnityEditor;
@@ -212,7 +211,7 @@
        foreach (var file in configFiles)
        {
            var fileInfo = new FileInfo(file.FullName);
            CopyTxtBuild(fileInfo);
            CopyTxt(fileInfo);
        }
    }
@@ -257,43 +256,6 @@
        }
        File.Copy(fileInfo.FullName, filePath);
    }
    private static void CopyTxtBuild(FileInfo fileInfo)
    {
        string fileName = fileInfo.Name.Split('.')[0];
        if (!Directory.Exists(configOutPutPath))
        {
            Directory.CreateDirectory(configOutPutPath);
        }
        string filePath = configOutPutPath + "/" + AssetVersionUtility.EncodeFileName(fileName) + ".txt";
        if (File.Exists(filePath))
        {
            File.Delete(filePath);
        }
        if (fileName.Contains("MapData_"))
        {
            File.Copy(fileInfo.FullName, filePath);
        }
        else
        {
            //按行读取文件,并将每行内容倒序写入新文件
            using (StreamReader sr = new StreamReader(fileInfo.FullName, Encoding.UTF8))
            {
                using (StreamWriter sw = new StreamWriter(filePath, false, Encoding.UTF8))
                {
                    string line;
                    while ((line = sr.ReadLine()) != null)
                    {
                        sw.WriteLine(new string(line.Reverse().ToArray()));
                    }
                }
            }
        }
    }
    /// <summary>
Assets/Launch/AssetVersion.cs
@@ -5,7 +5,7 @@
{
    public class AssetVersion
    {
        //参考文本 daimazijie/Assembly-CSharp.dll.bytes    .bytes    7360512    71157bfdecb53e8a580432621f3725c7
        //参考文本 logicbytes/Assembly-CSharp.dll.bytes    .bytes    7360512    71157bfdecb53e8a580432621f3725c7
        string m_RelativePath = string.Empty;
        public string relativePath { get { return m_RelativePath; } }
Assets/Launch/InitialFunctionConfig.cs
@@ -7,7 +7,7 @@
using System.IO;
using System;
using UnityEngine;
using System.Linq;
namespace StartAot
{
@@ -122,9 +122,6 @@
                int lineIndex = 0;
                while ((line = reader.ReadLine()) != null)
                {
#if !UNITY_EDITOR
                    line = new string(line.Reverse().ToArray());
#endif
                    lineIndex++;
                    if (lineIndex <= 3)
                    {
Assets/Launch/LoadDll.cs
@@ -58,7 +58,7 @@
        private string GetWebRequestPath(string asset)
        {
            var path = ResourcesModel.Instance.GetAssetFilePath(string.Concat(ResourcesModel.bytesFolderName, asset), false);
            var path = ResourcesModel.Instance.GetAssetFilePath(string.Concat(ResourcesModel.bytesFolderName, asset));
            if (!path.Contains("file:"))
            {
@@ -108,10 +108,15 @@
                {
                    // 特殊处理
                    byte[] assetData;
                    if (asset == "Assembly-CSharp.dll.bytes")
                    {
                    assetData = new byte[www.downloadHandler.data.Length - 3];
                    Array.Copy(www.downloadHandler.data, 3, assetData, 0, assetData.Length);
                    }
                    else
                    {
                        assetData = www.downloadHandler.data;
                    }
                    Debug.Log($"dll:{asset}  size:{assetData.Length}");
                    s_assetDatas[asset] = assetData;
@@ -137,7 +142,7 @@
            HomologousImageMode mode = HomologousImageMode.SuperSet;
            foreach (var aotDllName in AOTMetaAssemblyFiles)
            {
                if (aotDllName == ResourcesModel.Instance.EncodeFileName("Assembly-CSharp.dll.bytes"))
                if (aotDllName == "Assembly-CSharp.dll.bytes")
                    continue;
                // 加载assembly对应的dll,会自动为它hook。一旦aot泛型函数的native函数不存在,用解释器版本代码
                LoadImageErrorCode err = RuntimeApi.LoadMetadataForAOTAssembly(ReadBytesFromStreamingAssets(aotDllName), mode);
@@ -149,7 +154,7 @@
        {
#if !UNITY_EDITOR
        LoadMetadataForAOTAssemblies();
        _hotUpdateAss = Assembly.Load(ReadBytesFromStreamingAssets(ResourcesModel.Instance.EncodeFileName("Assembly-CSharp.dll.bytes")));
        _hotUpdateAss = Assembly.Load(ReadBytesFromStreamingAssets("Assembly-CSharp.dll.bytes"));
        s_assetDatas = null;
#else
            if (_hotUpdateAss == null)
Assets/Launch/ResourcesModel.cs
@@ -5,8 +5,8 @@
using LitJsonForAot;
using System.Collections;
using UnityEngine.Networking;
using System.Linq;
using StartAotSDK;
namespace StartAot
{
@@ -14,7 +14,7 @@
    {
        //不下载时本地安卓测试路径
        public string assetBundlesPath { get; private set; }
        public static string bytesFolderName = "daimazijie/";
        public static string bytesFolderName = "logicbytes/";
        public string StreamingAssetPath { get; private set; }
        public string ExternalStorePath { get; private set; }
@@ -31,7 +31,10 @@
        public int debugBranch { get; private set; }
        public class DebugBranch
        {
            public int branch = -1;
        }
        private int urlIndex = 0;
        private string versionUrl;
@@ -62,7 +65,7 @@
        string assetBytesUrl;
        //从网络获取的资源版本信息
        public Dictionary<string, AssetVersion> assetVersions = new Dictionary<string, AssetVersion>();
        //本地daimazijie文件和 assetVersions 比较是否需要下载
        //本地LogicBytes文件和 assetVersions 比较是否需要下载
        public Dictionary<string, AssetVersion> localAssetVersions = new Dictionary<string, AssetVersion>();
        public static string versionUrlResult { get; private set; }
@@ -204,49 +207,33 @@
            }
        }
        //将文件名倒序,加上_aop后缀
        public string EncodeFileName(string name)
        public class VersionInfo
        {
            name = name.Replace("\\", "/");
            int index = name.LastIndexOf("/");
            string headString;
            if (index >= 0)
            public JsonData notice_flag;
            public JsonData resource_url; //这里只用到这个取下载地址
            public string ResourceAward;
            public int downAsset = 1;
            public string downUrl;
            public int VersionCount;
            public string GetResourcesURL(int _branch)
            {
                int dotLastIndex = name.LastIndexOf(".");
                if (dotLastIndex == -1)
                if (resource_url != null)
                {
                    headString = name.Substring(0, index);
                    name = name.Substring(index + 1);
                    return StringUtility.Contact(headString, "/", new string(name.Reverse().ToArray()), "_aop");
                    return resource_url[_branch.ToString()].ToString();
                }
                else
                {
                    headString = name.Substring(0, index);
                    var ext = name.Substring(dotLastIndex);
                    name = name.Substring(index + 1, dotLastIndex - index - 1);
                    return StringUtility.Contact(headString, "/", new string(name.Reverse().ToArray()), "_aop", ext);
                }
            }
            else
            {
                int dotLastIndex = name.LastIndexOf(".");
                if (dotLastIndex == -1)
                    return StringUtility.Contact(new string(name.Reverse().ToArray()), "_aop");
                else
                {
                    var ext = name.Substring(dotLastIndex);
                    name = name.Substring(0, dotLastIndex);
                    return StringUtility.Contact(new string(name.Reverse().ToArray()), "_aop", ext);
                    return string.Empty;
                }
            }
        }
        public string GetAssetFilePath(string _assetKey, bool reverse = true)
        public string GetAssetFilePath(string _assetKey)
        {
            if (reverse)
                _assetKey = EncodeFileName(_assetKey);
            var path = Path.Combine(ExternalStorePath, _assetKey);
            if (!File.Exists(path))
            {
@@ -347,7 +334,7 @@
        //LogicBytes文件的MD5信息
        public void RequestLogicBytes()
        {
            var remoteURL = string.Concat(versionInfo.GetResourcesURL(VersionConfigEx.Get().branch), fixPath, "/daimazijie.txt");
            var remoteURL = string.Concat(versionInfo.GetResourcesURL(VersionConfigEx.Get().branch), fixPath, "/logicbytes.txt");
            //var localURL = string.Concat(.ExternalStorePath, "/logicbytes.txt");
            assetBytesUrl = remoteURL;
            Debug.Log("http地址:logicbytesUrl  " + assetBytesUrl);
@@ -448,7 +435,7 @@
            if (isPCTestDownLoad || Application.isMobilePlatform)
            {
                //读取的一定是StreamingAssetPath路径
                StartCoroutine(ReadText("daimazijie", (isOK, value) =>
                StartCoroutine(ReadText("logicbytes", (isOK, value) =>
                {
                    if (isOK)
                        InitLocalLogicbytes(value);
@@ -480,38 +467,6 @@
                        Debug.LogError(ex);
                    }
                }
            }
        }
    }
}
namespace StartAotSDK
{
    public class DebugBranch
    {
        public int branch = -1;
    }
    public class VersionInfo
    {
        public JsonData notice_flag;
        public JsonData resource_url; //这里只用到这个取下载地址
        public string ResourceAward;
        public int downAsset = 1;
        public string downUrl;
        public int VersionCount;
        public string GetResourcesURL(int _branch)
        {
            if (resource_url != null)
            {
                return resource_url[_branch.ToString()].ToString();
            }
            else
            {
                return string.Empty;
            }
        }