Android代码混淆
来源:互联网 发布:我的世界联机作弊器js 编辑:程序博客网 时间:2024/05/03 01:22
这是在工程中的proguard-project.txt中发现的
# To enable ProGuard in your project, editproject.properties
# to define the proguard.config property as described in thatfile.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flagsspecified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing theProGuard
# 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:
# If your project uses WebView with JS, uncomment thefollowing
# and specify the fully qualified class name to the JavaScriptinterface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview{
# public *;
#}
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script toyour
# project structure.
# Project target.
target=android-15
proguard.config=proguard.cfg
Android代码混淆,如何过滤掉反射的R文件及第三方包?
解决方案:在Proguard.cfg方件中添加以下设定:
- 过滤R文件的混淆:
-keep class **.R$* { *; }
- 过滤第三方包的混淆:
-keep class packagename.**{*;}(其中packagename为第三方包的包名)
Android导入第三方jar包,proguard混淆脚本(屏蔽警告,不混淆第三方包)
最近1个项目中需要导入移动MM的第三方计费包,混淆时用到了如下脚本,可屏蔽警告,不混淆第三方包指定内容。
非常有效
proguard.cfg 文件
-optimizationpasses 5
-dontusemixedcaseclassnam
-dontskipnonpubliclibrary
-dontpreverify
-ignorewarnings//这1句是屏蔽警告,脚本中把这行注释去掉
-verbose
-optimizations!code/simplification/arithmetic,!field/*,!class/merging/*
//这1句是导入第三方的类库,防止混淆时候读取包内容出错,脚本中把这行注释去掉
-libraryjars libs/mmbilling.jar
-dontwarn //dontwarn去掉警告
-dontskipnonpubliclibrary
-keep public class * extendsandroid.app.Activity
-keep public class * extendsandroid.app.Application
-keep public class * extends android.app.Service
-keep public class * extendsandroid.content.BroadcastReceiver
-keep public class * extendsandroid.content.ContentProvider
-keep public class * extendsandroid.app.backup.BackupAgentHelper
-keep public class * extendsandroid.preference.Preference
-keep public classcom.android.vending.licensing.ILicensingService
-keepclasseswithmembernam
native ;
}
-keepclasseswithmembernam
public (android.content.Context,android.util.AttributeSet);
}
-keepclasseswithmembernam
public (android.content.Context, android.util.AttributeSet,int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator*;
}
//这4句是不混淆第三方包中的指定内容,脚本中把这行注释去掉-keep class com.ccit.** {*; }
-keep class ccit.** { *; }
-keep class com.aspire.**
-keep class mm.vending.**
由www.J2meGame.com整理,转载请说明。
================更多内容推荐===================================
如何反编译APK
http://www.eoeandroid.com/thread-90027-1-1.html
Android一体化的反编译工具
http://www.eoeandroid.com/thread-62036-1-1.html
转自http://www.eoeandroid.com/thread-160335-1-1.html
- Android 代码混淆,混淆打包
- Android 代码混淆 webview混淆
- [Android]混淆Android代码
- [Android]混淆Android代码
- Android代码混淆------apk文件代码混淆
- android 代码混淆proguard
- Android项目代码混淆
- android 代码混淆总结
- android 代码混淆
- android代码混淆
- 混淆Android代码
- Android代码混淆 反编译
- android 代码混淆
- Android 代码混淆
- android 代码混淆
- Android代码混淆技术
- android 代码混淆
- Android代码混淆
- android常用color值
- PHP中array数组教程
- Android Eclipse:Debug Certifica…
- html页面中常用的js代码
- Android签名机制
- Android代码混淆
- litespeed+nginx+mysql+php+pureftpd一键安装包
- android:inputType值及说明
- Android反编译与防止反编译
- Android 获取状态栏高度
- java环境变量配置
- Android将发送的短信插入数据库
- jQuery Mobile(Popup)
- Only the original&nbsp…