[Exception throwing] If you are running as a GUI program, now’s the time to pop up a modal message box. It doesn’t really matter what text you put in it, because the user will ignore it.
-Verity Stob
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.-Brian Kernighan
It’s just, when you buy computer hardware, you tell yourself, that’s it. That’s the last router I’m gonna need.
Whatever else happens, I’ve got that router problem handled.
________________________________________________________________
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
________________________________________________________________
When using proguard with your Android project, you may face the following proguard error:
Proguard returned with error code 1. See console Unexpected error while evaluating instruction: Class = [org/jsoup/parser/TreeBuilder] Method = [insertInFosterParent(Lorg/jsoup/nodes/Node;)V] Instruction = [70] aload_2 v2 Exception = 1 (null) Unexpected error while performing partial evaluation: Class = [org/jsoup/parser/TreeBuilder] Method = [insertInFosterParent(Lorg/jsoup/nodes/Node;)V] Exception = 1 (null) java.lang.NullPointerException at proguard.evaluation.Variables.aload(Variables.java:264) at proguard.evaluation.Processor.visitVariableInstruction(Processor.java:677) at proguard.classfile.instruction.VariableInstruction.accept(VariableInstruction.java:306) at proguard.optimize.evaluation.PartialEvaluator.evaluateSingleInstructionBlock(PartialEvaluator.java:729) at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlock(PartialEvaluator.java:575) at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlockAndExceptionHandlers(PartialEvaluator.java:533) at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute0(PartialEvaluator.java:221) at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute(PartialEvaluator.java:180) at proguard.optimize.evaluation.LivenessAnalyzer.visitCodeAttribute(LivenessAnalyzer.java:195) at proguard.optimize.evaluation.VariableOptimizer.visitCodeAttribute(VariableOptimizer.java:102) at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101) at proguard.classfile.ProgramMethod.attributesAccept(ProgramMethod.java:79) at proguard.classfile.attribute.visitor.AllAttributeVisitor.visitProgramMember(AllAttributeVisitor.java:95) at proguard.classfile.util.SimplifiedVisitor.visitProgramMethod(SimplifiedVisitor.java:91) at proguard.classfile.ProgramMethod.accept(ProgramMethod.java:71) at proguard.classfile.ProgramClass.methodsAccept(ProgramClass.java:439) at proguard.classfile.visitor.AllMethodVisitor.visitProgramClass(AllMethodVisitor.java:47) at proguard.classfile.ProgramClass.accept(ProgramClass.java:281) at proguard.classfile.ClassPool.classesAccept(ClassPool.java:114) at proguard.optimize.Optimizer.execute(Optimizer.java:764) at proguard.ProGuard.optimize(ProGuard.java:325) at proguard.ProGuard.execute(ProGuard.java:114) at proguard.ProGuard.main(ProGuard.java:499)
Fortunately, this error has been fixed at the latest proguard release (4.7), but the Android SDK still uses a previous version.
So all you have to do, it to download the latest proguard version from here, unzip it and copy paste the 3 jars from the “lib” folder to your Android-SDK folder at ANDROID_SDK_HOME/tools/proguard/lib and replace the old jars.
Backing up is always a smart and proper move.
________________________________________________________________
________________________________________________________________

Today I was interviewed by the Digital life program at Athens 9.84 FM about the GreekAndroidApps application.
I was a little bit nervous, but I believe the result is fine!
I hope that you forgive my mistake with the number of downloads through our app, it is 12357.
You can listen it or download it here. (7MB)
(The interview is in greek)