proguard

App works perfectly on 1.6, but why am I getting java.lang.VerifyError on Xperia X10 running 1.6?

自闭症网瘾萝莉.ら 提交于 2019-12-21 05:58:40
问题 My app works perfectly on both emulated and real 1.6 devices. However The Sony Xperia X10 series (running 1.6) is crashing with a java.lang.VerifyError. This thread leads me to believe ProGuard optimization could be the culprit, but if that were the case wouldn't the problem exist on every device running 1.6, instead of just the X10? Here is the stack trace: java.lang.VerifyError: com.twocell.walkabout.Animator at com.twocell.walkabout.Main.void onCreate(android.os.Bundle)(SourceFile:197) at

ProGuard Performance - Will ProGuard make my software faster?

蹲街弑〆低调 提交于 2019-12-21 05:06:58
问题 Does anyone have experience in using ProGuard and are there already measurements about application performance beyond the class loading time? I have a fairly complex application that could need a boost, but preparing it for ProGuard would take a few days, so I would like to hear some opinions before. 回答1: The main benefit, from our experience, is that it can protect your intellectual rights. In terms of class loading time, we are not necessarily seeing any benefit and if so is negligible. One

Proguard doesnt preserve the line numbers and method names in stacktrace

笑着哭i 提交于 2019-12-21 04:08:36
问题 Here are few lines from proguard-rules.pro -keepattributes *Annotation* -keepattributes Signature -keepattributes InnerClasses,EnclosingMethod -renamesourcefileattribute SourceFile -keepattributes SourceFile,LineNumberTable -keep public class * extends java.lang.Exception -dontwarn org.apache.http.** Logcat output (error line number is listed as 1133, while my source file is 100 lines longer) 09-04 16:11:46.698 3827-5280/com.XX.main E/AndroidRuntime: FATAL EXCEPTION: IntentService

How do I use Proguard obfuscation while building a “maven-plugin” package?

亡梦爱人 提交于 2019-12-21 03:41:35
问题 The generated output JAR of a "maven-plugin" project (using the maven-plugin-plugin) is broken by the obfuscation performed by the Proguard tool. Attempting to use the obfuscated JAR as a Maven plugin generates exceptions, such as a MojoExecutionException, which terminate the build with an error. What are the proper Proguard configuration options to allow the generation of a working "maven-plugin" JAR containing an automatically generated plugin descriptor? 回答1: Basics of Maven Plugins and

Android - Proguard with httpcore and httpmime using Android Studio and Gradle

∥☆過路亽.° 提交于 2019-12-20 18:06:30
问题 I'm developing an app with Android Studio 1.0.2 and Gradle 1.0.0 using the Apache libraries httpmime and httpcore for multipart entities. Here's my build.gradle : apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.1" // Something wrong with the http* libs packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/DEPENDENCIES.txt' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE

How to stop proguard from obfuscating entire package?

一曲冷凌霜 提交于 2019-12-20 17:34:06
问题 I need to prevent Proguard from obfuscating any classes from the package com.foo.* . I have tried: -keep com.foo.** { <fields>; <methods>; <constructors>; } But proguard says : Error: Unexpected keyword 'com.sun.foo.**' in line 32 of file 'obfuscationConfig.pro', included from argument number 1 I get a similar error if I try keep name com.foo** or keep * com.foo.** . 回答1: Try to use the following: -keep class com.foo.** { public protected private *; } 来源: https://stackoverflow.com/questions

Tell Proguard to keep annotation on methods

一笑奈何 提交于 2019-12-20 13:58:18
问题 I'm using my own annotation: @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.TYPE}) public @interface Loggable { } and obfuscate using Proguard. I use the -keepattributes *Annotation* in the Proguard configuration to keep the annotations. At runtime, when I retrieve the annotation from an annotated class using someClass.getAnnotation(Loggable.class) everything works - I retrieve a non-null instance of my annotation. However, when I want to apply the same to an

Proguard configuration for Android Support v4 22.2.0

一世执手 提交于 2019-12-20 12:09:04
问题 After updating dependencies on Gradle Android build to use com.android.support:support-v4:22.2.0 from local Maven extras repository (within SDK), Proguard started throwing these problems. Warning: android.support.v4.app.DialogFragment: can't find referenced class android.support.v4.app.DialogFragment$DialogStyle Warning: android.support.v4.app.FragmentTransaction: can't find referenced class android.support.v4.app.FragmentTransaction$Transit Warning: android.support.v4.view.ViewCompat: can't

How to resolve multiple D8 warnings: <Class X> was not found, it is required for default or static interface methods desugaring <Class Y>?

◇◆丶佛笑我妖孽 提交于 2019-12-20 10:45:43
问题 After upgrading to Android Gradle Plugin from 3.1.4 to 3.2.x I'm getting multiple warnings such as: D8: Type `com.google.gson.reflect.TypeToken` was not found, it is required for default or static interface methods desugaring of `com.google.gson.reflect.TypeToken org.springframework.http.converter.json.GsonHttpMessageConverter.getTypeToken(java.lang.reflect.Type)` D8: Type `com.squareup.okhttp.MediaType` was not found, it is required for default or static interface methods desugaring of `com

Keep annotated class in Proguard

一个人想着一个人 提交于 2019-12-20 10:34:10
问题 I have a bunch of classes that use e.g. an @Singleton annotation like so @Singleton public class ImageCache that I would like to keep. How can I configure a proguard -keep statement so it applies to all classes that have that annotation. Btw in terms of context I need this for an app using Roboguice on Android, which is why I added the tags. Might help others. 回答1: ProGuard is based on a java-like configuration with wild-cards. It does require fully qualified class names. This should work: