IMEI=0 - how to enter working IMEI?

Search This thread

RogerG

Senior Member
Jul 7, 2007
107
34
Hi everyone & thanks for reading this!

I bought 2 new, unused Nexus 5 as presents for my sisters for Christmas (not via playstore, but via a reseller. Still: new, sealed, unused.)
I unlocked, installed a custom recovery, rooted both devices without problems, then set up one in a smartphone-newbie-friendly way, which took quite some time. Then, to save me some time, I fear I made quite a big mistake: I made a nandroid-backup of the newly-setup device and restored/installed it on the second nexus (so I wouldn't have to change all the settings again, install apps, etc).
Unfortunately, this seems to have erased the IMEI on the second device (it shows as IMEI=0), so I can't connect to any cell service. Some googling leads me to believe that this might be due to a corrupt/missing EFS-folder, which, second mistake, I did NOT make a backup of beforehand. I know, it's my own fault - my thinking was: why backup, there's nothing backupworthy on the device *yet*.

FML. :crying:

I am not sure if the phone is still in warranty (and even if it was - I guess I voided that by unlocking/rooting?!). I want to re-iterate that I own both devices LEGALLY, I have the bill, I have the original sticker with the original IMEI - I just need a way to re-enter it. Any dialer-code for that? Any modify-able EFS-backups? Any other way?

Thanks in advance!

PS: tried so far & found useless: other simcard (not working) & simcard in other phone (working), so it's a device-issue; factory-reset;
 

RogerG

Senior Member
Jul 7, 2007
107
34
Try fastboot flashing the cache.img from the factory image.

thanks for the super-quick reply jd1639!

to make sure I understand you correctly:
I can use the factory image from
https://dl.google.com/dl/android/aosp/hammerhead-kot49h-factory-02006b99.tgz
(nexus 5, android 4.4.2), extract the cache.img from there & flash that via fastboot? (or would it have to be a factory image of this very device - which I do not have, unfortunately)

and, just for my understanding: how does that restore the imei? I mean, the factory image itself (or it's cache) can't really contain MY imei. does this just delete the invalid imei & force the phone to get it's original imei from some other, not yet overwritten source? e.g. hardware?
 

danarama

Senior Member
Aug 22, 2010
31,277
18,811
Oxenhope, West Yorkshire, UK
Yes fastboot flash the cache.img from the factory image is a known fix for this issue. Something has corrupt your cache causing the imei to not display properly

Sent from my Nexus 5 using Tapatalk
 
  • Like
Reactions: RogerG

RogerG

Senior Member
Jul 7, 2007
107
34
Thank you for clarifying, rootSU - that gives me hope.
I will try tomorrow & hopefully report success :)
 

RogerG

Senior Member
Jul 7, 2007
107
34
Just tried this (twice) - unfortunately no success, IMEI is still 0 :(

downloaded factory image, verified md5, extracted cache.img, flashed in fastboot; every step successful - final result is still IMEI=0. Tried again, this time erasing cache beforehand for good measure - still IMEI 0.

What else can I try?

PS: this seems to be the only issue - no hw-problems or similar. directly after boot, the device seems to connect to a mobile network for a second, then gets kicked out (due to missing/invalid IMEI, I suppose).
 

charesa39

Senior Member
Aug 19, 2013
689
200
Orange County, CA
Just tried this (twice) - unfortunately no success, IMEI is still 0 :(

downloaded factory image, verified md5, extracted cache.img, flashed in fastboot; every step successful - final result is still IMEI=0. Tried again, this time erasing cache beforehand for good measure - still IMEI 0.

What else can I try?

PS: this seems to be the only issue - no hw-problems or similar. directly after boot, the device seems to connect to a mobile network for a second, then gets kicked out (due to missing/invalid IMEI, I suppose).

Did you use TWRP for the original nandroid backup that you restored on the new one? If so, you may have backed up, and consequently flashed the EFS from the original N5 to the new one. If so, I hate to say this, but I don't think there's any hope of getting the IMEI back on the new one...
 
  • Like
Reactions: RogerG

CellPhish

Senior Member
Feb 5, 2011
127
38
Just tried this (twice) - unfortunately no success, IMEI is still 0 :(

downloaded factory image, verified md5, extracted cache.img, flashed in fastboot; every step successful - final result is still IMEI=0. Tried again, this time erasing cache beforehand for good measure - still IMEI 0.

What else can I try?

PS: this seems to be the only issue - no hw-problems or similar. directly after boot, the device seems to connect to a mobile network for a second, then gets kicked out (due to missing/invalid IMEI, I suppose).

I had a problem with my phone IMEI (Nexus 4) before. It would say unknown. The reason why was I flashed a bad radio and boot loader version. So what I did was find a thread on the N4 section for the right radio and bootloader. I'm not exactly sure if this will work on your part, but I don't think it'll hurt to try. Oh and maybe reflash the factory image.

Sent from a potato

---------- Post added at 12:47 AM ---------- Previous post was at 12:44 AM ----------

Sorry for double post. Check this link out and go to the second post talking about IMEI. Idk if this will help you out. Good luck
http://xdaforums.com/showthread.php?t=2510966



Sent from a potato
 
  • Like
Reactions: atkhan and RogerG

RogerG

Senior Member
Jul 7, 2007
107
34
Did you use TWRP for the original nandroid backup that you restored on the new one? If so, you may have backed up, and consequently flashed the EFS from the original N5 to the new one. If so, I hate to say this, but I don't think there's any hope of getting the IMEI back on the new one...
yes, that's precisely what I did. :(
That's why I had little hope of restoring the original IMEI and was instead asking in my original post for a way to enter it anew (since I KNOW what it should be).
 

RogerG

Senior Member
Jul 7, 2007
107
34
I had a problem with my phone IMEI (Nexus 4) before. It would say unknown. The reason why was I flashed a bad radio and boot loader version. So what I did was find a thread on the N4 section for the right radio and bootloader. I'm not exactly sure if this will work on your part, but I don't think it'll hurt to try. Oh and maybe reflash the factory image.

Sent from a potato

---------- Post added at 12:47 AM ---------- Previous post was at 12:44 AM ----------

Sorry for double post. Check this link out and go to the second post talking about IMEI. Idk if this will help you out. Good luck
http://xdaforums.com/showthread.php?t=2510966



Sent from a potato
thanks I will try this (even though I think my problem is not related to radio/bootloader and I am generally skeptical about my chances of "restoring" IMEI, as opposed to "manually entering/modifying it"). Still, willing to try anything, thanks for the idea!
 
  • Like
Reactions: atkhan

CellPhish

Senior Member
Feb 5, 2011
127
38
thanks I will try this (even though I think my problem is not related to radio/bootloader and I am generally skeptical about my chances of "restoring" IMEI, as opposed to "manually entering/modifying it"). Still, willing to try anything, thanks for the idea!

If all fails you can try to contact LG service and tell them your situation. Though its not good to lie, just tell them you got the IMEI=0 problem, they'll say its a hardware problem and will replace the motherboard(if your device is on warranty)

Sent from a potato
 

jd1639

Inactive Recognized Contributor
Sep 21, 2012
16,833
5,404
Minnesota
You'll probably have a hard time here finding anyone to help you manually entering or modifying the imei.
 

BirchBarlow

Senior Member
Oct 6, 2013
428
155
Philadelphia
Yes fastboot flash the cache.img from the factory image is a known fix for this issue. Something has corrupt your cache causing the imei to not display properly

Sent from my Nexus 5 using Tapatalk

The IMEI is stored in the EFS partition, not the cache partition.

yes, that's precisely what I did. :(
That's why I had little hope of restoring the original IMEI and was instead asking in my original post for a way to enter it anew (since I KNOW what it should be).

Sounds like you turned the phone into a $400 paperweight. TWRP backs up and restores the EFS partition by default, and each device has a unique EFS partition, which contains the IMEI among other things. I don't know of a way of manually restoring the EFS data. This is unfortunately a $400 lesson for people who tinker without first doing their homework.
 
  • Like
Reactions: TheonlyTazz

Jsparta26

Senior Member
Aug 30, 2012
1,489
623
Detroit, MI
Hey guy. Let's not be so judgemental. There's always a risk of the imei being corrupted when you flash a ROM. As a matter of fact just before I even unlocked my nexus the imei got corrupted and I had to factory flash my phone to save it. Its scary but op, if you manage to get your phone working again make a backup and store it on your PC and or email yourself the backup. :)
 

danarama

Senior Member
Aug 22, 2010
31,277
18,811
Oxenhope, West Yorkshire, UK
The IMEI is stored in the EFS partition, not the cache partition.

Ha ha thanks! Can't believe you think I don't know that :/

Actually the "EFS partition" is 2 partitions..

/dev/block/platform/msm_sdcc.1/by-name/modemst1

And...

/dev/block/platform/msm_sdcc.1/by-name/modemst2


That doesn't change the fact that reflashing the cache.img is a known fix for missing IMEI. Corrupt cache can make the imei appear as 0 even when the EFS imei is in tact so reflashing the cache.img can resolve this.

Unfortunately though, I didn't read the OP fully. I just elaborated on an earlier response for the OP


You'll probably have a hard time here finding anyone to help you manually entering or modifying the imei.

Modification is illegal however many mobile repair shops have equipment that can rewrite the existing imei and are legally allowed to. In the UK, this costs about £20. That said, i'm not aware of anyone having it done on the nexus 5. The galaxy s3 with a single /EFS partition could be done easily by a professional


Sent from my Nexus 5 using Tapatalk
 

zelendel

Senior Member
Aug 11, 2008
23,360
20,608
OnePlus 6T
OnePlus 9
Modification is illegal however many mobile repair shops have equipment that can rewrite the existing imei and are legally allowed to. In the UK, this costs about £20. That said, i'm not aware of anyone having it done on the nexus 5. The galaxy s3 with a single /EFS partition could be done easily by a professional


Sent from my Nexus 5 using Tapatalk

Yes but all talks about how to change it in any way are not allowed here. Legally the only people that are allowed to do so is the OEM. You can look at international news reports of cellular dealers that are doing so are being closed down and arrested.

That is why it is well know to back up the efs before you do anything.

Bat cave One
 

atkhan

New member
Jan 20, 2015
1
0
My newly bought Nexus 5 shows IMEI 0 also

thanks I will try this (even though I think my problem is not related to radio/bootloader and I am generally skeptical about my chances of "restoring" IMEI, as opposed to "manually entering/modifying it"). Still, willing to try anything, thanks for the idea!

i just update my newly bought nexus 5 from initial 4.4.2 to 4.4.4 which is appear at update section but then my IMEI appear =0 .. dont understand what to do..
if your problem solved, pls tell me the detail procedure to recover my IMEI no.
 
Mar 16, 2009
24
0
RogerG, did you ever get this working? I'm on 6.0 and having the same problem, flashing cache.img also does nothing.

Thanks.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Just tried this (twice) - unfortunately no success, IMEI is still 0 :(

    downloaded factory image, verified md5, extracted cache.img, flashed in fastboot; every step successful - final result is still IMEI=0. Tried again, this time erasing cache beforehand for good measure - still IMEI 0.

    What else can I try?

    PS: this seems to be the only issue - no hw-problems or similar. directly after boot, the device seems to connect to a mobile network for a second, then gets kicked out (due to missing/invalid IMEI, I suppose).

    I had a problem with my phone IMEI (Nexus 4) before. It would say unknown. The reason why was I flashed a bad radio and boot loader version. So what I did was find a thread on the N4 section for the right radio and bootloader. I'm not exactly sure if this will work on your part, but I don't think it'll hurt to try. Oh and maybe reflash the factory image.

    Sent from a potato

    ---------- Post added at 12:47 AM ---------- Previous post was at 12:44 AM ----------

    Sorry for double post. Check this link out and go to the second post talking about IMEI. Idk if this will help you out. Good luck
    http://xdaforums.com/showthread.php?t=2510966



    Sent from a potato
    1
    Try fastboot flashing the cache.img from the factory image.
    1
    Yes fastboot flash the cache.img from the factory image is a known fix for this issue. Something has corrupt your cache causing the imei to not display properly

    Sent from my Nexus 5 using Tapatalk
    1
    Just tried this (twice) - unfortunately no success, IMEI is still 0 :(

    downloaded factory image, verified md5, extracted cache.img, flashed in fastboot; every step successful - final result is still IMEI=0. Tried again, this time erasing cache beforehand for good measure - still IMEI 0.

    What else can I try?

    PS: this seems to be the only issue - no hw-problems or similar. directly after boot, the device seems to connect to a mobile network for a second, then gets kicked out (due to missing/invalid IMEI, I suppose).

    Did you use TWRP for the original nandroid backup that you restored on the new one? If so, you may have backed up, and consequently flashed the EFS from the original N5 to the new one. If so, I hate to say this, but I don't think there's any hope of getting the IMEI back on the new one...
    1
    I had a problem with my phone IMEI (Nexus 4) before. It would say unknown. The reason why was I flashed a bad radio and boot loader version. So what I did was find a thread on the N4 section for the right radio and bootloader. I'm not exactly sure if this will work on your part, but I don't think it'll hurt to try. Oh and maybe reflash the factory image.

    Sent from a potato

    ---------- Post added at 12:47 AM ---------- Previous post was at 12:44 AM ----------

    Sorry for double post. Check this link out and go to the second post talking about IMEI. Idk if this will help you out. Good luck
    http://xdaforums.com/showthread.php?t=2510966



    Sent from a potato
    thanks I will try this (even though I think my problem is not related to radio/bootloader and I am generally skeptical about my chances of "restoring" IMEI, as opposed to "manually entering/modifying it"). Still, willing to try anything, thanks for the idea!