除了apktool之外,还有一个方便的工具来定位APK(resources.arsc)吗?

时间:2013-03-29 05:58:11

标签: localization apk aapt

我想将我的Android 4.0.4(3G)Pad本地化为维吾尔语。

我反编译,在values-ug-rCN文件夹中添加了一个新的res翻译,然后编译回来获取resources.arsc文件。

所有APK都很好,除了Phone.apk。 我可以反编译来获取xmls,但是在编译时,它给了我以下错误: (使用最新的ApkTool1.5.2重现错误,无论是否安装framework.apk)

    E:\apktool152\x>apktool.bat if framework-res.apk
    I: Framework installed to: C:\Documents and Settings\Administrator\apktool\frame
    work\1.apk

    E:\apktool152\x>apktool d Phone.apk
    I: Baksmaling...
    I: Loading resource table...
    W: Skipping "android" package group
    I: Loaded.
    I: Decoding AndroidManifest.xml with resources...
    I: Loading resource table from file: C:\Documents and Settings\Administrator\apk
    tool\framework\1.apk
    I: Loaded.
    I: Regular manifest package...
    I: Decoding file-resources...
    I: Decoding values */* XMLs...
    I: Done.
    I: Copying assets and libs...

    E:\apktool152\x>apktool b Phone
    I: Checking whether sources has changed...
    I: Smaling...
    I: Checking whether resources has changed...
    I: Building resources...
    E:\apktool152\x\Phone\res\values-de\strings.xml:194: error: Multiple substitutio
    ns specified in non-positional format; did you mean to add the formatted="false"
     attribute?
    E:\apktool152\x\Phone\res\values-de\strings.xml:195: error: Unexpected end tag s
    tring
    E:\apktool152\x\Phone\res\values-es\strings.xml:194: error: Multiple substitutio
    ns specified in non-positional format; did you mean to add the formatted="false"
     attribute?
    E:\apktool152\x\Phone\res\values-es\strings.xml:195: error: Unexpected end tag s
    tring
    E:\apktool152\x\Phone\res\values-es-rUS\strings.xml:197: error: Multiple substit
    utions specified in non-positional format; did you mean to add the formatted="fa
    lse" attribute?
    E:\apktool152\x\Phone\res\values-es-rUS\strings.xml:198: error: Unexpected end t
    ag string
    E:\apktool152\x\Phone\res\values-it\strings.xml:194: error: Multiple substitutio
    ns specified in non-positional format; did you mean to add the formatted="false"
     attribute?
    E:\apktool152\x\Phone\res\values-it\strings.xml:195: error: Unexpected end tag s
    tring
    aapt: warning: string 'modem_power' has no default translation in E:\apktool152\
    x\Phone\res; found: en_GB zh_CN
    aapt: warning: string 'modem_power_summary' has no default translation in E:\apk
    tool152\x\Phone\res; found: en_GB zh_CN
    Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
    ibException: brut.common.BrutException: could not exec command: [aapt, p, --min-
    sdk-version, 15, --target-sdk-version, 15, -F, C:\DOCUME~1\ADMINI~1\LOCALS~1\Tem
    p\APKTOOL187345540728029844.tmp, -0, arsc, -I, C:\Documents and Settings\Adminis
    trator\apktool\framework\1.apk, -S, E:\apktool152\x\Phone\res, -M, E:\apktool152
    \x\Phone\AndroidManifest.xml]
            at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)
            at brut.androlib.Androlib.buildResources(Androlib.java:283)
            at brut.androlib.Androlib.build(Androlib.java:206)
            at brut.androlib.Androlib.build(Androlib.java:176)
            at brut.apktool.Main.cmdBuild(Main.java:228)
            at brut.apktool.Main.main(Main.java:79)
    Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not
     exec command: [aapt, p, --min-sdk-version, 15, --target-sdk-version, 15, -F, C:
    \DOCUME~1\ADMINI~1\LOCALS~1\Temp\APKTOOL187345540728029844.tmp, -0, arsc, -I, C:
    \Documents and Settings\Administrator\apktool\framework\1.apk, -S, E:\apktool152
    \x\Phone\res, -M, E:\apktool152\x\Phone\AndroidManifest.xml]
            at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
    a:357)
            at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
            ... 5 more
    Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd
    k-version, 15, --target-sdk-version, 15, -F, C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\
    APKTOOL187345540728029844.tmp, -0, arsc, -I, C:\Documents and Settings\Administr
    ator\apktool\framework\1.apk, -S, E:\apktool152\x\Phone\res, -M, E:\apktool152\x
    \Phone\AndroidManifest.xml]
            at brut.util.OS.exec(OS.java:89)
            at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
    a:355)
            ... 6 more

    E:\apktool152\x>

我只想在values内翻译xmls,然后编译回来获取resources.arsc

如果需要,我可以通过删除values翻译来解决与de, es, it xmls相关的错误。 但我不知道其他错误。

那我怎么解决这个问题呢? 或者还有另一种替代工具吗?

1 个答案:

答案 0 :(得分:0)

我切换到ApkTool的修改版本,在中文网站中找到ApkTool 1.5 b-sf之类的内容,在installing framework-res.apk后,它编译正确!

希望这可以帮助一些人。