从 apk 中读取 res 文件夹
我想读取 res 文件夹中的所有 xml 文件。 我能够使用 jar AXMLPrinter2.jar
读取清单文件 同样,我尝试读取 res 文件夹中的 xml 文件,如下所示,
java -jar 'AXMLPrinter2.jar' 'account_list_item.xml' >'account_list_item.txt'
但它显示了一些异常,如下所示,
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)
有什么办法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为 AXMLPrinter2.jar 需要您首先从 APK 中提取 XML 文件。您可以使用 apktool 来完成此操作,它已经将文件转换为人类可读的形式。
像这样使用:
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:
根据此和这个
如果 apk 的 minSdkVersion >= 7,则不起作用
更新:
找到了这个
according to this and this
if apk's minSdkVersion >= 7, it didn't work
UPDATE:
found this