user1401644
user1401644

Reputation:

Does proguard remove unused classes in android.jar?

Suppose i am developing an application using android api 16, my app will include android.jar. I would be importing few classes from the jar file.

I would enable proguard in release mode by configuring proguard. Does proguard remove unused classes in android.jar also?

Edit:

properties file for my project

android.library.reference.1=../actionbarsherlock

So does proguard remove unused classes from my library project included when packaging everything to .apk ?

Upvotes: 2

Views: 2386

Answers (2)

D-Dᴙum
D-Dᴙum

Reputation: 7902

Proguard does NOT remove anything from libraries. See the diagram and quote from the Proguard website.

ProGuard requires the library jars (or wars, ears, zips, or directories) of the input jars to be specified. These are essentially the libraries that you would need for compiling the code. ProGuard uses them to reconstruct the class dependencies that are necessary for proper processing. The library jars themselves always remain unchanged. You should still put them in the class path of your final application.

Upvotes: 1

devconsole
devconsole

Reputation: 7925

Android.jar would be referenced as a library jar (-libraryjars, see Proguard documentation) as opposed to an input jar. That means it would not be included in the output APK anyway. After all you don't want to redistribute the Android system libraries along with your app.

Upvotes: 0

Related Questions