The Android project confuses the generated jar package

Source: Internet
Author: User

Another sleepless night.

The problem is, we write an Android project part of the code wants to build the jar package, and the jar is confused, not to be cut!

First of all, the code to generate the jar package, this is not much to say. Then find the Proguardgui.jar (directory: sdk\tools\proguard\lib\) found in the SDK and open it.

And you'll see Proguard's page.

Click Next for the first time, then look at the following page, click Addinput ... Add the jar package you want to confuse, click Add Output ... is to select the confusing jar package to save the directory. The bottom of the add ... Is the jar that your jar package relies on. (The black place is the item cannot be exposed)

Then directly click on the process, point 1 button is to view the configuration file, point 2 is to save the configuration file, save to Xxx.pro (such as Test.pro)

Then open your saved Test.pro to start adding classes and methods that are not confusing in your project

Then open Proguard again, add Test.pro

Click Process, and then you can see if the configuration information was changed by you, then click process!


OK, the confusion is complete, the confusion may be wrong, please follow the error to find a solution, most of the reason is because the configuration is written in a wrong format!

-optimizationpasses 5-dontusemixedcaseclassnames-dontskipnonpubliclibraryclasses-dontpreverify-verbose- Optimizations!code/simplification/arithmetic,!field/*,!class/merging/*-keep public class * extends Android.app.Activity//Inherit activity,application,service,broadcastreceiver,contentprovider .... No confusion-keep public class * extends Android.app.application-keep public class * extends Android.app.service-keep public cl 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 Pub Lic class Com.android.vending.licensing.ILicensingService

Please delete the Chinese when confused


-keep class com.lidroid.xutils.** {*;} The whole class is not confused
-dontwarn com.lidroid.xutils.**

Non-confusing classes and methods

-keepclasseswithmembers public final class Com.mzc.demo.MyDemo {
Public Mydemo (Android.content.Context, java.lang.String, android.widget.LinearLayout);
public void Opendoor ();
}




The Android project confuses the generated jar package

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.