【发布时间】:2012-07-21 09:31:27
【问题描述】:
有什么方法可以从apk file 读取strings.xml 文件?
我对库或类/代码文件只对strings.xml中定义的字符串不感兴趣
【问题讨论】:
有什么方法可以从apk file 读取strings.xml 文件?
我对库或类/代码文件只对strings.xml中定义的字符串不感兴趣
【问题讨论】:
是的,您可以使用 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
或
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.
【讨论】:
下载android-apktool(如果需要也可以下载依赖),解压到同一目录并运行apktool d application.apk
【讨论】:
下载apktool
您将在那里获得您的 strings.XML 文件。
【讨论】:
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"
...
【讨论】: