简体   繁体   中英

How can I get actual value in AndroidManifest.xml using Androguard?

I tried to use androguard to analyze apk files, but some apk's AndroidManifest.xml do not show value directly, for example

<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@7F0A02D1">

How can I retrieve the value of "@7F0A02D1" with androguard?

Please help, thanks.

I find a way to get this value:

from androguard.core.bytecodes.apk import APK

a = APK(path_to_apk)    
r = a.get_android_resources()
location = int('7F0A02D1', 16)
resolved_strings = r.get_resolved_strings()
package_name = a.get_package()
value = resolved_strings.get(package_name, {}).get('DEFAULT', {}).get(location, '')

'DEFAULT' could be other values, check it out for yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM