2

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?

Jyosna
  • 4,436
  • 13
  • 60
  • 93

2 Answers2

5

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
gimix
  • 797
  • 6
  • 21
  • --no-src means you do not want to do anything with the code, you only want to extract resources. – gimix Dec 21 '11 at 08:50
  • the files you get are already in text form, you do not need AXMLPrinter2.jar anymore – gimix Dec 21 '11 at 10:52
0

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

UPDATE:
found this

Community
  • 1
  • 1
asakura89
  • 531
  • 1
  • 12
  • 20