简体   繁体   English

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

[英]Reading Strings.xml file from apk file

Is there any way you can read the strings.xml file from an apk file ? 有什么方法可以从apk file读取strings.xml apk file吗?
I am not interested in libs or classes/code file just the strings defined in strings.xml 我对libs或类/代码文件只对strings.xml定义的strings.xml不感兴趣

Yes you can extract all the Resource files using apktool 是的,您可以使用apktool提取所有资源文件

Steps - 脚步 -

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.

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

Download apktool 下载apktool

  1. Put apk file ( suppose test.apk ) in the directory where you have downloaded it. 将apk文件(假设test.apk)放在您下载它的目录中。
  2. Now type the command ' apktool d test.apk ' 现在输入命令'apktool d test.apk'
  3. Now browse to " test \\ res \\ values " 现在浏览到“test \\ res \\ values”

You will get your strings.XML file there. 你将获得你的strings.XML文件。

Another option besides apktool is aapt , but it won't reproduce the strings in the original XML form. 除了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"
  ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM