【问题标题】:Reading Strings.xml file from apk file从 apk 文件中读取 Strings.xml 文件
【发布时间】:2012-07-21 09:31:27
【问题描述】:

有什么方法可以从apk file 读取strings.xml 文件?
我对库或类/代码文件只对strings.xml中定义的字符串不感兴趣

【问题讨论】:

    标签: java android eclipse


    【解决方案1】:

    是的,您可以使用 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.
    

    【讨论】:

    • Good Work bro..Cheers..还有一个问题..:))...是否可以提取我们 Android 项目的 src 文件夹...是否有任何工具可以做到这一点。 ??
    • 哦!!!是的,您也可以extract src folder,但它不会完全可读,但几乎您可以了解代码的全部内容:)
    • @LalitPoptani apktoll 在您提供的链接上不可用。
    • 伙计,你是救生员...非常感谢!
    • 我想补充一点,从apktool提取后,string.xml文件可以位于destination_path/res/values/文件夹中。
    【解决方案2】:

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

    【讨论】:

      【解决方案3】:

      下载apktool

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

      您将在那里获得您的 strings.XML 文件。

      【讨论】:

        【解决方案4】:

        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"
          ...
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2012-09-20
          • 2011-10-12
          • 1970-01-01
          • 1970-01-01
          • 2013-05-24
          相关资源
          最近更新 更多