proguard

Android proguard issues for release

淺唱寂寞╮ 提交于 2019-12-01 17:47:53
问题 I'm able to create builds for my android app, but when I turn on proguard i'm getting numerouos warnings, and then the build fails. The warnings are like the ones below: Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpRequest Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpEntity Warning: library class android.net.http.AndroidHttpClient depends on program class org.apache.http.params

Proguard: avoiding naming collisions with pre-obfuscated library JARs

柔情痞子 提交于 2019-12-01 17:31:41
It seems that Proguard doesn't make any attempt to avoid naming collisions with classes in library JARs when it renames/repackages classes. Is this correct, or have I just not configured it correctly? I am obfuscating an Android application that uses the latest Google AdMob SDK. Previously I was using the old AdMob SDK without a problem. The new SDK JAR file contains some classes that have been obfuscated. One of these classes is a.class in the default/unnamed package. When I obfuscate my app, Proguard renames/repackages one of my classes to also be a.class in the unnamed package, despite

Android Studio exclude class or file from jar

穿精又带淫゛_ 提交于 2019-12-01 17:18:21
问题 How to exclude class or any another file from jar library in Android Studio Gradle ? I tried to use this: packagingOptions { exclude 'com/imagpay/bU.class' } And this: sourceSets { main { java { exclude 'com/imagpay/bU.class' } } } But nothing helped. After adding new library to project get such error during release: Error:Execution failed for task ':app:proguardRelease'. java.io.IOException: Can't read [/home/denys/Epos/app/libs/PMCore.jar(;;;;;;!META-INF/MANIFEST.MF)] (Can't process class

android studio 代码混淆如何忽略第三方jar包

一世执手 提交于 2019-12-01 16:29:16
最近在打包混淆时,遇到一个问题,混淆编译都不出错,运行出错,一般遇到这种问题,肯定是在运行的地方有代码被混淆了,经过错误排查,发现是程序中用到第三方的jar包的方法出现问题了,原来android studio混淆打包时把第三方的jar包给混淆了。 于是想这个问题很简单,保持jar包不混淆就好,于是直接在app目录下的proguard-rules.pro(或者proguard-rules.txt)混淆规则文件直接-libraryjars libs/xx.jar避免混淆。但是却引出了另一个错误: Error:Execution failed for task ‘:app:proguardRelease’. java.io.IOException: The same input jar [E:myprojectapplibsXX.jar] is specifi 大专栏 android studio 代码混淆如何忽略第三方jar包 ed twice. 也就是说混淆规则文件中,我们指定了2次 解决方法: 打开app目录下的libs文件夹,将各第三方jar下的包名在proguard-rules.pro 文件中过滤。 code: -keep class audio.cutter.lib. {*;} -keep class universal.initlibs. {*;} 上面的代码以-keep

Proguard: avoiding naming collisions with pre-obfuscated library JARs

房东的猫 提交于 2019-12-01 16:25:31
问题 It seems that Proguard doesn't make any attempt to avoid naming collisions with classes in library JARs when it renames/repackages classes. Is this correct, or have I just not configured it correctly? I am obfuscating an Android application that uses the latest Google AdMob SDK. Previously I was using the old AdMob SDK without a problem. The new SDK JAR file contains some classes that have been obfuscated. One of these classes is a.class in the default/unnamed package. When I obfuscate my app

Proguard - PersistenceException: Constructor not matched for class

坚强是说给别人听的谎言 提交于 2019-12-01 15:59:15
问题 I am using retrofit2.0 in my app with simpleframework.xml library. The problem is when I run the app without proguard it works fine however when I run proguard I get the following Error in logs. E/ERROR: java.lang.RuntimeException: org.simpleframework.xml.core.PersistenceException: Constructor not matched for class A The class A has no/default constructor which should work. Still I added a No Argument Constructor . But that didn't rectify the issue. Class A @Root(name = "data",strict = false)

FileNotFoundException on proguard-rules.pro file

老子叫甜甜 提交于 2019-12-01 15:57:46
I'm using Android Studio v.1.0 My build file : buildTypes { debug { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } but when I try to make a release build, I get an error : Error:Execution failed for task ':app:proguardRelease'. java.io.FileNotFoundException: F:....\app\proguard-rules.pro (File not found) I think, that proguard-android.txt is a part of Android SDK, am I right ? And why Android Studio can't find it ? I also

How to tell Proguard to obfuscate class names

a 夏天 提交于 2019-12-01 15:21:50
问题 I would like proguard to obfuscate classnames. I have this line in Proguard.cfg -keepclasseswithmembers class * { public static <fields>; } -keepnames class * implements java.io.Serializable -keep public class com.google.** And I notice that what is not obfuscated is the class names. So running jdgui i see com/test/abcd/ActualClass.java public class ActualClassName extends Activity etc moreover I see methods returning real classnames. like ActualClassname aa(); and imports statements like

Proguard function names ambiguity

有些话、适合烂在心里 提交于 2019-12-01 14:40:02
I need to know is there some option to prevent giving same name to different functions during obfuscation. Mapping file: org.apache.http.impl.client.cache.BasicHttpCacheStorage -> org.apache.http.impl.client.cache.f: 67:68:void putEntry(java.lang.String,org.apache.http.client.cache.HttpCacheEntry) -> a 78:78:org.apache.http.client.cache.HttpCacheEntry getEntry(java.lang.String) -> a I'd like to have different names for different functions instead of lines interval. Thanks The option -useuniqueclassmembernames does this, at least for names that aren't overloaded to start with (java allows

Gson parsing on android with proguard

大兔子大兔子 提交于 2019-12-01 13:54:39
I only have a parsing problem with Gson when I use proguard. In debug mode and release mode without proguard, everything work fine. This is my json string : {"tables":[{"name":"Profile","columns":[{"label":"id","type":"text","primary":true},{"label":"name","type":"text"},{"label":"age","type":"integer"},{"label":"human","type":"integer"},{"label":"gear","type":"Gear","custom":true,"list":true}]},{"name":"Gear","columns":[{"label":"id","type":"text","primary":true},{"label":"type","type":"text","enum":true},{"label":"name","type":"text"},{"label":"id_Profile","type":"integer","foreign_key":true