proguard

Kotlin: ProGuard erases properties attributes

穿精又带淫゛_ 提交于 2019-12-07 16:10:33
问题 TL;DR : with proguard enabled, when using reflection, my properties look private, non-nullable and without annotations, despite proguard config that should keep all these attributes. I have some simple data class es with public properties to serve as data models in my Android app. Later, when doing generic [de]serialization of said classes, I filter the property list like this: val properties = instance::class.memberProperties .filter { it.visibility == KVisibility.PUBLIC } // && some other

i want to obfuscate AndroidManifest.xml with Proguard

可紊 提交于 2019-12-07 14:52:55
问题 Can i obfuscate AndroidManifest.xml file with Proguard? i think write to source code in my proguard.config file. (-adaptresourcefilenames AndroidManifest.xml) but it wasn't work. 回答1: The standard Android release builds only apply ProGuard to the compiled bytecode, not to any resource files. It therefore can't adapt files like AndroidManifest.xml. Moreover, these build processes first run aapt to convert AndroidManifest.xml and other XML files to binary versions, for more efficient packaging

java ProGuard remove (shrink) unused classes

…衆ロ難τιáo~ 提交于 2019-12-07 14:15:37
问题 Let's say I have this Java app: package com.site; public class MyAppBase {} package com.site.free; import com.site.MyAppBase; public class MyApp extends MyAppBase {} package com.site.pro; import com.site.MyAppBase; public class MyApp extends MyAppBase {} package com.site; public class Edition { public static final int FREE = 1; public static final int PRO = 2; private static final int EDITION = PRO; public static boolean is(final int edition) { return (EDITION == edition); } } package com

Getting too many Proguard warnings

谁说胖子不能爱 提交于 2019-12-07 07:55:29
I am trying to obfuscate my java application that is packed into a SINGEL jar. The application uses SWT gui libaries among others. I have duly listed them all in the Proguard configuration file via -libraryjars, but still I get too many warnings of the same type i.e.: "Warning: library class org.eclipse.swt.accessibility.Accessible$10 extends or implements program class org.eclipse.swt.internal.ole.win32.COMObject" What am doing wrong here?? Here is how my Proguard configuration looks like: -injars 'D:\Tasks\Deployment\NEW - 30.06.2011\proguard4.6\lib\fevflex.jar' -outjars 'D:\Tasks\Deployment

Proguard keep interface method paramternames

别来无恙 提交于 2019-12-07 07:10:07
问题 I use -keepparameternames but it's not responding to interface. The interface's methond parameter is proguard. Thank you for your help. 回答1: Proguard can preserve parameter names just fine. Unfortunately, javac does not preserve them by default. In order to emit necessary attributes, make sure to compile your code with full debugging info enabled. Java 8 javac does this with -g and -parameters flags. See this blogpost for some background. 来源: https://stackoverflow.com/questions/36685590

Should I keep android.support.v4.app.Fragment and its derived classes when building a release version of my app?

夙愿已清 提交于 2019-12-07 06:25:59
问题 I read this answer and undestood why I should keep names of my services, activities, and custom views. But should I keep my classes which derive from android.support.v4.app.Fragment? I also took a look at the defualt Proguard config file %SDK_DIR%\sdk\tools\proguard\proguard-android.txt , and there were no rules regarding fragments. 回答1: The main reason why you would need to keep a class , is because it is accessed via reflection. Fragments are normally not accessed via reflection, so you don

Obfuscating ORMLite model classes with Proguard

纵饮孤独 提交于 2019-12-07 06:13:48
问题 I have a few models that I want to obfuscate in my code. I know that I could just ignore the whole model package but I don't want to do that. I tried a few proguard tweaks and checked all relevant posts to no avail. ORMlite keeps throwing java.lang.RuntimeException: Unable to create application ...App: java.lang.IllegalArgumentException: Foreign field class ....f.p does not have id field . I checked that the annotation is still there with dex2jar and jd, and it is still there. I have this

ProGuard: keep private Inner Class

安稳与你 提交于 2019-12-07 05:59:28
问题 How to keep private Inner Class in ProGuard. I am already using($ for inner class) below code in my proguard.cfg but its not working. -keep public class com.xxx.droid.activity.LoginActivity$JsInterface 回答1: This should work: -keep public class com.xxx.droid.activity.LoginActivity$* { *; } 回答2: If the inner class is private, you shouldn't use the public keyword in the template, because it won't match. The compiler will actually compile the class as a package visible class (private classes don

Exclude jniLibs folder from Production APK

安稳与你 提交于 2019-12-07 05:55:41
问题 My app has a dev and production flavor defined in Gradle. In my production flavor, I would like the resulting APK file to NOT have my x86 jniLibs binaries. I only use them for testing in genymotion, and some of them are large so I really need the space. The only way I can get this to kinda work is by manually deleting my src/main/jniLibs/x86 folder then building, but I then have to do this every time I build, and then restore the libs later. Is there a simpler way using gradle/proguard

Proguard while Butterknife library and other warnings

◇◆丶佛笑我妖孽 提交于 2019-12-07 04:49:36
问题 My Activities , Fragments ,Services and BroadcastReceivers I want to implement a ProGuard taken to the safety of the classroom. Error I get when Proguard. What should I write into the file? -> proguard-android.txt ve proguard-rules.pro I'd written into the grade. lintOptions { checkReleaseBuilds false // Or, if you prefer, you can continue to check for errors in release builds, // but continue the build even when errors are found: abortOnError false } buildTypes { release { minifyEnabled true