From 45e52b5ab37a26149ce031caa44bb167da217667 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Fri, 10 Nov 2017 14:20:59 +0000 Subject: Add -systemjars support to Proguard Try and address the problem of using Proguard with applications that duplicate some classes in android.jar, e.g. applications that statically include junit. See https://sourceforge.net/p/proguard/discussion/182455/thread/76430d9e/ for more information. Rebuilt proguard with ant 1.10.1 and gradle 2.1 Bug: 30188076 Bug: 69156675 Test: make checkbuild Change-Id: I574becf07ed4a247e966f2c023e4b95b5ffc4011 --- src/proguard/Configuration.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/proguard/Configuration.java') diff --git a/src/proguard/Configuration.java b/src/proguard/Configuration.java index 0b855a5..fc212f6 100644 --- a/src/proguard/Configuration.java +++ b/src/proguard/Configuration.java @@ -39,6 +39,24 @@ public class Configuration // Input and output options. /////////////////////////////////////////////////////////////////////////// + // Android-added: Add -systemjars option. + /** + * A list of system entries (jars, wars, ears, zips, and directories). + * + *

A system jar is one that appears on the runtime classpath before the program jars. Unless + * there are duplicate classes between it and a program jar then it behaves no different to a + * library jar. If there are duplicate classes between it and a program jar then the class in + * the system jar will be used and the duplicate class in the program jar will be ignored. + * Conversely, if a library jar contains duplicates of classes in a program jar then the class + * in the program jar will be used and the one in the library jar will be ignored. + * + *

e.g. the android.jar from the Android SDK should usually be treated as a system jar + * because at runtime if the APK contains duplicates of classes in android.jar then the ones in + * the APK will be ignored; unless the APK does some ClassLoader manipulation to change that + * behavior. + */ + public ClassPath systemJars; + /** * A list of input and output entries (jars, wars, ears, zips, and directories). */ -- cgit v1.2.3