Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,742,742 Members 37,513 Now Online
XDA Developers Android and Mobile Development Forum

[TUT] Secphone recompiling

Tip us?
 
gyrene2083
Old
#1  
gyrene2083's Avatar
Senior Member - OP
Thanks Meter 512
Posts: 274
Join Date: Apr 2007
Location: Bronx, NY

 
DONATE TO ME
Info 2 [TUT] Secphone recompiling

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:
Select 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:
Select 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:
Select 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:
Select 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:
Select 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:
Select 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...
-Semper Fi
gyrene2083

The Following 16 Users Say Thank You to gyrene2083 For This Useful Post: [ Click to Expand ]
 
VECTUS
Old
#2  
VECTUS's Avatar
Forum Moderator / Recognized Developer
Thanks Meter 6984
Posts: 3,145
Join Date: Mar 2010
Location: Kansas City, Mo.

 
DONATE TO ME
Very nice work here sir... I'm sure someone here has been needing this info!



CLICK TO FIND OUT WHAT XDA IS AND WHY I MODERATED THE WAY I DID

"You know what they say, "Human see, human do." - Julius



The Following 3 Users Say Thank You to VECTUS For This Useful Post: [ Click to Expand ]
 
cbucz24
Old
#3  
cbucz24's Avatar
Recognized Themer
Thanks Meter 2033
Posts: 2,198
Join Date: Jan 2011
Location: Central Florida

 
DONATE TO ME
Default 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
If I helped you in any way please click the THANKS! button below.
Even if you just want to click it for fun, go ahead, have fun.

The Following 2 Users Say Thank You to cbucz24 For This Useful Post: [ Click to Expand ]
 
sling
Old
#4  
sling's Avatar
Senior Member
Thanks Meter 931
Posts: 1,809
Join Date: Aug 2007
Location: Va Beach / Hatteras NC

 
DONATE TO ME
Thanks OP great info
T-Mobile Galaxy S5 G900T
ROOT: CF-Auto-Root (HERE)
RECOVERY: [klte][CWM Advanced Edition] PhilZ Touch (HERE)
ROM:BeansTown106 - G900TUVU1ANCH 4,4,2 STOCK DEODEX (HERE)
[SlingMods]
ATT Data Icons-v1 (HERE)
SMS/MMS Screen Wake Control-v1 (HERE)
The Following User Says Thank You to sling For This Useful Post: [ Click to Expand ]
 
Tw1sted247
Old
#5  
Tw1sted247's Avatar
Senior Member
Thanks Meter 821
Posts: 912
Join Date: Nov 2012
Location: 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!!
Sprint Samsung Galaxy Note 3
JellyBomb v3.2.0 / Strongsteve Odexed Blue 3.2 / ToXiC 1.0.2
Apex Launcher Pro / Nova Launcher
Kernel:by Freeza
Baseband: Mj4
TeamWinRecovery 2.6.3.7

Flash-a-holic


Retired Devices: Samsung a-920 ->Motorola Q ->Palm Pre ->HTC Evo4G -> Galaxy Note 2
The Following 2 Users Say Thank You to Tw1sted247 For This Useful Post: [ Click to Expand ]
 
gyrene2083
Old
#6  
gyrene2083's Avatar
Senior Member - OP
Thanks Meter 512
Posts: 274
Join Date: Apr 2007
Location: Bronx, NY

 
DONATE TO ME
I'm glad it helped you out.

Sent from my SPH-L900 using Tapatalk 2
-Semper Fi
gyrene2083

The Following 3 Users Say Thank You to gyrene2083 For This Useful Post: [ Click to Expand ]
 
jayare313
Old
#7  
jayare313's Avatar
Senior Member
Thanks Meter 115
Posts: 541
Join Date: Jun 2010
Location: 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
The Following User Says Thank You to jayare313 For This Useful Post: [ Click to Expand ]
 
gyrene2083
Old
#8  
gyrene2083's Avatar
Senior Member - OP
Thanks Meter 512
Posts: 274
Join Date: Apr 2007
Location: Bronx, NY

 
DONATE TO ME
I'm glad it can help...Good luck...
-Semper Fi
gyrene2083


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

Advanced Search
Display Modes