最近文章

联系我们

最近文章

当前位置:主页 > 最近文章 >

Android项目代码混淆,android项目混淆

发布时间:2019-02-06 编辑:918Õ

Android项目代码混淆,android项目混淆

项目根目录有两个文件:


1.project.properties

# This file is automatically generated by Android Tools.
# 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 edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
sdk.dir=D:\Androidpmtoam\adt-bundle-windows-x86_64-20131030\sdk
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-19

2.proguard-project.txt

# 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:

# 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 *;
}

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public clasAAAAAAtends android.app.Activity

-dontwarn com.google.**
-keep class com.google.** {*;}

-dontwarn com.baidu.**
-keep class com.baidu.** {*;}

-dontwarn net.sqlcipher.**
-keep class net.sqlcipher.** {*;}

# Explicitly preserve all serialization members. The Serializable interface
# is only a marker interface, so it wouldn't save them.
-keepclassmembers clasAAAAAAAAAments 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();
}

-keep public clasAAAAAAAAAments java.io.Serializable {*;}


##---------------Begin: proguard configuration for Gson  ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-keep class suAAAAAc.Unsafe { *; }
-keep class com.dooioo.eal.entity.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { *; }

##---------------End: proguard configuration for Gson  ----------



安卓编程 怎进行代码混淆

安卓在eclipse中的ADT已经改变原有的模式了,你在项目文件中找到这两个文件,一般在项目根目录里。

第一个文件是描述文件,第二个文件是配置文件。
如果要实现代码混淆,需要修改第二个文件。打开第二个文件,如下:

其中红线部分说,如果你要实现代码混淆,你需要把下面一行给反注释掉。
就是把红线第二行前面的#号给去掉就好了。

如果有回答不当之处,还望见谅。


 
android怎混淆代码

如果你没用到第三方的library或者jar包,那么只要在工程目录下project.properties里面,把#proguard.config=AAAAAA前面的#去掉就好了。如果有第三方的jar包,那么把需要的配置加到proguard-project.txt里面就好。
 

http://www.bkjia.com/Androidjc/884040.htmlwww.bkjia.comtruehttp://www.bkjia.com/Androidjc/884040.htmlTechArticleAndroid项目代码混淆,android项目混淆 项目根目录有两个文件: 1.project.properties # This file is automatically generated by Android Tools.# Do not modify this...

本文源自: AG环亚官网


Copyright © 2005-2016 http://www.aayipanthi.com AG环亚官网_环亚AG娱乐_AG环亚集团_腾讯体育版权所有 AG环亚官网_环亚AG娱乐_AG环亚集团_腾讯体育