-6

I'm exporting an Android application from Eclipse. Proguard thinks it is obfuscating the .apk according to the console, dump.txt, mapping.txt, seeds.txt and usage.txt output, but when I decompile the .apk itself it is not obfuscated. Names of classes and fields are intact. I have tried various different Proguard configs but there doesn't seem to be anything wrong in terms of the configs. I make sure to clean the project so the classes.dex file won't be outdated.

fgsfdsfgts
  • 87
  • 2
  • 8
  • Please explain your downvotes. So far from reading other questions the only feasible solution (which I haven't tried yet) is to run Proguard from the command line outside of Eclipse. Ridiculous... – fgsfdsfgts Nov 04 '17 at 05:10
  • 1
    You might want to explain (1) why are you using Eclipse when the Android team deprecated support for that platform more than 2 years ago. (2) Adding in proguard to the Android ant build system wasn't feasible: https://stackoverflow.com/questions/4629444/ant-build-for-android-proguard-obfuscation which is another reason why Android moved to gradle. – Morrison Chang Nov 04 '17 at 05:31
  • Correction Proguard was for a time achievable in Eclipse/Ant, but all of newer Android features like multidex and AAR support are in Gradle. – Morrison Chang Nov 04 '17 at 05:41

1 Answers1

0

This worked for me in Eclipse Neon:

  1. Right click on project and add the Gradle nature

  2. File -> Export -> Android -> Generate Gradle build files

  3. In the root directory of your project, create a local.properties file and set sdk.dir. See: Where does local.properties go for android project?

  4. Right click on project -> Gradle -> Refresh Gradle Project

  5. Enable code shrinking in build.gradle. See: https://developer.android.com/studio/build/shrink-code.html

  6. Put your Proguard configuration in proguard-rules.pro (or in a different file if you set the proguardFiles property in build.gradle accordingly)

  7. Open the Gradle Tasks view and run the assembleRelease task. Check the console to see if it ran successfully. If it went well, refresh your project directory and the .apk file(s) will be in the build/outputs/apk subdirectory.

fgsfdsfgts
  • 87
  • 2
  • 8