android-proguard

Android ProGuard obfuscation of library: keep class not working

 ̄綄美尐妖づ 提交于 2019-12-04 17:34:41
Intro: I have in AS 1 project with 2 models: Android library project with some "Public API class" Android APP dependent on above library (the library module is on the dependency list) Task: I want to obfuscate my library project because I want to expose it as public SDK but keep my code protected... What I did: So I made custom ProGuard rules: -dontshrink -dontoptimize -dontpreverify -keep class com.org.my_public_api_class_name I skip all other stages in order to eliminate where the bug is to only obfuscation stage. Result: Build of the APP module fails with errors like Error: cannot find

Android Proguard warning: can't write resource (Duplicate zip entry)

我的未来我决定 提交于 2019-12-04 16:54:26
问题 I enabled proguard and got: Warning:can't write resource [META-INF/LICENSE.txt] (Duplicate zip entry [commons-io-2.4.jar:META-INF/LICENSE.txt]) Warning:can't write resource [META-INF/NOTICE.txt] (Duplicate zip entry [commons-io-2.4.jar:META-INF/NOTICE.txt]) Warning:can't write resource [META-INF/LICENSE.txt] (Duplicate zip entry [commons-collections-3.2.1.jar:META-INF/LICENSE.txt]) Warning:can't write resource [META-INF/NOTICE.txt] (Duplicate zip entry [commons-collections-3.2.1.jar:META-INF

When using R8 on Android, do I need to uninstall my existing Proguard?

雨燕双飞 提交于 2019-12-04 12:33:19
问题 Do I need to remove Proguard related code from Gradle when using R8? minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 回答1: You don't actually remove the proguard rules, as R8 works with Proguard rules in compat mode . For more details, please refer to https://android-developers.googleblog.com/2018/11/r8-new-code-shrinker-from-google-is.html. R8 is available with Android Studio 3.3 beta and works with Proguard rules. To try it, set

Android - Proguard and retrofit 2?

橙三吉。 提交于 2019-12-04 08:39:09
问题 I am using from Proguard for my project and bellow code is in my proguard-rules.pro : # Retrofit -keep class com.google.gson.** { *; } -keep class com.google.inject.** { *; } -keep class org.apache.http.** { *; } -keep class org.apache.james.mime4j.** { *; } -keep class javax.inject.** { *; } -keep class javax.xml.stream.** { *; } -keep class retrofit.** { *; } -keep class com.google.appengine.** { *; } -keepattributes *Annotation* -keepattributes Signature -dontwarn com.squareup.okhttp.*

Do library dependency increase size of APK?

陌路散爱 提交于 2019-12-04 07:33:51
I have multiple libraries in my project like dependencies { compile files('libs/universalloaderlibrary.jar') compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.android.support:design:22.2.1' compile 'com.android.support:recyclerview-v7:22.2.1' compile 'com.android.support:cardview-v7:22.2.1' compile 'de.hdodenhof:circleimageview:1.3.0' compile 'com.jakewharton:butterknife:7.0.1' //noinspection GradleCompatible compile 'com.google.android.gms:play-services-gcm:7.3.0' compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'

Proguard causing runtime exception with Android Navigation Component

南笙酒味 提交于 2019-12-04 04:41:32
I'm experiencing this crash when using proguard after integrating the NavigationComponent ( android.arch.navigation:navigation-fragment-ktx:1.0.0-alpha01 ) into my project with target and compile sdk of 27 2018-05-16 12:13:14.044 24573-24573/com.mypackage.myapp.x E/AndroidRuntime: FATAL EXCEPTION: main Process: com.mypackage.myapp.x, PID: 24573 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mypackage.myapp.x/com.mypackage.myapp.MainActivity}: android.view.InflateException: Binary XML file line #16: Binary XML file line #16: Error inflating class fragment at android.app

Run Proguard on multi-module project as “one piece”

*爱你&永不变心* 提交于 2019-12-04 04:38:32
TLDR: How to pass proguard mapping to javac to compile against obfuscated library ? That's long, but I don't see how to make it shorter: Background: I have the following product setup: Android Studio project - Library module - (sub)module Core - (sub)module A - (sub)module B - (sub)module C - Sample App module - ... Other modules Each of library submodules A, B, C reference classes in Core, but A, B, C independent among themselves. Conceptually similar to Play Services where user can only have code and required sub-module. Each of the library submodules has external APIs but also many internal

Android + Proguard + Apache POI

℡╲_俬逩灬. 提交于 2019-12-04 03:32:07
问题 Someone was able to get the Apache POI library to work after obfuscation. I read a lot of information, tried different methods, but still get the error: a.a.b.a: Provider com.bea.xml.stream.EventFactory not found org.apache.poi.openxml4j.opc.internal.marshallers.PackagePropertiesMarshaller.<clinit>(Unknown Source) at org.apache.poi.openxml4j.opc.OPCPackage.init(Unknown Source) at org.apache.poi.openxml4j.opc.OPCPackage.<init>(Unknown Source) at org.apache.poi.openxml4j.opc.Package.<init>

NullPointerExcepetion Facebook sdk v4.5.0 when enable Proguard (when try to login using Parse library)

和自甴很熟 提交于 2019-12-04 02:59:41
问题 I'm trying to login with Facebook using ParseFacebookUtils library and it's working good but when i enabled the Proguard file i have this exception on Facebook login activity startup: Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{my.package.name/com.facebook.FacebookActivity}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2413) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java

why proguard is only obfuscating the class which is not extending anything

别说谁变了你拦得住时间么 提交于 2019-12-04 02:56:17
问题 i am trying to obfuscate my android application with proguard. But the problem is when i decompiled the apk it only shows the changed variable names but class names are same as in the source.Only one class's name is changed which is not extending the any other class.I have searched many options but nothing worked so i am posting my problem here. Here is my gradle file code:- buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules