How To Obfuscate The Apk That Is Being Built

Should we proguard the AndroidRuntime.jar in ant or in the compiler or are there any other jar files we have to apply Proguard to.

What I have done so far:

Applying proguard to AndroidRuntime.jar in ant results in screen1.class is not found due to an error in kawa compilation. applying Proguard to each library before adding it into the dex will not do anything to the final apk.

Thanks

Which part? Any rough idea…

1 Like

Which jar file? Some details would be useful

Did you test it?

Proguard can be applied to an entire APK. The challenge will be getting the proguard rules file correctly so that the names of screens, components, etc. aren’t obfuscated or removed.

2 Likes

When should Proguard be applied. Like which part of the compilation process?

My guess is that you’d probably want to invoke it after the ApkBuilder step and before ZipAlign in Compiler.java, circa line 1330.

4 Likes

That would result in this error:

Error: The input doesn't contain any classes. Did you specify the proper '-injars' options?
1 Like

I'm interested in this answer too. Any best practise?