proguard

Ignore external libraries with Android proguard

一笑奈何 提交于 2019-11-30 21:27:29
I want to use Proguard mainly for obfuscation reasons. I have a problem with proguard in Android. I used simpleframework to parse XML; its external. In proguard cfg: -keepattributes *Annotation*,EnclosingMethod -keep public class org.simpleframework.**{ *; } -keep public class org.simpleframework.xml.**{ *; } -keep public class org.simpleframework.xml.core.**{ *; } -keep public class org.simpleframework.xml.util.**{ *; } -keep public class org.simpleframework.xml.stream.**{ *; } -keep public class javax.** { *; } -keep public class javax.xml.stream.**{ *; } -keep public class org

Using Proguard to remove unused classes in Google Play Services library

╄→гoц情女王★ 提交于 2019-11-30 20:25:30
I'm trying to get rid of unused classes from Google Play Services library. I've created brand new android project with single empty activity. The project does not use anything from Google Play Services library. So I would expect, that when I build release (which includes running proguard in my configuration) I will see no difference in binary size comparing building with/without play-services dependency. But actually, I see ~700 KB difference in apk size. I've found relatively complex solution, using gradle script , which involves repacking play-services.jar file. Also, this solution requires

使用proguard混淆android代码

北慕城南 提交于 2019-11-30 20:14:40
当前是有些工具比如apktool,dextojar等是可以对我们android安装包进行反编译,获得源码的。为了减少被别人破解,导致源码泄露,程序被别人盗取代码,等等。我们需要对代码进行混淆,android的sdk中为我们提供了ProGrard这个工具,可以对代码进行混淆(一般是用无意义的名字来重命名),以及去除没有使用到的代码,对程序进行优化和压缩,这样可以增加你想的难度。最近我做的项目,是我去配置的混淆配置,因此研究了一下,这里分享一下。 如何启用ProGuard ant项目和eclipse项目启用方法 在项目的 project.properties 文件中添加一下代码 proguard.config=proguard.cfg //proguard.cfg为proguard的配置文件 proguard.config=/path/to/proguard.cfg //路径不在项目根目录时,填写实际路径 填写这句配置后,在 release 打包时就会按照我们的配置进行混淆,注意,在我们平时的debug时是不会进行混淆的。 Gradle项目(以及Android Studio) 在build.gradle中进行配置 android { buildTypes { release { runProguard true proguardFiles getDefaultProguardFile(

Where do I find proguard.cfg in my project?

我与影子孤独终老i 提交于 2019-11-30 19:44:15
I want to enable the ProGuard for my application and in this documentation ProGuard it says that the proguard.cfg , where I have to modify something, is automatically generated. But if I look in my project folder I only see a proguard-project.txt file but I dont see the proguard.cfg which I need. How can I get this proguard.cfg? Or was I'm doing wrong? Please guid me to this file. The documentation is slightly inaccurate. The generated file is proguard-project.txt and will be in the root directory of your project. To enable Proguard , you will need to ignore the "do not modify" warning in

Setting ProGuard to obfuscate local variables and arguments

走远了吗. 提交于 2019-11-30 18:51:54
问题 I can't seem to find the setting that will obfuscate the local variables, inside methods of a class which is obfuscated. Here's an excerpt from one of the classes I've decompiled, with some obvious missing parts. Ideally, the arguments for the methods, and the local variables, would be obfuscated too. public class eA extends gu { private final gt a; private final gt b; public static boolean a(fy game) { boolean playerDead = game.k().j() <= 0; boolean enemyDead = game.g().a().size <= 0;

Proguard issue for mupdf library

≡放荡痞女 提交于 2019-11-30 18:43:11
My application is running well until I'm trying to build the release version. I got the following error message: java.lang.NoSuchFieldError: no field with name='globals' signature='J' in class Lcom/artifex/mupdfdemo/MuPDFCore; Apparently the problem is in my mupdf library. I built this library to an aar file without using proguard. Here is my build.gradle for mupdf library: apply plugin: 'android-library' android { compileSdkVersion 19 buildToolsVersion "19.0.0" defaultConfig { minSdkVersion 8 targetSdkVersion 19 versionCode 1 versionName "1.0" } buildTypes { release { runProguard false

NoClassDefFoundError: android.support.design.internal.NavigationMenu on Android 4.2.2 (wiko)

大兔子大兔子 提交于 2019-11-30 18:37:55
I am trying to use the Android Support Design library (in version 23.0.1) and the class NavigationMenu (I use this class as an XML tag into a layout). When I execute my app on a Samsung on Android 4.3 or on a Nexus on Android 5.x or 6.0 everything works well, but when I execute the app on a Wiko Rainbow on Android 4.2.2, it crashes with the following exception : java.lang.RuntimeException: Unable to start activity ComponentInfo{applicationId/package.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class <unknown> [...] Caused by: android.view

Proguard ParseException with Default proguard.cfg on Android

南楼画角 提交于 2019-11-30 18:04:27
问题 I am about to release an application but, while i was building it using Export Tool of Android SDK in Eclipse, i get the error below. I didn't change the proguard.cfg. It is in the root folder of my project. I only add proguard.config=proguard.cfg to default.properties. I read the forum and update proguard (just copied the files to the tools folder of Android SDK), but still I doesn't work. I couldn't figure out what the problem is with the 'Projects\Eclipse' ?? If you help me, I will be so

ProGuard doesn't obfuscate JAR with dependencies

这一生的挚爱 提交于 2019-11-30 17:55:45
I have a project with the pom.xml file given below. When I issue the command mvn clean compile assembly:single install I want Maven to generate a JAR, which contains all the dependencies and obfuscated version of my code. It doesn't work - my code is not obfuscated in the "jar-with-dependencies" file. When I run mvn clean compile install the resulting file contains obfuscated code of my application, but no dependencies. What can I do in order to have a JAR file with all the dependencies and my obfuscated code? <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4

Proguard Retrace not working with stacktrace runtime info like E/AndroidRuntime(10237):

◇◆丶佛笑我妖孽 提交于 2019-11-30 17:46:58
I need to remove lines from my proguard.trace file like E/AndroidRuntime(10237): in order for retrace to work. Basically I am looking at log file and need to remove this lines or retrace does not work. Am I missing something or do I need to do this for every stacktrace? Basically its the information before that appears at the beginning of a stacktrace line like E/AndroidRuntime(10237): at com.test.a.b.c(UnnownSource) :134 Here is the whole stacktrace: E/AndroidRuntime(10237): FATAL EXCEPTION: main E/AndroidRuntime(10237): java.lang.ArithmeticException: divide by zero E/AndroidRuntime(10237):