从apk文件中读取Strings.xml文件

时间:2012-07-21 09:31:27

标签: java android eclipse

您有什么方法可以阅读strings.xml中的apk file文件吗? 我对libs或类/代码文件只对strings.xml

中定义的字符串不感兴趣

4 个答案:

答案 0 :(得分:38)

是的,您可以使用apktool

提取所有资源文件

步骤 -

1.) Download files from above links and extract them in a folder.
2.) Open cmd -> run 
3.) Run command as 
    apktool.bat d source.apk destination_path

OR

1.) Put apktool.jar and test.apk in same folder 
2.) Go to the jar and .apk path by command line
3.) And fire the command java -jar apktool.jar d test.apk
4.) It will generate a folder with the name "test" in the same folder.

答案 1 :(得分:6)

下载android-apktool(如果需要也下载依赖项),在同一目录中解压缩并运行apktool d application.apk

答案 2 :(得分:2)

下载apktool

  1. 将apk文件(假设test.apk)放入您下载的目录中。
  2. 现在输入命令'apktool d test.apk'
  3. 现在浏览“test \ res \ values”
  4. 你会在那里得到你的strings.XML文件。

答案 3 :(得分:2)

apktool之外的另一个选项是aapt,但它不会以原始XML格式重现字符串。

$ aapt dump --values resources app.apk |
  grep '^ *resource.*:string/' --after-context=1

  resource 0x7f04011a com.example:string/hello: t=0x03 d=0x0000039e (s=0x0008 r=0x00)
    (string8) "Hello"
  ...