Skip to content

Commit ddf2961

Browse files
committed
update installation.md
1 parent f1b2218 commit ddf2961

3 files changed

Lines changed: 34 additions & 6 deletions

File tree

docs/beginner/quick-start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Obfuz支持Unity 2019+版本,同时也支持团结引擎1.0.0+,能在所有U
1414

1515
Obfuz的Unity Package Manager URL安装地址:
1616

17-
- gitee `https://gitee.com/focus-creative-games/obfuz.git?path=Obfuz/Packages/com.code-philosophy.obfuz`
18-
- github `https://github.com/focus-creative-games/obfuz.git?path=Obfuz/Packages/com.code-philosophy.obfuz`
17+
- gitee `https://gitee.com/focus-creative-games/obfuz.git?path=com.code-philosophy.obfuz`
18+
- github `https://github.com/focus-creative-games/obfuz.git?path=com.code-philosophy.obfuz`
1919

2020
打开Unity Package Manager窗口,点击`Add package from URL...`,填入以上地址之一即可完成安装。
2121

docs/manual/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
Obfuz的Unity Package Manager URL安装地址:
44

5-
- gitee `https://gitee.com/focus-creative-games/obfuz.git?path=Obfuz/Packages/com.code-philosophy.obfuz`
6-
- github `https://github.com/focus-creative-games/obfuz.git?path=Obfuz/Packages/com.code-philosophy.obfuz`
5+
- gitee `https://gitee.com/focus-creative-games/obfuz.git?path=com.code-philosophy.obfuz`
6+
- github `https://github.com/focus-creative-games/obfuz.git?path=com.code-philosophy.obfuz`
77

88
打开Unity Package Manager窗口,点击`Add package from URL...`,填入以上地址之一即可完成安装。
99

10-
如果想安装指定版本的Obfuz,可以在URL后添加`#{version}`,如`https://gitee.com/focus-creative-games/obfuz.git?path=Obfuz/Packages/com.code-philosophy.obfuz#v1.0.0-alpha`
10+
如果想安装指定版本的Obfuz,可以在URL后添加`#{version}`,如`https://gitee.com/focus-creative-games/obfuz.git?path=com.code-philosophy.obfuz#v1.0.0-alpha`
1111

1212
## 支持的Unity版本与平台
1313

docs/manual/serialization-reflection.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,42 @@ Obfuz与Unity工作流深度集成,目前会对Unity有一些特殊处理:
1515
Obfuz没有处理场景对象上的`UnityEvent`字段,因此如果在`Inspector`中设置了`UnityEvent`类型字段的回调函数,需要禁用这些函数的符号混淆,
1616
否则运行时将出现找不到回调函数的错误。
1717

18-
## 对某些元数据禁用符号混淆
18+
## 解决混淆后反射找不到类型的问题
19+
20+
主要有两个办法。
21+
22+
### 对需要反射查找的元数据禁用符号混淆
1923

2024
有几种方式:
2125

2226
1. [Obfuscation Pass](./obfuscation-pass)中配置对某些元数据禁用`Symbol Obfus` Pass。
2327
2. [符号混淆](./symbol-obfuscation)的规则文件中配置对某些元数据禁用符号混淆。
2428
3. 在代码中给需要禁用符号混淆的元数据上添加`[ObfuzIgnore]`特性, 文档[ObfuzIgnoreAttribute](./obfuzignore)
2529

30+
### 手动维护原始名称与反射对象的映射关系
31+
32+
使用类似下面的代码:
33+
34+
```csharp
35+
36+
class NotReflectionFind
37+
{
38+
private static readonly Dictionary<string, Type> _types = new Dictionary<string, Type>{
39+
{"A", typeof(A)},
40+
{"B", typeof(B)},
41+
// ...
42+
43+
};
44+
45+
public static Type FindType(string name)
46+
{
47+
return _types.TryGetValue(name, out var type) ? type : null;
48+
}
49+
}
50+
51+
52+
```
53+
2654
## 解决与Newtonsoft.Json之类序列化库的兼容问题
2755

2856
对需要序列化的类型添加`[Serializable]`特性可让它们的public字段不被混淆,但他们的public 属性仍然会被混淆。因此如果

0 commit comments

Comments
 (0)