New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't escape @ and ? chars for non-reference XML attrs. #211

Closed
iBotPeaches opened this Issue Mar 18, 2015 · 38 comments

Comments

Projects
None yet
1 participant
@iBotPeaches
Owner

iBotPeaches commented Mar 18, 2015

Original issue 100 created by mscorpionz on 2010-09-26T07:22:17.000Z:

Hi all

Version 1.3.2. not correctly decodes apk-file. Example of enclosure: file scanning_1.3.1.xml, which decoded using version 1.3.1 and the file scanning_1.3.2.xml, which decoded using version 1.3.2.
Apparently, the program adds additional characters "attr /" and ""(in the file - line 4).
You can check at any apk-file, I tested the file Music.apk.

As a result, the program on my phone, changed with version 1.3.2, finishing with error "force close", but changed with version 1.3.1 works correctly.

We used versions apktool 1.3.1 and 1.3.2, Java version - 1.6.0_20, OS - Windows 7 Professional x64

P.S. Sorry for my English :)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #1 originally posted by Brut.alll on 2010-09-26T07:43:11.000Z:

attr/ is ok, but that "" at the beginning definitely not.

Thanks for your report :-)

Owner

iBotPeaches commented Mar 18, 2015

Comment #1 originally posted by Brut.alll on 2010-09-26T07:43:11.000Z:

attr/ is ok, but that "" at the beginning definitely not.

Thanks for your report :-)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #2 originally posted by Brut.alll on 2010-09-27T11:57:25.000Z:

It's much worse than I thought. Apktool escapes many values that it shouldn't and worst is: it doesn't throw any warnings, apps just don't work :-/

Let's get e.g. xml/p12_sip_sms_gre.xml from HTC_IME: http://pastebin.com/1k8PXb52 . There are broken attrs everywhere! :-/ This file is good for tests, cause label at 5. line should be escaped.

Owner

iBotPeaches commented Mar 18, 2015

Comment #2 originally posted by Brut.alll on 2010-09-27T11:57:25.000Z:

It's much worse than I thought. Apktool escapes many values that it shouldn't and worst is: it doesn't throw any warnings, apps just don't work :-/

Let's get e.g. xml/p12_sip_sms_gre.xml from HTC_IME: http://pastebin.com/1k8PXb52 . There are broken attrs everywhere! :-/ This file is good for tests, cause label at 5. line should be escaped.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #3 originally posted by Brut.alll on 2010-10-04T11:24:42.000Z:

Ok, try attached version.

Owner

iBotPeaches commented Mar 18, 2015

Comment #3 originally posted by Brut.alll on 2010-10-04T11:24:42.000Z:

Ok, try attached version.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #4 originally posted by bimmer.sarge on 2010-10-04T11:37:47.000Z:

Still don't work for me with HTC_IME_lo.apk
Same error as with 1.3.2

Owner

iBotPeaches commented Mar 18, 2015

Comment #4 originally posted by bimmer.sarge on 2010-10-04T11:37:47.000Z:

Still don't work for me with HTC_IME_lo.apk
Same error as with 1.3.2

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #5 originally posted by Brut.alll on 2010-10-04T20:37:29.000Z:

I have decoded xml/p12_sip_sms_gre.xml: http://pastebin.com/1XKtvCaV . Looks ok and it's very similar to xml decoded by apktool1.3.1 . Where do you get errors?

Owner

iBotPeaches commented Mar 18, 2015

Comment #5 originally posted by Brut.alll on 2010-10-04T20:37:29.000Z:

I have decoded xml/p12_sip_sms_gre.xml: http://pastebin.com/1XKtvCaV . Looks ok and it's very similar to xml decoded by apktool1.3.1 . Where do you get errors?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #6 originally posted by bimmer.sarge on 2010-10-04T22:02:36.000Z:

I've looked at my xml/p12_sip_sms_gre.xml and it's looking fine.

I don't know what's wrong. I decompile and recompile without touching anything and apps crash on start. Tried with the deodexed apk from mocado and the HTC_IME mod v27 from jonas.

The HTC_IME mod v27 by Jonas is on my precedent comment.
The orignal HTC_IME deodexed file is in this one

The framework-res.apk from the htc phone has benn added (apktool if....) as 1.apk

Decompile is done without error.

when I recompile, I get those error for both apk:
C:\apktool1.3.2>apktool b HTC_IME_lo/ HTC_IME_lo2.apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'kb_tutorial_exit' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja
aapt: warning: string 'kb_tutorial_fuzzy_body' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_fuzzy_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_longpress_body' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_longpress_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_main_desc' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_main_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'keyboard_ime_settings_fqwerty_space_summary' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja
aapt: warning: string 'keyboard_ime_settings_fqwerty_space_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'main_menu_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'vibration_feedback' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
I: Copying libs...
I: Building apk file...

Owner

iBotPeaches commented Mar 18, 2015

Comment #6 originally posted by bimmer.sarge on 2010-10-04T22:02:36.000Z:

I've looked at my xml/p12_sip_sms_gre.xml and it's looking fine.

I don't know what's wrong. I decompile and recompile without touching anything and apps crash on start. Tried with the deodexed apk from mocado and the HTC_IME mod v27 from jonas.

The HTC_IME mod v27 by Jonas is on my precedent comment.
The orignal HTC_IME deodexed file is in this one

The framework-res.apk from the htc phone has benn added (apktool if....) as 1.apk

Decompile is done without error.

when I recompile, I get those error for both apk:
C:\apktool1.3.2>apktool b HTC_IME_lo/ HTC_IME_lo2.apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'kb_tutorial_exit' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja
aapt: warning: string 'kb_tutorial_fuzzy_body' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_fuzzy_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_longpress_body' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_longpress_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_main_desc' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_main_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'keyboard_ime_settings_fqwerty_space_summary' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja
aapt: warning: string 'keyboard_ime_settings_fqwerty_space_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'main_menu_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'vibration_feedback' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
I: Copying libs...
I: Building apk file...

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #7 originally posted by Brut.alll on 2010-10-05T11:46:14.000Z:

Ok, I had fixed "@", but had not "?". Try this one.

Owner

iBotPeaches commented Mar 18, 2015

Comment #7 originally posted by Brut.alll on 2010-10-05T11:46:14.000Z:

Ok, I had fixed "@", but had not "?". Try this one.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #8 originally posted by bimmer.sarge on 2010-10-05T12:08:47.000Z:

I still get those same error when rebuilding the 2 apk. Apps still crash :(

C:\apktool1.3.2>apktool b HTC_IME_lo/ HTC_IME_lo2.apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'kb_tutorial_exit' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja
aapt: warning: string 'kb_tutorial_fuzzy_body' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_fuzzy_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_longpress_body' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_longpress_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_main_desc' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_main_title' has no default translation in C:\Uapktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'keyboard_ime_settings_fqwerty_space_summary' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja
aapt: warning: string 'keyboard_ime_settings_fqwerty_space_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'main_menu_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'vibration_feedback' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
I: Copying libs...
I: Building apk file...

Owner

iBotPeaches commented Mar 18, 2015

Comment #8 originally posted by bimmer.sarge on 2010-10-05T12:08:47.000Z:

I still get those same error when rebuilding the 2 apk. Apps still crash :(

C:\apktool1.3.2>apktool b HTC_IME_lo/ HTC_IME_lo2.apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'kb_tutorial_exit' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja
aapt: warning: string 'kb_tutorial_fuzzy_body' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_fuzzy_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_longpress_body' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_longpress_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_main_desc' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'kb_tutorial_main_title' has no default translation in C:\Uapktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'keyboard_ime_settings_fqwerty_space_summary' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja
aapt: warning: string 'keyboard_ime_settings_fqwerty_space_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'main_menu_title' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
aapt: warning: string 'vibration_feedback' has no default translation in C:\apktool1.3.2\HTC_IME_lo\res; found: ja no
I: Copying libs...
I: Building apk file...

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #9 originally posted by Brut.alll on 2010-10-05T16:49:52.000Z:

Warnings are ok. We don't know whether crash is caused by this issue or something else. Could you try to rebuilt this apk using apktool 1.3.1? And what's in the logcat?

Owner

iBotPeaches commented Mar 18, 2015

Comment #9 originally posted by Brut.alll on 2010-10-05T16:49:52.000Z:

Warnings are ok. We don't know whether crash is caused by this issue or something else. Could you try to rebuilt this apk using apktool 1.3.1? And what's in the logcat?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #10 originally posted by bimmer.sarge on 2010-10-05T17:13:35.000Z:

I think you forgot to attach the apk

Owner

iBotPeaches commented Mar 18, 2015

Comment #10 originally posted by bimmer.sarge on 2010-10-05T17:13:35.000Z:

I think you forgot to attach the apk

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #11 originally posted by Brut.alll on 2010-10-05T17:30:31.000Z:

By "this apk" I meant apk which doesn't work for you after rebuild :-)

Owner

iBotPeaches commented Mar 18, 2015

Comment #11 originally posted by Brut.alll on 2010-10-05T17:30:31.000Z:

By "this apk" I meant apk which doesn't work for you after rebuild :-)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #12 originally posted by bimmer.sarge on 2010-10-05T17:38:43.000Z:

ho sorry, I've missed the "with 1.3.1" part :P

Here's the log of before rebuild attempt and after rebuild attempt with your lattest apktool.jar you've submitted this morning.

Owner

iBotPeaches commented Mar 18, 2015

Comment #12 originally posted by bimmer.sarge on 2010-10-05T17:38:43.000Z:

ho sorry, I've missed the "with 1.3.1" part :P

Here's the log of before rebuild attempt and after rebuild attempt with your lattest apktool.jar you've submitted this morning.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #13 originally posted by bimmer.sarge on 2010-10-05T17:49:00.000Z:

And here'S the log after rebuilding with 1.3.1

Owner

iBotPeaches commented Mar 18, 2015

Comment #13 originally posted by bimmer.sarge on 2010-10-05T17:49:00.000Z:

And here'S the log after rebuilding with 1.3.1

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #14 originally posted by Brut.alll on 2010-10-06T07:33:50.000Z:

So seems your problem isn't related to above issue. I will look into it.

Owner

iBotPeaches commented Mar 18, 2015

Comment #14 originally posted by Brut.alll on 2010-10-06T07:33:50.000Z:

So seems your problem isn't related to above issue. I will look into it.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #15 originally posted by mkatsev on 2010-10-07T02:24:04.000Z:

Hi. Not sure if it's the same issue, but definitely looks like it. If I decompile/compile skype.apk with 1.3.2 I get force-close on start (log attached). With 1.3.1 - works fine.

Owner

iBotPeaches commented Mar 18, 2015

Comment #15 originally posted by mkatsev on 2010-10-07T02:24:04.000Z:

Hi. Not sure if it's the same issue, but definitely looks like it. If I decompile/compile skype.apk with 1.3.2 I get force-close on start (log attached). With 1.3.1 - works fine.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #16 originally posted by Brut.alll on 2010-10-07T12:39:50.000Z:

@mkatsev
No, I think this is something else. You get "You must supply a layout_width attribute" if you have added without layout_width attribute which is required. Did you modified something in it?

Owner

iBotPeaches commented Mar 18, 2015

Comment #16 originally posted by Brut.alll on 2010-10-07T12:39:50.000Z:

@mkatsev
No, I think this is something else. You get "You must supply a layout_width attribute" if you have added without layout_width attribute which is required. Did you modified something in it?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #17 originally posted by mkatsev on 2010-10-08T04:55:13.000Z:

Nope. No modifications whatsoever. And, as I said, doing exactly the same thing with 1.3.1 works fine.

Owner

iBotPeaches commented Mar 18, 2015

Comment #17 originally posted by mkatsev on 2010-10-08T04:55:13.000Z:

Nope. No modifications whatsoever. And, as I said, doing exactly the same thing with 1.3.1 works fine.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #18 originally posted by mkatsev on 2010-10-08T04:58:19.000Z:

Oh, and I'm not 100% sure, but I remember unpacking original and 'corrupted' apks with 7-zip and there was no difference in the contents.

Owner

iBotPeaches commented Mar 18, 2015

Comment #18 originally posted by mkatsev on 2010-10-08T04:58:19.000Z:

Oh, and I'm not 100% sure, but I remember unpacking original and 'corrupted' apks with 7-zip and there was no difference in the contents.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #19 originally posted by bimmer.sarge on 2010-10-13T14:05:29.000Z:

Do you want me to open another issue for the HTC_IME.apk issue since the @ and ? issue has been fixed and it still don't fix the problem?

Owner

iBotPeaches commented Mar 18, 2015

Comment #19 originally posted by bimmer.sarge on 2010-10-13T14:05:29.000Z:

Do you want me to open another issue for the HTC_IME.apk issue since the @ and ? issue has been fixed and it still don't fix the problem?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #20 originally posted by dynfeisu on 2010-10-24T13:00:20.000Z:

burt can u see what's wrong with this file? 1.3.1 seems ok. but with test 1.3.2 and orignal 1.3.2 got some bug.

Owner

iBotPeaches commented Mar 18, 2015

Comment #20 originally posted by dynfeisu on 2010-10-24T13:00:20.000Z:

burt can u see what's wrong with this file? 1.3.1 seems ok. but with test 1.3.2 and orignal 1.3.2 got some bug.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #21 originally posted by josh.avroch on 2010-10-28T01:16:53.000Z:

I'm getting the same issue with Talk.apk. I'm getting the attr stuff added and force closes. In my log.txt it says that layer ID chat_switcher.xml is invalid. I edited chat_screen.xml, but only changing a few F's to 0's in the colors.

I'm going to try with 1.3.1

Owner

iBotPeaches commented Mar 18, 2015

Comment #21 originally posted by josh.avroch on 2010-10-28T01:16:53.000Z:

I'm getting the same issue with Talk.apk. I'm getting the attr stuff added and force closes. In my log.txt it says that layer ID chat_switcher.xml is invalid. I edited chat_screen.xml, but only changing a few F's to 0's in the colors.

I'm going to try with 1.3.1

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #22 originally posted by mkzhang1979 on 2010-10-31T15:49:08.000Z:

The latest apktool.jar posted in this thread will escape "&" to "&" while decompiling an APK.

Please fix it. Thank you.

Owner

iBotPeaches commented Mar 18, 2015

Comment #22 originally posted by mkzhang1979 on 2010-10-31T15:49:08.000Z:

The latest apktool.jar posted in this thread will escape "&" to "&" while decompiling an APK.

Please fix it. Thank you.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #23 originally posted by patrickboos85 on 2010-11-15T07:36:58.000Z:

@mkatsev and @Brut.all
about the skype app. here the same error takes place. there is no layout_width in that line. but a style with an @ that now has a backslash before it. because of that it results in layout_width missing exception

Owner

iBotPeaches commented Mar 18, 2015

Comment #23 originally posted by patrickboos85 on 2010-11-15T07:36:58.000Z:

@mkatsev and @Brut.all
about the skype app. here the same error takes place. there is no layout_width in that line. but a style with an @ that now has a backslash before it. because of that it results in layout_width missing exception

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #24 originally posted by patrickboos85 on 2010-11-15T07:45:24.000Z:

Just tried the new jar above with Skype. That seems to have fixed it! Great work!

Owner

iBotPeaches commented Mar 18, 2015

Comment #24 originally posted by patrickboos85 on 2010-11-15T07:45:24.000Z:

Just tried the new jar above with Skype. That seems to have fixed it! Great work!

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #25 originally posted by r.p.ang.in.CA on 2010-11-17T01:04:04.000Z:

Hola,

New to apktool but encountering the problems people mentioned here. Did this experiment with the latest apktool.jar posted here: decoded framework-res.apk, then built framework-res.apk (no changes). Old .apk vs new: 5.5Mb vs. 3.4Mb (what disappeared)! Did the same with 1.3.1: old vs. new = 5.5Mb vs. 5.4Mb.
Did a diff of the decoded directories with version 1.3.1 and there are only two things I see:

  1. for color values is getting escaped, e.g. color="#ff000000" (bug?)

  2. some but not all .9.png files are different (don't know what this means)
Owner

iBotPeaches commented Mar 18, 2015

Comment #25 originally posted by r.p.ang.in.CA on 2010-11-17T01:04:04.000Z:

Hola,

New to apktool but encountering the problems people mentioned here. Did this experiment with the latest apktool.jar posted here: decoded framework-res.apk, then built framework-res.apk (no changes). Old .apk vs new: 5.5Mb vs. 3.4Mb (what disappeared)! Did the same with 1.3.1: old vs. new = 5.5Mb vs. 5.4Mb.
Did a diff of the decoded directories with version 1.3.1 and there are only two things I see:

  1. for color values is getting escaped, e.g. color="#ff000000" (bug?)

  2. some but not all .9.png files are different (don't know what this means)
@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #26 originally posted by qngwng2 on 2010-12-16T06:38:56.000Z:

I have the issue also.Can you fix it.

Owner

iBotPeaches commented Mar 18, 2015

Comment #26 originally posted by qngwng2 on 2010-12-16T06:38:56.000Z:

I have the issue also.Can you fix it.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #27 originally posted by qngwng2 on 2010-12-16T06:47:15.000Z:

When I rebuild the k9-3.391-release.apk file,then install on my phone,but it turn to be "force close".

P.S:Sorry for my English.I am a Chinese.

Owner

iBotPeaches commented Mar 18, 2015

Comment #27 originally posted by qngwng2 on 2010-12-16T06:47:15.000Z:

When I rebuild the k9-3.391-release.apk file,then install on my phone,but it turn to be "force close".

P.S:Sorry for my English.I am a Chinese.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #28 originally posted by name.is.carl on 2011-02-25T16:28:00.000Z:

The apktool.jar attached in comment # 7 fixes the "missing layout_width" issues.

Great work !

Owner

iBotPeaches commented Mar 18, 2015

Comment #28 originally posted by name.is.carl on 2011-02-25T16:28:00.000Z:

The apktool.jar attached in comment # 7 fixes the "missing layout_width" issues.

Great work !

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #29 originally posted by jstorrs on 2011-04-13T20:14:18.000Z:

I used apktool.jar from comment # 7 to decompile, recompile, decompile a framework-res.apk (without making any modifications) and compare the two decompiled versions. The XML strings content seems to always replace & with &

< -> &lt; -> &amp;lt;
& -> &amp; -> &amp;amp;

e.g. framework-res/ is the first decompile and framework-res2/ is the second decompile:

diff framework-res-2/res/xml/password_kbd_extension.xml framework-res/res/xml/password_kbd_extension.xml
8c8

<

    <Key android:keyLabel="&amp;amp;" />

and

diff framework-res-2/res/xml/password_kbd_symbols_shift.xml framework-res/res/xml/password_kbd_symbols_shift.xml
35c35

<

    <Key android:keyLabel="&amp;lt;" />

The 9.png's also differ, but I don't know if that matters.

Owner

iBotPeaches commented Mar 18, 2015

Comment #29 originally posted by jstorrs on 2011-04-13T20:14:18.000Z:

I used apktool.jar from comment # 7 to decompile, recompile, decompile a framework-res.apk (without making any modifications) and compare the two decompiled versions. The XML strings content seems to always replace & with &

< -> &lt; -> &amp;lt;
& -> &amp; -> &amp;amp;

e.g. framework-res/ is the first decompile and framework-res2/ is the second decompile:

diff framework-res-2/res/xml/password_kbd_extension.xml framework-res/res/xml/password_kbd_extension.xml
8c8

<

    <Key android:keyLabel="&amp;amp;" />

and

diff framework-res-2/res/xml/password_kbd_symbols_shift.xml framework-res/res/xml/password_kbd_symbols_shift.xml
35c35

<

    <Key android:keyLabel="&amp;lt;" />

The 9.png's also differ, but I don't know if that matters.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #30 originally posted by jstorrs on 2011-04-13T21:09:03.000Z:

Just as a follow up about the 9.png's (using apktool.jar from comment # 7). They continue to change with each pass of decompile/recompile. For example the attached png becomes progressively brighter.

Owner

iBotPeaches commented Mar 18, 2015

Comment #30 originally posted by jstorrs on 2011-04-13T21:09:03.000Z:

Just as a follow up about the 9.png's (using apktool.jar from comment # 7). They continue to change with each pass of decompile/recompile. For example the attached png becomes progressively brighter.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #31 originally posted by Brut.alll on 2011-05-03T04:18:03.000Z:

I have written some integration tests for all these "magic" values and fixed quite a lot of bugs. Actually string escaping for XMLs should be very easy, but seems Android's escaping is totally fu$^%# up. Examples:

  • " stores... empty string O_o Same for ". You have to use " or "
  • ' or ' is a parse error - you have to backslash them too.
  • On the other hand you could use , , and and they're all exactly the same. But...
  • <View foo="""> is a parse error (at least this is consistent with XML standard) - you have to use " or "

I think it's best to always use ' and " - they should be always valid.

You could download new apktool.jar here: http://www.multiupload.com/5UD3FFYNBD . It contains fixes for all (I think) XML escaping issues. Any problems not related to escaping will be moved to another issues - I want to close this one finally.

About 9.pngs: I don't really do much with them, but aapt optimizes pngs each time you build an app. I think if you would create your own app, then build it, unpack pngs and replace original ones, then build it again and so on, then you would get same problems.

Owner

iBotPeaches commented Mar 18, 2015

Comment #31 originally posted by Brut.alll on 2011-05-03T04:18:03.000Z:

I have written some integration tests for all these "magic" values and fixed quite a lot of bugs. Actually string escaping for XMLs should be very easy, but seems Android's escaping is totally fu$^%# up. Examples:

  • " stores... empty string O_o Same for ". You have to use " or "
  • ' or ' is a parse error - you have to backslash them too.
  • On the other hand you could use , , and and they're all exactly the same. But...
  • <View foo="""> is a parse error (at least this is consistent with XML standard) - you have to use " or "

I think it's best to always use ' and " - they should be always valid.

You could download new apktool.jar here: http://www.multiupload.com/5UD3FFYNBD . It contains fixes for all (I think) XML escaping issues. Any problems not related to escaping will be moved to another issues - I want to close this one finally.

About 9.pngs: I don't really do much with them, but aapt optimizes pngs each time you build an app. I think if you would create your own app, then build it, unpack pngs and replace original ones, then build it again and so on, then you would get same problems.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #32 originally posted by Brut.alll on 2011-05-03T04:20:45.000Z:

Issue 101 has been merged into this issue.

Owner

iBotPeaches commented Mar 18, 2015

Comment #32 originally posted by Brut.alll on 2011-05-03T04:20:45.000Z:

Issue 101 has been merged into this issue.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #33 originally posted by Brut.alll on 2011-05-03T04:25:13.000Z:

Issue 109 has been merged into this issue.

Owner

iBotPeaches commented Mar 18, 2015

Comment #33 originally posted by Brut.alll on 2011-05-03T04:25:13.000Z:

Issue 109 has been merged into this issue.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #34 originally posted by Brut.alll on 2011-05-03T04:57:08.000Z:

Issue 127 has been merged into this issue.

Owner

iBotPeaches commented Mar 18, 2015

Comment #34 originally posted by Brut.alll on 2011-05-03T04:57:08.000Z:

Issue 127 has been merged into this issue.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #35 originally posted by Brut.alll on 2011-05-03T05:34:30.000Z:

Issue 144 has been merged into this issue.

Owner

iBotPeaches commented Mar 18, 2015

Comment #35 originally posted by Brut.alll on 2011-05-03T05:34:30.000Z:

Issue 144 has been merged into this issue.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #36 originally posted by Brut.alll on 2011-05-03T12:33:45.000Z:

Issue 138 has been merged into this issue.

Owner

iBotPeaches commented Mar 18, 2015

Comment #36 originally posted by Brut.alll on 2011-05-03T12:33:45.000Z:

Issue 138 has been merged into this issue.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #37 originally posted by Brut.alll on 2011-05-03T14:05:12.000Z:

Issue 152 has been merged into this issue.

Owner

iBotPeaches commented Mar 18, 2015

Comment #37 originally posted by Brut.alll on 2011-05-03T14:05:12.000Z:

Issue 152 has been merged into this issue.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #38 originally posted by Brut.alll on 2011-05-15T16:18:33.000Z:

Fixed in apktool v1.4.0. If you still have above problems then I will reopen an issue.

Owner

iBotPeaches commented Mar 18, 2015

Comment #38 originally posted by Brut.alll on 2011-05-15T16:18:33.000Z:

Fixed in apktool v1.4.0. If you still have above problems then I will reopen an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment