android-proguard

android signed apk / net.sourceforge.jtds errors

三世轮回 提交于 2020-08-05 08:58:40
问题 I'm trying to build a signed apk (release) using proguard, but when generating the APK android studio reports several warnings related to "net.sourceforge.jtds" like this: Warning:net.sourceforge.jtds.jdbcx.JtdsDataSource: can't find superclass or interface javax.sql.XADataSource Warning:net.sourceforge.jtds.jdbcx.JtdsDataSource: can't find superclass or interface javax.naming.Referenceable ... and finally ends with an error: Error:Execution failed for task ':app

Proguard is not obfuscating strings.xml in android

北城余情 提交于 2020-07-22 10:12:50
问题 I am using proguard in my project . It is obfuscating all the java code . But it is not obfuscating anything in strings.xml . I have some sensitive information in strings.xml . How can I make proguard to obfuscate the content in strings.xml ? Do I need to write any specific rule ? 回答1: ProGuard can't obfuscate strings.xml. You can use other software to obfuscate your file like DexGuard. You can get more info here. 回答2: It will not obfuscate string.xml file. If you will rename your .apk file

minifyEnabled true leads to crash on app start

半城伤御伤魂 提交于 2020-07-18 11:43:39
问题 Unfortunately XX has stopped. I receive this message as soon as I start my productive app, when I set buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } I do not have any additional proguard-rules (cause no library stated that it is necessary). My dependencies look like this: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.loopj.android:android-async-http

Duplicate class MultiDex$V14.class

浪子不回头ぞ 提交于 2020-07-09 06:54:18
问题 My Android gradle build is failing during the ProGuard phase with a duplicate class error for MultiDex$V14.class (see below). I understand what a duplicate class is and I know what MultiDex is but I still don't understand how it's a duplicate. Questions: I see one definition is in multidex.jar, of course. How can I tell where the other is defined? Isn't ProGuard supposed to remove duplicate entries instead of complaining about them? The "What went wrong" description at the bottom seems

Prevent a directory from proguard obfuscation

本秂侑毒 提交于 2020-06-27 11:34:48
问题 I have gone through several stackoverflow posts regarding proguard obfuscation How to keep/exclude a particular package path when using proguard? How to make Proguard ignore external libraries? How to exclude specific jars from injars during obfuscation using proguard? But I did not find answer to exclude a particular directory to prevented from obfuscation. Directory structure: libs => lib1 => a.b.c.package A.java B.java => lib2 => d.e.f.package C.java D.java => lib3 => g.h.i.package E.java

Android proguard, keep inner class of Inner class

耗尽温柔 提交于 2020-02-28 07:35:33
问题 Parent question: Android proguard, keep inner class My problem is with inner class of inner class One of the SDKs in my android project has a class A, which has two static inner class. They are found to be stripped after applying proguard. public class A{ .... static class B{ ... static class D { .... } } static class C{ ... } } My proguard looks like this -keepattributes Exceptions, InnerClasses -keep class com.xxx.A -keep class com.xxx.A$* Which prevents class B, C from proguard. But no

Android Volley always fails with Proguard

天涯浪子 提交于 2020-02-08 03:11:28
问题 The goal is to deploy an application with obfuscation and minification applied. Usual builds without minification work fine. But when minifyEnabled is switched to true, everything compiles too, but all Volley requests fail with error callback ( onErrorResponse ) regardless on successful result. Minification config in build.gradle : buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } debug

androidx.paging.PagedStorage.init is giving error when proguard is enabled

梦想的初衷 提交于 2020-01-23 19:01:25
问题 I'm using retrofit with okhttp and migrated to AndroidX, When I make a signed app that obfuscated with proguard it crashes and gives an error,but in debug mode when proguard is not enabled it's working good. and I disabled proguard just for testing and made a signed APK it's working this way too. so I'm sure the crash is caused by Proguard. And I did some search on google they all say that I have to add proguard rules for both OKHTTP and Retrofit I did add them too but it still crashes. The

Retrofit illegalargumentexception, no annotation found

五迷三道 提交于 2020-01-17 09:03:45
问题 So when running my app I'm getting this error: 06-17 12:56:08.547 E/AndroidRuntime(23432): Caused by: java.lang.IllegalArgumentException: XapoService.credit: No Retrofit annotation found. (parameter #1) I have Google searches and found it may be caused by ProGuard. I added the following lines to my ProGuard: -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.

Retrofit illegalargumentexception, no annotation found

爱⌒轻易说出口 提交于 2020-01-17 09:02:20
问题 So when running my app I'm getting this error: 06-17 12:56:08.547 E/AndroidRuntime(23432): Caused by: java.lang.IllegalArgumentException: XapoService.credit: No Retrofit annotation found. (parameter #1) I have Google searches and found it may be caused by ProGuard. I added the following lines to my ProGuard: -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.