[Android] Android stats apk, jar package method number

Source: Internet
Author: User

Reference to:http://www.jianshu.com/p/61e8f803e0d1

Android in the development process, with the reference to the library as well as the increase in business, there will inevitably be the 64K limit problem, that is, the number of methods too many problems, Java code in the total number of method and field total cannot exceed 65,535, It is necessary to count how many of these are contained in each jar package, and Google has implemented such tools for us today:

Dexdump command (View the total number of method apk)

#查看apk的method总数dexdump-F app.apk | grep method_ids_size# View apk field Total Dexdump-f app.apk | grep field_ids_size

But this is just the apk file, if it is a jar package, the above command does not meet the requirements, then we can use the following command to achieve:

Xxx.jar Target Jar file

After generating the Temp.dex file, execute the following command:

Cat Temp.dex | HEAD-C 92 | Tail-c 4 | Hexdump-e ' "%d\n" '

After I have netty-3.9.5.Final.jar calculated, I output 8302.
Using the Netty Library on Android is really heavyweight!

[Android] Android stats apk, jar package method number

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.