【问题标题】:proguard obfuscation in android missing methods and classesandroid缺少方法和类中的proguard混淆
【发布时间】:2014-08-12 07:44:30
【问题描述】:

我正在尝试使用 proGuard 混淆我的应用程序并收到以下错误:

Could not find class 'android.hardware.ConsumerIrManager', referenced from method com.g.b.d

我找到了使用它的类并将 ProGuard 设置为 - 保留它,但它仍然存在。

另一个问题是得到这个异常:

java.lang.NoSuchMethodException: <init> [class com.path.to.not.obfuscated.location]
at java.lang.Class.getConstructorOrMethod(Class.java:460)
at java.lang.Class.getConstructor(Class.java:431)

我的 proguard-properties 包含以下内容:

-libraryjars /mnt/storage/bin/sdk/platforms/android-19/android.jar    

-keep public class * extends com.path.to.not.obfuscated.location

-keepclassmembers public class * extends com.path.to.not.obfuscated.location{
 public <init>(android.content.Context);
}

我认为第一行将处理 android.hardWare.ConsumerIrManager 问题,而另一行将处理这个问题中的反射:Proguard and reflection in Android 但它没有帮助。

【问题讨论】:

    标签: android obfuscation proguard


    【解决方案1】:

    如果“com.path.to.not.obfuscated.location”在 .jar 中, 在您的 proguard.cfg 文件中,您必须像这样添加以下行:

    -libraryjars /libs/the_jar_name.jar
    

    【讨论】:

    • 不,它不在罐子里。
    【解决方案2】:

    我有一个错误。 我尝试取消混淆我在getConstructor() 中作为参数输入的类,但我真正需要做的是取消混淆正在调用的类getConstructor()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-04
      相关资源
      最近更新 更多