混淆代码app打包

发布时间:2020-07-14 21:47:04 作者:钓伯乐
来源:网络 阅读:1399

一般自己打包的jar包需要屏蔽混淆的代码:


-dontwarn com.nostra13.universalp_w_picpathloader.**


这是需要防止需要被打包


-keep class com.nostra13.universalp_w_picpathloader.** {*;}

-keep interface com.nostra13.universalp_w_picpathloader.** {*;}

-keep public class * extends com.nostra13.universalp_w_picpathloader.**



gson包屏蔽代码混淆时不能混淆相关的bean类不然会出现解析错误,无法解析

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

# Gson specific classes

-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson

-keep class com.pupuwang.ycyl.bean.** { *; }

-keep class com.pupuwang.ycyl.main.home.shops.model.** { *; }

-keep class com.pupuwang.ycyl.main.sale.model.** { *; }

-keep class com.pupuwang.ycyl.ordering.model.** { *; }

-keep class com.pupuwang.ycyl.main.feature.model.** { *; }


//这4句是不混淆第三方包中的指定内容,脚本中把这行注释去掉

-keep class com.ccit.** {*; }  
-keep class ccit.** { *; }
-keep class com.aspire.**

-keep class mm.vending.**


还要配置 default.properties

把proguard.config = proguard.cfg 加上



-ignorewarnings 屏蔽warning警告日志,脚本中把这行注释去掉


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

proguard.cfg 文件

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-ignorewarnings //这1句是屏蔽警告,脚本中把这行注释去掉
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
//这1句是导入第三方的类库,防止混淆时候读取包内容出错,脚本中把这行注释去掉



推荐阅读:
  1. 【推荐】App多渠道打包工具
  2. 如何实现App打包

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

混淆 proguard pp

上一篇:QtCreator插件开发(二)——QtCreator菜单和菜单项

下一篇:如何彻底解决国内正常使用Zoom Meeting问题?

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》