首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >除了apktool之外,有没有方便的工具来本地化APK (resources.arsc)?

问除了apktool之外,有没有方便的工具来本地化APK (resources.arsc)?
EN

Stack Overflow用户
提问于 2013-03-29 13:58:11
回答 1查看 1.5K关注 0票数 1

我想把我的Android4.0.4 (3G) Pad本地化成维吾尔语。

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

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

代码语言:javascript
复制
    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中转换resources.arsc,然后编译回来获得xmls。

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

那么我该如何解决这个问题呢?或者有没有其他的替代工具来完成这项任务?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-03-31 03:54:15

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

希望这对一些人有帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15698160

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档