显示通过包DEX方法计数 [英] Showing dex method count by package
问题描述
我工作在Android上的应用程序,在运行起来反对DEX方法计数限制。有一个简单的方法来显示方法计数按包分组? 我能得到的总的方法数,但我的应用程序有多个组成部分,我试图找出哪个组件与当前的最大功臣。
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.
推荐答案
这会给你多少每个包层次结构有助于方法计数的想法。结果包括在该目录/包中的所有类和所有子目录/包。
This will give you an idea of how much each package hierarchy contributes to the method count. The results include all classes in that directory/package and all subdirectories/packages.
baksmali blah.apk -o out
cd out
find * -type d -print -exec sh -c "smali {} -o {}/classes.dex && sh -c \"dexdump -f {}/classes.dex | grep method_ids_size\"" \;
这稍微修改后的版本相似,不同的是它仅适用于类的特定目录/包,不包括任何子目录/子包
This slightly modified version is similar, except that it is only for the classes in that particular directory/package, not including any subdirs/subpackages
baksmali blah.apk -o out
cd out
find * -type d -print0 | xargs -0 -I{} sh -c "echo {} && find {} -maxdepth 1 -name \"*.smali\" -print0 | xargs -r -0 smali -o {}/classes.dex"
find -name "*.dex" -print -exec sh -c "dexdump -f {} | grep method_ids_size" \;
这篇关于显示通过包DEX方法计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!