proguard

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

混江龙づ霸主 提交于 2019-11-30 04:38:15
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? 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 though. In your config file, set up your jars as library jars instead of input jars. This leaves them

Where do I find proguard.cfg in my project?

假如想象 提交于 2019-11-30 04:23:31
问题 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. 回答1: The documentation is slightly inaccurate. The generated file is proguard-project.txt and will be in the root

Proguard error: Expecting class path seperator - not sure where I need to put a path in quotes

若如初见. 提交于 2019-11-30 04:04:26
问题 The error: BUILD FAILED C:\workspace\projectName\add-proguard-release.xml:35: Expecting class path separator ';' before 'Files\eclipse\android-sdk-windows\platforms\android-3\android.jar' in argument number 1 I am fully aware that my problem is that I have eclipse+android in the c:\program files\eclipse directory - and the space between 'program' and 'files' is causing this problem. I am also aware that a solution is to put this path in quotes. My problem is WHERE to put these quotes. I'm a

Proguard issue for mupdf library

雨燕双飞 提交于 2019-11-30 03:18:30
问题 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

Proguard and Android :(

时光怂恿深爱的人放手 提交于 2019-11-30 03:13:39
问题 I am trying to run Proguard on my Android app and running into issues. I am using SpongyCastle jar (copy and past of full bouncy castle with package renamed so it does not conflict with androids bouncy castle built in version) When running proguard I see the following How do I fix this? Add rt.jar to my libs? The whole point of proguard is to shrink the code, but I keep adding jars to get around these issues where proguard complains it cannot find a class! Am I missing something? [proguard]

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

坚强是说给别人听的谎言 提交于 2019-11-30 02:47:13
问题 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

Generating a Pro Guard configuration file with Android Studio

十年热恋 提交于 2019-11-30 02:42:05
I am using Android Studio since 0.1.0 ... I just learned yesterday that Pro Guard seems to be integrated in newly created projects. Unfortunately this is not true for my project (which was a former Eclipse project). I didn't know of Pro Guard until I started working with Android Studio. And now I am looking for examples on how to use Pro Guard with Android Studio. Unfortunately the Android Dev documentation is only mentioning situations where the configuration file is already created. Is there a possibility to get Android Studio to create a configuration file to an already existing project?

Proguard: can't find referenced class

試著忘記壹切 提交于 2019-11-30 02:41:46
问题 There are a few questions around but no solution that works for me. I thought it was suppose to be easy to use. I just get a console full of can't find referenced class This is my proguard-project.txt -injars bin/classes -injars libs -outjars bin/classes-processed.jar -libraryjars C:/Users/ME/android-sdks/platforms/android-10/android.jar -dontpreverify -repackageclasses '' -allowaccessmodification -optimizations !code/simplification/arithmetic -keepattributes *Annotation* -keep public class *

Obfuscate private fields using ProGuard

試著忘記壹切 提交于 2019-11-30 02:00:53
I'm using ProGuard in AndroidStudio 1.2.1.1 with Gradle 1.2.3. My Gradle's release build is configured like so: minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' shrinkResources true I would like the private fields of classes to be obfuscated. Here is my proguard config file (after many tries) as of now: -allowaccessmodification -dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers -renamesourcefileattribute SourceFile -keepattributes SourceFile,LineNumberTable -repackageclasses '' -verbose [...] But I end up, after

ProGuard doesn't obfuscate JAR with dependencies

﹥>﹥吖頭↗ 提交于 2019-11-30 01:51:16
问题 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