Skip to content

Instantly share code, notes, and snippets.

@natanovia
Forked from JakeWharton/dex.sh
Created July 4, 2014 01:10
Show Gist options
  • Select an option

  • Save natanovia/900b9ed1a2676d548f18 to your computer and use it in GitHub Desktop.

Select an option

Save natanovia/900b9ed1a2676d548f18 to your computer and use it in GitHub Desktop.

Revisions

  1. @JakeWharton JakeWharton revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dex.sh
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ function dex-method-count-by-package() {
    baksmali $1 -o $dir
    for pkg in `find $dir/* -type d`; do
    smali $pkg -o $pkg/classes.dex
    count=$(dexdump -f $pkg/classes.dex | \grep method_ids_size | cut -d':' -f2 | tr -d ' ')
    count=$(dex-method-count $pkg/classes.dex)
    name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.')
    echo -e "$count\t$name"
    done
  2. @JakeWharton JakeWharton revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dex.sh
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ function dex-method-count-by-package() {
    baksmali $1 -o $dir
    for pkg in `find $dir/* -type d`; do
    smali $pkg -o $pkg/classes.dex
    count=$(dexdump -f $pkg/classes.dex | \grep method_ids_size | \cut -d':' -f2 | \tr -d ' ')
    count=$(dexdump -f $pkg/classes.dex | \grep method_ids_size | cut -d':' -f2 | tr -d ' ')
    name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.')
    echo -e "$count\t$name"
    done
  3. @JakeWharton JakeWharton created this gist Jul 15, 2013.
    14 changes: 14 additions & 0 deletions dex.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    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=$(dexdump -f $pkg/classes.dex | \grep method_ids_size | \cut -d':' -f2 | \tr -d ' ')
    name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.')
    echo -e "$count\t$name"
    done
    rm -rf $dir
    }