nilkash
nilkash

Reputation: 7546

How to obfuscate Android library project with Eclipse?

Hi I developed one small library in Java for my Android application. I want to do obfuscating for that library. I using Android version 4.1.2. First thing is that according to Google's Android documentation there is no proguard.cfg file in my project root directory. Instead of that proguard-project.txt is there. I add proguard.config=proguard-project.txt into my project-properties file.

After this configuration I tried to export this library project and try to do obfuscating of that project. It showing error can generate .apk file because it is library project. Then I tried with another option in export. Instead of regular export android application I use general -> archive file and tried to export it and generate jar file but I check inside the jar and no encoding is done. That means anyone can extract and check classes and content inside my library. But the main thing is that it generates proguard folder inside my project and also generate dump mapping seeds usage.text files inside it.

So I need help to do proper ProGuard obfuscating of my Android library. Am I doing something wrong. What kind of configuration do I have to add inside my proguard-project.txt so that it will do proper encoding of my code?

Upvotes: 2

Views: 1021

Answers (1)

Regex Rookie
Regex Rookie

Reputation: 10662

Actually, you can obfuscate a library project, but not directly! You can only do that by exporting the entire application's project that uses that library.

With that in mind, you can set a different proguard.cfg at the root folder of your Library Project.

Hope this helps.

Upvotes: 1

Related Questions