proguard

Export signed Android apk with Proguard

不羁的心 提交于 2019-12-05 21:50:13
What I am trying to do: obfuscate and export a signed app from Eclipse. The problem: I am getting the same console error, no matter what I write on Project.properties and on proguard-android.txt . it makes me have no clue of what´s going on and I´m starting to feel miserable. What I could do: I could export the project without using Proguard. I could export a similar project that didn't use ABS (Action Bar Sherlock) using Proguard My questions: Is it possible that eclipse is not using at all proguard-android.txt ? When you include ABS library you should delete android-support-v4.jar from your

关于解决该如图 Failed to resolve:com.android.support:appcompat-v7.28+: 问题的方法 !

流过昼夜 提交于 2019-12-05 21:33:37
关于解决该如图 Failed to resolve:com.android.support:appcompat-v7.28+: 问题的方法 出现这种问题,无非是SDK版本与AS不匹配,我们可以在Gradle Scripts,再继续点击build.gradle(Module:app) 将以下的代码直接拷贝到build.gradle(Module:app)里即可,至少可以初步解决问题,至于SDK版本选择,开发者可以自主选择尝试。 apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { applicationId "com.example.myapplication" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile

Proguard setting to not remove unused method

雨燕双飞 提交于 2019-12-05 21:19:15
Conside the following code structure for android: package blah; class A{ class B{ public void foo(String s){ } } } How can I tell proguard to not remove or obfuscate foo. foo is unused function in code at compile time but is run at run-time from another code. I have tried: -keep class blah.A.B; -keepclassmembers class blah.A.B { public void foo(String s); } etc. but nothing stops Proguard from removing that function. I do not want proguard to change name of 'foo'. Proguard may change the name of class A or class B but not the function name 'foo'. Any suggestions? Eric Lafortune Almost right.

What are features of using Proguard in project with Protocol Buffers?

梦想与她 提交于 2019-12-05 21:15:54
I have a project in where Google Protocol Buffers are used. Once I try to obfuscate it with ProGuard it seems that protobuf causes problem. All my own classes I package into mybuildedclasses.jar . Google code is packaged into protbuf.jar mybuildedclasses.jar protobuf.jar other external jars After that I am trying to obfuscate mybuildedclasses.jar . Config file is similar to this one . Eventually all jars are packaged inside another fat jar. I run the program and once message is tried to be sent this kind of Exceptions are printed. Caused by: java.lang.RuntimeException: Generated message class

Proguard with Autovalue

感情迁移 提交于 2019-12-05 21:00:02
问题 I have just started using AutoValue but I am unable to make it work with proguard. I have around 6000+ warnings that look like this Warning:autovalue.shaded.com.google.common.auto.common.MoreElements$1: can't find superclass or interface javax.lang.model.util.SimpleElementVisitor6 The actually errors shows this... Error:Execution failed for task ':transformClassesAndResourcesWithProguardForDebug'. java.io.IOException: Please correct the above warnings first. How can i resolve this issue? 回答1:

Kotlin: ProGuard erases properties attributes

一笑奈何 提交于 2019-12-05 20:34:21
TL;DR : with proguard enabled, when using reflection, my properties look private, non-nullable and without annotations, despite proguard config that should keep all these attributes. I have some simple data class es with public properties to serve as data models in my Android app. Later, when doing generic [de]serialization of said classes, I filter the property list like this: val properties = instance::class.memberProperties .filter { it.visibility == KVisibility.PUBLIC } // && some other conditions, unrelated here .filterIsInstance<KMutableProperty<*>>() It works normally on my debug builds

How to obfuscate an apk with Proguard through Eclipse?

核能气质少年 提交于 2019-12-05 19:56:42
问题 I added proguard.config=proguard.cfg to my default.properties file and have a proguard.cfg file in my project root. If I now use Export as Android Application from within Eclipse I get the following Errors: [2011-01-27 11:11:37 - Application] Warning: class [classes/com/package.Class.class] unexpectedly contains class [com/package.Class] [2011-01-27 11:11:37 - Application] Warning: class [classes/com/package.Class2.class] unexpectedly contains class [com/package.Class2] [2011-01-27 11:11:37 -

Jackson Json parser returns nulls on all object members on Android after optimizing with Proguard

 ̄綄美尐妖づ 提交于 2019-12-05 19:25:45
I have an Android app which uses Jackson parser for JSON parsing. After I've ran Proguard on the classes I started to get null values on each and every member of the de-serialized classes. For example, if I have a object: public class Service{ private String name; private String version; ... getters, setters and stuff } and I receive a JSON with list of those objects: [{"name":"service1","version":"1.1"},{"name":"service2","version":"1.0"}] then I do: objectMapper.readValue(jsonString,new TypeReference<List<Service>>() {}) what I get is a list with 2 Service objects where all members are null.

In proguard, what is the keyword to preserve package/default access variables and methods?

二次信任 提交于 2019-12-05 18:54:35
You can say: -keepclassmembers class sun.** { public protected *; } But I am not excluding package/default access methods :( void myMethod { } You can add another -keepclassmembers like that: -keepclassmembers class com.mycompany.MyClass { !public !protected !private *; } 来源: https://stackoverflow.com/questions/26183906/in-proguard-what-is-the-keyword-to-preserve-package-default-access-variables-an

ClassNotFoundException: twitter4j.conf.PropertyConfigurationFactory : Android [closed]

二次信任 提交于 2019-12-05 18:21:07
If I don't run pro-guard on my project, everything is fine but if I run pro-guard and install .apk in device, I am getting above error. I tried adding following lines in proguard-android.txt file -keep public class twitter4j.conf.PropertyConfigurationFactory -dontwarn twitter4j.** but it did not make any difference. I am using default proguard-android.txt file from SDK and setting it in project.properties like below proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt I had a look at this link for same issue but could not understand that and also googling did not