How do I get the android application name from a apk file programatically outside an android environment? I have tried parsing androidmanifest.xml but it only shows the package name ( which may not be very informative at times)
Asked
Active
Viewed 4,754 times
5
-
It won't generally be stored in the Manifest, that usually points to a string resource, typically in strings.xml... – Kristopher Micinski May 21 '12 at 16:05
-
where might i find this strings.xml? – paradox May 21 '12 at 16:07
-
Generally in the res/ folder, if you have an APK, then it's just a zip file. – Kristopher Micinski May 21 '12 at 16:08
-
doesn't seem to be there, maybe it isn't standard across all apk files? – paradox May 21 '12 at 16:11
-
read this: http://developer.android.com/guide/topics/resources/string-resource.html – Kristopher Micinski May 21 '12 at 16:15
-
you want to get application name from apk,using some software etc? – Sarim Sidd May 21 '12 at 16:23
2 Answers
6
If you are using Linux, this command will give you the application name:
aapt dump badging your.apk | sed -n "s/^application-label:'\(.*\)'/\1/p"
You'll have to install aapt
first.

xhienne
- 5,738
- 1
- 15
- 34
1
Can also be done with apktool.
#!/bin/sh
if [ -z "$1" ]; then echo ${0##*/} useage: ${0##*/} /path/to/your.apk; exit; fi
APKTOOL=$(which apktool apktool.sh | head -1); if [ -z "$APKTOOL" ]; then echo "Error: Could not locate apktool wrapper script."; exit; fi
TMPDIR="/tmp/apktool"
rm -Rf $TMPDIR
$APKTOOL d -q -f -s --force-manifest -o $TMPDIR $1
LABEL=$(cat $TMPDIR/res/values/strings.xml | grep 'string name="title"' | sed -e 's/.*">//' -e 's/<.*//')
rm -Rf $TMPDIR
echo ${LABEL}

5p0ng3b0b
- 511
- 4
- 10