Question

I am trying to use ProGuard to obfuscate my Android Library Project source code.

I use a few libraries in my project, some as jars in the libs folder (e.g. android-async-http-1.4.4.jar) and one as a referenced library project (google-play-services_lib).

When I build my project without ProGuard (using ant release), only the classes I coded are packaged into the created jar. This is what I want, because the Android applications that will use my library could already be using some of the same libraries mine is using.

But when I build my project with ProGuard, the libraries I use are included in the output jar. I don't know why and I don't want this. I thought adding those jars with the -libraryjars command would keep them from being included in my output jar, since the ProGuard documentation is clear, but it didn't help.

-libraryjars class_path

Specifies the library jars (or aars, wars, ears, zips, apks, or directories) of the application to be processed. The files in these jars will not be included in the output jars.

I am probably not using this correctly. Does someone knows what I did wrong (or what I haven't done yet)?

-libraryjars ./libs/android-async-http-1.4.4.jar
-libraryjars ./libs/AndroidIBeaconLibrary-0.7.5.jar
-libraryjars ../google-play-services_lib/libs/google-play-services.jar
Was it helpful?

Solution

I still don't know why the referenced libraries are included in the obfuscated jar, but the simple solution to correct the problems related to this was to open the obfuscated jar with winrar and delete the classes that I didn't want to be there...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top