proguard

How can I obfuscate only com.foo.* and com.bar.* (ProGuard)?

依然范特西╮ 提交于 2019-12-03 06:34:11
问题 I want to obfuscate only some packages: com.foo.* com.bar.* I have tried -keepclasseswithmembers class **, !com.foo.**, !com.bar.** { *; } and -keepclasseswithmembers class !com.foo.** { *; } -keepclasseswithmembers class !com.bar.** { *; } In both cases the classes from com.foo.* and com.bar.* was NOT obfuscated. 回答1: This should work -keep class !com.foo.**,!com.bar.** { *; } You can find a summary of the various -keep options at http://proguard.sourceforge.net/manual/usage.html

How to create an obfuscated jar file?

泪湿孤枕 提交于 2019-12-03 06:21:00
问题 How can I go about creating an obfuscate jar file? As of now I can easily export my Android lib project to a jar and use it. How do I obfuscate the jar file? My end goal is to allow others to use my lib.jar in their projects. I just want to protect the code as much as I can... :) 回答1: Turns out it is possible and it's not that hard. After 3hrs of trying I finally figured it out! Android provides a convenient proguard GUI under: android-sdk\tools\proguard Using the GUI you just select the in

Ignore proguard configuration of an external library

坚强是说给别人听的谎言 提交于 2019-12-03 06:14:42
So, I want to add an external library to my project. The library itself is quite small, around 300 methods. But it is configured to be very liberal with it's proguard configuration. I ran a simple test with/without the library and with/without proguard on a barebones project and this is what I came up with Proguard Lib Method Count N N 15631 Y N 6370 N Y 15945 Y Y 15573 As you can see, with proguard enabled, the count is ~6000. But the moment I add the lib, count shoots up to ~15000 despite the library itself being only ~300 methods. So my question is, how do I ignore the proguard

How to use Java annotations to guide Android's Proguard?

懵懂的女人 提交于 2019-12-03 06:10:58
问题 When using Proguard with Android, methods that are only invoked via reflection (e.g., callbacks defined in onClick XML attributes) are erroneously stripped out. One solution for this issue is to add each affected class and method to your proguard.cfg. How can I use Java annotations to achieve the same effect? I feel that would make the code self-documenting and it would avoid code and proguard.cfg drifting out of sync. However, Android's Proguard doesn't seem to ship with the annotations.jar

How secure is proguard against reverse engineering?

北城以北 提交于 2019-12-03 05:59:19
I will be working with very sensitive data in an app. Obfuscation by my definition is not added security, it will only delay the cracker with finite time. Is it possible that Proguard does this so well it may be called added security? What is most sensitive are some network calls. It will be hard to sniff the password because we will generate the password on both sides and check it's validity with timestamps. Problem is the app may be reverse engineered and the generate algorithm may be exploited. It is not possible to keep the algorithm locally in a file because with a rooted phone the

How to stop proguard from obfuscating entire package?

℡╲_俬逩灬. 提交于 2019-12-03 05:54:37
I need to prevent Proguard from obfuscating any classes from the package com.foo.* . I have tried: -keep com.foo.** { <fields>; <methods>; <constructors>; } But proguard says : Error: Unexpected keyword 'com.sun.foo.**' in line 32 of file 'obfuscationConfig.pro', included from argument number 1 I get a similar error if I try keep name com.foo** or keep * com.foo.** . Try to use the following: -keep class com.foo.** { public protected private *; } 来源: https://stackoverflow.com/questions/7593397/how-to-stop-proguard-from-obfuscating-entire-package

Android - Proguard with httpcore and httpmime using Android Studio and Gradle

社会主义新天地 提交于 2019-12-03 05:25:22
I'm developing an app with Android Studio 1.0.2 and Gradle 1.0.0 using the Apache libraries httpmime and httpcore for multipart entities. Here's my build.gradle : apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.1" // Something wrong with the http* libs packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/DEPENDENCIES.txt' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/DEPENDENCIES' exclude 'META

Android ProGuard error with org.xmlpull.v1.XmlPullParser

99封情书 提交于 2019-12-03 05:21:42
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.XmlPullParser [2011-03-17 09:27:04 - MyProject] Warning: library class android.content.Intent depends on

Obfuscation causes VerifyError: Expecting a stackmap frame

廉价感情. 提交于 2019-12-03 05:11:29
问题 We are using latest JDK 7 (u45) and ProGuard Version 4.10 Lately starting our distribution fails, after obfuscating it, with the following error: Exception in thread "main" java.lang.VerifyError: Expecting a stackmap frame at branch target 155 Exception Details: Location: com/bla/bla/service/ioc/SpringBootstrap.c()V @0: getstatic Reason: Expected stackmap frame at this location. Bytecode: 0000000: b200 73b6 008b 9900 82b2 0073 b800 933b 0000010: 1a99 0074 b200 73b6 008d 9900 6bb2 0074 0000020

Obfuscating method with throws clause

左心房为你撑大大i 提交于 2019-12-03 04:56:46
I'm using ProGuard to obfuscate my code. My project is comprised of a few modules, each obfuscated independently. One library includes an interface; public interface IFace { public int methodA(boolean b) throws CustomException; } Another library provides an implmentation public class IFaceImpl implements IFace { @Override public int methodA(boolean b) throws CustomException { return 0; } } The library with the interface is built first, and the second is built against the obfuscated version. Unfortunately the compile fails on the @Override as the interface does not have the throws clause. I