Android and Native C/C++ Libraries
They’re everywhere.
1 min readDec 8, 2018
The 100 most popular applications for the Android platform (as of December 2018) have been installed 54+ billion times.
I downloaded each of the most popular app’s APK file and unzipped them to count the number of compiled native C/C++ libraries that each app contained.
#!/bin/bashapk=1
for app in *.apk; do
app=$(basename -- "$app")
extension="${app##*.}"
appPackage="${app%.*}" mkdir -p ${appPackage}
cd ${appPackage}
unzip ${appPackage} numberOfNativeLibs=$(find . -type f -name "*.so" | wc -l)
cd .. apk=$(($apk+1))
echo "$ranking $appPackage $numberOfNativeLibs"
done | column -t
85% of the one hundred most popular apps contain native code with 1038 individual shared objects (.so
files).
Instagram contained a total 141 native libraries!