Created
April 24, 2015 20:41
-
-
Save who/cdb37baffa7f64d27180 to your computer and use it in GitHub Desktop.
Counts methods in a jar. Useful for testing to see if a jar is going to contribute to the 65K method limit in Android
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
#!/bin/bash | |
if [ ! -e `which dx` ] | |
then | |
echo "Please make sure the dx executable (from android-sdk build-tools) is in your $PATH" | |
exit 1 | |
fi | |
tmpFolder=$(mktemp -d /tmp/tmp.XXXXXXXX); | |
dx --dex --output=$tmpFolder/temp.dex $1 >> /dev/null 2>&1 | |
cat $tmpFolder/temp.dex | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
To count methods in a single jar:
To count and total the methods in a directory of jars: