proguard

ProGuard difficulties when obfuscating with libraries

痞子三分冷 提交于 2020-01-07 05:52:06
问题 While trying to use ProGuard (4.9) to obfuscate and optimise a desktop application everything works up until I use something from an external library such as JSoup.connect("http://google.com/").get(); . I would get the following error: Exception in thread "Thread-2" java.lang.ExceptionInInitializerError at org.jsoup.b.l.<clinit>(Unknown Source) at org.jsoup.b.f.<init>(Unknown Source) at org.jsoup.b.e.<init>(Unknown Source) at org.jsoup.c.bh.b(Unknown Source) at org.jsoup.c.bh.a(Unknown Source

Proguard: use variable to point to the sdk directory

坚强是说给别人听的谎言 提交于 2020-01-06 04:36:08
问题 I have these two lines in some of my proguard.cfg files: -libraryjars /path/to/sdk/android-sdk-linux/add-ons/addon-google_apis-google_inc_-10/libs/maps.jar -libraryjars /path/to/sdk/android-sdk-linux/tools/support/annotations.jar My question is whether there is some variable one can use to avoid having a hardcoded path to the sdk? Otherwise when I commit the file into svn, the other developers must change the file manually, which is not really maintainable. I've found the <java.home> variable

Can't find ScalaSig for class - json4s with scala + proguard for an android app

自作多情 提交于 2020-01-05 18:01:38
问题 I have a very simple case class (Baz) that I want to serialise to JSON using json4s-native. I cannot seem to get this to work at all, when using Proguard to make an android apk. When serialising, the following exception occurs: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method

Proguard corrupts drawable files

假装没事ソ 提交于 2020-01-05 04:05:25
问题 I have strange issue with proguard, somehow it breaks my valid drawable file. Without proguard drawable shows ok. Is proguard supposed to minify xml drawables? drawable/wide_btn_round_white.xml : <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle" > <corners android:radius="25dip" /> <padding android:bottom="10dp"/> <padding android:top="10dp"/> <solid android:color="@color/colorOrangeGetStarted"

Proguard returned with error code 1. (Proguard errors with untiy-classes.jar)

北慕城南 提交于 2020-01-04 09:25:32
问题 I try to run proguard on an Android project contain classes.jar (library from Unity3d software) in attachement. I have error: [2014-03-04 15:28:55 - Test0289_0304] Proguard returned with error code 1. See console [2014-03-04 15:28:55 - Test0289_0304] Error: Can't read [F:\140303\Test0289_0304\lib\untiy-classes.jar] (Can't process class [com/unity3d/player/UnityPlayer.class] (Unknown verification type [251] in stack map frame)) I add one line in proguard-project.txt: -libraryjars lib/untiy

Irreproducible error: Class had used a different * during pre-verification

ε祈祈猫儿з 提交于 2020-01-04 06:32:28
问题 I am using ProGuard to obfuscate and shrink my app and everything seems to work fine for me and 99% of my users but once in a while I get a report from a user who isn't able to run my app at all. It crashes with the following pattern: 01-05 13:20:57.273 W/dalvikvm(22002): Class resolved by unexpected DEX: MyClass;(0x418d1200):0x1d3ef00 ref [Lorg/apache/commons/lang3/time/FastDateFormat;] Lorg/apache/commons/lang3/time/FastDateFormat;(0x418d1200):0x1d5ebf8 01-05 13:20:57.273 W/dalvikvm(22002):

How to keep class which implement an interface with annotation

拥有回忆 提交于 2020-01-04 05:31:46
问题 I defined an annotation named @KeepAll . I have an interface like @KeepAll public interface MainEntity { //some methods } I want to keep all classes which implement this interface from obfuscation. Is this possible on ProGuard? NOTE I know I can define it as -keep public class * implements **.MainEntity But I don't want to specify interface name but annotation name. 回答1: After a long trial and error process I get what I want. Here is the solution Keep class names with annotation KeepAll;

Is it possible to use proguard with Grails

有些话、适合烂在心里 提交于 2020-01-04 05:20:14
问题 Even if it is not possible to use proguard for an entire grails app would it be possible to just use it for the src/java folder? 回答1: I don't know either Proguard or Grails in depth, but I do know that: Grails uses Groovy Groovy compiles down to bytecode Proguard operates on bytecode (not source code) Thus my intuition is yes, ProGuard can shrink/obfuscate grails apps. Your question asks about using ProGuard on the src/java folder. It's important to understand that ProGuard operates on .class

Proguard: Keep annotation of specific method

ε祈祈猫儿з 提交于 2020-01-04 02:28:05
问题 Have have this class in my Minecraft Bukkit plugin: public class AsyncPlayerChatListener implements Listener { @EventHandler(priority = EventPriority.HIGH) public void onEvent(AsyncPlayerChatEvent event) { } } And I want to keep the method along with its annotation. This is my current proguard configuration: -keep class * extends org.bukkit.event.Listener { @org.bukkit.event.EventHandler <methods>; } ProGuard currently keeps the method and removes the annotation. How can I specify to keep all

Incorrect line number with ACRA

我与影子孤独终老i 提交于 2020-01-03 17:51:46
问题 I user android/proguard/ACRA. Can anyone tell me please why the crash reports I am getting have incorrect line numbers (line number pointing at obviously a wrong statment)? It is really annoying that I am unable to know the exact line number of the crash so I can't fix my user's reported error Thank you PS: I am using the mapping file corresponding to version I am releasing 回答1: With some optimizations (notably class merging and method inlining), ProGuard may be unable to preserve all debug