in Android

Android Proguard stacktrace example

So, how an obfuscated stacktrace from an application shrunk by Proguard is like?
Take a look at the following examples:

Stacktrace with out Proguard:

E  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pinapps.greekandroidapps/com.pinapps.greekandroidapps.Splash}: java.lang.NullPointerException
...
E  Caused by: java.lang.NullPointerException
E  	at com.pinapps.greekandroidapps.Tools.DataHandler.init(DataHandler.java:58)
E  	at com.pinapps.greekandroidapps.Splash.onCreate(Splash.java:81)
E  	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E  	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)

Stacktrace with standard Proguard configuration:

E  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pinapps.greekandroidapps/com.pinapps.greekandroidapps.Splash}: java.lang.NullPointerException
...
E  Caused by: java.lang.NullPointerException
E  	at com.pinapps.greekandroidapps.Tools.c.c(Unknown Source)
E  	at com.pinapps.greekandroidapps.Splash.onCreate(Unknown Source)
E  	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E  	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)

Stacktrace with some options for useful obfuscated stacktraces Proguard configuration:

E  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pinapps.greekandroidapps/com.pinapps.greekandroidapps.Splash}: java.lang.NullPointerException
...
E  Caused by: java.lang.NullPointerException
E  	at com.pinapps.greekandroidapps.Tools.c.c(SourceFile:57)
E  	at com.pinapps.greekandroidapps.Splash.onCreate(SourceFile:81)
E  	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E  	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)

-printmapping out.map

-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable

Share