Proguard混淆处理对活动无效吗? [英] Proguard Obfuscation doesnt work on activities?

查看:290
本文介绍了Proguard混淆处理对活动无效吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目上运行了proguard,但它不会混淆我的活动名称.我已经尝试了几个规则,但是它不起作用.我不知道这到底是什么意思,例如以下规则:

i ran proguard on my project but it doesnt obfuscate my activity name. i have tried several rules and it is not working. i dont know what exactly it means for example the rule below:

-keep public class models.* {
  *;
}

-keepclassmembers class * {

}

-keepclasseswithmembers class * {

}

我在这些规则的工作方式上遇到困难.请帮忙.

i am having difficulty on how these rules work. please help.

推荐答案

在构建过程中,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

这篇关于Proguard混淆处理对活动无效吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆