proguard

NoClassDefFoundError when using proguard

穿精又带淫゛_ 提交于 2019-11-27 18:17:43
问题 My Project contains some librarys (ViewPagerIndicator, ActionbarSherlock, SlidingMenu...). After using proguard, my application crash every time when starts. Below is error log java.lang.NoClassDefFoundError:android.support.v4.appp.FragmentActivity$2 at android.support.v4.app.FragmentActivity.<init> (Unknown Source).... And here is my proguard script: -injars bin/classes -injars libs -outjars bin/classes-processed.jar -dontpreverify -repackageclasses '' -allowaccessmodification -optimizations

Obfuscating WAR file with Proguard

僤鯓⒐⒋嵵緔 提交于 2019-11-27 17:52:37
问题 I want to obfuscate my web application built as WAR archive, as this sensitive application in first time deployed outside our data center. I tried to use the Proguard GUI tool to obfuscate the input war, with all the service jar required for the UI application, with other external dependencies. Though the Proguard runs successfully with some warnings, ex., duplicate definition of library class [javax.servlet.UnavailableException], the output war contains no classes, but has lib with the

Proguard no longer works with Retrofit

梦想的初衷 提交于 2019-11-27 17:45:56
问题 I have found older questions which touch on the same subject but with the latest versions none of the available answers work for me. I am using Retrofit in my project. When I try to assemble I get the following error: Warning: retrofit.client.OkClient: can't find referenced class com.squareup.okhttp.OkHttpClient I'm using the following but none of it is helping: -keepattributes Signature -keep class retrofit.** { *; } -keep class retrofit.http.** { *; } -keep class retrofit.client.** { *; }

com.google.android.gms.internal.zzhu: can't find referenced class android.security.NetworkSecurityPolicy

房东的猫 提交于 2019-11-27 17:31:34
问题 I tried to generate an apk using proguard, but I've got this error while trying to build: Warning: com.google.android.gms.internal.zzhu: can't find referenced class android.security.NetworkSecurityPolicy Warning: there were 3 unresolved references to classes or interfaces. You may need to add missing library jars or update their versions. If your code works fine without the missing classes, you can suppress the warnings with '-dontwarn' options. (http://proguard.sourceforge.net/manual

appcompat-v7 v21.0.0 causing crash on Samsung devices with Android v4.2.2

北城余情 提交于 2019-11-27 17:29:07
We just changed our application to use the appcompat-v7 support library in order to take advantage of the support actionbar and support Material themes. Using v21.0.0 of appcompat-v7 (and v21.0.0 of support-v4) , we are now seeing crashes in Google Play and Crashlytics only from Samsung devices running Android v4.2.2 . Here is the stack trace from Google Play and the app appears to crash as soon as the actionbar` is shown and/or invalidated. java.lang.NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder at android.support.v7.app.ActionBarActivityDelegateBase

Where does Android Studio save the ProGuard mapping file?

好久不见. 提交于 2019-11-27 16:56:19
In Android Studio, where are the ProGuard mapping files generated after compiling a signed APK? I'm not sure if it isn't working or if I just forgot the file path, and my compulsory Google/Stack Overflow search did not answer this Scott Barta It should be located at build/outputs/proguard/release/mapping.txt in your application module's directory. In the latest version of ProGuard and Android Studio, the file is located at build/outputs/mapping/release/mapping.txt . Tom For me they are at 'build/outputs/mapping/release' Mark I found it cleaner to configure proguard to write the mapping.txt

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

半腔热情 提交于 2019-11-27 16:50:34
问题 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

Android 编程下的代码混淆

谁都会走 提交于 2019-11-27 16:49:31
什么是代码混淆 Java 是一种跨平台的、解释型语言,Java 源代码编译成中间”字节码”存储于 class 文件中。由于跨平台的需要,Java 字节码中包括了很多源代码信息,如变量名、方法名,并且通过这些名称来访问变量和方法,这些符号带有许多语义信息,很容易被反编译成 Java 源代码。为了防止这种现象,我们可以使用 Java 混淆器对 Java 字节码进行混淆。 混淆就是对发布出去的程序进行重新组织和处理,使得处理后的代码与处理前代码完成相同的功能,而混淆后的代码很难被反编译,即使反编译成功也很难得出程序的真正语义。被混淆过的程序代码,仍然遵照原来的档案格式和指令集,执行结果也与混淆前一样,只是混淆器将代码中的所有变量、函数、类的名称变为简短的英文字母代号,在缺乏相应的函数名和程序注释的况下,即使被反编译,也将难以阅读。同时混淆是不可逆的,在混淆的过程中一些不影响正常运行的信息将永久丢失,这些信息的丢失使程序变得更加难以理解。 混淆器的作用不仅仅是保护代码,它也有精简编译后程序大小的作用。由于以上介绍的缩短变量和函数名以及丢失部分信息的原因, 编译后 jar 文件体积大约能减少25% ,这对当前费用较贵的无线网络传输是有一定意义的。 混淆文件 proguard.cfg 参数详解 -optimizationpasses 5 # 指定代码的压缩级别

Proguard errors with external jar - returns error code 1

丶灬走出姿态 提交于 2019-11-27 15:50:48
问题 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

Prevent Proguard to remove specific drawables

倖福魔咒の 提交于 2019-11-27 15:03:38
In my Android project, I have some images stored in res/drawable/ which are accessed only from an HTML file loaded in a Webview. For example (code in HTML): <img src="file:///android_res/drawable/myfriend.png"> These images are removed by Proguard from apk during optimization. Does somebody know a way to keep these files (even if they are not used directly in the java code)? I had a similar issue and wanted to add just a few bits. The resources ARE NOT stripped away by ProGuard. If you simply unzip your apk you will see that the image files are still there. The problem is that the Webkit