proguard

How can I tell proguard to assume a package is not used?

走远了吗. 提交于 2019-12-06 03:23:38
问题 I'm attempting to set up proguard for my Android project. We use some pieces of a netty library in our code and I'd like to use Proguard to completely remove the pieces of code that I know aren't used. Is there some way to tell proguard to assume a package (or class) is never used and so should not be included in the output JARs? Note that I'm not talking about excluding some code from obfuscation (which is what the -keep configuration options do), I'm talking about completely removing a

java ProGuard remove (shrink) unused classes

◇◆丶佛笑我妖孽 提交于 2019-12-06 02:52:13
Let's say I have this Java app: package com.site; public class MyAppBase {} package com.site.free; import com.site.MyAppBase; public class MyApp extends MyAppBase {} package com.site.pro; import com.site.MyAppBase; public class MyApp extends MyAppBase {} package com.site; public class Edition { public static final int FREE = 1; public static final int PRO = 2; private static final int EDITION = PRO; public static boolean is(final int edition) { return (EDITION == edition); } } package com.site; public class EditionFactory { public static MyAppBase get_app() { MyAppBase ret = null; if (Edition

Android apk Debug mode works fine but release mode gives too many warnings

允我心安 提交于 2019-12-06 02:35:07
问题 I'm trying to get a signed APK from eclipse. I have a debuggable apk version that works fine. Now for release when I tried to compile and sign with Eclipse ADT, I get many warnings, most of which is can't find superclass or interface some.package.Class . So, I referred to this, this and many others unfortunately I couldn't reach anywhere! I also get Note: there were 314 duplicate class definitions. warning My progaurd-project.txt was untouched earlier. So, I added -libraryjars /libs/lib-name

ProGuard obfuscation, java, Google Gson and generic collections - how to keep members?

爱⌒轻易说出口 提交于 2019-12-06 01:59:26
I have a class like this: public class MyClass { private Queue<MyOtherClass> myQueue; } My problem is that I cannot get ProGuard to keep myQueue after serialization to json using Google Gson. What happens is that the member name "myQueue" is serialized as "a". Obviously, deserialization then breaks. Here are some of the ProGuard configs I have tried. -keepclassmembers class com.my.package.MyClass { #private java.util.Queue<com.my.package.MyOtherClass> myQueue; #private java.util.Queue<com.my.package.*> myQueue; private java.* myQueue; } With private java.util.Queue<com.my.package.MyOtherClass>

How to inspect proguard process, so I know what takes so long?

依然范特西╮ 提交于 2019-12-06 01:41:07
My release build is stuck on :android:transformClassesAndResourcesWithProguardForRelease for 10 minutes. Gradle console does not print anything. How do I make it print what proguard is doing, so I know where the problem could be? You need to add the following to your proguard configuration file: -verbose Additionally, you need to enable info logging for your gradle build via gradle -i <target> where target is the actual task your are running (most likely assembleRelease). Then you will see more output and what ProGuard is currently doing. Based on experience, the optimization step can take a

Using Spongycastle with Proguard

非 Y 不嫁゛ 提交于 2019-12-06 01:18:16
I've been strugling with proguard to make Spongycastle work. Most of the time, the problem comes when I'm exporting a signed APK, either I've got error, or the app will just crash before starting. So, I've managed to gather informations to get a working proguard configuration : -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers -dontpreverify -verbose -repackageclasses '' -allowaccessmodification -keepattributes *Annotation* -optimizations !code/simplification/arithmetic -libraryjars C:\Program Files\Java\jre7\lib\rt.jar

Google Play Services with Proguard in Android Studio

我只是一个虾纸丫 提交于 2019-12-06 01:01:02
问题 I've recently move across from Eclipse to Android Studios. I had my app using Proguard via eclipse and now that I've move across I'm getting the following errors. Error: ProGuard: [myApp] Warning: com.google.android.gms.auth.GoogleAuthUtil: can't find referenced field 'int auth_client_availability_notification_title' in class com.google.android.gms.R$string ProGuard: [myApp] Warning: com.google.android.gms.auth.GoogleAuthUtil: can't find referenced field 'int auth_client_play_services_err

Phonegap 2.4 Android Proguard config

妖精的绣舞 提交于 2019-12-05 23:59:27
问题 I've upgraded a build from Phonegap (Cordova) 2.0 to 2.4 and everything was working fine in dev until I actually came to testing the final release apk. What I'm finding, after a lot of time wasted, is that for some reason now when I run the build my proguard config is breaking the phonegap build in some way that means that when it runs the deviceready is never called. There seem to be no errors when building, nor running and nothing as far as I can see but I'm guessing something is silently

Obfuscate Parcelable classes with proguard

心不动则不痛 提交于 2019-12-05 23:11:26
问题 I'm trying to obfuscate a parcelable class with Proguard: Before adding the Parcelable part the class is: public class Foo{ private String value; public String getValue() { return value; } public void setValue(String value) { this.value = value; } } The obfuscated result is: public class a { private String a; public String a() { return this.a; } public void a(String paramString) { this.a = paramString; } } After adding implementing parcelable the example class is public class Foo implements

Note: android.support.v4.text.ICUCompatIcs: can't find dynamically referenced class libcore.icu.ICU

别说谁变了你拦得住时间么 提交于 2019-12-05 23:07:08
问题 I started getting the message with the latest Android Build Tools (ABT) v19.0.3 today. At first glance, I thought this might be an issue with ABT. However, a closer investigation reveals that this message: android.support.v4.text.ICUCompatIcs: can't find dynamically referenced class libcore.icu.ICU is only shown when Proguard is used. Answers on the net has yeilded no solution for me. Perhaps, this is only an issue with Proguard (the version I'm using is bundled with Android SDK v22.3). I