Today, with the use of code confusion, the app can not run after the confusion, the old error, because the project only used afinal third-party library, so according to the answer on the Internet to not confuse afinal jar package, in the configuration file write the following statement:
-libraryjars Libs/afinal_0.5.1_bin.jar-dontwarn net.tsz.afinal.**-keep class net.tsz.afinal.** {*;}-keep public class * Extends net.tsz.afinal.** -keep public interface net.tsz.afinal.** {*;}
But after the confusion of the package is still error, the error log shows a null pointer anomaly, turned over the code, only use the afinal of the finalactivity annotation to get the view, there may be the reason, and then Baidu Google to find the answer, the framework used the mechanism of reflection, So it is sometimes necessary to add the following statement:
-keepattributes signature-keepattributes *annotation*
Add after the confusion of the pass, and then check the configuration before and after, think about it is not much
Because at the top of the configuration file, a sentence has been added
-dontwarn
Then remove
Or not, to view the error log, as a result of introducing Android-support-v4.jar, add:
-dontwarn android.support.v4.**
OK, confusing pass, installed test, OK, also passed.
See online that there may be other problems, you need to add the following code:
-keepclasseswithmembers class xxx.** { <fields>; < Methods > ;}
Replace XXX with the name of the package name you inherited afinal.
Add these, basically is no problem!
Afinal the jar package for code obfuscation error