简体   繁体   English

使用apktool构建APK时出错

[英]Error building apk using apktool

I am trying to decompile and then recompile an apk using apktool. 我正在尝试反编译,然后使用apktool重新编译apk。 I used apktool like this: 我像这样使用apktool: 在此处输入图片说明

No changes made to the files. 没有对文件进行任何更改。 I just decompiled and recompiled them but apktool is showing error. 我只是反编译并重新编译了它们,但是apktool显示错误。 The problem persists when i do make some changes to the xml files. 当我对xml文件进行一些更改时,问题仍然存在。 What should I do now? 我现在应该怎么办?

Regards 问候

I am answering this just in case somebody gets stuck with same problem. 我正在回答这个问题,以防有人陷入同样的​​问题。 If you are not concerned about resources of apk you can skip the extraction of resources by using the following command 如果您不关心apk的资源,则可以使用以下命令跳过对资源的提取

apktool d -r my_app.apk

this command will skip the decompling of res folder. 此命令将跳过对res文件夹的反编译。

That problem is caused by apktool improperly decoding some positional XML elements. 该问题是由于apktool不正确地解码某些位置XML元素引起的。 You can fix this manually by adding `formatted="false" to all those lines that it errors on or wait for Apktool 2.0 (set for a release in about 1.5 months). 您可以通过在所有错误的行上添加`formatted =“ false”来手动解决此问题,或者等待Apktool 2.0(大约在1.5个月内发布)。

We added about 25 unit tests for this exact problem and hopefully this example is fixed on 2.0. 对于这个确切的问题,我们添加了约25个单元测试,并希望此示例在2.0上已得到修复。 You may build 2.0 from source and test this. 您可以从源代码构建2.0并对其进行测试。

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

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