[TUT] Secphone recompiling

Search This thread

gyrene2083

Senior Member
Apr 20, 2007
414
578
Bronx, NY
Hello All,

How many of you devs have been struck by the angst of recompiling the pesky SecPhone.apk? Or how many of you have just said the hell with it I will just have someone else who knows more do it for me?

Well I yesterday, I was actually making some changes to the SecPhone.apk file, and when it came time to recompile, BAM errors all around. Needless to say it took great, restraint on my part not to throw my laptop across the room, I've already had to replace the screen for punching it!

I then sat and thought to myself, this is enough, I have to figure this out, so I use a brillant AIO program, I'll post what you need in a few. I opened the log file and low and behold it came up with a bunch of geek speak, but upon close observation, it pointed out the following; :eek:

Code:
D:\AIO\projects\SecPhone.apk\res\values-es\strings.xml:195: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
D:\AIO\projects\SecPhone.apk\res\values-es\strings.xml:196: error: Unexpected end tag string
D:\AIO\projects\SecPhone.apk\res\values-es-rUS\strings.xml:204: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
D:\AIO\projects\SecPhone.apk\res\values-es-rUS\strings.xml:205: error: Unexpected end tag string
D:\AIO\projects\SecPhone.apk\res\values-it\strings.xml:201: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
D:\AIO\projects\SecPhone.apk\res\values-it\strings.xml:202: error: Unexpected end tag string
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException:

Now before I go further, here is what your going to need:

An apk decompiler / recompiler

RUJELUS22s Android AIO Tool created by - Rujelus22. This is the one that I use, and recommend.

APKManager is another one I have heard of by Daneshm90.

Notepad++

Now for this period of instruction, the objective is to get you to recompile your SecPhone.apk. So, pay close attention, this Grumpy 'Ole Marine, doesn't like repeating himself......<Semper Fi to all you Devildogs!!!>

The portion of the log file above, is actually telling us where the errors are and what they think we meant to add.

Go to your - \res\values directory and open the following files and look these lines for each;

values-es 195, 196

values-rUS 204, 205

values-it 201, 202

For the purpose of this tutorial I am only going to work with values-es.

When we look at line 195 and 196, this is what we see;

Code:
"line 195" <string name="throttle_time_frame_subtext">"%1$d% del ciclo transcurrido. Próx       período en %2$d días (%3$s)"</string>

We are now going to open up values.xml and compare these lines. (be advised, that the line numbers will probably be different) Just search for this "throttle_time_frame_subtext"

Code:
"line 209" <string name="throttle_time_frame_subtext">"%1$d٪ of cycle elapsed
Next period starts in %2$d days (%3$s)"</string>

Look at both lines. What's the difference? .......You took too long, <grumbles to himself> :rolleyes:, look below;

Code:
values-es -  %1$d%

values - %1$d٪

Freaking amazing how something so small can just prevent you from recompiling. Now you can make those changes to the other files and you should be able to recompile, no problems....

Here is another way of doing it, my Teammate Sniper showed me this one. :highfive: In the above code it asks the following;

Code:
did you mean to add the formatted=[COLOR="Red"]"false"[/COLOR] attribute?

That is basically giving you the answer, so with that information you can add this "false" attribute after the _subtext"> like so;

Code:
From:
"line 195" <string name="throttle_time_frame_subtext">"%1$d% del ciclo transcurrido. Próx       período en %2$d días (%3$s)"</string>

To
<string name="throttle_time_frame_subtext" [COLOR="Orange"]formatted="false">[/COLOR]"%1$d% del ciclo transcurrido. Próx período en %2$d días (%3$s)"</string>

That's it. Make the changes to the other files, and you should be able to recompile. Also, side note. When editing any .smali file you need to delete the classes.dex file before you recompile. Then with 7zip, right click the new apk, and open archive, and compare the classes.dex file with the original one, and they should be different sizes.

Hope this helps you all... :D
 

cbucz24

Senior Member
Jan 31, 2011
2,757
2,897
Central Florida
Ya know, I was just playing with a transparent secphone the other day and I couldn't get it to work so I deleted my changes. Figured I'd come back to it later cuz I didn't have time that day an I wanted to push the theme out.

It must have had issues from the start when samsung released it...




sigpic4644111_1.gif

-Team Nocturnal Like A Boss
-Galaxy Note II Lab Rats Edition
 
  • Like
Reactions: Chaz187 and VECTUS

Tw1sted247

Senior Member
Nov 10, 2012
1,118
957
NorthWest
Thanks a million Gyrene!!! I was stuck on this damned apk, this worked like a charm!

Thanks for taking the time out to check into find the culprit and post it up for us!!:good::good:
:highfive:
 

jayare313

Senior Member
Jun 15, 2010
568
123
Detroit , Mi.
I've been trying to recompile a jar file for days to no avail! This will help me a bunch. I'm no dev but I've been teaching myself a few tricks. Thanks a million for this thread!

Sent from my SPH-L900 using xda app-developers app
 
  • Like
Reactions: gyrene2083

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    Hello All,

    How many of you devs have been struck by the angst of recompiling the pesky SecPhone.apk? Or how many of you have just said the hell with it I will just have someone else who knows more do it for me?

    Well I yesterday, I was actually making some changes to the SecPhone.apk file, and when it came time to recompile, BAM errors all around. Needless to say it took great, restraint on my part not to throw my laptop across the room, I've already had to replace the screen for punching it!

    I then sat and thought to myself, this is enough, I have to figure this out, so I use a brillant AIO program, I'll post what you need in a few. I opened the log file and low and behold it came up with a bunch of geek speak, but upon close observation, it pointed out the following; :eek:

    Code:
    D:\AIO\projects\SecPhone.apk\res\values-es\strings.xml:195: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
    D:\AIO\projects\SecPhone.apk\res\values-es\strings.xml:196: error: Unexpected end tag string
    D:\AIO\projects\SecPhone.apk\res\values-es-rUS\strings.xml:204: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
    D:\AIO\projects\SecPhone.apk\res\values-es-rUS\strings.xml:205: error: Unexpected end tag string
    D:\AIO\projects\SecPhone.apk\res\values-it\strings.xml:201: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
    D:\AIO\projects\SecPhone.apk\res\values-it\strings.xml:202: error: Unexpected end tag string
    Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException:

    Now before I go further, here is what your going to need:

    An apk decompiler / recompiler

    RUJELUS22s Android AIO Tool created by - Rujelus22. This is the one that I use, and recommend.

    APKManager is another one I have heard of by Daneshm90.

    Notepad++

    Now for this period of instruction, the objective is to get you to recompile your SecPhone.apk. So, pay close attention, this Grumpy 'Ole Marine, doesn't like repeating himself......<Semper Fi to all you Devildogs!!!>

    The portion of the log file above, is actually telling us where the errors are and what they think we meant to add.

    Go to your - \res\values directory and open the following files and look these lines for each;

    values-es 195, 196

    values-rUS 204, 205

    values-it 201, 202

    For the purpose of this tutorial I am only going to work with values-es.

    When we look at line 195 and 196, this is what we see;

    Code:
    "line 195" <string name="throttle_time_frame_subtext">"%1$d% del ciclo transcurrido. Próx       período en %2$d días (%3$s)"</string>

    We are now going to open up values.xml and compare these lines. (be advised, that the line numbers will probably be different) Just search for this "throttle_time_frame_subtext"

    Code:
    "line 209" <string name="throttle_time_frame_subtext">"%1$d٪ of cycle elapsed
    Next period starts in %2$d days (%3$s)"</string>

    Look at both lines. What's the difference? .......You took too long, <grumbles to himself> :rolleyes:, look below;

    Code:
    values-es -  %1$d%
    
    values - %1$d٪

    Freaking amazing how something so small can just prevent you from recompiling. Now you can make those changes to the other files and you should be able to recompile, no problems....

    Here is another way of doing it, my Teammate Sniper showed me this one. :highfive: In the above code it asks the following;

    Code:
    did you mean to add the formatted=[COLOR="Red"]"false"[/COLOR] attribute?

    That is basically giving you the answer, so with that information you can add this "false" attribute after the _subtext"> like so;

    Code:
    From:
    "line 195" <string name="throttle_time_frame_subtext">"%1$d% del ciclo transcurrido. Próx       período en %2$d días (%3$s)"</string>
    
    To
    <string name="throttle_time_frame_subtext" [COLOR="Orange"]formatted="false">[/COLOR]"%1$d% del ciclo transcurrido. Próx período en %2$d días (%3$s)"</string>

    That's it. Make the changes to the other files, and you should be able to recompile. Also, side note. When editing any .smali file you need to delete the classes.dex file before you recompile. Then with 7zip, right click the new apk, and open archive, and compare the classes.dex file with the original one, and they should be different sizes.

    Hope this helps you all... :D
    3
    Very nice work here sir... I'm sure someone here has been needing this info! :good:
    3
    I'm glad it helped you out. :D

    Sent from my SPH-L900 using Tapatalk 2
    2
    Ya know, I was just playing with a transparent secphone the other day and I couldn't get it to work so I deleted my changes. Figured I'd come back to it later cuz I didn't have time that day an I wanted to push the theme out.

    It must have had issues from the start when samsung released it...




    sigpic4644111_1.gif

    -Team Nocturnal Like A Boss
    -Galaxy Note II Lab Rats Edition
    2
    Thanks a million Gyrene!!! I was stuck on this damned apk, this worked like a charm!

    Thanks for taking the time out to check into find the culprit and post it up for us!!:good::good:
    :highfive: