proguard

Injection with google guice does not work anymore after obfuscation with proguard

我只是一个虾纸丫 提交于 2019-11-29 02:20:15
Has anyone ever tried to combine the use of google guice with obfuscation (in particular proguard)? The obfuscated version of my code does not work with google guice as guice complains about missing type parameters. This information seems to be erased by the transformation step that proguard does, even when the relevant classes are excluded from the obfuscation. The stack trace looks like this: com.google.inject.CreationException: Guice creation errors: 1) Cannot inject a Provider that has no type parameter while locating com.google.inject.Provider for parameter 0 at de.repower.lvs.client

How can I exclude external .jar from obfuscation by Proguard (Android project)?

巧了我就是萌 提交于 2019-11-29 01:54:24
问题 When I export android project with proguard.cfg, all referenced .jar files are obfuscated as well. How can I exclude some of that .jars from obfuscation? 回答1: If you don't want to edit the Ant script, you can add -keep options to proguard.cfg for the classes in those external jars. For instance: -keep class othercode.** { *; } Or with a regular expression containing a negator: -keep class !mycode.** { *; } The standard Ant script will still merge all referenced jars in the single output jar

Proguard errors with external jar - returns error code 1

时光总嘲笑我的痴心妄想 提交于 2019-11-29 01:20:07
While exporting my Android Application, Proguard returned with error code 1. I am using twitter4j external jars in my app. I already added library jars, rt.jar (For this I downloaded latest jdk1.7 which has javax.management.* classes) and dontwarn statements also to proguard.cfg file. I included injars, libraryjars statements also.. Updated -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers -dontpreverify -dontshrink -verbose #-injars bin/classes #-injars libs #-outjars bin/classes-processed.jar -libraryjars <java.home>/jre

proguardRelease FAILED when compiling apk with assembleRelease in Android Studio

泄露秘密 提交于 2019-11-29 00:51:22
I'm trying to compile my app as assembleRelease in Android Studio 1.0.1 and get the following message: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:proguardRelease'. > java.io.IOException: Please correct the above warnings first. The app compiles and runs perfectly in debug mode, and assembleRelease worked with Android Studio 0.8. The proguard-rules.pro file is empty. The build.gradle file and the full error are shown below. Anybody can help? build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 19 buildToolsVersion '19

代码混淆proguard技术介绍

早过忘川 提交于 2019-11-28 23:59:09
由于各种反编译工具的泛滥,作为Android程序员在2.3版本以前只能通过手动添加proguard来实现代码混淆 proguard这个工具是一个java代码混淆的工具 在2.3版本的sdk中 我们可以看到在android-sdk-windows/tools/下面多了一个proguard文件夹 google已经把proguard技术放在了android sdk里面 可以通过正常的编译方式也能实现代码混淆了 可以看见新建一个工程里面有default.properties和proguard.cfg 默认的default.properties代码如下 [c-sharp] view plain copy # This file is automatically generated by Android Tools. # Do not modify this file -- YOUR CHANGES WILL BE ERASED! # # This file must be checked in Version Control Systems. # # To customize properties used by the Ant build system use, # "build.properties", and override values to adapt the script to

Avoid apk cracked [closed]

我与影子孤独终老i 提交于 2019-11-28 23:22:24
问题 Recently I released an app into Android Market using the licensing system with the ServerManagedPolicy model. Some days ago someone cracked the apk making it always response "Using cached license response" and allow access. How can I avoid that in future apps? Thanks! 回答1: I agree with @Tom van der Woerdt Implement your own licensing library I'd also refer you to check out this from Google I/O 2011: Evading Pirates and Stopping Vampires http://www.youtube.com/watch?v=TnSNCXR9fbY EDIT: The

How to tell proguard to keep enum constants and fields

筅森魡賤 提交于 2019-11-28 23:10:44
I've try obfuscate our web application which use spring, jaxb and relies on annotations, and reflection heavily. I apply many recipes found in internet to keep some classes, attributes, annotations and enumerations. But with enumerations still have problem. I've able preserve enum constants apply configuration from http://proguard.sourceforge.net/manual/examples.html#enumerations : -keepclassmembers,allowoptimization enum * { public static **[] values(); public static ** valueOf(java.lang.String); } At first glance it looks like working solution and constant preserved, so ( Class

Android Unit Tests with proguard enabled

折月煮酒 提交于 2019-11-28 22:55:43
I have a problem that Proguard strips out methods of my debug APK (I need to run proguard on debug beccause of method dex file limit), even if they are used in the Test apk. E.g. i use GSON addProeprty method in Unit test, but not in the App apk. This method gets stripped away and causes the test to fail. But i do not want to configure proguard to just keep all of GSOn because of the dex file limit, but also do not want to list all methods seperately. is there a way to tell rpguard to consider the unit tests as source code entry points? This is what I did. Add a custom proguard rules file.

Running ProGuard on OS X: Where is Apple's equivalent to the rt.jar?

僤鯓⒐⒋嵵緔 提交于 2019-11-28 22:49:01
I'm running ProGuard to shrink my jar file. One of the parameters it needs is the system's runtime jar. This is at $JAVA_HOME/lib/rt.jar on Sun distributions, but not on Apple's Mac OS X (v10.6 (Snow Leopard) in my case). Is there an rt.jar for OS X? It is called classes.jar and it is under /System/Library/Frameworks/JavaVM.framework/Classes Look here for details: http://lists.apple.com/archives/java-dev/2003/Mar/msg01530.html This blog entry describes a relatively straight-forward way to resolve the issue without modifying the Proguard configuration. The entry recommends that two symbolic

ProGuard Cannot Find Referenced Libraries

依然范特西╮ 提交于 2019-11-28 22:26:58
[2014-07-15 23:57:43 - MozMeet] Proguard returned with error code 1. See console [2014-07-15 23:57:43 - MozMeet] Note: there were 662 duplicate class definitions. [2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$1: can't find superclass or interface com.facebook.android.Facebook$ServiceListener [2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find superclass or interface com.facebook.Session$StatusCallback [2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find superclass or