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

Multiple substitutions specified in non-positional format (1.4.2) #365

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

Comments

Projects
None yet
1 participant
@iBotPeaches
Owner

iBotPeaches commented Mar 18, 2015

Original issue 254 created by byczybyk on 2011-12-07T13:27:24.000Z:

What steps will reproduce the problem?

  1. apktool if framework-res.apk
  2. apktool d framework-res.apk
    3.

What is the expected output? What do you see instead?
in \res\values*\strings.xml
expected:
<string name="hour_ampm" formatted="false">
instead:
<string name="hour_ampm">

What version of the product are you using? On what operating system?
1.4.1 & 1.4.2

w7-32

Please provide any additional information below.
attached:
original framework-res.apk from i9000xwjvx
also deodexed with baksmali v1.2.8 Camera.apk from same firmware

smaali seems to decompile wo problem, what more it adds nice comments here and there :]

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #1 originally posted by byczybyk on 2011-12-07T13:31:18.000Z:

could not attach in first post idk why

framework-res.apk

Owner

iBotPeaches commented Mar 18, 2015

Comment #1 originally posted by byczybyk on 2011-12-07T13:31:18.000Z:

could not attach in first post idk why

framework-res.apk

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #2 originally posted by byczybyk on 2011-12-07T13:32:59.000Z:

and here Camer.apk i mentioned

Owner

iBotPeaches commented Mar 18, 2015

Comment #2 originally posted by byczybyk on 2011-12-07T13:32:59.000Z:

and here Camer.apk i mentioned

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #3 originally posted by byczybyk on 2011-12-07T18:37:44.000Z:

also in \Mms\res\values\plurals.xml
ive spotted that in 1.4.2 it is:
%1$s results for "%2$s"
and in 1.4.1:
%1$1$s results for "%2$2$s"

Owner

iBotPeaches commented Mar 18, 2015

Comment #3 originally posted by byczybyk on 2011-12-07T18:37:44.000Z:

also in \Mms\res\values\plurals.xml
ive spotted that in 1.4.2 it is:
%1$s results for "%2$s"
and in 1.4.1:
%1$1$s results for "%2$2$s"

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #4 originally posted by Brut.alll on 2011-12-07T22:36:14.000Z:

Man, I hate these string formatting problems. I will make a quick fix.

Owner

iBotPeaches commented Mar 18, 2015

Comment #4 originally posted by Brut.alll on 2011-12-07T22:36:14.000Z:

Man, I hate these string formatting problems. I will make a quick fix.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #5 originally posted by Brut.alll on 2011-12-07T22:36:34.000Z:

Issue 253 has been merged into this issue.

Owner

iBotPeaches commented Mar 18, 2015

Comment #5 originally posted by Brut.alll on 2011-12-07T22:36:34.000Z:

Issue 253 has been merged into this issue.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #6 originally posted by Brut.alll on 2011-12-07T22:36:45.000Z:

Issue 250 has been merged into this issue.

Owner

iBotPeaches commented Mar 18, 2015

Comment #6 originally posted by Brut.alll on 2011-12-07T22:36:45.000Z:

Issue 250 has been merged into this issue.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #7 originally posted by byczybyk on 2011-12-07T23:34:07.000Z:

thank you, looking forward for 1.4.3 :)

Owner

iBotPeaches commented Mar 18, 2015

Comment #7 originally posted by byczybyk on 2011-12-07T23:34:07.000Z:

thank you, looking forward for 1.4.3 :)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #8 originally posted by Brut.alll on 2011-12-08T01:54:08.000Z:

<empty>

Owner

iBotPeaches commented Mar 18, 2015

Comment #8 originally posted by Brut.alll on 2011-12-08T01:54:08.000Z:

<empty>

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #9 originally posted by MLaBarbara on 2011-12-08T01:59:55.000Z:

While I appreciate the quick work, the issue is still present. I am the one who reported issue 250, and the same thing happens with the new version.

Owner

iBotPeaches commented Mar 18, 2015

Comment #9 originally posted by MLaBarbara on 2011-12-08T01:59:55.000Z:

While I appreciate the quick work, the issue is still present. I am the one who reported issue 250, and the same thing happens with the new version.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #10 originally posted by Brut.alll on 2011-12-08T02:51:50.000Z:

Could you upload your apk (and framework if needed)?

Owner

iBotPeaches commented Mar 18, 2015

Comment #10 originally posted by Brut.alll on 2011-12-08T02:51:50.000Z:

Could you upload your apk (and framework if needed)?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #11 originally posted by Brut.alll on 2011-12-08T02:54:11.000Z:

Ahh and did you decode this file again or just tried to build what you have decoded using older version? You have to decode apk using v1.4.3.

Owner

iBotPeaches commented Mar 18, 2015

Comment #11 originally posted by Brut.alll on 2011-12-08T02:54:11.000Z:

Ahh and did you decode this file again or just tried to build what you have decoded using older version? You have to decode apk using v1.4.3.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #12 originally posted by MLaBarbara on 2011-12-08T03:01:57.000Z:

That was it! Sorry about that :)

Thank's again for your work!

Owner

iBotPeaches commented Mar 18, 2015

Comment #12 originally posted by MLaBarbara on 2011-12-08T03:01:57.000Z:

That was it! Sorry about that :)

Thank's again for your work!

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #13 originally posted by gzwalter79 on 2011-12-08T09:57:05.000Z:

plurals.xml:79: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?

  • ICS framework-res.apk

Apktool 1.4.3 did not work.

Owner

iBotPeaches commented Mar 18, 2015

Comment #13 originally posted by gzwalter79 on 2011-12-08T09:57:05.000Z:

plurals.xml:79: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?

  • ICS framework-res.apk

Apktool 1.4.3 did not work.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #14 originally posted by Brut.alll on 2011-12-08T10:37:00.000Z:

Did I say I hate formatting problems? ;-)

Owner

iBotPeaches commented Mar 18, 2015

Comment #14 originally posted by Brut.alll on 2011-12-08T10:37:00.000Z:

Did I say I hate formatting problems? ;-)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #15 originally posted by Brut.alll on 2011-12-08T10:44:12.000Z:

Ok, this one is more complicated. It's quite a different problem: Issue 256

Owner

iBotPeaches commented Mar 18, 2015

Comment #15 originally posted by Brut.alll on 2011-12-08T10:44:12.000Z:

Ok, this one is more complicated. It's quite a different problem: Issue 256

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #16 originally posted by byczybyk on 2011-12-08T11:53:53.000Z:

yup missing formatted="false" problem still exists with 1.4.3 :|

Owner

iBotPeaches commented Mar 18, 2015

Comment #16 originally posted by byczybyk on 2011-12-08T11:53:53.000Z:

yup missing formatted="false" problem still exists with 1.4.3 :|

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #17 originally posted by Brut.alll on 2011-12-08T12:20:44.000Z:

This error may be caused by many different situations. I have fixed most of them in 1.4.3, but still there are problems with xliff tags. This is why I have created a new issue.

Owner

iBotPeaches commented Mar 18, 2015

Comment #17 originally posted by Brut.alll on 2011-12-08T12:20:44.000Z:

This error may be caused by many different situations. I have fixed most of them in 1.4.3, but still there are problems with xliff tags. This is why I have created a new issue.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #18 originally posted by byczybyk on 2011-12-08T12:41:33.000Z:

holdin my breath till you sort it out in next release, hmm not literally ;]

Owner

iBotPeaches commented Mar 18, 2015

Comment #18 originally posted by byczybyk on 2011-12-08T12:41:33.000Z:

holdin my breath till you sort it out in next release, hmm not literally ;]

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #19 originally posted by byczybyk on 2011-12-08T16:58:54.000Z:

ok framework-res.apk compiles now but there is a problem compiling Settings.apk

with output from Apk_Multi-Tool_Alpha_02 (with updated apktool ofc)

this is the error output -> http://pastebin.com/PWRiuWdz

attached Settings.apk deodexed with baksmali.jar 1.3.0 with -a 10

also attached twframework-res.apk if needed

framework used from comment # 1 -> http://code.google.com/p/android-apktool/issues/detail?id=254#c1

Owner

iBotPeaches commented Mar 18, 2015

Comment #19 originally posted by byczybyk on 2011-12-08T16:58:54.000Z:

ok framework-res.apk compiles now but there is a problem compiling Settings.apk

with output from Apk_Multi-Tool_Alpha_02 (with updated apktool ofc)

this is the error output -> http://pastebin.com/PWRiuWdz

attached Settings.apk deodexed with baksmali.jar 1.3.0 with -a 10

also attached twframework-res.apk if needed

framework used from comment # 1 -> http://code.google.com/p/android-apktool/issues/detail?id=254#c1

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #20 originally posted by psych0phobia on 2011-12-15T04:42:47.000Z:

Confirming that this fix has caused regression issues as well.

Attached is Email.apk from I9100XWKK5. Decomping with 1.4.1 works correctly, but with 1.4.3, there are many instances of "Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?"

Owner

iBotPeaches commented Mar 18, 2015

Comment #20 originally posted by psych0phobia on 2011-12-15T04:42:47.000Z:

Confirming that this fix has caused regression issues as well.

Attached is Email.apk from I9100XWKK5. Decomping with 1.4.1 works correctly, but with 1.4.3, there are many instances of "Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?"

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #21 originally posted by danny.d.yu on 2011-12-15T06:32:26.000Z:

apktool 1.4.3 has a problem. It decompiles \n\n into a hiden return. When copying the sentence to MS Word, the whole line is broken into two lines.

Owner

iBotPeaches commented Mar 18, 2015

Comment #21 originally posted by danny.d.yu on 2011-12-15T06:32:26.000Z:

apktool 1.4.3 has a problem. It decompiles \n\n into a hiden return. When copying the sentence to MS Word, the whole line is broken into two lines.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #22 originally posted by Mariusz.Skwarczynski on 2011-12-16T14:46:31.000Z:

v 1.4.3 also leaves % characters unescaped if there is no "formatted" attribute:

%1$s (%2$d %),週期上限為 %3$s

instead of:
%1$s (%2$d %%),週期上限為 %3$s

I think that it should check strings that contains % char(s) if it is valid format string, if so, it should escape every % that is not part of a valid format string.

Owner

iBotPeaches commented Mar 18, 2015

Comment #22 originally posted by Mariusz.Skwarczynski on 2011-12-16T14:46:31.000Z:

v 1.4.3 also leaves % characters unescaped if there is no "formatted" attribute:

%1$s (%2$d %),週期上限為 %3$s

instead of:
%1$s (%2$d %%),週期上限為 %3$s

I think that it should check strings that contains % char(s) if it is valid format string, if so, it should escape every % that is not part of a valid format string.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #23 originally posted by xkaping77 on 2012-01-05T15:47:19.000Z:

SO here's what I know. 1.4.3 will not recompile to ICS 4.0.2 or 4.0.3 framework-res.apk file without the Multiple Substitutions issue located at plurals.xml on line 79 mine says. So, In order to get it to work, I had to decompile with apktool.jar 1.4.1 and then move my images and edited xmls into that decompiled frame. What I also had to do, is rename two folders because 1.4.1 (and 1.4.3 when it worked) renames the drawable-sw600dp-hdpi folder and the layout-sw600dp folders to drawable-xhdpi-v13 and layout-v13 respectively. If you recompile without renaming, it will do it successfully but, upon installation, your lock screen and settings.apk will be severely crippled. Let me tell you one other thing I noticed. When apktool.jar 1.4.3 worked (it did for a couple days) it renamed those folders. Now that its not working and im getting the multiple substitution error, it actually keeps the folder names correct when decompiling.

Owner

iBotPeaches commented Mar 18, 2015

Comment #23 originally posted by xkaping77 on 2012-01-05T15:47:19.000Z:

SO here's what I know. 1.4.3 will not recompile to ICS 4.0.2 or 4.0.3 framework-res.apk file without the Multiple Substitutions issue located at plurals.xml on line 79 mine says. So, In order to get it to work, I had to decompile with apktool.jar 1.4.1 and then move my images and edited xmls into that decompiled frame. What I also had to do, is rename two folders because 1.4.1 (and 1.4.3 when it worked) renames the drawable-sw600dp-hdpi folder and the layout-sw600dp folders to drawable-xhdpi-v13 and layout-v13 respectively. If you recompile without renaming, it will do it successfully but, upon installation, your lock screen and settings.apk will be severely crippled. Let me tell you one other thing I noticed. When apktool.jar 1.4.3 worked (it did for a couple days) it renamed those folders. Now that its not working and im getting the multiple substitution error, it actually keeps the folder names correct when decompiling.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #24 originally posted by xkaping77 on 2012-01-05T16:07:09.000Z:

Adding on here... theres a folder thats called layout-w600dp. It somehow just gets completely removed and you have to add it back in.

Owner

iBotPeaches commented Mar 18, 2015

Comment #24 originally posted by xkaping77 on 2012-01-05T16:07:09.000Z:

Adding on here... theres a folder thats called layout-w600dp. It somehow just gets completely removed and you have to add it back in.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #25 originally posted by ralfniesing on 2012-01-08T07:32:08.000Z:

It`s faster if you decompile framework-res both with 1.41 and 1.43, then copy all values folder from 1.41 to 1.43. Then compile 1.43 version with apktool 1.43 and it works.

Owner

iBotPeaches commented Mar 18, 2015

Comment #25 originally posted by ralfniesing on 2012-01-08T07:32:08.000Z:

It`s faster if you decompile framework-res both with 1.41 and 1.43, then copy all values folder from 1.41 to 1.43. Then compile 1.43 version with apktool 1.43 and it works.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #26 originally posted by byczybyk on 2012-01-08T12:26:32.000Z:

and from where comes the certainty that there ain't other segments tht got cutted out and that are not triggering any apktool errors or such? whats going on on compile

Owner

iBotPeaches commented Mar 18, 2015

Comment #26 originally posted by byczybyk on 2012-01-08T12:26:32.000Z:

and from where comes the certainty that there ain't other segments tht got cutted out and that are not triggering any apktool errors or such? whats going on on compile

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #27 originally posted by karamimed on 2012-07-19T11:30:33.000Z:

Still getting this issue on GT-I9300-XXBLG1.
I get while decompiling :

%d of %d
1 match

Apktool can't compile it this way, i fix the strings format :

%1$d of %2$d
1 match

I compile it, then i got a duplicate %1$1$.

framework-res.apk : http://www.mediafire.com/?643ls00te81kz24

Owner

iBotPeaches commented Mar 18, 2015

Comment #27 originally posted by karamimed on 2012-07-19T11:30:33.000Z:

Still getting this issue on GT-I9300-XXBLG1.
I get while decompiling :

%d of %d
1 match

Apktool can't compile it this way, i fix the strings format :

%1$d of %2$d
1 match

I compile it, then i got a duplicate %1$1$.

framework-res.apk : http://www.mediafire.com/?643ls00te81kz24

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #28 originally posted by hema.angamuthu on 2014-08-06T11:42:41.000Z:

I do see this issue while decompiling an apk using apktool1.5.2. Tried out other versions mentioned above - 1.4.3, 1.4.4 and few others. But the "formatted=false" specified in the application resource strings.xml is not available in the decompiled strings.xml generated by the apktool.

The string is as below;

<string name="_120435678" formatted="false">Test %1$s%。</string> 

Strangely some strings.xml decompiled by the apktool do have the attribute "formatted=false" as has been specified in the application resources. Is the issue anywhere related to the value in the string like the % at the end of the string?

Owner

iBotPeaches commented Mar 18, 2015

Comment #28 originally posted by hema.angamuthu on 2014-08-06T11:42:41.000Z:

I do see this issue while decompiling an apk using apktool1.5.2. Tried out other versions mentioned above - 1.4.3, 1.4.4 and few others. But the "formatted=false" specified in the application resource strings.xml is not available in the decompiled strings.xml generated by the apktool.

The string is as below;

<string name="_120435678" formatted="false">Test %1$s%。</string> 

Strangely some strings.xml decompiled by the apktool do have the attribute "formatted=false" as has been specified in the application resources. Is the issue anywhere related to the value in the string like the % at the end of the string?

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