desword / android-apktool

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

Error declaring public resource [...] for included package miui #609

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build MIUI using PatchROM
2. Decompile AntiSpam.apk (resources only)
3. Attempt to recompile without any modification

What is the expected output? What do you see instead?
Expected a built APK, get this error log instead:
E:\Xtreamer\~MIUI\Xtreamer_Q-MIUI_4.2.28.14064\system\app\AntiSpam\.\res\values\
public.xml:148: error: Error declaring public resource id/number for included 
package miui
E:\Xtreamer\~MIUI\Xtreamer_Q-MIUI_4.2.28.14064\system\app\AntiSpam\.\res\values\
public.xml:152: error: Error declaring public resource id/root for included 
package miui
E:\Xtreamer\~MIUI\Xtreamer_Q-MIUI_4.2.28.14064\system\app\AntiSpam\.\res\values\
public.xml:165: error: Error declaring public resource id/subtitle for included 
package miui
E:\Xtreamer\~MIUI\Xtreamer_Q-MIUI_4.2.28.14064\system\app\AntiSpam\.\res\values\
public.xml:176: error: Public entry identifier 0x7f0b001c entry index is larger 
than available symbols (index 28, total symbols 28).
E:\Xtreamer\~MIUI\Xtreamer_Q-MIUI_4.2.28.14064\system\app\AntiSpam\.\res\values\
public.xml:176: error: Public symbol id/edit_mode_delete declared here is not 
defined.
E:\Xtreamer\~MIUI\Xtreamer_Q-MIUI_4.2.28.14064\system\app\AntiSpam\.\res\values\
public.xml:178: error: Public entry identifier 0x7f0b001e entry index is larger 
than available symbols (index 30, total symbols 28).
E:\Xtreamer\~MIUI\Xtreamer_Q-MIUI_4.2.28.14064\system\app\AntiSpam\.\res\values\
public.xml:178: error: Public symbol id/keyword_edit_mode_delete declared here 
is not defined.
E:\Xtreamer\~MIUI\Xtreamer_Q-MIUI_4.2.28.14064\system\app\AntiSpam\.\res\values\
public.xml:177: error: Public entry identifier 0x7f0b001d entry index is larger 
than available symbols (index 29, total symbols 28).
E:\Xtreamer\~MIUI\Xtreamer_Q-MIUI_4.2.28.14064\system\app\AntiSpam\.\res\values\
public.xml:177: error: Public symbol id/keyword_edit_mode_edit declared here is 
not defined.

What version of the product are you using? On what operating system?
APKTool 2.0 Beta 9 on Windows (with JRE 1.7)

Please provide any additional information below.
All relevant frameworks are correctly installed. Antispam.apk is a renamed 
package labelled "miui". Just incase you can't reproduce I've attached the APK. 
Thanks for your review.

Original issue reported on code.google.com by dconnoll...@gmail.com on 5 Mar 2014 at 3:46

Attachments:

GoogleCodeExporter commented 9 years ago
Forgot to mention that Linux has the same result.

Original comment by dconnoll...@gmail.com on 5 Mar 2014 at 3:52

GoogleCodeExporter commented 9 years ago
Is this from the v6 (4.4) miui rom?

Original comment by connor.tumbleson on 5 Mar 2014 at 3:59

GoogleCodeExporter commented 9 years ago
Nah, just the latest v5 ROM. MTK (4.2) branch so maybe it's different to the 
others. The previous AntiSpam MIUI's could recompile fine though, seems it was 
recently turned into a stub-like app.

Original comment by dconnoll...@gmail.com on 5 Mar 2014 at 11:09

GoogleCodeExporter commented 9 years ago
It had changed to this new APK in 4.2.21 it seems, see 
https://github.com/MiCode/patchrom_miui/tree/jellybean42-mtk/XHDPI/system/app

Looking at the AAPT sources, I guessed it's to do with the renamed manifest 
(looking at status_t ResourceTable::addPublic) - but I've no idea how to deal 
with it. I confirmed it by changing the package name from "miui" to 
"com.miui.antispam" in manifest, it compiled fine then but obviously that's 
dirty.

Original comment by dconnoll...@gmail.com on 5 Mar 2014 at 11:20

GoogleCodeExporter commented 9 years ago
Sorry for the triple post, but by "dirty" I mean the recompiled APK after 
renaming appears to work fine. So I guess this is just a case of the 
renamed-manifest fix being not quite ready.

Original comment by dconnoll...@gmail.com on 6 Mar 2014 at 1:13

GoogleCodeExporter commented 9 years ago
I have the same issue with MIUI v6 SystemUI Changing package name works for 
that as well (but ofc you have to change package name to 
"com.android.systemui").

Original comment by klekan...@gmail.com on 6 Mar 2014 at 3:55

GoogleCodeExporter commented 9 years ago
I have a fix. Testing with another MIUI member.

Original comment by connor.tumbleson on 6 Mar 2014 at 3:58

GoogleCodeExporter commented 9 years ago
I need a link to a ROM that has this problem. I could not duplicate with the 
4.4 flo rom I had.

Original comment by connor.tumbleson on 6 Mar 2014 at 4:19

GoogleCodeExporter commented 9 years ago
Roger that, I'm uploading a 4.2.28 PatchROM build for one of our MT6589 devices 
at the moment - it'll be a few hours. About half of the packages since 4.2.21 
have this new behavior, but as klekan... mentioned I just sed the package name 
in manifest to its original for now, no problems whatsoever.

Original comment by dconnoll...@gmail.com on 7 Mar 2014 at 3:46

GoogleCodeExporter commented 9 years ago
Oh duh, the firmware I'm uploading has the packages renamed - that won't help. 
I'm not too keen on uploading a whole ~500MB ZIP file again so here is a 
smaller ZIP of just the framework APK's; along with AntiSpam.apk attached in OP 
this should be enough? 
http://www.mediafire.com/download/c3xdraenldj7dil/frameworks.zip

Original comment by dconnoll...@gmail.com on 7 Mar 2014 at 5:51

GoogleCodeExporter commented 9 years ago
This'll work thank you.

Original comment by connor.tumbleson on 7 Mar 2014 at 3:53

GoogleCodeExporter commented 9 years ago
This patch I believe fixes it, but we also moved a variable around. Which will 
require me to test in more details against other renamed packages (htc and 
android).

If it passes. This will get merged.

Original comment by connor.tumbleson on 7 Mar 2014 at 8:04

Attachments:

GoogleCodeExporter commented 9 years ago
Not a problem, it's easy to work around this particular case so take your time 
ensuring there's no regression. Cheers!

Original comment by dconnoll...@gmail.com on 8 Mar 2014 at 7:40

GoogleCodeExporter commented 9 years ago
https://github.com/iBotPeaches/Apktool/commit/1e3b66f9be3e1c78afe20192e0c828e952
0bcc2c

It worked. Should be good now.

Original comment by connor.tumbleson on 9 Mar 2014 at 10:48

GoogleCodeExporter commented 9 years ago
In lewa it is the same error on files with rename.

Original comment by indian...@gmail.com on 31 May 2014 at 5:24