且构网

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

Proguard不会混淆GUI组件

更新时间:2023-12-04 07:48:40


但是我的gui类(扩展了acitvit,view和sherlockactivtiy)并未被混淆。

But my gui classes, which extends acitvit, view and sherlockactivtiy are not obfusecated.

这是因为您的ProGuard配置文件说不要混淆它们。此外,这很重要,就像它们被混淆了一样,您的应用将无法运行,因为:

That is because your ProGuard configuration file says to not obfuscate them. Moreover, this is important, as if they are obfuscated, your app will not run, because:


  • Android不会找到您重命名的活动

  • Android不会找到您的活动生命周期方法

  • Android不会找到您的小部件(用于在解释布局时进行反射)资源)

  • 等。

  • Android will not find your renamed activities
  • Android will not find your activity lifecycle methods
  • Android will not find your widgets (for use with reflection in interpreting layout resources)
  • etc.

我试图添加: -keep公共类mypackege.myactivity.class 但这不能解决问题。

那是因为您要告诉ProGuard 混淆该类。

That is because you are telling ProGuard to not obfuscate that class.


任何想法

您不愿意,如果您希望在完成时拥有一个可运行的应用程序。

You don't, if you wish to have a working app when you are done.