android - How to drop third party jars from obfuscated jar using proguard, gradle -
i'm using -libraryjar dependency obfuscate android library jar this:
-injars build/libs/mylib.jar -outjars build/libs/mylib-proguarded.jar -libraryjars build/intermediates/classes/release/libs/gson-2.3.1.jar
this bundles gson library final obfuscated library jar.
issue: android app that's supposed using obfuscated library jar, has own inclusion of gson, , conflict having 2 copies of gson jars. how can exclude gson jar library obfuscated jar.
my rest of proguard config this:
-dontpreverify -dontwarn android.annotation.suppresslint -keepparameternames -renamesourcefileattribute sourcefile -keepattributes *annotation*,exceptions,innerclasses,signature,deprecated,sourcefile,linenumbertable,*annotation*,enclosingmethod -keep class sun.misc.unsafe { *; } -keep public class * { public protected *; } -keepclassmembernames class * { java.lang.class class$(java.lang.string); java.lang.class class$(java.lang.string, boolean); } -keepclasseswithmembernames,includedescriptorclasses class * { native <methods>; } -keepclassmembers,allowoptimization enum * { public static **[] values(); public static ** valueof(java.lang.string); } -keepclassmembers class * implements java.io.serializable { static final long serialversionuid; private static final java.io.objectstreamfield[] serialpersistentfields; private void writeobject(java.io.objectoutputstream); private void readobject(java.io.objectinputstream); java.lang.object writereplace(); java.lang.object readresolve(); }
Comments
Post a Comment