android混淆

1、编译的过程遇到各种警告:

增加如下两段代码

-dontwarn com.xx.bbb.**
-keep class com.xx.bbb.** { *;}
参数来保持第三方库中的类而不乱,-dontwarn和-keep 结合使用,意思是保持com.xx.bbb.**这个包里面的所有类和所有方法而不混淆,接着还叫ProGuard不要警告找不到com.xx.bbb.**这个包里面的类的相关引用。


2、加入新浪微博sdk遇到的问题

Proguard returned with error code 1. See console
Note: there were 1 duplicate class definitions.
Warning: library class android.webkit.WebViewClient depends on program class android.net.http.SslError
Warning: there were 1 instances of library classes depending on program classes.
          You must avoid such dependencies, since the program classes will
          be processed, while the library classes will remain unchanged.
java.io.IOException: Please correct the above warnings first.
  at proguard.Initializer.execute(Initializer.java:321)
at proguard.ProGuard.initialize(ProGuard.java:211)
  at proguard.ProGuard.execute(ProGuard.java:86)
  at proguard.ProGuard.main(ProGuard.java:492)

根据异常相信同行们已经看出来了,还要单独keep 一下SslError这个,因为这个东西没有在 com.weibo.sdk.android这个包里面,于是再加上:

-dontwarn android.net.http.**

-keep class android.net.http.** { *;}


3、对于引入了第三方Library,以actionbarsherlock为例

#actionbarsherlock start

-keep class android.support.v4.app.** { *; }

-keep interface android.support.v4.app.** { *; }

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

-keep interface com.actionbarsherlock.** { *; }

#actionbarsherlock start


4、Conversion to Dalvik format failed with error 

对于这个问题注释掉了下面的代码启用了上面的代码,上面的代码是防止方法调用的栈太多导致的溢出,下面的意思猜测可能是只允许5层嵌套的方法,明天再确定一下

-dontoptimize

#-optimizationpasses 5


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值