Example #1
0
    private static void GenerateAndroidDllConfig(string pathToBuildProject)
    {
        var backupFolder = GetAndroidBackupDllFolder(pathToBuildProject);
        var dllVersion   = new DllVersion();

        foreach (var file in Directory.GetFiles(backupFolder, "*.dll"))
        {
            var name    = Path.GetFileNameWithoutExtension(file);
            var md5     = MD5Hashing.HashFile(file);
            var size    = (new FileInfo(file)).Length;
            var dllInfo = new DllInfo()
            {
                dllName = name,
                MD5     = md5,
                size    = size,
            };
            dllVersion.Manifest.Add(name, dllInfo);
            FileUtil.MoveFileOrDirectory(file, backupFolder + "/" + dllInfo.ToFileName());
        }

        dllVersion.Version = AssetManager.GetVisualDateTimeNow();
        if (dllVersion.Version > DllHelper.Max_Versoin)
        {
            throw new Exception("dll版本号居然比限定的最大版本号还要大!");
        }

        FileHelper.SaveJsonObj(dllVersion, backupFolder + "/" + dllVersion.ToFileName());
        FileHelper.SaveJsonObj(dllVersion, GetDecodeApkFolder(pathToBuildProject) + "/assets/dllVersion.json");

        ChangeAndroidManifestDllVersion(pathToBuildProject, dllVersion.Version);
    }
Example #2
0
    private static void GenerateWinDllConfig(string rootFolder, string dataPath)
    {
        var backupFolder = GetWinBackupDllFolder(rootFolder);
        var dllVersion   = new DllVersion();

        foreach (var file in Directory.GetFiles(backupFolder, "*.dll"))
        {
            var name    = Path.GetFileNameWithoutExtension(file);
            var md5     = MD5Hashing.HashFile(file);
            var size    = (new FileInfo(file)).Length;
            var dllInfo = new DllInfo()
            {
                dllName = name,
                MD5     = md5,
                size    = size,
            };
            dllVersion.Manifest.Add(name, dllInfo);
            FileUtil.MoveFileOrDirectory(file, backupFolder + "/" + dllInfo.ToFileName());
        }

        dllVersion.Version = AssetManager.GetVisualDateTimeNow();

        FileHelper.SaveJsonObj(dllVersion, backupFolder + "/" + dllVersion.ToFileName());
        FileHelper.SaveJsonObj(dllVersion, dataPath + "/StreamingAssets/" + GameResPath.DLLVERSION_FILE);
    }
Example #3
0
    private static void GenerateAndroidDllConfig(string pathToBuildProject)
    {
        var backupFolder = GetAndroidBackupDllFolder(pathToBuildProject);
        var dllVersion   = new DllVersion();

        foreach (var file in Directory.GetFiles(backupFolder, "*.dll"))
        {
            var name    = Path.GetFileNameWithoutExtension(file);
            var md5     = MD5Hashing.HashFile(file);
            var size    = (new FileInfo(file)).Length;
            var dllInfo = new DllInfo()
            {
                dllName = name,
                MD5     = md5,
                size    = size,
            };
            dllVersion.Manifest.Add(name, dllInfo);
            FileUtil.MoveFileOrDirectory(file, backupFolder + "/" + dllInfo.ToFileName());
        }

        dllVersion.Version = DateTime.UtcNow.ToFileTimeUtc();

        FileHelper.SaveJsonObj(dllVersion, backupFolder + "/" + dllVersion.ToFileName());
        FileHelper.SaveJsonObj(dllVersion, GetDecodeApkFolder(pathToBuildProject) + "/assets/dllVersion.json");
    }