1

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

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

除 Phone.apk 外,所有 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>

我只是想翻译里面的xmls values,然后编译回来resources.arsc

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

那么我该如何解决这个问题呢?或者是否有其他替代工具仅用于该任务?

4

1 回答 1

0

我切换到一个修改版的 ApkTool,类似于ApkTool 1.5 b-sf在一个中文网站上找到的东西,然后installing framework-res.apk,它正确地编译了!

希望这可以帮助一些人。

于 2013-03-30T19:54:15.210 回答