少年修仙传客户端基础资源
lwb
2020-11-20 523a8c5b8de799aeaeaa7287f0b4f9e2edf339ee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System;
 
public class ConfusionModel
{
    private string LS_KEY_RECONFUSION_MAP_FILE = Application.dataPath + "ReConfuseMapFile";
 
    // 通过Assembly找到需要被混淆的ClassType
    // 对这些ClassType的Field和Method根据配置建立索引
    private const string PREV_FIX = "_";
    private static int m_Seed = 0;
 
    public string NewContent
    {
        get
        {
            return string.Format("{0}{1}", PREV_FIX, m_Seed++);
        }
    }
 
    // 想要被混淆的文件夹路径
    public Dictionary<string, ConfusionDirectoryInfo> confuseFileSourcePathDict = new Dictionary<string, ConfusionDirectoryInfo>();
 
    // 类型对应的文件路径
    public Dictionary<Type, string> typeToPathDict = new Dictionary<Type, string>();
    // 类型里需要被混淆的变量或者方法名称对应列表
    public Dictionary<Type, List<string>> confusionTypeDict = new Dictionary<Type, List<string>>();
    // 记录类型里最终被混淆成了什么内容, 用于反混淆的时候替换
    public Dictionary<Type, Dictionary<string, string>> confusionDict = new Dictionary<Type, Dictionary<string, string>>();
    // 记录类型里最终被混淆成了什么内容, 用于反混淆的时候替换
    public Dictionary<Type, Dictionary<string, string>> reConfusionDict = new Dictionary<Type, Dictionary<string, string>>();
    // 通过反射搜集到的文件路径
    public List<string> confusionScriptFilePath = new List<string>();
 
    // 替换表生成路径
    public string ReConfuseMapFileDir
    {
        get
        {
            return EditorPrefs.GetString(LS_KEY_RECONFUSION_MAP_FILE, Application.dataPath + "/ReConfusionMapFiles");
        }
        set
        {
            EditorPrefs.SetString(LS_KEY_RECONFUSION_MAP_FILE, value);
        }
    }
 
    public ConfusionModel()
    {
        Reset();
    }
 
    public void Reset()
    {
        m_Seed = 0;
        typeToPathDict.Clear();
        confuseFileSourcePathDict.Clear();
        confusionTypeDict.Clear();
        confusionDict.Clear();
    }
}