« May the Eid Happy Us All | Main | Ramadan is Upon Us. Need to Get Into Holy Mode. »
Saturday
Sep202008

Automatic 7 to 8 Digit Converter for the iPhone

With all the confusion that’s going on, I thought it best to get this done automagically.  This will ONLY work with Cydia!  AKA: This is for jailbroken iPhones version 2.0+

Update:  Just added the caller-id fix as well to the repository, so you can add that if you don’t see the contact name when someone calls you.

Disclaimer:  This will add +965 and the new digit to all Kuwaiti numbers that it sees.  This should be a safe process, but If your iPhone eats your numbers, I’m not responsible!  The whole process is detailed below.  To be really safe, go get Funambol from the app store and back up your numbers online.

Add this repository to Cydia: http://iphone.bojacob.net


Once that’s done, you’ll find a new section called Kuwait Number Conversion or something, I forgot what I called it.


You’ll find a package by name of 8digit there.  Install it, and it should convert all the numbers currently on your iPhone.



Grats!  You should be all converted now.  Keep in mind that some numbers are cached, so you may need an iPhone restart to see the changes, but usually it’ll work right off the bat.

Something bad happened?  Just remove the package and it should revert to a backup copy of your address book.  Do NOT hit Reinstall.


How it works (Geeks and brave people only.)

This basically runs a bunch of SQL queries on your address book file located in /var/mobile/Library/AddressBook/AddressBook.sqlitedb

These are the queries:

UPDATE ABMultiValue SET value = Replace(value, “+965”, “”);
UPDATE ABMultiValue SET value = “+9656” || value WHERE (substr(value,0,2) IN (“51”,”58”,”59”) OR value LIKE “6%” OR substr(value,0,3) IN (“700”, “701”, “703”, “704”, “705”, “706”, “707”, “708”, “709”, “770”, “771”, “772”, “773”, “774”, “775”, “776”, “778”, “779”, “501”, “502”, “505”, “506”, “507”, “508”, “509”));
UPDATE ABMultiValue SET value = “+9659” || value WHERE (value LIKE “9%” OR value LIKE “44%” OR substr(value,0,2) IN (“71”, “72”, “73”, “74”, “75”, “76”, “78”, “79”) OR substr(value,0,3) = “702”);
UPDATE ABMultiValue SET value = “+9652” || value WHERE (value LIKE “2%” OR value LIKE “3%” OR substr(value,0,2) IN (“41”, “42”, “43”, “45”, “46”, “47”, “48”, “49”, “52”, “53”, “54”, “56”) OR substr(value,0,3) IN (“500”, “503”, “504”, “551”, “552”, “553”, “571”, “551”, “552”, “553”, “571”, “572”, “573”, “574”, “575”, “576”, “577”));

UPDATE ABMultiValue SET value = “1” || value WHERE value LIKE “8%”;


Et voila!


PrintView Printer Friendly Version

Reader Comments (56)

I wish I had an iPhone to try it :)

September 20, 2008 | Unregistered CommenterBashar

How about the Caller ID ? it still doesn't read the changed numbers from the address book?

September 20, 2008 | Unregistered CommenterG-Funk

Bashar: One day my friend :)

G-Funk: I just finished that part up. It's another package in the repository now.

September 20, 2008 | Registered CommenterBojacob

What about international numbers?

September 20, 2008 | Unregistered CommenterN.

Bojacob :

Thanks for the quick responce, All are working well, Thanks again :-)

September 20, 2008 | Unregistered CommenterG-Funk

N: What about them? It won't modify anything that starts with + other than +965. However, it'll suck if you have 00965 'cause it won't do anything. 965xxxxxxx is disaster, it'll add a 9 to it. That format is just wrong though.

G-Funk: Glad it's working! :) If I knew this was actually getting attention, I'd have spent a bit more time polishing it heh.

September 20, 2008 | Registered CommenterBojacob

Thanks once again, It is really worth spending that time polishing it :-) .

As a gratitude, Follow the Link Below :

http://q8mug.com/prime/news/iphone-8-digit-address-book-caller-id-update/

September 20, 2008 | Unregistered CommenterG-Funk

Please help me..
I have the old iPhone, running 1.4..
how do I upgrade to 2.0 or 2.1
I heard that if I upgrade through itunes it will know that my iPhone is hacked and it will lock my phone...
help anyone..
Thanks

September 20, 2008 | Unregistered Commenterq8ty

how do i remove the package? all i can do is reinstall, and you said not to..

September 20, 2008 | Unregistered CommenterDan

q8ty: You'll have to do it through the PwnageTool. It wasn't that difficult honestly, but just needs some bravery and geekery.

Dan: On Cydia,

- Press Manage at the bottom
- Press Packages
- You'll find the 8digit package (mine was at the bottom.) Press that
- Press Modify
- Press Remove

That should remove the package for you and restore the backup.

September 20, 2008 | Registered CommenterBojacob

Okay apart from all that I went ahead and did the change via the Script I found on Q8i.org... but what I wanted to know is why does the iPhone3g not read the +965 or the numbers without it.. I think I am not making sense but let's say I want to dial 555-1234 okay? It's saved in my address book as +965 555-1234 so when I type it without the +965 it wont give me the person's name.. so what I did was go ahead and add two numberes one with the +965 and one without... because if I were to remove the +965 then I wont be able to sms or read the other person's name on sms messages and i'd have to go and browse who +965-555-1234 is... get it?

Any way around this?

September 20, 2008 | Unregistered CommenterJacqui

Jacqui yup, install the caller id package from the same repository

September 20, 2008 | Unregistered CommenterBojacob

Ta3jebniiii ya ba6al !!!

September 20, 2008 | Unregistered CommenterAhmad Al-Awadi

Hmmm then let me try it out rather than go and add a billion numbers to the same contact :(

September 21, 2008 | Unregistered CommenterJacqui

Ahmad Al-Awadi heh 3alek bil 3afya

Jacqui: Tell me if it works. I've only tested it on my iPhone and I still didn't get any confirmation from anyone who installed it yet. You'll have to restart the iPhone after installing though, and I'm not sure if the iPhone 3G is any different, but it should work.

September 21, 2008 | Registered CommenterBojacob

very snazzy indeed. Kudos.

September 21, 2008 | Unregistered CommenterKTDP

nice job, does it work on anything below v2.0 though ?

September 21, 2008 | Unregistered CommenterSpartX

KTPD: Thanks!

SpartX: Well anything under 2.0 will use Installer, and I didn't really check how those repositories worked, nor am I able to test it out. I'll see if I can cook one up later today, but no promises. By the way, credit or a link to the blog would be nice on your forum post :)

September 21, 2008 | Registered CommenterBojacob

sorry, i wrote something else. i want to uninstall cydia, not just the 8 digit number package.

September 21, 2008 | Unregistered CommenterDan

so it wont work for 1.1.4 ?

September 21, 2008 | Unregistered Commenterjoud

so no solution for 00965 ?
Most of my 800+ contacts are saved like that. :(

September 21, 2008 | Unregistered CommenterMadi

bojacob my friend, would you be kind enough to update us on the status of your 1.1.4 trial ? :) will be more than happy to give credit back here.
Cheers
K

September 22, 2008 | Unregistered CommenterKaushik

Great news!
I will try it tonight.
You know, reading the readers' comments here, I realise it is NOT just me who has had two numbers for everyone (one with a +965 and one without) so I get caller ID for phone and SMS. I thought it was just me doing something wrong when inputting numbers in my iPhone. Nice to know I am not alone! I shall also try the app from Cydia for caller IDs.
Thanks for your hard work; nice to know that even in Kuwait, we CAN get some information.
BTW, Fring say that they are working on a package for iphone that will allow Skype, Gizmo, Aim etc to be used on the iphone. At the moment it doesn't work on iPhone 2.0 upwards. Of course, it does work on your Nokia already.
I love my iPhone, but honestly, why does Apple want to control everything we put on it? I mean, we would not stand this "Big Brother" stuff on our Macs would we? Imagine being told what applications we could download to our Macs? No way!
Oh, and don't you love Kuwait authorities who are blocking websites like Fring and Skype? Cashed-up Kuwaitis might not mind paying through the nose for international calls, but the rest of us sure do. This is a democracy? LOL.

September 22, 2008 | Unregistered CommenterSalmiya Ross

I'm working on the 1.1.x version right now, and hoping I'll be done with it tonight :)

September 22, 2008 | Registered CommenterBojacob

All right, the repository is at http://iphone.bojacob.net/installer/index.xml
but I have NO idea if it'll work since I can't test it. If someone is willing to help me test, send me a message up the page on Meebo.

September 22, 2008 | Unregistered CommenterBojacob

I did follow these steps on my iphone 3G unlocked with rebel SIM its still shows number not the contact name it is saved it has any1 tried on iphone 3G with rebel sim?

September 23, 2008 | Unregistered Commenterjoel

Joel: Did you restart the phone after installing the fix?

September 23, 2008 | Registered CommenterBojacob

yes we did try to restart the phone (joel and i) but we still had the same problem. we also tested with both 8 digit (mobile) and 7 digit (landline) incoming numbers and no luck.

we're guessing it may have to do with the rebel SIM unlock device. otherwise maybe a full backup and restore is in order but not sure that will fix it either.

September 23, 2008 | Unregistered Commenterhamad

Tried with other 3G unlocked with rebel SIM the results are same. I tried on 2G it works fine

September 23, 2008 | Unregistered CommenterJoel

hamand & Joel: I'm guessing the directory structure or file location might be different on the 3G. I don't really have any way of finding out or testing :/

September 23, 2008 | Registered CommenterBojacob

thanks bojacob. we will just continue fiddling with it until he does find a solution i guess.

one question that would be of interest is: what files does the 'caller id' fix add and/or replace on the iphone? this would give us more of an idea what to look for.

thanks again.

September 23, 2008 | Unregistered Commenterhamad

u didnt tell me, how do we uninstall cydia? :P

September 23, 2008 | Unregistered CommenterDan

bojacob: no answer to the question on files changed by your caller id fix app that i asked above?

September 24, 2008 | Unregistered Commenterhamad

Sorry guys! Busy days :(

Dan: I'm not sure why you'd want to uninstall Cydia? Nor am I sure it's even possible. It just comes with the 2.x jailbreak.

Hamad: Basically what it does is copy an edited PhoneNumberTemplate.plist to /System/Library/PrivateFrameworks/AppSupport.framework/

If you want, you can do it yourself through SSH. copy to /System/Library/PrivateFrameworks/AppSupport.framework/ or wherever the iPhone 3G stores that file. It has to exist somewhere :p

September 24, 2008 | Registered CommenterBojacob

hey :) thnx for the fix, it works fine on my 2.0.2, but my mom's is on 1.1.4 and it's not working with the other link that u gave before, it shows "Package download failed!", can u please do something? my mom is driving me crazy! :( i can't update her phone cuz the new ones don't support arabic/arabtaller

September 26, 2008 | Unregistered CommenterNino

ur lucky ur service providers helps u with converting ur numbers. laman 3man added 9 to the beginning of every mobile phone number, i had to do number by number manually. it took forever

September 28, 2008 | Unregistered Commenter3anooda

3anooda - that's because we have a parliament that will withdraw the mobile license from the provider if they dont :) actually that's highly unlikely. they probably dont want to give people a reason to switch to any of the other two providers.

September 28, 2008 | Unregistered Commenterhamad

bojacob - where is your edited PhoneNumberTemplates.plist file? cydia is crashing on me and your 'installer' repository only includes the number converter.

September 28, 2008 | Unregistered Commenterhamad

Nino: I really can't test it or do anything about it :( I've only got one iPhone with the 2.1 firmware, so I can't test it on older firmware.

3anooda: Well it's not like it worked pretty well anyway :p

Hamad: ehh, squarespace has this strange way of linking files. It's here http://www.bojacob.net/storage/iphone/PhoneNumberTemplates.plist

September 28, 2008 | Registered CommenterBojacob

thank God i have a K850i :) ..

September 29, 2008 | Unregistered Commenterelberk

Bojacob: LOOL sa7 ashoof elshabab hnak 6ay7een feeny as'ela .. 3abalhom ana fa67al, wana mo msawe shay :-)
anywayz, sorry about forgetting to mention or link your site, and I thank you so much for being nice about it. it will not happen again I swear.

Just wanted to thanks you again man ;-)

October 1, 2008 | Unregistered CommenterSpartX

you rock!!!!

October 3, 2008 | Unregistered CommenterYousef

can you please tell me what will happen if I reinstall this package ?

October 3, 2008 | Unregistered CommenterBo Talal

elberk: How very unfortunate for you :p

SpartX: No problem. It just motivates me to make more iPhone apps in the future.

Yousef Why thank you! Seeing I've been playing Rock Band a lot lately, I think it's fitting!

Bo Talal: Well, in my laziness, my pre-installation script makes a backup copy of your phone database. If you reinstall, it'll overwrite that backup copy with the modified copy. I could have avoided it pretty easily just by checking if a file exists, but was too lazy. Now that I look back, I should have just made the check :/

Anyway, it's nothing serious.

October 3, 2008 | Registered CommenterBojacob

@Nino If your mom's phone has 1.1.4 and you don't want to upgrade hers to 2, you could go about it the hard way. First sync all her contacs through iTunes and export it to a csv file or something. Then import the contacts, again through iTunes to your 2.0 firmware jailbroken iPhone. Apply bojacob's magical patch and repeat the similar process for storing it back from your phone to hers. I should caution you though, if there are some numbers in your address book, which you would rather not have anyone else look, don't synch them :). I had a 1.1.4 firmware phone. But the ridiculous number change forced me to convert to 2.0.2 just so that i could apply bojacob's patch. You can read about my ordeal here.

@bojacob on a slightly different note, do you know of any plist file editors for windows? Renaming .plist file to a .txt file and opening just doesn't seem to work. And no i am not blessed with a mac :( .

October 7, 2008 | Unregistered CommenterKaushik

Kaushik: plist files on the iPhone come in binary form. You'll need Erica's Utilities (I think?) The command itself is plutil.

example:
# plutil -c xml1 PhoneNumberTemplates.plist

Once you're done with it, you can convert it back to binary.

# plutil -c binary1 PhoneNumberTemplates.plist

Great post by the way :p pretty adventurous!

October 7, 2008 | Registered CommenterBojacob

thanx Kaushik :) i'll try to do that and let u know

October 12, 2008 | Unregistered CommenterNino

Jacob

I just got an officially unlocked iPhone 3G from Italy (yes they sell it unlocked over there officially) and im going thru the same mess with the caller id situation. All my numbers have a +965 but they dont come up in the caller id.. Any suggestions on what can be done?

Thanks

October 13, 2008 | Unregistered CommenterMacCrazy

dear mr. ,
i already add the digit 9 and 6 but i need app to add the +965 and to for land lines and 1 for commercial lines coz when i use your app they come 9 digits bcoz i already add 9 and 6 for my contacts and i left the rest ( 1 for comercial lines and 2 for land lines) plus i need foe +965 bcoz i use i phone so when msg coming to me it come no name but i'm alredy sae it bcoz no +965 . plz i'm waiting for your help

October 19, 2008 | Unregistered Commenterjoseph

allah ya36eek al 3afyah enshallah

bas ba`3eet astafser etha alhal 6areeqah tenfa3 7ag 2.2 3aashan ba`3eet aswee add lel sourse fel Cidya bas ma ye9eer !!

enshallah etha fe 7al 7ag 2.2 mawjood tebale`3naa o ma ga9aret ya6eek al 3afyah

ana a3teqed bas aly ne7tajah +965 3alashan taqreeban al arqam kelaha 9arat 8 digits

thanks again :)

December 27, 2008 | Unregistered CommenterMohsen

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>