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;
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;
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"
Look at both lines. What's the difference? .......You took too long, <grumbles to himself> , look below;
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;
That is basically giving you the answer, so with that information you can add this "false" attribute after the _subtext"> like so;
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...
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;
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> , 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...