• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 方舟运行时子系统变更说明
2
3## cl.arkcompiler.1 默认不合并依赖混淆规则变更说明
4
5**访问级别**
6
7其他
8
9**变更原因**
10
11混淆默认合并依赖混淆规则,由于部分开发者不了解混淆机制,在发布的三方库中的obfuscation.txt文件中引入了混淆开关选项,其它应用依赖这些三方库后出现应用启动崩溃,且开发者无法直接感知这些三方库引入了混淆开关。
12
13**变更影响**
14
15此变更涉及应用适配。
16
17变更前:
18
19编译一个模块时,生效的混淆规则为当前模块所有混淆配置与依赖模块及三方库**所有混淆配置**合并后的结果:
20
21即如果当前模块、依赖的HAR模块、依赖的三方库中混淆配置如下:
22
23```
24// current-obfuscation-rules.txt
25-enable-toplevel-obfuscation
26-keep-global-name
27currentVar
28
29// dependencyHar-consumer-rule.txt
30-enable-property-obfuscation
31-keep-global-name
32harVar
33-keep-property-name
34harProp
35
36// dependencyThirdParty-obfuscation.txt
37-compact
38-keep-property-name
39thirdPartyProp
40```
41
42那么编译当前模块时生效的混淆规则为:
43
44```
45-enable-toplevel-obfuscation
46-enable-property-obfuscation
47-compact
48-keep-global-name
49currentVar
50harVar
51-keep-property-name
52harProp
53thirdPartyProp
54```
55
56变更后:
57
58编译一个模块时,生效的混淆规则为当前模块所有混淆配置与依赖模块及三方库的**混淆保留选项**合并后的结果:
59
60
61即对于上面的例子,编译当前模块时生效的混淆规则为:
62```
63-enable-toplevel-obfuscation
64-keep-global-name
65currentVar
66harVar
67-keep-property-name
68harProp
69thirdPartyProp
70```
71
72**起始API Level**
73
74API 10
75
76**变更发生版本**
77
78从OpenHarmony 5.1.0.46 版本开始。
79
80**变更的接口/组件**
81
82不涉及。
83
84**适配指导**
85
86在当前编译模块的混淆配置文件`obfuscation-rules.txt`中配置混淆开关选项`-enable-lib-obfuscation-options`,可实现编译当前模块时合并依赖模块及三方库中所有的混淆配置,即规则合并功能与变更前一致。
87