我的保镖有
-keep public class * extends android.app.Activity
我遵循的规则将保留所有活动,但标记有“可混淆的”界面的活动除外:
public class SensitiveActivity extends Activity implements Obfuscateable
是否有否定的规则,以便Proguard保留所有活动(第一个规则)减去标记为Obfuscateable接口的活动?我的意思是,就像“保持”的反面吗?
在相关的手册部分http://proguard.sourceforge.net/index.html#manual/usage.html中有一个用于类规范的模板,但我不太了解:
[@annotationtype] [[!]public|final|abstract|@ ...] [!]interface|class|enum classname
[extends|implements [@annotationtype] classname]
[{
[@annotationtype] [[!]public|private|protected|static|volatile|transient ...] <fields> |
(fieldtype fieldname);
[@annotationtype] [[!]public|private|protected|static|synchronized|native|abstract|strictfp ...] <methods> |
<init>(argumenttype,...) |
classname(argumenttype,...) |
(returntype methodname(argumenttype,...));
[@annotationtype] [[!]public|private|protected|static ... ] *;
...
}]
ProGuard始终考虑所有保留选项的并集。没有可供选择的选项。您可以使用标记界面或注释(例如,proguard /示例/注释)标记要保留的活动。
Android构建过程(aapt)会自动写出保留所有导出活动的ProGuard配置,因此您可能必须在生成它之后以及调用ProGuard之前对其进行修改。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句