proguard

Proguard+Maven混淆java web项目

送分小仙女□ 提交于 2019-12-05 04:14:20
这里用到的是常用配置,更多详细配置方法和参数信息见官网:https://www.guardsquare.com/en/products/proguard/manual/usage#keepoptions 1. proguard常用关键字 dontshrink 不压缩 dontoptimize 不优化 keep 保留类和类中的成员,防止被混淆或移除 keepclassmembers 只保留类中的成员,防止被混淆或移除 dontwarn 一个和keep可以说是形影不离,尤其是处理引入的library时,不显示警告信息 2. proguard通配符 *匹配任意长度字符,不包含包名分隔符(.) ** 匹配任意长度字符,包含包名分隔符(.) *** 匹配任意参数类型 3. 哪些不应该混淆 a. 使用了枚举要保证枚举不被混淆 b. 对第三方库中的类不进行混淆 c. 运用了反射的类也不进行混淆 d. 交给Spring管理的类 e. JNI中调用的类 f. Test类 4. 混淆模板 a. 在需要被混淆工程的pom文件中加入以下配置,具体配置的参数意义已注释。 ``` <plugins> <!-- ProGuard混淆插件--> <plugin> <groupId>com.github.wvengen</groupId> <artifactId>proguard-maven-plugin<

what is the difference between -keep class and -dontwarn

放肆的年华 提交于 2019-12-05 03:58:15
Hey I'm new with proGuard , I use it to protect my code from reverse engineering , but when I built my signed apk I got a lot of errors when I enabled proGuard ,I have googled my problem I've found answers that says use -dontwarn for the classes that showing in the error message but after seeing the documentation from proGuard it says If you don't feel like filtering out the problematic classes, you can try your luck with the -ignorewarnings option, or even the -dontwarn option. Only use these options if you really know what you're doing though. and I don't know what I'm doing and here is my

Android-Studio-1.2.RC Proguard warnings on Square's Okio library reference

試著忘記壹切 提交于 2019-12-05 03:31:59
WIth Android Studio: 1.2.RC I enabled proguard in .gradle: ``` minifyEnabled=true and added these rules to my proguard-rules.pro: -dontwarn com.squareup.** -dontwarn okio.** and added these lint rules to my .gradle file: warningsAsErrors false abortOnError false disable 'InvalidPackage' ``` But I still get these warning when I try to run the app in debug mode: ``` Warning: okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement Warning: okio.Okio: can't find referenced class java.nio.file.Files Warning: okio.Okio: can't find referenced class java

Proguard Android using Action Bar Sherlock

ⅰ亾dé卋堺 提交于 2019-12-05 02:29:27
问题 EDIT 4: I've tried taking out Action Bar Sherlock and Proguard did it ok. So I guess it is a problem with android-support-v4.jar. I tried this when including the ABS library, but it didn't work.. -keep class android.support.v4.app.** { *; } -keep interface android.support.v4.app.** { *; } -keep class com.actionbarsherlock.** { *; } -keep interface com.actionbarsherlock.** { *; } -keepattributes *Annotation* Finally, What is weird is that I tried without the ABS library and without proguard

Signed apk getting crashed in proguard enable

瘦欲@ 提交于 2019-12-05 02:19:48
I am trying to use proguard in my app set the proguard to true and then the problem starts I am importing lib when I use proguard by following this -keepnames class com.somepackage.* with my package name the app is getting getting crashed when I try to use the signed apk. I know this iS a dumb question but I am stuck at this for last 5 hr not able to find an easy solution as I am using about 20 lib. I followed this also . Plz guide me in this how can I do this? This is my proguard rule class code -keepnames class beatbox.neelay.dummybeat.* -keepnames com.srx.widget.* -keepnames de.hdodenhof

Proguard Aws s3 issue

天大地大妈咪最大 提交于 2019-12-05 01:53:33
问题 Having a real issue trying to implement proguard for amazon s3 it keeps on crashing on loading the application at line 29 which is s3Client = new AmazonS3Client(new BasicAWSCredentials( Constants.ACCESS_KEY_ID, Constants.SECRET_KEY)); This is the stack trace of the error and not sure what it means to be honest any way getting a better stacktrace or any suggestions on how to fix it? Process: com.closr.closr, PID: 24517 java.lang.NoSuchFieldError: PUBLIC_ONLY at java.lang.Class

Proguard Duplicate Zip Entry

匆匆过客 提交于 2019-12-05 01:21:22
I am trying to run my android application through Proguard, however this keeps appearing: Warning:Exception while processing task java.io.IOException: Can't write [C:\Users\Aliaksei\AndroidStudioProjects\SignOutSystem\app\build\intermediates\transforms\proguard\debug\jars\3\1f\main.jar] (Can't read [D:\Users\Aliaksei\.android\build-cache\f7a6034d02d095f18cc21950f131d07fa78b41c0\output\jars\classes.jar(;;;;;;**.class)] (Duplicate zip entry [android/support/v4/os/j.class == classes.jar:android/support/v4/os/ResultReceiver$MyResultReceiver.class])) I am aware that this means that the android

Android build release transformClassesWithDexBuilderForRelease FAILED java.lang.ArrayIndexOutOfBoundsException

霸气de小男生 提交于 2019-12-05 01:09:42
问题 I've updated Firebase (from v15.0.2) and play-services-base (from v15.0.0) to the latest versions. I'm using implementation 'com.google.firebase:firebase-core:16.0.5' implementation 'com.google.android.gms:play-services-base:16.0.1' implementation 'com.google.firebase:firebase-config:16.1.0' implementation "com.google.firebase:firebase-messaging:17.3.4" implementation 'com.google.firebase:firebase-ads:17.1.1' dependencies { classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com

how to keep all methods in a class with ProGuard

。_饼干妹妹 提交于 2019-12-05 00:14:28
I use ProGuard to optimize my Android Application. However for Android instrumentation test I need some (but not all) classes to keep all there members. I tried various approaches, the last being: -keepclassmembers public class com.mycompany.myclass { *; } But surprisingly I still get java.lang.NoSuchMethodError: com.mycompany.myclass.<init> The painful part here is that there are two constructors and one has quite a few parameters. Does anyone know the correct syntax to keep a class completely unchanged and untouched by ProGuard? Well, it is confession time. The question is bollocks. The

Proguard进行Android代码混淆

泄露秘密 提交于 2019-12-04 22:20:41
在实际的开发成产品apk的发布过程中,我们经常会使用到代码混淆技术。不过在讲解如何进行代码混淆之前,我先跟大家演示一下反编译的过程,这样才能让大家明白为什么需要进行代码混淆。 一、代码反编译 1.准备工作 首先我们准备好一个项目的apk文件(未进行混淆打包 )、dex2jar工具(下载地址: http://code.google.com/p/dex2jar/ )、 jd-gui工具(下载地址 : http://jd-gui.softpedia.com/ )。 2.获取CodeMixTest.apk中的classes.dex文件 将CodeMixTest.apk解压,这里我们为了方便就直接解压到当前文件夹下。在解压出的文件中,我们可以看见有一个classes.dex文件,这就是我们的源代码打包生成的文件。 3.使用dex2jar工具还原jar文件 dex2jar工具的作用就是将class.dex文件还原成.jar文件。先将dex2jar-0.0.9.15.zip解压,然后将上面获得的classes.dex文件拷贝至解压的目录中。 查看解压目录中,有dex2jar.bat文件。 启动cmd,进入到dex2jar工具解压的目录中,运行命令:dex2jar.bat classes.dex, 有如下结果 。 查看 dex2jar工具解压的目录中,生成了我们想要得到的 classes