proguard

AssertionError in Gson EnumTypeAdapter when using Proguard Obfuscation

泄露秘密 提交于 2019-11-28 17:22:34
My project implements a TypeAdapter in Gson during serialization/deserialization for preserving object's polymorphism state. Anyhow, the project works fine during development tests, but when it is released with proguard obfuscation and tested, it just crashes. 03-21 10:06:53.632: E/AndroidRuntime(12441): FATAL EXCEPTION: main 03-21 10:06:53.632: E/AndroidRuntime(12441): java.lang.AssertionError 03-21 10:06:53.632: E/AndroidRuntime(12441): at com.google.gson.internal.bind.TypeAdapters$EnumTypeAdapter.<init>(SourceFile:724) 03-21 10:06:53.632: E/AndroidRuntime(12441): at com.google.gson.internal

How to obfuscate Java code quickly?

丶灬走出姿态 提交于 2019-11-28 16:03:35
问题 How to obfuscate code quickly. I have a very small Java App and I want to deliver the obfuscated code to my client. I have heard a lot about ProGuard to obfuscate code and have downloaded it but doesn't know how to obfuscate my "abc.jar" file. I checked out its website but it contains a lot of material to read. I don't need heavy obfuscation. I just need a obfuscate that simply changes the name of variables, methods and classes to some unreadable ones. I know ProGuard provide all of this with

How to tell ProGuard to keep everything in a particular package?

谁说胖子不能爱 提交于 2019-11-28 15:28:27
My application has many activities and uses native library too. With the default ProGuard configuration which Eclipse generates ProGuard removes many things - OnClick methods, static members, callback methods which my native library uses... Is it there a simple way to instruct ProGuard to NOT remove anything from my package? Removing things saves only about 2.5% of the application size, but breaks my application completely. Configuring, testing and maintaining it class by class in ProGuard configuration would be a pain. I think you need to add these flags at the very least (modify for you

How to debug with obfuscated (with ProGuard) applications on Android?

寵の児 提交于 2019-11-28 15:25:07
When I got something like this ERROR/AndroidRuntime(18677): Caused by: java.lang.NullPointerException ERROR/AndroidRuntime(18677): at com.companyname.a.a.a(Unknown Source) How can I know where the problem is and debug this issue? I only got the mapping output from ProGuard and don't know the line number. Thanks. Add the following lines to your proguard configuration. -renamesourcefileattribute SourceFile -keepattributes SourceFile,LineNumberTable Now your stack traces will include line numbers, and by using the retrace tool that ships with proguard (included in the Android SDK), you are able

NameNotFoundException webview

自古美人都是妖i 提交于 2019-11-28 15:12:12
I am getting errors from Crashlytics that indicates that some devices are missing com.google.android.webview. How is that even possible? java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.app/com.myapp.ReaderActivity}: android.view.InflateException: Binary XML file line #29: Error inflating class com.myapp.MyWebView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) at android.app.ActivityThread.access$800(ActivityThread.java:144) at android.app.ActivityThread$H

Proguard: IllegalArgumentException - Unexpected error while evaluating instruction

强颜欢笑 提交于 2019-11-28 13:41:57
I'm trying to build a release apk with the proguard enabled. I'm getting the error below. I will attach the full stacktrace below. Unexpected error while evaluating instruction: Class = [*] Method = [myMethod(Ljava/lang/String;Ljava/util/Map;)V] Instruction = [532] aload_3 v3 Exception = [java.lang.IllegalArgumentException] (Value is not a reference value [proguard.evaluation.value.UnknownIntegerValue]) Unexpected error while performing partial evaluation: Class = [*] Method = [myMethod(Ljava/lang/String;Ljava/util/Map;)V] Exception = [java.lang.IllegalArgumentException] (Value is not a

Android Proguard Duplicate Definition

回眸只為那壹抹淺笑 提交于 2019-11-28 13:25:58
I'm attempting to add a 3rd party library (JmDNS) to my Android project. I created a folder 'libs' under the base project directory, and dropped the jar file in the directory. When I attempt to build he project using Ant (ant release), I receive a 'duplicate definition' notices for what appears to be each class in the JmDNS jar file. .... [proguard] Note: duplicate definition of library class [javax.jmdns.impl.tasks.state.Canceler] [proguard] Note: duplicate definition of library class [javax.jmdns.impl.tasks.state.DNSStateTask] [proguard] Note: duplicate definition of library class [javax

“Java.exe” exited with code 1 (Proguard issue)

白昼怎懂夜的黑 提交于 2019-11-28 12:37:26
I get the following error when I build my Xamarin.Android app in Release. "Java.exe" exited with code 1 Here is the output... ... 1> java.io.IOException: Can't read [C:\Users\FranciscoJavier\AppData\Local\Android\android-sdk\platforms\android-24\android.jar] (Can't process class [java/nio/charset/CharsetDecoder.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7))) 1> at proguard.InputReader.readInput(InputReader.java:230) 1> at proguard.InputReader.readInput(InputReader.java:200) 1> at proguard.InputReader.readInput(InputReader.java:178) 1> at proguard.InputReader.execute

Build fails with app:transformClassesAndResourcesWithProguardForRelease

随声附和 提交于 2019-11-28 12:11:31
I recently updated android studios to version 2.3, build tools to 25.0.2, gradle 2.3.0 and gradle distribution 3.3 and now i am getting this while building the project. Never had this issue with older versions. * Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55) at org

How can I force Proguard to keep my .xml resource file?

浪尽此生 提交于 2019-11-28 12:04:10
I am succesfully using proguard for my Android apps. However, with one app I am having trouble. This app uses a java library that has a .xml file that is stored in the package. InputStream istream = Library.class.getResourceAsStream("resource.xml"); This library works great when proguard is disabled. However, running proguard, it seems that the xml file is just completely stripped away. Relevant proguard.cfg -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify #-dontobfuscate #-repackageclasses '' //THIS IS DISABLED -keepattributes *Annotation*