proguard

ProGuard not working in my app

情到浓时终转凉″ 提交于 2019-12-12 10:32:32
问题 I am trying to protect my apk file with ProGuard but I got errors. [2013-08-14 12:21:41 - LookAround] Proguard returned with error code 1. See console [2013-08-14 12:21:41 - LookAround] Warning: android.support.v4.media.TransportMediatorJellybeanMR2: can't find superclass or interface android.media.RemoteControlClient$OnGetPlaybackPositionListener [2013-08-14 12:21:41 - LookAround] Warning: android.support.v4.media.TransportMediatorJellybeanMR2: can't find superclass or interface android

ProGuard JNI Error

荒凉一梦 提交于 2019-12-12 09:57:43
问题 I'm using ProGuard to obfuscate my Java Desktop application. When I launch the obfuscated JAR , I'm getting the following error: > java -jar program.jar Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.VerifyError: Expecting a stackmap frame at branch target 80 Exception Details: Location: MyMainClass.a(Ljava/lang/String;)Ljava/lang/String; @40: iflt Reason: Expected stackmap frame at this location. Bytecode: 0x0000000: 0406

Proguard setting to not remove unused method

好久不见. 提交于 2019-12-12 09:47:47
问题 Conside the following code structure for android: package blah; class A{ class B{ public void foo(String s){ } } } How can I tell proguard to not remove or obfuscate foo. foo is unused function in code at compile time but is run at run-time from another code. I have tried: -keep class blah.A.B; -keepclassmembers class blah.A.B { public void foo(String s); } etc. but nothing stops Proguard from removing that function. I do not want proguard to change name of 'foo'. Proguard may change the name

How to include TypeReference ProGuard rule

流过昼夜 提交于 2019-12-12 09:44:57
问题 I have already included following line to keep all files inside the package. -keep class com.fasterxml.** { *; } I am getting following exception. Caused by: java.lang.IllegalArgumentException: Internal error: TypeReference constructed without actual type information at com.fasterxml.jackson.core.type.TypeReference.<init>(SourceFile:36) 回答1: I found the solution. Adding following find into ProGuard-rules or Config file solved the issue. -keepattributes Signature PS: Please voteup if you find

My log messages are not removed with proguard configuration

我是研究僧i 提交于 2019-12-12 08:48:19
问题 I am developing my Android app. Then I enable & configure proguard by: Step 1. Enable proguard: In project.properties I have: proguard.config=${sdk.dir}/tools/proguard/proguard-android-optimize.txt:proguard-project.txt I also tried the following: # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): proguard.config=proguard.cfg Step 2. Configure proguard: In proguard.cfg I have: -assumenosideeffects class android.util.Log { *; } I

How to stop ProGuard from stripping the Serializable interface from a class

百般思念 提交于 2019-12-12 08:27:59
问题 Is there an explicit way to stop ProGuard from changing a class from implementing an interface? I have a class that implements java.io.Serializable , let's call it com.my.package.name.Foo . I've found that after running through ProGuard, it no longer implements Serializable . I get null after I cast from Serializable to Foo and false if I check an instance with instanceof Serializable . I've made sure to set ProGuard to ignore this class: -keep class com.my.package.name.Foo I've also tried:

Proguard return with error code 1 proguard.ParseException

最后都变了- 提交于 2019-12-12 06:58:00
问题 I tried to export my android project to apk, and while building i got this error on Console, i cycled through google, but I didn't find any error like this: [2013-09-24 18:09:42 - Google] Proguard returned with error code 1. See console [2013-09-24 18:09:42 - Google] proguard.ParseException: Expecting jar or directory name before '-include' in argument number 3 [2013-09-24 18:09:42 - Google] at proguard.ConfigurationParser.readNextWord(ConfigurationParser.java:1133) [2013-09-24 18:09:42 -

Android Roboguice not working with Proguard

家住魔仙堡 提交于 2019-12-12 06:14:26
问题 this is my proguard-project.txt: -keep class com.google.inject.** { *; } -keep class javax.inject.** { *; } -keep class javax.annotation.** { *; } -keep class roboguice.** { *; } -keepattributes Signature -keepattributes *Annotation* -keep class roboguice.** -keep class com.google.inject.** { *; } -keepclassmembers class * { @com.google.inject.Inject <fields>; @com.google.inject.Inject <init>(...); } -keep class javax.inject.** { *; } -keep class javax.annotation.** { *; } -keep class com

Getting com.loopj.android.http.AsyncHttpClient after enabling Proguard

蓝咒 提交于 2019-12-12 05:07:50
问题 I have read this, It looks like its a known issue from quite some time. But i was not receiving any warning or crash when i was not using pro-guard . After enabling it, I am receiving around 500 warnings like following; Warning:com.loopj.android.http.AsyncHttpClient: can't find referenced class cz.msebera.android.httpclient I have tried following, but still all of the warnings are there. android { compileSdkVersion 24 buildToolsVersion "24.0.3" useLibrary 'org.apache.http.legacy' } I am not

ProGuard to keep class members with “unused” annotation

时光毁灭记忆、已成空白 提交于 2019-12-12 04:33:26
问题 The app has dependency on library, which has class members with @SuppressWarnings("unused") annotation. When I made use of proguard-rules.pro by, minifyEnabled true in gradle file, the members with above annotations are not found at runtime, with NoSuchFieldError error. How to keep those members from that library package, with annotation @SuppressWarnings("unused") , through "proguard-rules.pro" 回答1: The @SuppressWarnings annotation has source-level retention, thus it is not present in the