开发者

Extracting AndroidManifest.xml file from apk using just Java

开发者 https://www.devze.com 2023-03-13 02:27 出处:网络
Is there a way to retrieve the androidmanifest.xml using just Java? I know about android-apktools but I can\'t install an application. I need to keep this restricted to just Java and whatever librarie

Is there a way to retrieve the androidmanifest.xml using just Java? I know about android-apktools but I can't install an application. I need to keep this restricted to just Java and whatever libraries I point i开发者_开发技巧t to. Is there a library with these kind of functions (like an apktool.jar)?

Thanks.


If you look into the question on your comment link, there is an answer (Ribo's community wiki) providing a code snippet in Java to decode the manifest XML in the APK, and then recreate the XML.

Providing the APK file, the code then extracts the manifest and recreate it.

I just read the code very quickly, and I didn't find anything tied to Android (i.e., pure Java). So I believe you can copy that code and create a standalone Java jar to be executed on demand. Or integrated into code, in case you want go further.

0

精彩评论

暂无评论...
验证码 换一张
取 消