Skip to content

Instantly share code, notes, and snippets.

View jerrellmardis's full-sized avatar

Jerrell Mardis jerrellmardis

View GitHub Profile
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)
java -jar baksmali.jar $1 -o $dir
for pkg in `find $dir/* -type d`; do
java -jar smali.jar $pkg -o $pkg/classes.dex
count=$(dex-method-count $pkg/classes.dex)
#!/bin/bash
f=$(pwd)
mkdir drawable-mdpi drawable-hdpi drawable-xhdpi drawable-xxhdpi
# fake argv and argc in bash
argc=$#; argv[0]=$0 # argv[0] is a prog name
for foo in $( seq $argc )
do