proguard

Proguard: How to keep everything except specific condition?

…衆ロ難τιáo~ 提交于 2020-01-01 06:27:02
问题 I'm using Proguard to obfuscate my code, and I need to keep every third party libraries like: -keep class com.layer.** -dontwarn com.layer.** -keep class com.twitter.** -keep class android.support.** -keep class com.crashlytics.** { *; } -dontwarn com.crashlytics.** ... And whenever I add a new third party library, I need to check its package name and add it to my proguard config file, or the app may crashes. Can't I write the rule just like this? I don't care about codes that's not mine.

Android proguard obfuscated code is causing NullPointerException when it really shouldn't be

独自空忆成欢 提交于 2020-01-01 05:22:12
问题 I have distributed an application on the Android Marketplace. I am getting error reports back in from a small handful of users (maybe 2%) where they are getting NullPointerExceptions where it doesn't make logical sense. I have never been able to replicate this myself. The code is relatively straightforward and is a common code path that EVERY user has to follow. I've actually taken every separate line of code that could possibly be creating the NPE and wrapped it in a try-catch block and

Proguard configuration when using Android Studio's Google Cloud Endpoints template

余生长醉 提交于 2020-01-01 05:18:07
问题 We need to store and retrieve the content that users generate with our app online. To do so, we decided to use Android Studio's integrated Google Cloud Endpoints template to quickly create an API (official usage example here). It works fine in debug, but in release mode, with Proguard enabled, it fails. Worse still, I've failed to find any documentation or samples about using Proguard with the Android Studio's Endpoints templates. After an hour or so of poking around and trying to make it

Using Proguard to Obfuscate Android App with Dropbox.com Libraries

烂漫一生 提交于 2020-01-01 02:40:17
问题 I've just finished creating an Android app that requires the Dropbox.com API libraries. I'm now trying to build the application in 'Release' mode and would like to run proguard on the code in order to obfuscate it. However, whenever I attempt to run Proguard, I get the following error: Proguard returned with error code 1. See console Warning: com.dropbox.client2.DropboxAPI: can't find referenced class org.json.simple.JSONArray Warning: com.dropbox.client2.DropboxAPI: can't find referenced

Android ProGuard error with org.xmlpull.v1.XmlPullParser

别来无恙 提交于 2020-01-01 01:56:49
问题 When my application is build with ProGuard, it fails with following message. I use a default proguard.cfg generated by Android SDK with some -libraryjars. What can I do for it? [2011-03-17 09:27:04 - MyProject] Proguard returned with error code 1. See console [2011-03-17 09:27:04 - MyProject] Note: there were 4247 duplicate class definitions. [2011-03-17 09:27:04 - MyProject] Warning: library class android.content.res.XmlResourceParser extends or implements program class org.xmlpull.v1

How can I tell ProGuard to keep my function that is used for onClick?

五迷三道 提交于 2019-12-31 21:08:24
问题 I am using the android:onClick atribute in some of my .xml layout files for my android application, but ProGuard is removing these methods from my code when it runs because nothing in my code is ever calling them. Rather then specifying each function individually, I would like to name them something like listener_functionName , and use wildcards, like -keep listener_* (I know this is incorrect, but hopefully it illustrates my goal). If this is possible that would be great, but if not I still

Proguard error android, unable to access jar file

左心房为你撑大大i 提交于 2019-12-31 03:11:25
问题 This is the first time I am using progurad and getting the following error on exporting signed apk. Error: Unable to access jarfile ..\lib\proguard.jar I uncommented the proguard.config= line # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt But there still seems to be some issue. What is needed to fix it. 回答1: Sounds like a known bug in ADT 22.6

Build Signed APK failed - Can't find common super class of [android/content/Context]

假如想象 提交于 2019-12-31 02:54:10
问题 This is Android Project. Using Normal Build was successfull, but using signed Key i got this error : Execution failed for task ':transformClassesAndResourcesWithProguardForFlavorRelease'. > java.io.IOException: java.lang.IllegalArgumentException: Can't find common super class of [android/content/Context] (with 2 known super classes) and [com/onesignal/ADMMessageHandler] (with 1 known super classes) Any Idea ? Thanks in advance... 回答1: I think Proguard causes this problem. Add this line to

Enable Proguard for only two packages in large Android application

感情迁移 提交于 2019-12-31 01:44:11
问题 Background I am developing an Android application that relies on multiple external libraries (8 added as library project dependencies, 14 added as jar dependencies). Some of these jar libraries are closed source an have already been obfuscated and some of them rely pretty heavily on reflection. The application uses ZXing for QR code scanning/recognition and, without Proguard optimization, ZXing is quite slow (at least on Android). At first, I only needed to optimize the com.google.zxing.**

How to use proguard optimizer tool with xamarin forms

泄露秘密 提交于 2019-12-30 15:42:15
问题 I want to reduce size of .apk file, so I am checking Enable ProGuard option in Android project's property window but getting compile time error Error "java.exe" exited with code 1. I tried few things like Head size is already 1G. Android target version is 9.0(Pie). My Solutions Configuration in Release mode. Using latest ProGuard file(6.1.1) Added proguard-android.txt, proguard-android-optimize.txt and proguard-project.txt in new ProGuard file. Log: 1>------ Rebuild All started: Project: