In my java application, I have tried to get the package name of an android application. I have tried it by executing command line argument. The command is :
aapt dump badging <apk file>
And this command returned whole meta data of the application.I have to extract the package name from the returned string suppose named 'result' ;
hoe you are looking for this try this code :
String line;
while ((line = r.readLine()) != null) {
int ind = line.indexOf("package: name=");
if (ind >= 0) {
String yourValue = line.substring(ind + "default =".length(), line.length() - 1).trim(); // -1 to remove de ";"
System.out.println(yourValue);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With