android中的代码混淆

原创 2016年06月02日 11:15:09

代码混淆应注意,保留不被混淆的第三方jar包以及工具类
在project.properties中修改一下几点
proguard.config=proguard-project.txt

Project target.

target=android-14
android.library.reference.1=../../æžå®¢å­¦é™¢å­¦ä¹ ä»£ç /demo-project-eclipse-master/IMKit/src/main

//在proguard-project文件中配置一下文件

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

-keep class org.apache.**{ *; }
-keep class com.baidu.**{ *; }
-optimizationpasses 5  
-dontusemixedcaseclassnames  
-dontskipnonpubliclibraryclasses  
-dontpreverify  
-verbose  
-ignorewarnings
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*  
-keepattributes *Annotation*  
-keepattributes Signature  

-keep public class * extends android.app.Fragment 
-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 * extends android.support.v4.**
-keep public class com.android.vending.licensing.ILicensingService

-keep class com.baidu.** { *; }
-keep class vi.com.gdi.bgl.android.**{*;}

#主类继承的Activity
-keep class * extends com.lcjl.autolayout.AutoLayoutActivity
#封装类避免被混淆
-keep class com.example.bean.** { *; }

-dontoptimize
-dontpreverify
#极光推送
-dontwarn cn.jpush.**
-keep class cn.jpush.** { *; }

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

#自己定义的回调接口
#自己定义的工具类
-keepclasseswithmembers class com.example.utils.**{ 
     <fields>;
     <methods>;
}

-keepclassmembers class fqcn.of.javascript.interface.for.webview {
 public *;
}

-keepclasseswithmembers class * {                                               
        public <init>(android.content.Context, android.util.AttributeSet);  
}  
-keepclasseswithmembers class * {  
        public <init>(android.content.Context, android.util.AttributeSet, int);     
}  

-keepclassmembers class * extends android.app.Activity {                       
       public void *(android.view.View);  
}  

#融云服务
-keepattributes Exceptions,InnerClasses

-keep class io.rong.** {*;}

-keep class * implements io.rong.imlib.model.MessageContent{*;}

-keepattributes Signature

-keepattributes *Annotation*

-keep class sun.misc.Unsafe { *; }

-keep class com.google.gson.examples.android.model.** { *; }

-keepclassmembers class * extends com.sea_monster.dao.AbstractDao {
 public static java.lang.String TABLENAME;
}
-keep class **$Properties
-dontwarn org.eclipse.jdt.annotation.**

-keep class com.ultrapower.** {*;}

#第三方类库避免混淆
-libraryjars ..\PullRefreshLibrary
-dontwarn com.handmark.pulltorefresh.library.**
-keep class com.handmark.pulltorefresh.library.** { *;}
版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

Android代码混淆前后分析

  • 2012-08-13 21:50
  • 648KB
  • 下载

Android Studio中代码混淆

我们辛辛苦苦开发一款app,如果被心怀叵测的人恶意反编译,会让人感到恶心至极!所以考虑到安全性和应用的私密性,在打包的时候,都会进行一些代码混淆处理,Android Studio(一下简称AS)中的其...

android ndk+代码混淆demo

  • 2014-11-09 10:48
  • 2.20MB
  • 下载

使用ProGuard混淆Android工程 保护好自己的代码

ProGuard的简单介绍 Java的字节码一般是非常容易反编译的。为了很好的保护Java源代码,我们往往会对编译好的class文件进行混淆处理。ProGuard的主要作用就是混淆。当然它还能对字节...

Android代码混淆防止反编译APK获取源码

上一篇说了如何反编译APK文件获取Android源代码,但是如果所有的

Android 反编译和代码混淆

  • 2014-10-21 13:57
  • 10.08MB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)