proguard

Gson parsing on android with proguard

∥☆過路亽.° 提交于 2019-12-30 13:41:33
问题 I only have a parsing problem with Gson when I use proguard. In debug mode and release mode without proguard, everything work fine. This is my json string : {"tables":[{"name":"Profile","columns":[{"label":"id","type":"text","primary":true},{"label":"name","type":"text"},{"label":"age","type":"integer"},{"label":"human","type":"integer"},{"label":"gear","type":"Gear","custom":true,"list":true}]},{"name":"Gear","columns":[{"label":"id","type":"text","primary":true},{"label":"type","type":"text

Gson parsing on android with proguard

你说的曾经没有我的故事 提交于 2019-12-30 13:41:14
问题 I only have a parsing problem with Gson when I use proguard. In debug mode and release mode without proguard, everything work fine. This is my json string : {"tables":[{"name":"Profile","columns":[{"label":"id","type":"text","primary":true},{"label":"name","type":"text"},{"label":"age","type":"integer"},{"label":"human","type":"integer"},{"label":"gear","type":"Gear","custom":true,"list":true}]},{"name":"Gear","columns":[{"label":"id","type":"text","primary":true},{"label":"type","type":"text

Android Proguard - ClassNotFoundException

你。 提交于 2019-12-30 09:56:08
问题 I enabled proguard for my android app. I can build the project successfully but it crashes on startup with classNotFoundException. It doesn't even find the launcher activity. Here is my proguard rules file -libraryjars libs -keep public class * extends android.app.Activity -keep public class * extends android.app.Application -keepnames class com.mypackage.** { *; } //someone suggested this but doesn't work # We only want obfuscation -keepattributes InnerClasses,Signature # Sdk -keep public

How to automatically generate proguard-android.txt?

烂漫一生 提交于 2019-12-30 09:35:17
问题 Reading all the wonderful things the new ProGuard Improvements for Android do, I switched to to the new scheme by uncommenting the following line in a newly created project: proguard.config=${sdk.dir}\tools\proguard\proguard-android.txt;proguard-project.txt But when I try to export this project's APK, I am greeted with the following message: Invalid proguard configuration file path C:\android-sdk-windows\tools\proguard\proguard-android.txt does not exist or is not a regular file Well, I

ProGuard keep class name but change package name

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-30 06:22:59
问题 want to change package name but need keep Class Name not change. any idea? 回答1: ProGuard doesn't have a standard option to rename packages yet keep their simple class names. You could create a ProGuard mapping file manually, with lines like: com.example.MyClass -> a.MyClass: com.example.MyOtherClass -> a.MyOtherClass: You can then use the option -applymapping mapping.txt 来源: https://stackoverflow.com/questions/15780865/proguard-keep-class-name-but-change-package-name

Exposing inner classes when obfuscating with ProGuard

折月煮酒 提交于 2019-12-30 04:38:13
问题 I'm obfuscating a library with ProGuard using the Ant task. I'm keeping particular class names and their method names when they have a particular annotation (@ApiAll) and I'm requesting that the InnerClasses attribute be kept: <keepattribute name="InnerClasses" /> <keep annotation="com.example.ApiAll"/> <keepclassmembers annotation="com.example.ApiAll"> <constructor access="public protected"/> <field access="public protected"/> <method access="public protected"/> <constructor access=

Gradle混淆+打包Jar包基础

丶灬走出姿态 提交于 2019-12-29 09:49:58
本文为原创文章,转载请注明 出处 。 文章最后会附带源码下载地址,有需要的朋友可下载。 通常我们编写Android APP时有这样的需求:(1)代码混淆;(2)模块化;(3)向第三方提供JAR包。下面将以实例的形式向初学Android或开始使用AndroidStudio(AS)的朋友介绍下这几部分。 引述: (1)AS采用了Gradle的构建工具,可以让我们很方便的对我们的APP进行配置,比如版本、支持最低API level 、代码混淆文件、第三方库等等,具体语法请查考其他朋友的文章。 (2)AS提供了模块编程,便于我们对APP进行分层和理清架构,个人推荐初学者可以参考下这篇 文章 。 实例正文: 本文实例仅作为演示使用,重点是演示代码混淆和打包JAR,所以功能都进行了简化并省略了很多逻辑代码。 基本需求:接受用户的登录请求,模拟完成向服务端发起登录请求,并提示登录结果。 一、创建项目 项目目录结构: 个人习惯将各模块创建为平级,模块(android library)描述: app:用户模块,用户交互界面、用户资源等 model:实体模块 player:核心业务模块 utils:辅助类模块。 提示:创建模块时注意模块类型为Android Library,否则会对后面的一些功能会有影响。 二、代码编写 (1)model模块 用户登录信息实体: 1 package xiaoshubao

How to assembly a project after using proguard-maven-plugin

走远了吗. 提交于 2019-12-29 08:50:08
问题 I am trying to add an obfuscation step while packaging my app. I supposed that I had to insert the Proguard plugin between the compiler plugin and the assembly (the assembly just put all of my app and dependencies into one single jar). <build> <finalName>myApp</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.2</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin>

ProGuard breaks JavaFX application

本秂侑毒 提交于 2019-12-29 05:17:05
问题 I'm trying to obfuscate my JavaFX application but it fails. The generated result does not work and I do not understand why. The resulting jar just fails because the fxml file cannot load all imports anymore (ClassNotFoundException). The Deployment workflow: Build runnable jar (in IntelliJ knwon as an artifact) Obfuscate that jar with ProGuard Fix some issues in that jar that ProGuard fails to do 1) The minimal example application The example application 'GuardTest' is a IntelliJ project that

How to tell proguard to keep enum constants and fields

冷暖自知 提交于 2019-12-29 04:34:09
问题 I've try obfuscate our web application which use spring, jaxb and relies on annotations, and reflection heavily. I apply many recipes found in internet to keep some classes, attributes, annotations and enumerations. But with enumerations still have problem. I've able preserve enum constants apply configuration from http://proguard.sourceforge.net/manual/examples.html#enumerations: -keepclassmembers,allowoptimization enum * { public static **[] values(); public static ** valueOf(java.lang