Showing dex method count by package

ajma picture ajma · Jun 13, 2013 · Viewed 17.8k times · Source

I'm working on android app that's running up against the dex method count limit. Is there a simple way to show the method count grouped by package? I can get the total method count, but my app has multiple components and I'm trying to figure out which component is the biggest contributor to this.

Answer

Mihai Parparita picture Mihai Parparita · May 19, 2014

I've written a dex-method-counts tool that outputs per-package method counts faster and more accurately than the smali-based tools referenced in JesusFreke's answer¹. It can be installed from https://github.com/mihaip/dex-method-counts.

[1] that script disassembles the .dex and re-assembles it by package, but this means that methods that are referenced by multiple packages are counted twice