read res folder from an apk

匆匆过客 提交于 2019-12-09 22:04:16

问题


I want to read all the xml files in res folder. I able to read Manifest file using jar AXMLPrinter2.jar Same way i am trying to read xml files in res folder like below,

java -jar 'AXMLPrinter2.jar' 'account_list_item.xml' >'account_list_item.txt' 

but it shows some exception like bellow,

java.lang.ArrayIndexOutOfBoundsException: 109
    at android.content.res.StringBlock.getShort(StringBlock.java:231)
    at android.content.res.StringBlock.getString(StringBlock.java:91)
    at android.content.res.AXmlResourceParser.getName(AXmlResourceParser.java:140)
    at test.AXMLPrinter.main(AXMLPrinter.java:56)

Is there any way?


回答1:


I think AXMLPrinter2.jar needs that you first extract the XML files from the APK. You can do that with apktool, which already transforms the files into a human-readable form.

Use like this:

apktool decode --no-src yourapk.apk



回答2:


according to this and this
if apk's minSdkVersion >= 7, it didn't work

UPDATE:
found this



来源:https://stackoverflow.com/questions/8586897/read-res-folder-from-an-apk

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!