Recompile error of Brut.alll

Search This thread

Tan9890

Senior Member
Feb 9, 2012
166
38
Pune
Im using cyanogen 7.2 on my ray..
I'm tying to decompile the apk make the changes and recompile it again...

However the phone.apk dosent recompile.. It gives all those brut.alll errors..

Here's the log:

c:\apkt>java -jar apktool.jar b -f c:\apkt\phon c:\apkt\Phonez.apk
I: Smaling...
I: Building resources...
c:\apkt\phon\res\values-da\strings.xml:200: error: Multiple substitutions specif
ied in non-positional format; did you mean to add the formatted="false" attribut
e?
c:\apkt\phon\res\values-da\strings.xml:201: error: Unexpected end tag string
c:\apkt\phon\res\values-es\strings.xml:203: error: Multiple substitutions specif
ied in non-positional format; did you mean to add the formatted="false" attribut
e?
c:\apkt\phon\res\values-es\strings.xml:204: error: Unexpected end tag string
c:\apkt\phon\res\values-fi\strings.xml:200: error: Multiple substitutions specif
ied in non-positional format; did you mean to add the formatted="false" attribut
e?
c:\apkt\phon\res\values-fi\strings.xml:201: error: Unexpected end tag string
c:\apkt\phon\res\values-it\strings.xml:203: error: Multiple substitutions specif
ied in non-positional format; did you mean to add the formatted="false" attribut
e?
c:\apkt\phon\res\values-it\strings.xml:204: error: Unexpected end tag string
c:\apkt\phon\res\values-lv\strings.xml:205: error: Multiple substitutions specif
ied in non-positional format; did you mean to add the formatted="false" attribut
e?
c:\apkt\phon\res\values-lv\strings.xml:206: error: Unexpected end tag string
c:\apkt\phon\res\values-nb\strings.xml:200: error: Multiple substitutions specif
ied in non-positional format; did you mean to add the formatted="false" attribut
e?
c:\apkt\phon\res\values-nb\strings.xml:201: error: Unexpected end tag string
c:\apkt\phon\res\values-ru\strings.xml:208: error: Multiple substitutions specif
ied in non-positional format; did you mean to add the formatted="false" attribut
e?
c:\apkt\phon\res\values-ru\strings.xml:209: error: Unexpected end tag string
c:\apkt\phon\res\values-sv\strings.xml:203: error: Multiple substitutions specif
ied in non-positional format; did you mean to add the formatted="false" attribut
e?
c:\apkt\phon\res\values-sv\strings.xml:204: error: Unexpected end tag string
c:\apkt\phon\res\values-zh-rTW\strings.xml:205: error: Multiple substitutions sp
ecified in non-positional format; did you mean to add the formatted="false" attr
ibute?
c:\apkt\phon\res\values-zh-rTW\strings.xml:205: error: Unexpected end tag string

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\Tanuj\AppData\Local\Temp\A
PKTOOL4820468380985856256.tmp, -I, C:\Users\Tanuj\apktool\framework\1.apk, -S, c
:\apkt\phon\res, -M, c:\apkt\phon\AndroidManifest.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\Tanuj\AppData\Local\Temp\APKTOOL4820468380985856256.tmp, -I, C:\Users\Tanuj
\apktool\framework\1.apk, -S, c:\apkt\phon\res, -M, c:\apkt\phon\AndroidManifest
.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more




I searched all places.. They say, use the latest aapt.exe...
I am using the latest one and apktool 1.4.3..

Still cant recompile...

Pleasssssse help... I'm working on this since two days now...
 

hansip87

Senior Member
Jan 14, 2011
2,916
2,242
Jakarta
If there are double % in one sentence inside any xml (e.g. %d to %d) you must add % to that (%d to %%d)

Sent from my ST18i using XDA
 

Tan9890

Senior Member
Feb 9, 2012
166
38
Pune
Do you mean only the %d to %d type or any kind of sentences where % is used twice..

Eg:

string name="throttle_status_subtext">"%1$s (%2$d٪) of %3$s period maximum

how should this be changed?
 

hansip87

Senior Member
Jan 14, 2011
2,916
2,242
Jakarta
Actually i'm still confused about that, but AFAIK, the original is like (%s (%d) of %s period maximum) so you should try to use
%s (%%d) of %%s

Let me know if it worked.
 

jjdoctor

Inactive Recognized Developer
May 3, 2011
2,731
4,166
Rawalpindi
hansip, you should write a Guide for Decompiling apks from Sony Rom and recompiling.. No need to mention Mods.. coz even I cant compile it either.. Let us know how u did those apk edits...


I am planning tomake Sony defualt dialer look just like ICS dialer but limited by decompling error...:eek:
 

hansip87

Senior Member
Jan 14, 2011
2,916
2,242
Jakarta
hansip, you should write a Guide for Decompiling apks from Sony Rom and recompiling.. No need to mention Mods.. coz even I cant compile it either.. Let us know how u did those apk edits...


I am planning tomake Sony defualt dialer look just like ICS dialer but limited by decompling error...:eek:
What's your problem jj? I have no problem so far when i follow this
http://xdaforums.com/showthread.php?t=1511730

Only when i tried to recompile framework-res that i got error. but the above method fixes that.
 
Last edited:

Tan9890

Senior Member
Feb 9, 2012
166
38
Pune
Auto apk does not work either

Thanks hansip87 and jjdoctor, but this auto apktool isnt working either..

Still the same errors..:(:(:(:(:(:(:(

I know i'm doing something wrong.. and its just a tiny bit...
Can you post a guide or link to the tools that are to be used...

Is there a problem with windows 7?

Run as administrator? anything?
 

Tan9890

Senior Member
Feb 9, 2012
166
38
Pune
Here, I'm posting the phone.apk that i'm trying to recompile again..

Its a cyanogenmod 7.2 apk...

Please try to decompile n recompile it again... Tell me if it works..

It dosent recommpile even if i make no changes at all..

If it works for you please tell me the steps...

Thanks a lot again..
 

Attachments

  • Phone.apk
    1.3 MB · Views: 2

hansip87

Senior Member
Jan 14, 2011
2,916
2,242
Jakarta
Here, I'm posting the phone.apk that i'm trying to recompile again..

Its a cyanogenmod 7.2 apk...

Please try to decompile n recompile it again... Tell me if it works..

It dosent recommpile even if i make no changes at all..

If it works for you please tell me the steps...

Thanks a lot again..

Well as u can see in the log, can you post just the line of 200,201,203, and 204 of any of the mentioned strings.xml?

Sent from my ST18i using XDA
 

Tan9890

Senior Member
Feb 9, 2012
166
38
Pune
Here you go..

line 200 and 201 from values-da:

<string name="throttle_status_subtext">"%1$s (%2$d %) af %3$s periodens maksimum
Næste periode om %4$d dage (%5$s)"</string>

203 204 from values-es

<string name="throttle_status_subtext">"%1$s (%2$d%) de período máximo de %3$s.
Próx período en %4$d días (%5$s)"</string>
 

Tan9890

Senior Member
Feb 9, 2012
166
38
Pune
Also, i tried doing the same with Contacts.apk using the autoapk tool..
Now this one did recompile..

however, there's a problem with the signing i guess..
I tried signing the app, but that didnt work..

I replaced the original Meta-inf folder.. That that didnt work either,...

n now, even if i put back the original contacts.apk, when i go into call logs, it force closes saying some com.android.acore has crashed..

I think i'll have to flash my rom again now.. Cant receive any calls..:D
 

hansip87

Senior Member
Jan 14, 2011
2,916
2,242
Jakarta
line 200 and 201 from values-da:

<string name="throttle_status_subtext">"%1$s (%2$d %) af %3$s periodens maksimum
Næste periode om %4$d dage (%5$s)"</string>

203 204 from values-es

<string name="throttle_status_subtext">"%1$s (%2$d%) de período máximo de %3$s.
Próx período en %4$d días (%5$s)"</string>
try to fix it into this:
<string name="throttle_status_subtext">"%s (%d %%) af %s periodens maksimum
Næste periode om %d dage (%s)"</string>

<string name="throttle_status_subtext">"%s (%d %%) de período máximo de %s.
Próx período en %d días (%s)"</string>
 

Tan9890

Senior Member
Feb 9, 2012
166
38
Pune
Found the solution

Hi..
it seems a file named mgwz.dll was missing..
I downloaded the file from google and it worked fine..

Also, the error of the system not accepting the new recompiled apk has been solved..

The original certificates need to be present in the modified apk as well..

however, you shouldnt replace the META-INF folder..
Instead, extract the file you edited from the recompiled apk, and add and replace it in the original apk..

There was a problem with the checksum of the certificates. Thats why the apk wasnt getting identified..
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Why are you using smali and baksmali for CM apk ? You can easily grab the real sourcecode and recompile it in a proper way ......

    Regards