ProGuard - Obfuscating apk causing error

馋奶兔 提交于 2021-01-28 00:14:28

问题


I am having issues with my app once I obfuscate the code with ProGuard. The app launches ok, but once I try to make a REST call to my server, I get the below error in the LogCat.. and the app just hangs.

Exception Ljava/lang/NullPointerException; thrown while initializing Lorg/codehaus/jackson/map/introspect/VisibilityChecker$Std;

Any help is appreciated.. as I have searched the entire internet :|

Below is my pro guard .cfg contents:

    -optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-dump class_files.txt 
-printseeds seeds.txt 
-printusage unused.txt 
-printmapping mapping.txt
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService


-keep class com.vungle.sdk.** { *; }

-keep class org.codehaus.** { *; }

-keep class javax.** { *; }
-dontwarn javax.**

-keep class org.apache.** { *; }
-dontwarn org.apache.**

-keep class log4j.** { *; }
-dontwarn log4j.**

-keep class jtwitter4j.** { *; }
-dontwarn twitter4j.**

-keep class android.print.** { *; }
-dontwarn android.print.**

-keep class org.joda.** { *; }
-dontwarn org.joda.**

-keep class org.w3c.** { *; }
-dontwarn org.w3c.**

-keep class org.json.** { *; }
-dontwarn org.json.**

-keep class android.** { *; }
-dontwarn android.**

-keep class java.io.** { *; }
-dontwarn java.io.**

-keep class java.lang.String.** { *; }
-dontwarn java.lang.String.**

-keep class java.beans.** { *; }
-dontwarn java.beans.**

-keepclassmembers class * implements java.io.Serializable
{
    private static final java.io.ObjectStreamField[] serialPersistentFields;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    java.lang.Object writeReplace();
    java.lang.Object readResolve();
}

-keepclasseswithmembernames class * {
    native <methods>;
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.app.Activity {
   public void *(android.view.View);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

来源:https://stackoverflow.com/questions/22997476/proguard-obfuscating-apk-causing-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!