Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,809,924 Members 45,080 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] Recover your IMEI in 9 steps.

Tip us?
 
vaskodogamagmail
Old
(Last edited by vaskodogamagmail; 17th September 2011 at 02:08 PM.) Reason: add more details
#1  
Junior Member - OP
Thanks Meter 217
Posts: 27
Join Date: Oct 2009
Location: Tehran
Lightbulb [GUIDE] Recover your IMEI in 9 steps.

If you did not make any backup of your EFS folder, and your IMEI is messed up, this could be your solution to recover your lost IMEI. NOTE THAT AT LEAST YOU MUST HAVE THE SHIPPED ORIGINAL EFS FOLDER ON YOUR PHONE ( even if you didn't make a backup of it yet and even it's messed up ) FOR THIS METHOD TO WORK

My history with my IMEI:

I flashed my phone with some ROMs, and I didn't backup my EFS folder before, then My SGS2 IMEI was changed to 004999010640000, and we know this is the fake IMEI that is assigned to the phone if the nv_data.bin file is messed up.
so I researched. searched all the forums and didn't find anything that could cure my phone's IMEI and set it to the original IMEI number. so I experimented and after some hours, I fixed my IMEI.
one thing that led me to the conclusion that " .nv_data " file is the thing that I need to fix the IMEI is that they share a very look alike name, and they have the same 2MB size.

PS: I restored my phone's firmware to it's original PDA, Phone and CSC, rooted it with CF-Root, and then done this procedures below

here is what I have done:

you must have:
-Root
-Root explorer for copying files to and from EFS folder
-Android SDK for the ADB tools or Terminal in your phone.


It is interesting to know that the IMEI is stored in ".nv_data" file in ORIGINAL SHIPPED EFS folder too, so you just have to do these:

1) make a copy of your EFS folder to your sdcard using root explorer and then make a backup of the folder to your computer [ to have another copy if you had to format sd card sometime ]

2) delete the EFS folder (BE SURE YOU HAVE BACKED IT UP IN A SAFE PLACE AS SAID IN STEP 1) from the root of your phone using root explorer.

3) reset the phone, after that, go to the root, and you can see that the EFS folder is still there, don't make any mistake, this EFS folder is new and generated by the android OS.

4) go to EFS folder using root explorer, and delete "nv_data.bin", "nv_data.bin.md5".

5) go to your backed up EFS folder on your sdcard, copy the "imei" folder to the EFS folder at the root of your phone, then again go to the backed up EFS folder at yout sdcard and copy the " .nv_data " file to your EFS folder at the root of your phone using root explorer, NOTE: the dot in first of nv_data is not a mistake, copy the ".nv_data" file.

6) make another copy of the ".nv_data" file in EFS folder in your phone, so you would have 2 copies of ".nv_data" in EFS folder

7) rename one of ".nv_data" files to "nv_data.bin" and another one to "nv_data.bin.bak"

8) at your PC open CMD at the ADB tool path, or run Terminal at your phone enter these commands:

adb shell ( use this command of you use ADB, if you're using terminal, skip this line )
su ( ALLOW THE MESSAGE CAME AT YOUR PHONE's DISPLAY BY SUPERUSER PROGRAM )
chown 1001:radio /efs/nv_data.bin

9) reset your phone.... after that you have your original IMEI. you can check your IMEI by dialing *#06#.


and DO IT ON YOUR OWN RISK.
and PLEASE MAKE A COPY OF THE ORIGINAL EFS FOLDER BEFORE DELETING IT. IT HAS IMPORTANT FILES IN IT.
and sorry for bad English.
The Following 209 Users Say Thank You to vaskodogamagmail For This Useful Post: [ Click to Expand ]
 
maddada
Old
#2  
maddada's Avatar
Senior Member
Thanks Meter 29
Posts: 108
Join Date: Aug 2011
Location: Dubai - United Arab Emirates
Thank you very much for taking the time to write this helpful thread, but can you please tell us how your IMEI was changed to a fake one in the first place so that we don't have to go through all this?
 
JJEgan
Old
#3  
Senior Member
Thanks Meter 4,420
Posts: 23,043
Join Date: Oct 2010
Quote:
Originally Posted by maddada View Post
Thank you very much for taking the time to write this helpful thread, but can you please tell us how your IMEI was changed to a fake one in the first place so that we don't have to go through all this?

Flashing a rom may often be the only reason .

jje
 
kcaz
Old
#4  
Member
Thanks Meter 20
Posts: 96
Join Date: Oct 2010
Had you already made a copy of your EFS folder before your IMEI was changed?
 
vaskodogamagmail
Old
#5  
Junior Member - OP
Thanks Meter 217
Posts: 27
Join Date: Oct 2009
Location: Tehran
Quote:
Originally Posted by kcaz View Post
Had you already made a copy of your EFS folder before your IMEI was changed?
No, I didn't had the back up before IMEI change.
To make a conclusion:
... You didn't backup your EFS folder.
... Your IMEI changed because of ROM flashings.
... You want to recover your IMEI.
The Following User Says Thank You to vaskodogamagmail For This Useful Post: [ Click to Expand ]
 
angelomaldito
Old
(Last edited by angelomaldito; 16th September 2011 at 06:37 PM.) Reason: Grammar
#6  
angelomaldito's Avatar
Senior Member
Thanks Meter 69
Posts: 299
Join Date: May 2011

 
DONATE TO ME
For the purpose of making a backup of the EFS folder, how about simply copying the whole folder into a safe place?

There is an app called Nitrality (if my spelling is not wrong) which one of its various functions is to backup and restore the EFS folder. I've made a backup using this method and it seems that what the app actually did was simply copying the whole folder into a different directory. If it's simple like that, it seems that Root Explorer or similar app would be enough for that purpose.

Nevertheless, as there are numerous guides on this topic, all of which providing more complex methods, either using ADB or Terminal Emulator (I've made a backup using it as well, just in case, which resulted in the EFS being saved as tarball file), I have some doubts whether simply copying the whole folder would be enough for a eventual restoration. Would it?
The Following User Says Thank You to angelomaldito For This Useful Post: [ Click to Expand ]
 
vaskodogamagmail
Old
#7  
Junior Member - OP
Thanks Meter 217
Posts: 27
Join Date: Oct 2009
Location: Tehran
Quote:
Originally Posted by angelomaldito View Post
For the purpose of making a backup of the EFS folder, how about simply copying the whole folder into a safe place?

There is an app called Nitrality (if my spelling is not wrong) which one of its various functions is to backup and restore the EFS folder. I've made a backup using this method and it seems that what the app actually did was simply to copy the whole folder into a different directory. If it's simple like that, it seems that Root Explorer or similar app would be enough for that purpose.

Nevertheless, as there are numerous guides on this topic, all of which providing more complex methods, either using ADB or Terminal Emulator (i've made a backup using it as well, just in case, which resulted in the EFS being saved as tarball file), I have some doubts wheter simply copying the whole folder would be enough for a eventual restoration. Would it?
Just copying your EFS folder to a safe place is enough, using any method, but copying EFS folder messes up wih its permissions, so if you want to restore your nv_data.bin file, you must set the owner of the nv_data.bin using "chown" command in ADB like described in my post.
After all, I hope this method works for everyone, worked for me though.
The Following 4 Users Say Thank You to vaskodogamagmail For This Useful Post: [ Click to Expand ]
 
superleeds27
Old
#8  
superleeds27's Avatar
Senior Member
Thanks Meter 592
Posts: 4,602
Join Date: Jun 2010
Location: Hull
Have copied the efs folder onto my PC.

At least i now know i have a backup, i can mess about with permissions there and then if it ever comes down to it!
Phone: Samsung S5 ROM: CM11 Kernel: KT-SGS5

Tablet: Asus Nexus 7 2013 ROM: AICP 4.4.4 Kernel: ElementalX 2.14
 
Schindler33
Old
(Last edited by Schindler33; 16th September 2011 at 06:41 PM.)
#9  
Senior Member
Thanks Meter 52
Posts: 217
Join Date: Oct 2010
I do not have the .nv_data file. onle *.bin or *.bak. Any suggestions or do I have to stick with the generic 00... IMEI? The whole procedure did not word for me, but thanks anyway.


By the way I think you do not need adb for that. You can execute the chmod command in a Terminal editor on the phone.
The Following 2 Users Say Thank You to Schindler33 For This Useful Post: [ Click to Expand ]
 
vaskodogamagmail
Old
(Last edited by xHausx; 8th September 2013 at 07:55 AM.)
#10  
Junior Member - OP
Thanks Meter 217
Posts: 27
Join Date: Oct 2009
Location: Tehran
Quote:
Originally Posted by Schindler33 View Post
I do not have the .nv_data file. onle *.bin or *.bak. Any suggestions or do I have to stick with the generic 00... IMEI? The whole procedure did not word for me, but thanks anyway.


By the way I think you do not need adb for that. You can execute the chmod command in a Terminal editor on the phone.
yes you can use terminal in your phone, but as for information for the other users, you don't need to enter " adb shell " command in step 8, because you are already connected to the phone's kernel.

I think you deleted your original EFS folder that came preinstalled with your phone, because I had " .nv_data " file.

anyway, use " nv_data.bin.bak " instead of " .nv_data " and see what happens.

thanks for the update.

---------- Post added at 07:55 PM ---------- Previous post was at 07:53 PM ----------

Quote:
Originally Posted by superleeds27 View Post
Have copied the efs folder onto my PC.

At least i now know i have a backup, i can mess about with permissions there and then if it ever comes down to it!
thank you for your reply. but please don't play with EFS folder too much. the Android OS can't recover your IMEI if you lost it completely. I've been lucky with this method to restore my IMEI.

thanks.

The Following 3 Users Say Thank You to vaskodogamagmail For This Useful Post: [ Click to Expand ]
Tags
efs, imei, recover
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes