1

Is there any way to get the meta-data declared in AndroidManifest.xml from apk?

PS: Not programmatically.

AndroidManifest.xml

<meta-data
  android:name="password"
  android:value="abc123" />

I had tried to use aapt d badging /apkpath.

But what I got is only the package, versionCode, versionName, platformBuildVersionName, sdkVersion, targetSdkVersion, uses-permission and application-label.

1 Answers1

0

Pro grammatically you can read meta data like this

try {
ApplicationInfo app = getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA);
Bundle bundle = app.metaData;
String myApiKey = bundle.getString("password");
} catch (Exception e) {
 // handle exception
}
sasikumar
  • 12,540
  • 3
  • 28
  • 48