且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Proguard混淆处理对活动无效吗?

更新时间:2023-12-04 08:24:22

在构建过程中,proguard检查AndroidManifest并保留所有活动类.这是您的应用程序运行所必需的.您不应该混淆扩展android.app.Activity的类.

During the build process, proguard checks the AndroidManifest and keeps all activity classes. This is needed for your app to run. You should not obfuscate classes which extend android.app.Activity.

请参阅:

为什么Proguard在Android中保留了Activity类?

为什么proguard处理AndroidManifest.xml

... keepclassmembers和... keepclasseswithmembers之间有什么区别

whats the difference between ... keepclassmembers and ... keepclasseswithmembers

根据文档:

-保持班级成员

指定要保留的类成员(如果他们的类是 保留.例如,您可能要保留所有序列化 实现Serializable的类的字段和方法 界面.

Specifies class members to be preserved, if their classes are preserved as well. For example, you may want to keep all serialization fields and methods of classes that implement the Serializable interface.

-与成员保持课堂

根据条件指定要保留的类和类成员 所有指定的班级成员都在场.例如,你 可能希望保留所有具有主要方法的应用程序,而无需 必须明确列出它们.

Specifies classes and class members to be preserved, on the condition that all of the specified class members are present. For example, you may want to keep all applications that have a main method, without having to list them explicitly.

请参阅: http://proguard.sourceforge.net/manual/usage.html