Showing dex method count by package

前端 未结 6 1339
无人共我
无人共我 2021-01-30 05:30

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

6条回答
  •  遥遥无期
    2021-01-30 05:56

    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" \;
    

提交回复
热议问题