proguard

What are the recommended ProGuard rules for Smack 4.1?

ε祈祈猫儿з 提交于 2019-12-06 20:01:19
问题 What are the proper ProGuard rules for Smack 4.1 when building an Android release apk? Currently, I'm using the rules from aSmack 4.0.x from the README.asmack file on the aSmack github repository which is outdated (references old class names, and intended for 4.0.x). I could not find any references to what the proper proguard rules to use for 4.1.x are, could anyone shed light on this? 回答1: What are the proper Proguard rules for Smack 4.1 when building an Android release apk? Depends on what

how to keep all methods in a class with ProGuard

混江龙づ霸主 提交于 2019-12-06 18:43:08
问题 I use ProGuard to optimize my Android Application. However for Android instrumentation test I need some (but not all) classes to keep all there members. I tried various approaches, the last being: -keepclassmembers public class com.mycompany.myclass { *; } But surprisingly I still get java.lang.NoSuchMethodError: com.mycompany.myclass.<init> The painful part here is that there are two constructors and one has quite a few parameters. Does anyone know the correct syntax to keep a class

proguard warning: the configuration keeps the entry point…but not the descriptor class

老子叫甜甜 提交于 2019-12-06 16:36:53
问题 I've configured: -keep ,allowoptimization,allowobfuscation,allowshrinking public class org.jf.dexlib2.dexbacked.** { *; } but still getting the warning: Note: the configuration keeps the entry point 'com.trusteer.trf.dex_parser { int get_strings_count(org.jf.dexlib2.dexbacked.DexBackedDexFile); }', but not the descriptor class 'org.jf.dexlib2.dexbacked.DexBackedDexFile' I am using proguard version 4.7 (in Android SDK) What should I do? 回答1: You have told Proguard to keep a certain method void

[转]Android Studio实现代码混淆

こ雲淡風輕ζ 提交于 2019-12-06 16:35:54
1,在build.grandle添加,其中规则写在proguard-rules.pro中,也可以自定义一个文件,将其代替,比如eclipse常用的 proguard-project.txt: buildTypes { release { signingConfig signingConfigs.release minifyEnabled true # 设置是否进行 shrink 等操作(即无用代码压缩),一般设置为 true,使混淆更有效 proguardFiles getDefaultProguardFile(‘proguard-android.txt‘), ‘proguard-rules.pro‘ } } 2,在proguard-rules.pro中加入以下代码,基本可以涵盖所有 : -optimizationpasses 5 # 指定代码的压缩级别 -dontusemixedcaseclassnames # 是否使用大小写混合 -dontpreverify # 混淆时是否做预校验 -verbose # 混淆时是否记录日志 -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* # 混淆时所采用的算法 -keep public class * extends android.app

Differences in simple proguard keep option

泪湿孤枕 提交于 2019-12-06 16:00:41
What is the difference between these two proguard options? -keep class com.myclass.** -keep class com.myclass.** { *; } The first rule will only keep the classes themselves (and the default constructors). The second rule will also keep all methods and fields in the classes. -keep class com.myclass.** Preserve all classes in the com.myclass package and any sub-packages. Even if shrinking and optimization steps should alter the structure of or remove these classes, do not do so. -keep class com.myclass.** { *; } Preserve all classes in the com.myclass package as defined above as well as all

How to configure ProGuard to respect Jackson model?

血红的双手。 提交于 2019-12-06 15:55:42
The following class describes a model I read from a .json file using Jackson 2.2 . public class Product { public String name; public int width; } The Gradle build process invokes ProGuard to shrink and obfuscate the release build. When I start the application the following error message occurs: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "name" (class com.example.b.c), not marked as ignorable (0 known properties: ]) How can I configure ProGuard or annotate the Product class so that Jackson still works? I have to admin that I simplified the example in my

Android - proguard.cfg error

﹥>﹥吖頭↗ 提交于 2019-12-06 15:38:06
I imported an older project after a I installed the android SDK on a new computer. I am getting the following error in the "problems" window in eclipse. Obsolete proguard file; use -keepclasseswithmembers instead of -keepclasseswithmembernames proguard.cfg /MyApplication line 1 Here is the file. I tried replacing the -keepclasseswithmembernames in this file with -keepclasseswithmembers but it did not help. -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -keep

Proguard returned with error code 1, error can't find referenced class android.support.v4.app

浪尽此生 提交于 2019-12-06 15:29:09
I am receiving this exception while creation of signed apk of my application. [2017-04-13 02:47:21 - MyApp] Proguard returned with error code 1. See console [2017-04-13 02:47:21 - MyApp] Warning: com.google.android.gms.common.SupportErrorDialogFragment: can't find superclass or interface android.support.v4.app.DialogFragment [2017-04-13 02:47:21 - MyApp] Warning: com.google.android.gms.common.api.d: can't find superclass or interface android.support.v4.app.Fragment [2017-04-13 02:47:21 - MyApp] Warning: com.google.android.gms.maps.SupportMapFragment: can't find superclass or interface android

how to reduce app size increased after admob ads?

↘锁芯ラ 提交于 2019-12-06 14:24:07
问题 before adding google-play-services to my project its size was just 900kb and after adding lib of play services it is now 4.01MB . its terrible. for 900kb app ads of 3MB is too much. help me as soon as possible. my app is finished now. I tried reading about proguard but unable to understand. someone please give me step by step tutorial to reduce app size. 回答1: You don't need to edit google-play-services.jar file. Use proguard to keep only needed class files. Create proguard.txt file in your

ProGuard with maven-android-plugin

流过昼夜 提交于 2019-12-06 14:22:48
问题 I'm trying to pack my project to APK and then obfuscate it with ProGuard. Here is my pom: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.skayred</groupId> <artifactId>skayred</artifactId> <version>1.26</version> <packaging>apk</packaging> <name>skayred<