1.混淆配置文件
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
# 保护泛型, removes such information by default, so configure it to keep all of it.
-keepattributes Signature
# For using GSON @Expose annotation
-keepattributes *Annotation*
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
-keepclasseswithmembernames class * {
native <methods>;
}
# keep entity for json
# android support
-keep class android.support.**{*;}
-dontwarn android.support.**
# annotation.
-keep public class android.annotation.** { *; }
-dontwarn android.annotation.**
# Gson specific classes
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.stream.** { *; }
-keep class com.google.gson.examples.android.model.** { *; }
-keep class com.google.gson.** { *;}
-dontwarn com.google.gson.**
## end of Gson
# other libs
2.工程配置文件
proguard.config=${sdk.dir}/tools/proguard/proguard-android-optimize.txt:proguard-project.txt
3.需要注意的问题:
a.反射不能混淆
b.泛型不能混淆
c.序列化的不能混淆
d.自定义VIEW不能混淆
e.google的gson不能混淆
分享到:
相关推荐
Unity CodeGuard代码混淆 包体导入即可 自定义配置混淆程度
基于springboot搭建一个简单案例,利用proguard插件实现代码混淆,增加源代码的阅读和理解的难度, 并不能百分百保证代码安全。常用的应用场景是项目需要部署到客户机器上,一定程度上防止代码泄露。 ProGuard 是一个...
c#代码混淆源代码,帮您的代码实现加密目的
iOS代码混淆加密工具 制作iOS马甲包,包括代码加密、代码混淆、修改方法名、修改类名、生成垃圾代码、修改工程名等 https://zfj1128.blog.csdn.net/article/details/95482006
自治c语言代码混淆器,可选择移除c语言注释、变量名混淆、函数名混淆,#pragma行删除,#region行删除,空行删除。 可屏蔽不被混淆的关键词、导入导出关键词列表,清空关键词等功能。 可以保护在需要将源码给出时...
c#代码混淆器工具源码,保护开发成果还是挺有必要的,是源码,可以根据需要进行工具的二次开发。
代码混淆器,可用于代码混淆,打扰代码原有顺序
maven代码混淆代码混淆,
web代码混淆方案.混淆js代码,压缩css代码 什么?右击网页就能看到JS,CSS源代码?!别人抄起来岂不是太容易了? 所以我们要混淆,压缩JS,CSS代码,即防止别人抄走修改,又能节省网络流量
iOS代码混淆,马甲包混淆,iOS4.3被拒,ZFJObsLibV1.5.4-iOS混淆工具.dmg https://zfj1128.blog.csdn.net/article/details/95482006
随着移动互联网的快速发展,应用的安全问题不断涌现出来,于是越来越多的应用开发者将核心代码由java层转到native层,以对抗...答案是肯定的,今天我们就来介绍一种有效对抗native层代码分析的方法——代码混淆技术。
Allatori java 代码混淆 , Allatori java 代码混淆 Allatori java 代码混淆
实现maven管理的Javaweb项目的proguard代码混淆功能、工具包下载及错误解决
delphi 代码混淆器防止破解
dotNET代码混淆器
JS代码混淆软件,JS代码混淆软件,JS代码混淆软件,JS代码混淆软件
iOS安全攻防,代码混淆,敏感词替换,易读字符替换。
java代码混淆器proGuard,可以混淆函数变量、类、方法名以实现代码加密
android 代码混淆自己目前项目所用,真实有效
两款java代码混淆工具 1:jocky是eclipse的插件 2:Allatori-4.6