Post Reply

[TUT] Secphone recompiling

23rd March 2013, 07:47 PM   |  #1  
gyrene2083's Avatar
OP Senior Member
Flag Bronx, NY
Thanks Meter: 512
 
274 posts
Join Date:Joined: Apr 2007
Donate to Me
More
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;

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. In the above code it asks the following;

Code:
did you mean to add the formatted="false" 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" formatted="false">"%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...
The Following 16 Users Say Thank You to gyrene2083 For This Useful Post: [ View ]
23rd March 2013, 08:20 PM   |  #2  
VECTUS's Avatar
Forum Moderator / Recognized Developer
Flag Kansas City, Mo.
Thanks Meter: 7,094
 
3,166 posts
Join Date:Joined: Mar 2010
Donate to Me
More
Very nice work here sir... I'm sure someone here has been needing this info!
The Following 3 Users Say Thank You to VECTUS For This Useful Post: [ View ]
23rd March 2013, 11:44 PM   |  #3  
cbucz24's Avatar
Recognized Themer
Flag Central Florida
Thanks Meter: 2,333
 
2,287 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Re: [TUT] Secphone recompiling
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...





-Team Nocturnal Like A Boss
-Galaxy Note II Lab Rats Edition
The Following 2 Users Say Thank You to cbucz24 For This Useful Post: [ View ]
30th March 2013, 08:06 PM   |  #4  
sling's Avatar
Senior Member
Flag Va Beach / Hatteras NC
Thanks Meter: 932
 
1,809 posts
Join Date:Joined: Aug 2007
Donate to Me
More
Thanks OP great info
The Following User Says Thank You to sling For This Useful Post: [ View ]
27th April 2013, 07:27 PM   |  #5  
Tw1sted247's Avatar
Senior Member
NorthWest
Thanks Meter: 822
 
912 posts
Join Date:Joined: Nov 2012
More
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!!
The Following 2 Users Say Thank You to Tw1sted247 For This Useful Post: [ View ]
27th April 2013, 07:30 PM   |  #6  
gyrene2083's Avatar
OP Senior Member
Flag Bronx, NY
Thanks Meter: 512
 
274 posts
Join Date:Joined: Apr 2007
Donate to Me
More
I'm glad it helped you out.

Sent from my SPH-L900 using Tapatalk 2
The Following 3 Users Say Thank You to gyrene2083 For This Useful Post: [ View ]
29th April 2013, 01:53 AM   |  #7  
jayare313's Avatar
Senior Member
Flag Detroit , Mi.
Thanks Meter: 115
 
541 posts
Join Date:Joined: Jun 2010
More
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
The Following User Says Thank You to jayare313 For This Useful Post: [ View ]
29th April 2013, 02:04 AM   |  #8  
gyrene2083's Avatar
OP Senior Member
Flag Bronx, NY
Thanks Meter: 512
 
274 posts
Join Date:Joined: Apr 2007
Donate to Me
More
I'm glad it can help...Good luck...

Post Reply Subscribe to Thread

Tags
recompile, secphone
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Sprint Galaxy Note II General by ThreadRank