lnln1111 / android-apktool

Automatically exported from code.google.com/p/android-apktool
Other
0 stars 0 forks source link

can't compile layouts.xml in values #316

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.decode the apk
2.build the decoded files without any changes

What is the expected output? What do you see instead?

Please Type/Drag in the Folder U want to Build:apk
I: Checking whether resources has changed...
I: Building resources...
C:\Users\Anrik\Desktop\APKTool\apk\res\values-xlarge\layouts.xml:3: error: Found
 tag layout where item is expected
C:\Users\Anrik\Desktop\APKTool\apk\res\values-sw600dp\layouts.xml:3: error: Foun
d tag layout where item is expected
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\Anrik\AppData\Local\Temp\A
PKTOOL5187609451632710717.tmp, -I, C:\Users\Anrik\apktool\framework\1.apk, -S, C
:\Users\Anrik\Desktop\APKTool\apk\res, -M, C:\Users\Anrik\Desktop\APKTool\apk\An
droidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:193)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
        at brut.androlib.Androlib.buildResources(Androlib.java:248)
        at brut.androlib.Androlib.build(Androlib.java:171)
        at brut.androlib.Androlib.build(Androlib.java:154)
        at brut.apktool.Main.cmdBuild(Main.java:182)
        at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\Anrik\AppData\Local\Temp\APKTOOL5187609451632710717.tmp, -I, C:\Users\Anrik
\apktool\framework\1.apk, -S, C:\Users\Anrik\Desktop\APKTool\apk\res, -M, C:\Use
rs\Anrik\Desktop\APKTool\apk\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:83)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
        ... 6 more

Another One?[y/n]

What version of the product are you using? On what operating system?
apktool 1.4.3 with the lasted aapt.exe from SDK.
Windows 7 Ultimate x64

Please provide any additional information below.
I have attached the apk file.

Original issue reported on code.google.com by liyuanmi...@gmail.com on 20 Mar 2012 at 7:18

Attachments:

GoogleCodeExporter commented 9 years ago
can be reproduced with the ICS version of ApiDemos.

<item type="layout" name="resources_layout_reference">
@layout/resources_layout_reference_tablet
</item>

becomes

<layout 
name="resources_layout_reference">@layout/resources_layout_reference_tablet</ite
m>

when decoding with apk tool (the latter version isn't accepted by aapt)

I can try fixing this and submitting a patch.

Original comment by madis.p...@gmail.com on 28 Mar 2012 at 3:34

GoogleCodeExporter commented 9 years ago
I've tried and succeeded.

But I want to know weather the modification may affect the layout in the 
"xlarge" and "sw600dp" devices...

Original comment by liyuanmi...@gmail.com on 28 Mar 2012 at 3:49

GoogleCodeExporter commented 9 years ago
can you show the modification? difficult to say otherwise...

Original comment by madis.p...@gmail.com on 28 Mar 2012 at 4:05

GoogleCodeExporter commented 9 years ago
One could hack the item conditional in 
brut.androlib.res.data.value.ResScalarValue:60, but there has to be a cleaner 
way.

Original comment by madis.p...@gmail.com on 28 Mar 2012 at 4:10

GoogleCodeExporter commented 9 years ago
Fixed in v1.4.9

Original comment by connor.tumbleson on 16 Nov 2012 at 7:57