desword / android-apktool

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

Cannot ReBuild Some Apk Files After Decompile #623

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Decompile apk files using apktool d -s appPath appPath.dir
2.Rebuild it without any changes using apktool b appPath.dir
3.

What is the expected output? What do you see instead?
I: Copying classes.dex file...
I: Checking whether resources has changed...
I: Building resources...
/home/******/apktooldir/res/values/styles.xml:61: error: Error retrieving 
parent for item: No resource found that matches the given name 
'Widget.AppCompat.Base'.
/home/******/apktooldir/res/values/styles.xml:101: error: Error retrieving 
parent for item: No resource found that matches the given name 
'Widget.AppCompat.Base'.
/home/******/apktooldir/res/values/styles.xml:149: error: Error retrieving 
parent for item: No resource found that matches the given name 
'Widget.AppCompat.Base'.
/home/******/apktooldir/res/values/styles.xml:192: error: Error retrieving 
parent for item: No resource found that matches the given name 
'Widget.AppCompat.Base'.
/home/******/apktooldir/res/values/styles.xml:208: error: Error retrieving 
parent for item: No resource found that matches the given name 
'Widget.AppCompat.Base.DropDownItem'.
/home/******/apktooldir/res/values/styles.xml:234: error: Error retrieving 
parent for item: No resource found that matches the given name 
'Widget.AppCompat.Base'.
/home/******/apktooldir/res/values/styles.xml:241: error: Error retrieving 
parent for item: No resource found that matches the given name 
'Widget.AppCompat.Light.Base'.
/home/******/apktooldir/res/values/styles.xml:260: error: Error retrieving 
parent for item: No resource found that matches the given name 
'TextAppearance.AppCompat.Base'.
/home/******/apktooldir/res/values/styles.xml:293: error: Error retrieving 
parent for item: No resource found that matches the given name 
'Widget.AppCompat.Base'.
/home/******/apktooldir/res/values-v14/styles.xml:52: error: Error retrieving 
parent for item: No resource found that matches the given name 
'Widget.AppCompat.Base'.
/home/******/apktooldir/res/values/styles.xml:485: error: Error retrieving 
parent for item: No resource found that matches the given name 
'Theme.AppCompat.Base'.
Exception in thread "main" brut.androlib.AndrolibException: 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec 
command: [aapt, p, --min-sdk-version, 8, -F, 
/tmp/APKTOOL5309730867382221266.tmp, -0, arsc, -I, 
/home/******/apktool/framework/1.apk, -S, /home/******/apktooldir/res, -M, 
/home/******/apktooldir/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, 8, -F, 
/tmp/APKTOOL5309730867382221266.tmp, -0, arsc, -I, 
/home/******/apktool/framework/1.apk, -S, /home/******/apktooldir/res, -M, 
/home/******/apktooldir/AndroidManifest.xml]
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:357)
    at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
    ... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, 
--min-sdk-version, 8, -F, /tmp/APKTOOL5309730867382221266.tmp, -0, arsc, -I, 
/home/******/apktool/framework/1.apk, -S, /home/******/apktooldir/res, -M, 
/home/******/apktooldir/AndroidManifest.xml]
    at brut.util.OS.exec(OS.java:89)
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:355)
    ... 6 more

What version of the product are you using? On what operating system?
Tried apktool 1.5.2 on Linux Ubuntu 13.04

Please provide any additional information below.
I have tested many apk files, some of it are rebuilding successfully, but some 
are failed. Attachment included an apk file which failed when I rebuilding it.

Original issue reported on code.google.com by guany...@gmail.com on 22 Apr 2014 at 5:08

Attachments:

GoogleCodeExporter commented 9 years ago
The same issue I have with recompilation of some apk form oppo Color OS

Original comment by sorocean...@gmail.com on 23 Apr 2014 at 10:05

GoogleCodeExporter commented 9 years ago
Hi, sorocean, I am not sure whether you problem is caused by framework files. 
Maybe you'd better take a look this 
http://code.google.com/p/android-apktool/wiki/FrameworkFiles

Original comment by guany...@gmail.com on 23 Apr 2014 at 4:15

GoogleCodeExporter commented 9 years ago
These are framework errors. Not related to Apktool. As you can see the missing 
themes are in fact in the newest framework: 
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/co
re/res/res/values/themes.xml

So that means your framework is out of date.

Original comment by connor.tumbleson on 1 May 2014 at 12:54