zoukankan      html  css  js  c++  java
  • proguard.cfg 配置文件

    # -------------------------------------
    # android 原始混淆模板
    # -------------------------------------
    
    # ----------------------------------
    #  通过指定数量的优化能执行
    #  -optimizationpasses n
    # ----------------------------------
    -optimizationpasses 5
    
    # ----------------------------------
    #   混淆时不会产生形形色色的类名 
    #   -dontusemixedcaseclassnames
    # ----------------------------------
    #-dontusemixedcaseclassnames
    # ----------------------------------
    #      指定不去忽略非公共的库类
    #  -dontskipnonpubliclibraryclasses
    # ----------------------------------
    #-dontskipnonpubliclibraryclasses
    
    # ----------------------------------
    #       不预校验
    #    -dontpreverify
    # ----------------------------------
    # -dontpreverify
    
    # ----------------------------------
    #      输出生成信息
    #       -verbose
    # ----------------------------------
    -verbose
    
    # ----------------------------------
    #        优化选项
    #   optimizations  {optimization_filter} 
    # ----------------------------------
    -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
    
    -keepclasseswithmembernames class * {
        native <methods>;
    }
    # -----------------
    # modify 修改合并
    # -----------------
    -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 enum * {
        public static **[] values();
        public static ** valueOf(java.lang.String);
    }
    
    -keep class * implements android.os.Parcelable {
      public static final android.os.Parcelable$Creator *;
    }
    
    #--------------------------
    # 保护类型   -keepattributes 说明
    # Exceptions, Signature, Deprecated, SourceFile, SourceDir, LineNumberTable, LocalVariableTable, 
    # LocalVariableTypeTable, Synthetic, EnclosingMethod, RuntimeVisibleAnnotations, RuntimeInvisibleAnnotations, 
    # RuntimeVisibleParameterAnnotations, RuntimeInvisibleParameterAnnotations, and AnnotationDefault
    # --------------------
    -keepattributes **
    -libraryjars <java.home>/lib/rt.jar
    
    # ----------------------
    #  不压缩指定的文件
    #  -dontshrink
    # ----------------------
    -dontshrink
    
    # ----------------------
    #  不优化指定的文件
    #  -dontoptimize
    # -----------------------
    -dontoptimize
    
    # -----------------------
    #  不混淆指定的文件
    #  -dontobfuscate
    # -----------------------
    
    # ----- 混淆包路径 -------
    -repackageclasses ''
    -flattenpackagehierarchy ''
    -target 1.6
    
    # -------- 以下是使用了 roboguice-1.1.2.jar 以及 guice-2.0-no_app.jar 功能需要保护的字段及类相关 --------
    -keep class com.google.inject.Binder
    -keepclassmembers class * {
        @com.google.inject.Inject <init>(...);
    }
    -keepclassmembers class * {
        void *(**On*Event); 
    }
    -keepclassmembers class **.R$* {
        public static <fields>;
    }
    
    # ------ 编译时需要用到的 jar 包
    -libraryjars D:/dev_rc/android-sdk-windows/add-ons/addon_google_apis_google_inc_11/libs/maps.jar
    
    # ------ 保护 谷歌第三方 jar 包,界面特效 ----------
    -keep class android.support.v4.**
    -dontwarn android.support.v4.**
    
    # ------ 保护百度地址jar包 --------
    -keep class com.baidu.mapapi.** { *; }
    -dontwarn com.baidu.mapapi.**
    
    # --- 打包时忽略以下类的警告 --
    -dontwarn com.classpackage.AA
    
    #-keepnames class * implements java.io.Serializable
    # ---------保护所有实体中的字段名称----------
    -keepclassmembers class * implements java.io.Serializable {
        <fields>;
    }
    
    # --------- 保护类中的所有方法名 ------------
    -keepclassmembers class * {
    	public <methods>;
    }
  • 相关阅读:
    反思 自学困境自我剖析、习惯的惯性与维持
    Java IO 节点流 FileInput/OutputStream
    Java IO 理解流的概念
    spring boot2.1读取 apollo 配置中心1
    saga+.net core 分布式事务处理
    npm install 报错 ECONNREFUSED
    读书笔记: Microsot .NET企业级应用架构设计
    Dockerfile 设置语言包
    Centos环境下,执行gulp,显示执行成功,但找到不生成的压缩文件
    Jenkins Pipeline shell脚本用svn_revision当做系统版本号
  • 原文地址:https://www.cnblogs.com/qhyhao/p/3696560.html
Copyright © 2011-2022 走看看