unable to compute hash of

The problem with API 23 and Google Play Services is still not resolved.

Just in case you get something like “unable to compute hash of /intermediates/classes-proguard/release/classes.jar” – just add a few lines to the proguard-rules.pro.

-dontwarn org.apache.http.**
-dontwarn android.net.http.AndroidHttpClient
-dontwarn com.google.android.gms.**
-dontwarn com.android.volley.toolbox.**

Stack overflow thread: http://stackoverflow.com/questions/30705589/gradle-build-failure
Star google bug: https://code.google.com/p/android-developer-preview/issues/detail?id=3001


proguard-android.txt is missing

> java.io.FileNotFoundException: \android-sdk\sdk\tools\proguard\proguard-android.txt

Wondering where is “proguard-android.txt” in the lates ADT (rev 23)?
No worries! The universe is not collapsing. It is just a packaging bug! 🙂


Download your own local copy or proguard-android.txt

Obfuscate your Android application

Proguard is the nice way to obfuscate your Android application to prevent reverse engineering. Here is Google tutorial for this http://developer.android.com/guide/developing/tools/proguard.html.

But you can face some difficulties with it:

  1. To minimize risk of “class not found” exceptions – don’t obfuscate external libraries that you have in your project. Add -keep option to proguard.cfg
    -keep public class com.google.ads.** {
        public protected *;
  2. If you are using reflection in your code – add these classes to the exclude list:
    -keepclassmembers class * {
        public static void buildUriMatcher(android.content.UriMatcher, java.lang.String);
  3. Stop using onClick listeners in xml resources!:) Or also add an exception:
    public void on*(android.view.View);
  4. In Eclipse you can easily get “conversion to dalvik format failed with error 1”:

    Don’t worry – don’t obfuscate external libraries + don’t use Eclipse for export signed application. Just create build.xml for Ant and all will be just perfect!

    Read more about this problem here: http://bimbim.in/post/2010/09/24/Reason-of-Conversion-to-dalvik-format-failed-with-error-1.aspx

  5. Try to reverse engineering your code with JD (as described here). You may need to remove some debug log String constants to make your code completely unreadable:)



© 2020 Android Tales

Theme by Anders NorenUp ↑