问题描述
我尝试使用:
-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int v(...);
public static int i(...);
public static int w(...);
public static int d(...);
public static int e(...);
}
在Proguard中删除日志,如果我不使用新的Jack编译器,效果很好
in Proguard to remove logs, and it works great if I'm not using the new Jack compiler
defaultConfig {
...
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
当我编译apk时,我注意到所有日志在生产发行版中都处于活动状态.是否存在错误,错误或尚不支持"-assumenosideeffects"?
When I compile the apk, I have noticed all logs being active in production release. Is there an error, bug or is "-assumenosideeffects" not supported yet?
我还能做些其他事情,以便从最终apk中的日志中删除字符串吗?
Can I do something else te remove strings from logs in the final apk ?
推荐答案
在使用Jack编译器工具链时,将不会使用ProGuard.相反,杰克将使用自己的工具来应用指定的规则.
When using the Jack compiler toolchain, ProGuard will not be used. Instead, Jack will use its own tool to apply the specified rules.
并非所有ProGuard规则都受支持(请参阅受支持的指令):不不受支持.
Not all ProGuard rules are supported (see supported directives): -assumenosideeffects
is not supported.
注意: DexGuard ,ProGuard的商业变体支持ProGuard的所有指令,可以结合使用Jack的版本从7.2开始,将在1-2周内发布.
Note: DexGuard, the commercial variant of ProGuard supports all directives from ProGuard and can be used in combination with Jack starting from version 7.2, to be released in 1-2 weeks.
这篇关于Android Jack Compiler无法从Proguard规则中删除日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!