android-proguard

Proguard claims to obfuscate the .apk, but does not

馋奶兔 提交于 2019-12-14 03:33:11
问题 I'm exporting an Android application from Eclipse. Proguard thinks it is obfuscating the .apk according to the console, dump.txt, mapping.txt, seeds.txt and usage.txt output, but when I decompile the .apk itself it is not obfuscated. Names of classes and fields are intact. I have tried various different Proguard configs but there doesn't seem to be anything wrong in terms of the configs. I make sure to clean the project so the classes.dex file won't be outdated. 回答1: This worked for me in

How can I force Proguard make my illegible .XML resource file?

痴心易碎 提交于 2019-12-13 22:02:46
问题 I used ProGuard in android studio to protect my data resources because I have two files in it: res / raw / fiche.xml and res / raw / fiche1 .XML so I'd make the content of my unreadable files. My question is how to make these two files unreadable with Proguard. thank you in advance. 回答1: ProGuard only affects Java code, not resources. You will need to research other tools, like DexGuard, that may offer resource obfuscation. Whether there is a tool that can obfuscate raw resources is another

Do I need to 'keep' Parcelable in proguard rules while obfuscating

南楼画角 提交于 2019-12-13 14:42:04
问题 My Project has few classes that extends Parcelable. Do I need to 'keep' them in proguard rules while obfuscating. What is the general practice for parcelables? 回答1: No, the default android rules include this: -keepclassmembers class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator CREATOR; } These default rules will be applied if you leave the default generated gradle definition in place: proguardFiles getDefaultProguardFile('proguard-android.txt'),

Proguard error with fresco

落花浮王杯 提交于 2019-12-13 14:28:14
问题 I am using ProGuard and when I am running the project in release configuration, I get the following error: Warning:com.facebook.imagepipeline.bitmaps.DalvikBitmapFactory: can't find referenced field 'android.graphics.Bitmap$Config BITMAP_CONFIG' in program class com.facebook.imagepipeline.nativecode.Bitmaps I searched everywhere but couldn't find any clue to solve it. I have updated my proguard-rules.pro with what is given in the fresco's docs page. Fresco dependency: compile 'com.facebook

Why does AndroidManifest.xml have invalid targetSdkVersion?

被刻印的时光 ゝ 提交于 2019-12-13 11:19:19
问题 I build an app using android studio 3, but when I want to publish it, market said "Your application must have a valid targetSdkVersion set. To solve this problem, you need to edit your AndroidManifest.xml file and upload again the .apk file." I thought proguard make this problem so add -keep AndroidManifest.xml to rules. But it doesn't resolve my problem. could you help me please? I forgot to say I didn't have targetSdkVersion in my manifest. I added it manually but didn't resolve my problem.

Keep method name from Obfuscator Proguard

本秂侑毒 提交于 2019-12-13 05:52:56
问题 How can I prevent method SendToGroup() from Obfuscator in proguard. Coz, this method name will be call from server side and need to be same name (dynamic method call). It's a push from signalR. public class main { private class inner implement x { @Override public Object dynamic { return new Object { @SuppressWarnings("unused") public void SendToGroup(String message) { androidNotification(message); } }; } } } I have seen this and this but still not work and not understand. Please advice. 回答1:

Android Can't load vlcjni library (libVLC)

有些话、适合烂在心里 提交于 2019-12-13 03:47:02
问题 I can't use implementation 'de.mrmaffen:libvlc-android:2.1.12@aar' if the set minifyEnable to true . The error message is Can't load vlcjni library: java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app//lib/arm64/libvlcjni.so" How can I use minifyEnable true with libvlc ? 回答1: if you obfuscate the libvlc there is no way for the native code to find the necessary classes and methods so it returns a JNI_ERR . You just need to exclude the libvlc from ProGuard , add this

App crashes when minifyEnabled is true [Logcat included]

核能气质少年 提交于 2019-12-13 03:34:22
问题 I am using a multi-module app and the app crashes when minifyEnabled true in the installed module's build.gradle. Following is the deobfuscated stacktrace I retrieved from play console. FATAL EXCEPTION: ControllerMessenger Process: com.packagename, PID: 16978 java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.List.get(int)' on a null object reference at com.packagename.login.Utils.AuthenticationActions.saveCredentials(AuthenticationActions.java) at

Obfuscating a module/library

元气小坏坏 提交于 2019-12-12 18:25:25
问题 I have a library that will be consumed by apps. This module has interfaces and helper classes. How can I obfuscate the whole module but still allow access to all those interfaces and helper classes? I tried this: buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } Then I found myself having to do --keep on all my classes in proguard. Is there something I can add to pro guard so that I can keep all those interfaces

How to distribute a SDK as AAR file without exposing the source code?

喜你入骨 提交于 2019-12-12 15:22:30
问题 I want to distribute an SDK to end developers but I don’t want to share my code. I have used AAR file to share my SDK (Android Archive Library (aar) vs standard jar). But there is a possibility that others can view my class files. How to avoid that? Please help us. Note: I had review this “Android - Need a way to create the library(.aar file) without source code” but it didn’t solve my problem. 回答1: Proguard cuts unused classes. Libraries are standalone products, and has some specific entry