Created
October 1, 2014 17:00
-
-
Save douglasdrumond/29b76a34b3f2389f6539 to your computer and use it in GitHub Desktop.
Count dex methods
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dex-method-count() { | |
| cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"' | |
| } | |
| function dex-method-count-by-package() { | |
| dir=$(mktemp -d -t dex) | |
| baksmali $1 -o $dir | |
| for pkg in `find $dir/* -type d`; do | |
| smali $pkg -o $pkg/classes.dex | |
| count=$(dex-method-count $pkg/classes.dex) | |
| name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.') | |
| echo -e "$count\t$name" | |
| done | |
| rm -rf $dir | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment