zoukankan      html  css  js  c++  java
  • 坑爹的android混淆

    最近1个项目中 需要导入移动MM的第三方计费包,混淆时用到了如下脚本,可屏蔽警告,不混淆第三方包指定内容。

    非常有效

    proguard.cfg 文件

    -optimizationpasses 5
    -dontusemixedcaseclassnames
    -dontskipnonpubliclibraryclasses
    -dontpreverify
    -ignorewarnings //这1句是屏蔽警告,脚本中把这行注释去掉
    -verbose
    -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

    //这1句是导入第三方的类库,防止混淆时候读取包内容出错,脚本中把这行注释去掉

    -libraryjars libs/mmbilling.jar

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

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

    -keepclasseswithmembernames class * {
        public <init>(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.**

  • 相关阅读:
    继承与组合关系
    sql decimal & float & celling 介绍
    EFDB 基本规范&知识
    html 5 video
    screen printing
    javascript array
    angular router ui bug !
    angular destroy & jquery destroy
    Google addword 策略
    规范 : angular ui router path & params
  • 原文地址:https://www.cnblogs.com/songtzu/p/2578311.html
Copyright © 2011-2022 走看看