After packing collapse to note the small pit _ pack crash

Source: Internet
Author: User
Tags eventbus

1: Often encountered such a problem, run the program well, but once the package signed after the operation is a crash, is not a headache, some people will say that the problem is 6.0 permissions, but if 6.0 of the following will also collapse.
2: Think carefully must be confusing yes, file compression problem, look at the meaning of these several fields under the Build.gradle file of this project:

3: A lot of people will see my official release version below Shrinkresources to False. No way it should be true to remove useless files, but there is no way the project integrated Ali hundred feedback function so this can only be false, when the project function and installation package size conflict, even the boss will choose to function.
4 nonsense too much, let's take a look at the confusing file
Here is the obfuscation specification:

#
#############################################
#代码混淆压缩比, between 0~7, the default is 5, generally do not make changes
-optimizationpasses 5
#混合时不使用大小写混合, the mixed class name is lowercase
-dontusemixedcaseclassnames
#指定不去忽略非公共库的类
- Dontskipnonpubliclibraryclasses
#指定不去忽略非公共库的类
-dontskipnonpubliclibraryclassmembers
# This sentence can confuse our project to produce a mapping file
#包含有类名-> Confusion after the mapping of class names
-verbose
#不做预校验, Preverify is one of the four steps Proguard, Android does not need preverify, and removing this step can speed up confusion.
-dontpreverify
#保留Annotation不混淆
-keepattributes *annotation*,innerclasses
#避免混淆泛型
- Keepattributes Signature
#抛出异常时保留代码行号
-keepattributes sourcefile,linenumbertable
#指定混淆是采用的算法, The following parameter is a filter
#这个过滤器是谷歌推荐的算法 and generally does not make changes
-optimizations!code/simplification/cast,!field/*,!class/merging/*

4: The following is something confusing to my project, each of the introduced dependencies or libraries have his code to ignore files and confuse files, no can go to the authorities to find the next

# Butterknife-keep class butterknife.** {*;}-dontwarn butterknife.internal.**-keep class **$ $ViewBinder {*;}-keep Classeswithmembernames class * {@butterknife. * <fields>;}-keepclasseswithmembernames class * {@butterkni
Fe.* <methods>; # eventbus-keepattributes *annotation*-keepclassmembers class * {@org. Greenrobot.eventbus.Subscribe <methods
>;

}-keep enum Org.greenrobot.eventbus.ThreadMode {*;} -dontwarn com.google.**-dontwarn cn.sharesdk.**-dontwarn butterknife**-dontwarn uk.co**-dontwarn com.jeremyfeinstein**-dontwarn com.alipay**-dontwarn com.mob**-dontwarn-cn.qq** class Com.alibaba.sdk.android.feedback.impl.FeedbackServiceImpl {*;}-keep Class Com.alibaba.sdk.android.feedback.impl.FeedbackAPI {*;}-keep Class com.alibaba.sdk.android.feedback.util.IWxCallback {*;}-keep Class com.alibaba.sdk.android.feedback.util.iunreadcountcallback{*}-keep Class com.alibaba.sdk.android.feedback.feedbackservice{*}-keep Public Class Com.alibaba.mtl.log.model.LogField {public *;}-keep class com.cmyd.aiyou.bean.** {*;}-keep class Com.taobao.security jni.**{*}-keep class com.taobao.wireless.security.**{*;}-keep class com.ut.secbody.**{*;}-keep class COM.TAOBAO.DP.
**{*;} -keep class com.alibaba.wireless.security.**{*;}-keep class com.ta.utdid2.device.**{*;-keepattributes
, Linenumbertable-keep class Android.net.http.sslerror-keep class android.webkit.**{*;}-keep class cn.sharesdk.**{*;} -keep class cn.smssdk.**{*;}-keep class com.mob.**{*;} #-keep class com.android.support.multidex.**{*;} #okhttp-

Dontwarn okhttp3.**-keep class okhttp3.**{*;}


#okio-dontwarn okio.**-keep class okio.**{*}-dontwarn rx.**-keep class rx.**{*;} -dontusemixedcaseclassnames-dontskipnonpubliclibraryclasses-dontnote-verbose #jpush-dontwarn cn.jpush.**-keep
 Class cn.jpush.** {*;}

5: For example, after I played a formal package, there was an example of a crash, and a confusing one that is easy to ignore is that the bean or the so-called model file is all mixed up


This is a typical model without confusing ignoring the example caused by the crash

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.