Last active
August 29, 2015 13:59
-
-
Save mente/10651383 to your computer and use it in GitHub Desktop.
calculate total number of methods in dex files
This file contains 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
#!/usr/bin/env sh | |
dxPath="/Applications/Android Studio.app/sdk/build-tools/android-4.4/dx" | |
jarDir=build/pre-dexed/debug | |
rm temp.dex | |
sum=0 | |
line='-----------------------------------------------------------------------------------------------------------------------' | |
for file in $jarDir/*.jar; do | |
"$dxPath" --dex --output=temp.dex $file | |
curr=`cat temp.dex| head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'` | |
printf "%s %s $curr\n" $file "${line:${#file}}" | |
let "sum += $curr" | |
done | |
file=TOTAL | |
printf "%s %s $sum\n" $file "${line:${#file}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment