I added proguard.config=proguard.cfg
to my default.properties file and have a proguard.cfg file in my project root. If I now use Export as Android Application from within Eclipse I get the following Errors:
[2011-01-27 11:11:37 - Application] Warning: class [classes/com/package.Class.class] unexpectedly contains class [com/package.Class]
[2011-01-27 11:11:37 - Application] Warning: class [classes/com/package.Class2.class] unexpectedly contains class [com/package.Class2]
[2011-01-27 11:11:37 - Application] Note: there were 145 duplicate class definitions.
[2011-01-27 11:11:37 - Application] Warning: there were 146 classes in incorrectly named files.
[2011-01-27 11:11:37 - Application] You should make sure all file names correspond to their class names.
[2011-01-27 11:11:37 - Application] The directory hierarchies must correspond to the package hierarchies.
[2011-01-27 11:11:37 - Application] If you don't mind the mentioned classes not being written out,
[2011-01-27 11:11:37 - Application] you could try your luck using the '-ignorewarnings' option.
[2011-01-27 11:11:37 - Application] java.io.IOException: Please correct the above warnings first.
[2011-01-27 11:11:37 - Application] at proguard.InputReader.execute(InputReader.java:133)
[2011-01-27 11:11:37 - Application] at proguard.ProGuard.readInput(ProGuard.java:195)
[2011-01-27 11:11:37 - Application] at proguard.ProGuard.execute(ProGuard.java:78)
[2011-01-27 11:11:37 - Application] at proguard.ProGuard.main(ProGuard.java:499)
It seems that somehow my classes are saved in a classes subfolder but Proguard uses this classes subfolder as a package. Therefore the definition of the classes can not be understood by Proguard.
Is this a problem with my SDK Setup? Or are there errors in my Proguard Configuration causing this problem?
Obfuscate APK Android ProGuard tool can be used to obfuscate , shrink , and optimize the code. ProGuard renames classes, fields, and methods with semantically obscure names and removes unused code. To obfuscate we can set the minifyEnabled true in the app/build. gradle file.
You can obfuscate Android code to provide security against reverse engineering. You can use the Android ProGuard tool to obfuscate, shrink, and optimize your code. Obfuscated code can be more difficult for other people to reverse engineer.
ProGuard is a command-line tool that reduces app size by shrinking bytecode and obfuscates the names of classes, fields and methods. It's an ideal fit for developers working with Java or Kotlin who are primarily interested in an Android optimizer.
I changed the proguard.cfg slightly from whatever was working for me last May and now it works:
from
-injars bin
to
-injars bin/classes
I also had to clean-up a bit--removing Junit (which wasn't used in this project) and the compatibility library (which I probably could have ignored away, but chose to ditch altogether instead).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With