WARNING!
I AM NOT RESPONSIBLE IF YOU BRICK YOUR PHONE!
I've decided to create this little tutorial thread to show how can you backup some important device specific data like IMEI, WiFi/BT mac address, modem (RIL) specific data and configuration files.
If the baseband version or IMEI number gets damaged you will face with some serious network issues like dropping the network signal, no 3G, no mobile data, no roaming - so the phone is basically useless.
Special thanks to:
@fluffi444 for his help to indentify the the correct partitions: [HOW-TO] Recover FULL GT-I8160P if flashed to GT-I8160 (non-P)
@Shaaan for Temporary CWM Recovery: [JB] CWM Recovery 6
REQUIREMENTS:
Rooted phone
ADB tool for do this on PC or Terminal Emulator from Google Play
CWM recovery - only if you want to use the .zips
BEFORE STARTING
Before starting the backup/restore process flash back to your Official Stock Firmware!
IMEI null/null, Unknown Baseband and other issues not always caused by corrupted NV Data!
To get root permission you have to enter "su" command for every terminal/adb shell session!
There are 3 dd commands for every partition, first is for GB (2.3.6) second is for JB (4.1.2) and the third is for recovery mode - the only difference is that External SDCard is mounted to different location.
If you used vold.fstab mod to swap internal/external storage check the correct path and use it to External SDCard (possibly /sdcard)
BE AWARE! To restore broken IMEI/Serial number you must have backups from ALL 3 partitions and you must restore all of them!
Create nv_backup folder manually on your external SD-card or use this command from ADB shell / terminal:
GB/JB:
Code:
mkdir /sdcard/external_sd/nv_backup
mkdir /storage/extSdCard/nv_backup
From Recovery (if says device busy, sdcard is already mounted):
Code:
mount -t vfat -o rw /dev/block/mmcblk1p1 /sdcard
mkdir /sdcard/nv_backup
EFS partition
This partition contains: product code, BT/WiFi mac address, RIL calibration files, DRM info and some other data like language, timezone set by your provider.
NOTE: Our phone (and I guess all phones with NovaThor SoC) doesn't store IMEI and SimLock information on EFS partition (no nv_data.bin).
Create a backup from EFS partition:
In ADB/Terminal emulator enter this:
Code:
dd if=/dev/block/mmcblk0p7 of=/sdcard/external_sd/nv_backup/efs.bin
dd if=/dev/block/mmcblk0p7 of=/storage/extSdCard/nv_backup/efs.bin
dd if=/dev/block/mmcblk0p7 of=/sdcard/nv_backup/efs.bin
Restoring EFS partition:
Code:
dd if=/sdcard/external_sd/nv_backup/efs.bin of=/dev/block/mmcblk0p7
dd if=/storage/extSdCard/nv_backup/efs.bin of=/dev/block/mmcblk0p7
dd if=/sdcard/nv_backup/efs.bin of=/dev/block/mmcblk0p7
NOTES:
On i8160 EFS partition is the 7th partition
efs.bin will be exactly a 10 MB file which contains every information and files from the EFS partition
ModemFS partition:
If you got unknown baseband or XXXX as baseband (modem/phone version) you probably have problems with this one...
This partition contains: RIL calibaration files the same from /efs, and other configuration files created by the RIL.
Also the STE modem for "everyday" operations uses this partition instead of efs and cspsa, therefore the chance to loose your imei is much lower compared to other Samsung phones (because there is always a working backup from the files on efs and cspsa).
Create a backup from ModemFS partition:
In ADB/Terminal emulator enter this:
Code:
dd if=/dev/block/mmcblk0p2 of=/sdcard/external_sd/nv_backup/modemfs.bin
dd if=/dev/block/mmcblk0p2 of=/storage/extSdCard/nv_backup/modemfs.bin
dd if=/dev/block/mmcblk0p2 of=/sdcard/nv_backup/modemfs.bin
Restoring ModemFS partition:
Code:
dd if=/sdcard/external_sd/nv_backup/modemfs.bin of=/dev/block/mmcblk0p2
dd if=/sdcard/storage/extSdCard/nv_backup/modemfs.bin of=/dev/block/mmcblk0p2
dd if=/sdcard/nv_backup/modemfs.bin of=/dev/block/mmcblk0p2
NOTES:
On i8160 ModemFS partition is the 2nd partition
modemfs.bin will be exactly a 16 MB file which contains every information and files from the MODEMFS partition
CSPSA partition:
This partition contains: RIL calibaration files, IMEI, SimLock data, serial number.
Also on every system start there is a synchronization between CSPSA and Modemfs.
Create a backup from CSPSA partition:
In ADB/Terminal emulator enter this:
Code:
dd if=/dev/block/mmcblk0p6 of=/sdcard/external_sd/nv_backup/cspsa.bin
dd if=/dev/block/mmcblk0p6 of=/storage/extSdCard/nv_backup/cspsa.bin
dd if=/dev/block/mmcblk0p6 of=/sdcard/nv_backup/cspsa.bin
Restoring CSPSA partition:
Code:
dd if=/sdcard/external_sd/nv_backup/cspsa.bin of=/dev/block/mmcblk0p6
dd if=/sdcard/storage/extSdCard/nv_backup/cspsa.bin of=/dev/block/mmcblk0p6
dd if=/sdcard/nv_backup/cspsa.bin of=/dev/block/mmcblk0p6
NOTES:
On i8160 CSPSA partition is the 6th partition
cspsa.bin will be exactly a 1.5 MB file which contains every information from the CSPSA partition
PHONE/BASEBAND "UNKNOWN":
You flashed a wrong modem.img.md5, f.e. you can't flash i8160P/L modem on i8160.
Create a tar from phone part (modem.img.md5) extracted from roms built for your model (i8160/L/P) and flash just the phone.tar with odin.
Or write modem.bin.md5 (not the tar!) directly to modem/phone partition using terminal/adb (requires rooted phone):
If doesn't solves the problem flash a rom made for your model!
Code:
su
dd if=/sdcard/external_sd/modem.bin.md5 of=/dev/block/mmcbk0p13
or
dd if=/storage/extSdCard/modem.bin.md5 of=/dev/block/mmcbk0p13
reboot
If you are using a custom rom copy your original /system/lib/tee folder to the custom roms /system/lib/tee folder!
Automated ZIPs for CWM RECOVERY
only tested with JB and Temp. CWM
extract nv_backup_restore.rar to you sdcard, including the empty nv_backup folder and the 2 zips.
nv_backup.zip/nv_restore.zip will backup/restore all (EFS/MODEMFS/CSPSA) partitions from External SD Card/nv_backup folder.
NOTES:
I highly recommend to do backup/restore from recovery with update.zips or using ADB, it's much safer when the phone is not completly booted.
This method will not give you/change your imei, only creates a backup from the original and restores from an already created (and working) partition image!
There is no sollution to SimUnlock the phone, but the simlock data is on CSPSA_FS.
Sometimes IMEI will stays null/null or shows nothing, flash a JB firmware again might solve the issue.
After a complete JB flash there will be a log file in /efs/pre_recovery.log - the phone writes it when checks and restores IMEI.
The CSPSA and MODEMFS backup must be created from the same state, f.e: a cspsa backup from GB and a MODEMFS backup from JB (or possible even from different GB build) will NOT work!
If your phone's RIL needs to be replaced with a new one old backups will NOT work, you have to create new backups for the new STE MODEM, that could caused by the encryption algorithm.
Nice tutorial, it exactly the problem that I am facing with I8160L version of this ace 2
Please explain if its method could be applied in my case:
I have a I8160L version from brazil, i tried to install custom ROMs fro Kyrillos and Messi, but after update always occurs the same problem that u described. I would like to know if I can apply this method to replace the files and get back my IMEI with european ROMs or, in my case, is a different problem.
Thanks in advance.
I don't think you can bring back your imei now, because it's stored on unknown location.
If you still have that rom which caused the error then flash back to a stock i8160L rom (I think you flashed a wrong modemfs.img.md5 with rom).
Or if you are on a stock L rom and still don't have imei, then dial *#197328640# choose COMMON -> NVREBUILD and after reboot check your imei again.
If doesn't help send the phone back to Samsung and they will fix it.
luigisvc said:
Nice tutorial, it exactly the problem that I am facing with I8160L version of this ace 2
Please explain if its method could be applied in my case:
I have a I8160L version from brazil, i tried to install custom ROMs fro Kyrillos and Messi, but after update always occurs the same problem that u described. I would like to know if I can apply this method to replace the files and get back my IMEI with european ROMs or, in my case, is a different problem.
Thanks in advance.
Click to expand...
Click to collapse
I will post back soon, my phone is also an I8160L. I will attempt to upgrade to KryillosV5 then post back. Wish me luck =3
Read the "How to install (v5)" section carefully he described how to install if you have different i8160.
I think you flashed the european i8160 modem to your i8160l, flashing back to a stock i8160l rom will solve the issue.
Szaby59 said:
I don't think you can bring back your imei now, because it's stored on unknown location.
If you still have that rom which caused the error then flash back to a stock i8160L rom (I think you flashed a wrong modemfs.img.md5 with rom).
Or if you are on a stock L rom and still don't have imei, then dial *#197328640# choose COMMON -> NVREBUILD and after reboot check your imei again.
If doesn't help send the phone back to Samsung and they will fix it.
Click to expand...
Click to collapse
I reflashed stock rom and my phone is working now, but i never tried to install custom ROM again, because I was affraid of permanent damage.
I tried JB, but I can´t go further because o PIT file missing for no european phones.
But now I have a hope to install others ROM and replace the files that u mentioned.
I think you will need to replace the kernel.img.md5 too and that could be a problem because some custom roms have their own custom kernel and there is a good chance it will not work with stock kernels.
No luck. In *#1234# I get PHONE: Unknown. Baseband in About is also unknown. Maybe modem as well? Could you write how to do that too?
Re: [HOW-TO] Repair Baseband (XXXX/unknown) and backup some device specific data
You cant use eu roms on i8160l, try fashing l kernel and modem only or a full stock rom.
Sent from my GT-I8160 using xda app-developers app
In fact I´m using HD custom kernel, it is the only custom file that worked. Only ROM´s get in problems.
I have I8160L too.
I try to flash custom rom such as [ROM][GB-XXLL2] KYRILLOSv5 **Fast n' Lite**.
After flash this rom ... my phone can't detect sim card and lost imei.
then I found this post ...
I try 1.creating&restoring backup from EFS partition
2.create&restoring backup from MODEMFS partition
3.write modem.bin.md5 (not the tar) directly to modem/phone partition using terminal (I extract from I8160L Stock Rom)
but my phone can't detect sim card and lost imei.
I've tried everything I know but fail.
I want you guys some help. I want to use custom rom or I should sell my I8160L phone.
Thank you everyone
(sorry for my english)
theresth said:
I have I8160L too.
...
Click to expand...
Click to collapse
How do flashed an img.md5 with odin ? First you have to make a tar.
Flash back a full L rom to see if it solves the problem.
Szaby59 said:
How do flashed an img.md5 with odin ? First you have to make a tar.
Flash back a full L rom to see if it solves the problem.
Click to expand...
Click to collapse
Sorry ----> 3.write modem.bin.md5 (not the tar) directly to modem/phone partition using terminal (I extract from I8160L Stock Rom)
I can flash back to I8160L Rom and it solves the problem.
But I don't want use stock I8160L rom then I try to flash with I8160 Customrom but fail.
I don't know how to flash my I8160L with custom rom of I8160
please help me please
That's doesn't belong to this topic.
There could be several modifications (kernel, build prop, drivers) why doesn't work with different model, ask on the custom roms own topic.
Szaby59 said:
That's doesn't belong to this topic.
There could be several modifications (kernel, build prop, drivers) why doesn't work with different model, ask on the custom roms own topic.
Click to expand...
Click to collapse
But I doubt why I9300T can use custom rom of I9300.
Here's what I did! ( kyrillos v5 didn't detect sim)
I found a custom ROM which detects my sim!
Replaced the tee folder ( found in /lib) with the tee folder from the rom which worked and then flashed it!
Kyrillos v5 then detected my sim
loof13 said:
Here's what I did! ( kyrillos v5 didn't detect sim)
I found a custom ROM which detects my sim!
Replaced the tee folder ( found in /lib) with the tee folder from the rom which worked and then flashed it!
Kyrillos v5 then detected my sim
Click to expand...
Click to collapse
Its work. Thank you guys for this tip. :good::good::good:
Finally I can flash I8160 custom rom to my I8160L ---> My phone can detect sim card and doesn't lose imei.
I tried only Gingerbread custom rom ---> It's work.
But I doub if i flash jelly Bean rom with the same way ... It's still work ???
(Sorry for my english)
loof13 said:
Here's what I did! ( kyrillos v5 didn't detect sim)
I found a custom ROM which detects my sim!
Replaced the tee folder ( found in /lib) with the tee folder from the rom which worked and then flashed it!
Kyrillos v5 then detected my sim
Click to expand...
Click to collapse
Hell YES!! Thank you! I finally managed to get Kyrillos V5 on my I8160L!
Although it doesnt say Im the 'L' model in the settings
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Now we just need a way to get Jelly bean to work on it!
is this the tee folder the entire /lib folder with all folders inside?
I don´t understand this part.
thanks
luigisvc said:
is this the tee folder the entire /lib folder with all folders inside?
I don´t understand this part.
thanks
Click to expand...
Click to collapse
Inside the lib folder, there will be a folder called tee!
Related
Is there a way to Backup and Restore Original Shipped Firmware? Is we have Norton Ghost for Android then it will be good...
The purpose is to claim the phone for warranty, after flashed with customized firmware. The phone's hardware might go fault.
Well as a previous sgs user I know that the best way is to have root on ur device then u can access cwm to create a complete image (backup) of ur current os.
I don't know if there is a better way of doing so
Cheers
Sent from my GT-I9100 using Tapatalk
A lot of branded roms are posted in the Branded rom post in dev section .
jje
For an own backup, exactely as you bought the phone, here's what I did:
- flash an insecure kernel (stock kernels are available for all FWs, so restoring original stock kernel is easy)
- apply root
- dump all important partitions:
Code:
dd if=/dev/block/mmcblk0p1 of=/sdcard/p1-EFS.img bs=4096
dd if=/dev/block/mmcblk0p4 of=/sdcard/p4-PARAM.img bs=4096
dd if=/dev/block/mmcblk0p5 of=/sdcard/p5-KERNEL.img bs=4096
dd if=/dev/block/mmcblk0p8 of=/sdcard/p8-MODEM.img bs=4096
dd if=/dev/block/mmcblk0p9 of=/sdcard/p9-FACTORYFS.img bs=4096
dd if=/dev/block/mmcblk0p12 of=/sdcard/p12-HIDDEN.img bs=4096
As a more easy/convinient alternative you could flash a kernel with a custom recovery (like CF-Root, containing CWM recovery) and use the Nandroid backup feature from the recovery menu - but those root-kernels usually perform a few more changes on the /system partition, so I did my "initial stock backup" just using an insecure kernel and root applied.
HellcatDroid said:
For an own backup, exactely as you bought the phone, here's what I did:
- flash an insecure kernel (stock kernels are available for all FWs, so restoring original stock kernel is easy)
- apply root
- dump all important partitions:
Code:
dd if=/dev/block/mmcblk0p1 of=/sdcard/p1-EFS.img bs=4096
dd if=/dev/block/mmcblk0p4 of=/sdcard/p4-PARAM.img bs=4096
dd if=/dev/block/mmcblk0p5 of=/sdcard/p5-KERNEL.img bs=4096
dd if=/dev/block/mmcblk0p8 of=/sdcard/p8-MODEM.img bs=4096
dd if=/dev/block/mmcblk0p9 of=/sdcard/p9-FACTORYFS.img bs=4096
dd if=/dev/block/mmcblk0p12 of=/sdcard/p12-HIDDEN.img bs=4096
As a more easy/convinient alternative you could flash a kernel with a custom recovery (like CF-Root, containing CWM recovery) and use the Nandroid backup feature from the recovery menu - but those root-kernels usually perform a few more changes on the /system partition, so I did my "initial stock backup" just using an insecure kernel and root applied.
Click to expand...
Click to collapse
Thanks for the advice! I have a question regarding Nandroid and CWM. Restoring the image made with Nandroid is easy enough, but won't the carrier/Samsung detect that a custom recovery (CWM) has been installed and consider it voiding the warranty regardless of the stock ROM being on the device?
Thanks in advance.
techjunkieza said:
Restoring the image made with Nandroid is easy enough, but won't the carrier/Samsung detect that a custom recovery (CWM) has been installed and consider it voiding the warranty regardless of the stock ROM being on the device?
Click to expand...
Click to collapse
After restoring a stock backup via a custom recovery/nandroid, just flash a stock kernel afterwards with Odin as well.
That will restore kernel and the recovery back to stock too.
All that is then left from a rooting is two files and a few symlinks hidden in /system/xbin - unlikely they'll go and check that IMO.
HellcatDroid said:
After restoring a stock backup via a custom recovery/nandroid, just flash a stock kernel afterwards with Odin as well.
That will restore kernel and the recovery back to stock too.
All that is then left from a rooting is two files and a few symlinks hidden in /system/xbin - unlikely they'll go and check that IMO.
Click to expand...
Click to collapse
Thanks dude. I was wondering how it is done. I did not know that flashing a stock kernel will make the recovery mode default as well. I'm new to Android so please forgive the noob questions. Surely there should be a list of files in a thread somewhere which indicates which files are modified when rooting the phone?
So I take it by restoring the original ROM, flashing a stock kernel (if you have a custom recovery mode or root access), removing the files and symlinks and resetting the ROM counter that the phone will be "stock" again?
techjunkieza said:
Thanks dude. I was wondering how it is done. I did not know that flashing a stock kernel will make the recovery mode default as well. I'm new to Android so please forgive the noob questions.
Click to expand...
Click to collapse
He, I had to learn all this myself recently, the SGS2 is my first Android device as well
For the SGS2 the recovery mode is part of the main kernel (partition), so flashing a stock kernel replaces that as well.
AFAIK this a unique Samy thing, on the other Android devices the recovery actually resides on its own partition.
techjunkieza said:
Surely there should be a list of files in a thread somewhere which indicates which files are modified when rooting the phone?
So I take it by restoring the original ROM, flashing a stock kernel (if you have a custom recovery mode or root access), removing the files and symlinks and resetting the ROM counter that the phone will be "stock" again?
Click to expand...
Click to collapse
Depending on how you rooted it's just /system/xbin/su that gets replaced and /system/xbin/busybox that gets added.
Then all the symlinks busybox installs - not sure if busybox has an "uninstall" option to remove them, if not just dump all symlinks in /system/xbin, on stock FWs there are none in this dir.
HellcatDroid said:
He, I had to learn all this myself recently, the SGS2 is my first Android device as well
For the SGS2 the recovery mode is part of the main kernel (partition), so flashing a stock kernel replaces that as well.
AFAIK this a unique Samy thing, on the other Android devices the recovery actually resides on its own partition.
Click to expand...
Click to collapse
Thanks a lot for the advice. I see many people asking the same questions but no one really gives them answers. I'm guessing it's betterfor it to be on two different partitions in terms of coupling. For noobs, the Samsung way is easier.
HellcatDroid said:
Depending on how you rooted it's just /system/xbin/su that gets replaced and /system/xbin/busybox that gets added.
Then all the symlinks busybox installs - not sure if busybox has an "uninstall" option to remove them, if not just dump all symlinks in /system/xbin, on stock FWs there are none in this dir.
Click to expand...
Click to collapse
Great. Thanks. I would like to know what Android does on a low level in order to gain root access. I'm going to research that a bit.
Thanks very much for the info!
techjunkieza said:
I would like to know what Android does on a low level in order to gain root access. I'm going to research that a bit.
Click to expand...
Click to collapse
Well, once one knows what happens it's not that much magic that happens.
Basically, the stock su gets replaced with a custom one that actually has a way of allowing other user (IDs) to run as root, Superuser.apk is installed to maintain su's database of allowed (and disallowed) user IDs and last not least busybox is installed to gain some shell commands not available (or limited) on stock.
All that is done via an adb daemon (already) running with root perms - that's what the insecure kernels do, they simply let the adbd run with root perms (so the above things can be done).
Each app running has it's unique, own user ID it's running with, so root access/permissions can easiely be maintained that way.
I hope that was what you wanted to know
HellcatDroid said:
Well, once one knows what happens it's not that much magic that happens.
Basically, the stock su gets replaced with a custom one that actually has a way of allowing other user (IDs) to run as root, Superuser.apk is installed to maintain su's database of allowed (and disallowed) user IDs and last not least busybox is installed to gain some shell commands not available (or limited) on stock.
All that is done via an adb daemon (already) running with root perms - that's what the insecure kernels do, they simply let the adbd run with root perms (so the above things can be done).
Each app running has it's unique, own user ID it's running with, so root access/permissions can easiely be maintained that way.
I hope that was what you wanted to know
Click to expand...
Click to collapse
Basically, yes! You definitely deserve a thanks for all of this. I was looking for information of what you just described but couldn't find anything. Shot dude!
how to reset counter without the USB jig ?
You don't.
Best you can do is getting rid of the triangle by flashing a stock kernel, but to reset the counter you really need the USB jig.
Great post! I cannot find a clear answer to these questions as well:
1. What is the location of the so called "boot loader" and how to make a backup? On Intel architecture it's on the first few sectors of the disk block device.
2. What is the location of the "ODIN mode/Download mode" application and how to make a backup? I suspect it may be in some read only memory and there is nothing to backup?
3. What is the location of the partition table? How to backup?
I want to understand the real/core/linux/android way of doing these, not just blindly running arbitrary tools.
Thanks in advance.
HellcatDroid said:
You don't.
Best you can do is getting rid of the triangle by flashing a stock kernel, but to reset the counter you really need the USB jig.
Click to expand...
Click to collapse
You can try this
http://forum.xda-developers.com/showthread.php?t=1494114
I already did it on my SII running ICS 4.0.3, worked great!..., but..., read the thread and cross your fingers...
gingingingin said:
1. What is the location of the so called "boot loader" and how to make a backup? On Intel architecture it's on the first few sectors of the disk block device.
2. What is the location of the "ODIN mode/Download mode" application and how to make a backup? I suspect it may be in some read only memory and there is nothing to backup?
3. What is the location of the partition table? How to backup?
Click to expand...
Click to collapse
1, 2 and 3: they are outside of the normal partitioned space / on hidden partiions (the bootloader partition is visible in ICS though) and you should not touch them.
Backing them up is useless as when the bootloaders are corrupted/broken, you'll have no way to restore them anyways as no bootloader == no boot to run anything, hence no restoring.
One is advised to leave them alone and not touch them - usually you can't access them anyways.
2: "Download Mode" is part of the secondary bootloader (partitions /dev/block/mmcblk0p2 and mmcblk0p3).
Hence the inability to access Download Mode when the bootloaders are broken.
Does it mean that "Download Mode" can be corrupt by overwriting this secondary bootloader? What about the the primary one? Is this a sure way for "hard bricking"? I was always wondering is there a way to completely lock yourself out of SGS2, but could not get a conclusive answer in the forum. Or you can recover from any failure by having any single piece backed up?
What do update packages mean when they contain a bootloader update - is it primary or secondary bootloader, or both?
You didn't say about the location of the partition table, although it's quite often part of the updates to have a PIT file with a new layout?
And last but not least, what is the basic sequence to recover from a partition based raw backup, like the one we're discussing in the thread?
Regards,
Anton
LG Optimus G EFS Backup/Restore
Every rooted Optimus G user should backup their EFS partitions! Included in this thread is a flashable EFS backup script and terminal/adb commands if you want to do it manually. The script automates the entire backup of all 3 EFS partitions and then packs the files into a flashable zip for easy restoring later. Place this zip somewhere safe other than your sdcard!
Thanks goes to toastcfh for the script help and everyone in #lg-optimus-g that helped out with EFS testing.
Original Optimus G EFS Thread(ZERO EFS) - HERE
I have received an ATT EFS backup from an ATT user and will be attempting to create a ZERO EFS zip for ATT devices. This thread will be updated if I'm successful.
Background
You never know when your NV/EFS may stop working correctly. Restoring your WORKING EFS may save the day. A few users in the #lg-optimus-g IRC channel have run into issues and found their phone unusable, myself included. Our issues could have been fixed if an EFS backup was made while the phone was still in working order.
m9kefs1 seems to be radio related
m9kefs2 contains your unique phone identifiers: IMEI, phone number, etc
m9kefs3 seems to be blank 00s
Backing up EFS
It's easiest to run the Optimus_G_Create_Flashable_EFS.zip attached to this thread. Run in recovery. Optimus_G_Create_Flashable_EFS.zip creates a flashable zip backup of your EFS in /sdcard/EFS_Backup/(instead of just a .tar). Confirmed working on TWRP 2.3.2.3/2.4.1.0 and CWM 6.0.2.7. Confirmed NOT working on CWM 6.0.1.5. Please check to make sure the backup zip worked and actually made a .zip file in /sdcard/EFS_Backup. Any issues please list what recovery and version you are using and please post the recovery.log.
If you don't like convenience this can also be done manually with adb or terminal with the commands below.. root required.
Code:
su
dd if=/dev/block/platform/msm_sdcc.1/by-name/m9kefs1 of=/sdcard/m9kefs1.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/m9kefs2 of=/sdcard/m9kefs2.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/m9kefs3 of=/sdcard/m9kefs3.img
Restoring EFS
To restore your original EFS just boot into recovery and flash the efsbackupflash.zip in your /sdcard/EFS_Backup folder.
If you don't like convenience this can also be done manually with adb or terminal with the commands below. Adjust the "dd if=/sdcard/" command depending on where your backup EFS .img files are located.
Code:
su
dd if=/sdcard/m9kefs1.img of=/dev/block/platform/msm_sdcc.1/by-name/m9kefs1
dd if=/sdcard/m9kefs2.img of=/dev/block/platform/msm_sdcc.1/by-name/m9kefs2
dd if=/sdcard/m9kefs3.img of=/dev/block/platform/msm_sdcc.1/by-name/m9kefs3
Code:
[B]Changelog[/B]
[I]v1 EFS backup zip[/I]:
backed up m9kefs1.img and m9kefs2.img then .tar'd them.
[I]v2 EFS backup zip[/I]:
backed up EFS then creates a flashable .zip containing the EFS partitions.
[I]v3 EFS backup zip[/I]:
zip script is now "safer" and should work on all Optimus G variants.
[I]v4 EFS backup zip[/I]:
backup zip now backs up m9kefs3. this is for "completeness" only.
I believe m9kefs3 contains no worthwhile data.
Does this work on any of the Canadian variants?
on stock rooted firmware i run zip but the backup tar in nowhere to be found
sucsss said:
Does this work on any of the Canadian variants?
Click to expand...
Click to collapse
I know that the Telus version will work. I'd assume both Bell and Rogers have the same m9kefs1/m9kefs2 partitions as well.
Going to confirm then I will make a thread in the Canadian section as well.
pinkster said:
on stock rooted firmware i run zip but the backup tar in nowhere to be found
Click to expand...
Click to collapse
Hmm.. I've had confirmation from ATT users that this works... even received some EFS backups from them for further testing.
The zip no longer makes a .tar. You should have an EFS_Backup folder on your INTERNAL /sdcard containing both efs partitions as well as a flashable .zip backup. Please check the internal card and not the external. If there is still no backup to be found please post the recovery.log file after you flash Optimus_G_Create_Flashable_EFS.zip
All of my personal tests were done while using TWRP 2.4.1.0 . Can't confirm older TWRP versions or CWM.. but I see no reason why they shouldn't work as well.
*UPDATE*
The above issue was fixed after updating CWM. CWM 6.0.1.5 is no good. Upgrade.. or better yet.. switch to TWRP.
The latest cwm works perfectly, that's what I used.
Sent from my LG-E970 using Tapatalk 2
autoprime said:
I know that the Telus version will work. I'd assume both Bell and Rogers have the same m9kefs1/m9kefs2 partitions as well.
Going to confirm then I will make a thread in the Canadian section as well.
Hmm.. I've had confirmation from ATT users that this works... even received some EFS backups from them for further testing.
The zip no longer makes a .tar. You should have an EFS_Backup folder on your INTERNAL /sdcard containing both efs partitions as well as a flashable .zip backup. Please check the internal card and not the external. If there is still no backup to be found please post the recovery.log file after you flash Optimus_G_Create_Flashable_EFS.zip
All of my personal tests were done while using TWRP 2.4.1.0 . Can't confirm older TWRP versions or CWM.. but I see no reason why they shouldn't work as well.
Click to expand...
Click to collapse
I've got the E971. need any help to confirm?
sucsss said:
I've got the E971. need any help to confirm?
Click to expand...
Click to collapse
can u run this in adb/terminal: ls -la /dev/block/platform/msm_sdcc.1/by-name/
post output.. or at least confirm that you have an m9kefs1, m9kefs2 and m9kefs3. could you also post the actual locations of the 3.. like.. do they use /dev/block/mmcblk0p12 and /dev/block/mmcblk0p13 and /dev/block/mmcblk0p14 ?
Used the .zip in TWRP 2.3.2.3 and it successfully created backups of m9kefs1 & 2 it looks like.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sent from my Nexus 7 using Tapatalk HD
autoprime said:
can u run this in adb/terminal: ls -la /dev/block/platform/msm_sdcc.1/by-name/
post output.. or at least confirm that you have an m9kefs1, m9kefs2 and m9kefs3. could you also post the actual locations of the 3.. like.. do they use /dev/block/mmcblk0p12 and /dev/block/mmcblk0p13 and /dev/block/mmcblk0p14 ?
Click to expand...
Click to collapse
lrwxrwxrwx root root 1970-04-22 03:41 m9kefs1 -> /dev/block/mmcblk0p12
lrwxrwxrwx root root 1970-04-22 03:41 m9kefs2 -> /dev/block/mmcblk0p13
lrwxrwxrwx root root 1970-04-22 03:41 m9kefs3 -> /dev/block/mmcblk0p14
interesting note, why are the dates like that?
sucsss said:
lrwxrwxrwx root root 1970-04-22 03:41 m9kefs1 -> /dev/block/mmcblk0p12
lrwxrwxrwx root root 1970-04-22 03:41 m9kefs2 -> /dev/block/mmcblk0p13
lrwxrwxrwx root root 1970-04-22 03:41 m9kefs3 -> /dev/block/mmcblk0p14
interesting question, why are the dates like that?
Click to expand...
Click to collapse
thanks for the update.. this confirms what i suspected.. its just like all the other Optimus G devices and the backup efs zip will work! I will post a new thread in the Canadian Dev forums so that it catches everyones eye.
i forget the technical reason for the date issue.. but its something with recovery not reporting the time correctly. it's the same with my device. sorry i dont have a better answer
nymica said:
The latest cwm works perfectly, that's what I used.
Sent from my LG-E970 using Tapatalk 2
Click to expand...
Click to collapse
Same here.
Well if latest you mean Sk8s CWMRTouch 6.0.2.7 14.4.7
I apologize for this noob question but what is the difference between this and making a nandroid backup or the one created in let us say twrp?
yhe2x said:
I apologize for this noob question but what is the difference between this and making a nandroid backup or the one created in let us say twrp?
Click to expand...
Click to collapse
as far as i know.. a nandroid doesn't backup the efs partition. a nandroid contains android data and system stuff.
*edit*
TWRP recovery should now have EFS backup in the "Backup" option when using an LG OG(this feature is not in all devices).
clorbag said:
so do i go into twrp and choose install zip to use this ?
Click to expand...
Click to collapse
If you dont want to use TWRP to backup EFS then yes, you can flash my zip in recovery.. just the the OP states.
DraginMagik said:
Can you elaborate on how we would know when we'd need to restore the EFS partition?
What would cause a problem with the EFS partition?
Sent from my Optimus G using xda premium
Click to expand...
Click to collapse
here's a bit more info on possible efs issues - http://forum.xda-developers.com/showpost.php?p=38350918&postcount=4
EFS is much more important on a CDMA device(what I use).. but its also good practice to do it on GSM devices. Example... Any time someone lost their IMEI and can't fix it no matter what modem/baseband they flash... restoring your EFS could maybe fix that.
autoprime said:
as far as i know.. a nandroid doesn't backup the efs partition. a nandroid contains android data and system stuff.
Click to expand...
Click to collapse
so do i go into twrp and choose install zip to use this ?
Can you elaborate on how we would know when we'd need to restore the EFS partition?
What would cause a problem with the EFS partition?
Sent from my Optimus G using xda premium
So rooting the phone isn't enough to use this flashable Zip, we should be on a customer Kernel that has either TWRP or Clockwork Mod, that is what I am getting from this so would I be correct? Thanks. I am more intimately familiar with the AT&T SGS2 SGH 777 and new to LG.
WarEagleUS said:
So rooting the phone isn't enough to use this flashable Zip, we should be on a customer Kernel that has either TWRP or Clockwork Mod, that is what I am getting from this so would I be correct? Thanks. I am more intimately familiar with the AT&T SGS2 SGH 777 and new to LG.
Click to expand...
Click to collapse
This device doesn't have recoveries baked into the kernel like the i777. They are flashed independently.
Sent from my Optimus G using Tapatalk 2
WarEagleUS said:
So rooting the phone isn't enough to use this flashable Zip, we should be on a customer Kernel that has either TWRP or Clockwork Mod, that is what I am getting from this so would I be correct? Thanks. I am more intimately familiar with the AT&T SGS2 SGH 777 and new to LG.
Click to expand...
Click to collapse
After rooting the boot loader must be unlocked with FreeGee app from play store. I think the latest version only has option to install twrp, but you can use that to flash cwm if you prefer it.
lg optimus G radio not working..helpp
autoprime said:
LG Optimus G EFS Backup/Restore
Every rooted Optimus G user should backup their EFS partitions! Included in this thread is a flashable EFS backup script and terminal/adb commands if you want to do it manually. The script automates the entire backup of all 3 EFS partitions and then packs the files into a flashable zip for easy restoring later. Place this zip somewhere safe other than your sdcard!
Thanks goes to toastcfh for the script help and everyone in #lg-optimus-g that helped out with EFS testing.
Original Optimus G EFS Thread(ZERO EFS) - HERE
I have received an ATT EFS backup from an ATT user and will be attempting to create a ZERO EFS zip for ATT devices. This thread will be updated if I'm successful.
Background
You never know when your NV/EFS may stop working correctly. Restoring your WORKING EFS may save the day. A few users in the #lg-optimus-g IRC channel have run into issues and found their phone unusable, myself included. Our issues could have been fixed if an EFS backup was made while the phone was still in working order.
m9kefs1 seems to be radio related
m9kefs2 contains your unique phone identifiers: IMEI, phone number, etc
m9kefs3 seems to be blank 00s
Backing up EFS
It's easiest to run the Optimus_G_Create_Flashable_EFS.zip attached to this thread. Run in recovery. Optimus_G_Create_Flashable_EFS.zip creates a flashable zip backup of your EFS in /sdcard/EFS_Backup/(instead of just a .tar). Confirmed working on TWRP 2.3.2.3/2.4.1.0 and CWM 6.0.2.7. Confirmed NOT working on CWM 6.0.1.5. Please check to make sure the backup zip worked and actually made a .zip file in /sdcard/EFS_Backup. Any issues please list what recovery and version you are using and please post the recovery.log.
If you don't like convenience this can also be done manually with adb or terminal with the commands below.. root required.
Code:
su
dd if=/dev/block/platform/msm_sdcc.1/by-name/m9kefs1 of=/sdcard/m9kefs1.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/m9kefs2 of=/sdcard/m9kefs2.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/m9kefs3 of=/sdcard/m9kefs3.img
Restoring EFS
To restore your original EFS just boot into recovery and flash the efsbackupflash.zip in your /sdcard/EFS_Backup folder.
If you don't like convenience this can also be done manually with adb or terminal with the commands below. Adjust the "dd if=/sdcard/" command depending on where your backup EFS .img files are located.
Code:
su
dd if=/sdcard/m9kefs1.img of=/dev/block/platform/msm_sdcc.1/by-name/m9kefs1
dd if=/sdcard/m9kefs2.img of=/dev/block/platform/msm_sdcc.1/by-name/m9kefs2
dd if=/sdcard/m9kefs3.img of=/dev/block/platform/msm_sdcc.1/by-name/m9kefs3
Code:
[B]Changelog[/B]
[I]v1 EFS backup zip[/I]:
backed up m9kefs1.img and m9kefs2.img then .tar'd them.
[I]v2 EFS backup zip[/I]:
backed up EFS then creates a flashable .zip containing the EFS partitions.
[I]v3 EFS backup zip[/I]:
zip script is now "safer" and should work on all Optimus G variants.
[I]v4 EFS backup zip[/I]:
backup zip now backs up m9kefs3. this is for "completeness" only.
I believe m9kefs3 contains no worthwhile data.
Click to expand...
Click to collapse
need helpp...i was on stock ics in optimus g e970, i tried flashing korean kdz onto it via R n D tool and messed it up...when i went back to stock via lgnpst, lost my radio (network signal).....now i have tried soooooooooo many things but no use....i guess this efs is the last left procedure and hope for me...helpp please....
i didnt backup my efs file and deleted everything.....now no radio, no sim working
You LGNPST'd a KOREAN FIRMWARE FFS. You richly deserve your misfortune. Your actions might constitute the most incredible "derp" that I've seen since migrating to this device.
Dear Friends,
Need help please. I have installed another custom rom that was not meant for I9300 and now the EFS is corrupted. I tried installing orignal rom using ODIN but geting boot loop and the phone is not booting. On going into recovery i can see an error efs/ corupted or something like that. I have the backup of my EFS folder in tar.gz format however dont know how to install the same and recover my phone as not able to boot to android.
Please help me if someone can work it out. My phone has just 3 days of warranty left and it does not shows rooted anywhere except the count of installation is about 32 and rom says official and kernel says custom.
Please if someone can help me restore my phone back in working condition i shall always remain thankfull.
Regards,
Mush
mush2004 said:
Dear Friends,
Need help please. I have installed another custom rom that was not meant for I9300 and now the EFS is corrupted. I tried installing orignal rom using ODIN but geting boot loop and the phone is not booting. On going into recovery i can see an error efs/ corupted or something like that. I have the backup of my EFS folder in tar.gz format however dont know how to install the same and recover my phone as not able to boot to android.
Please help me if someone can work it out. My phone has just 3 days of warranty left and it does not shows rooted anywhere except the count of installation is about 32 and rom says official and kernel says custom.
Please if someone can help me restore my phone back in working condition i shall always remain thankfull.
Regards,
Mush
Click to expand...
Click to collapse
It is essential that you have a backup of the EFS partition and a way to place it back - the first two ways that I would think about are:
a) use a good recovery - like Philz recovery, that has commands to restore EFS
b) if the format of the backup is not exactly right you might be able to boot in recovery and use ADB commands.
xclub_101 said:
It is essential that you have a backup of the EFS partition and a way to place it back - the first two ways that I would think about are:
a) use a good recovery - like Philz recovery, that has commands to restore EFS
b) if the format of the backup is not exactly right you might be able to boot in recovery and use ADB commands.
Click to expand...
Click to collapse
Code:
su
umount /efs
dd if=/sdcard/efs.img of=/dev/block/mmcblk0p1 bs=4096
reboot
Ver3go said:
Code:
su
umount /efs
dd if=/sdcard/efs.img of=/dev/block/mmcblk0p1 bs=4096
reboot
Click to expand...
Click to collapse
I am new to adb commands. Will phylz recovery help me enter the commands? if yes then i shall be replying with the sd card efs tar file name. Will then you be able to guide me with the commands based on the tar file?
Thanks all of you in advance.
Mush
mush2004 said:
I am new to adb commands. Will phylz recovery help me enter the commands? if yes then i shall be replying with the sd card efs tar file name. Will then you be able to guide me with the commands based on the tar file?
Thanks all of you in advance.
Mush
Click to expand...
Click to collapse
No for ADB you boot into recovery, connect your computer via USB and run the ADB commands from either Linux Terminal or Windows Command Prompt.
The tool here:
http://forum.xda-developers.com/showthread.php?t=1703488
May help if you're new to adb.
Otherwise it's a case of downloading and installing the drivers for your phone and the Android SDK http://developer.android.com/sdk/index.html
Thanks for all your replies.
Just wanted to confirm if i have the efs backup in sd card as under folder backup_efs and there are two files in tar.gz format will i be able to use the phylz recovery to use this replace my efs folder? if yes then can you guide me the steps please.
Regards,
Mush
mush2004 said:
Thanks for all your replies.
Just wanted to confirm if i have the efs backup in sd card as under folder backup_efs and there are two files in tar.gz format will i be able to use the phylz recovery to use this replace my efs folder? if yes then can you guide me the steps please.
Regards,
Mush
Click to expand...
Click to collapse
I do not remember right now what creates an backup_efs folder but it really does not matter that much - the tar.gz is a "file archive" and .img is usually a partition image. Each could have minor advantages - the .img also contains the entire filesystem of the partition (and will work easier if the filesystem is bonked) but a tar.gz backup is more versatile when you have bad sectors or a changed partition.
Under an advanced recovery like Philz you would just navigate some menus and try to restore the EFS - see the info in those specific threads.
Under ADB you need to have stuff (drivers and some programs) installed in your PC, you connect the phone on USB and you run ADB commands from the command line.
Problem solved!
**********************
I think my problem happened because a flashed a ROM with MG4 baseband, and then flashed UltimaROM with another baseband which caused my baneband to corrupt.
I tried to flash Stock ROM and install different baseband but non of this worked.
finally I flashed BTU stock ROM (Which comes with MG4) but the problem still here.
Then I installed root, deleted the efs folder and replaced all the files with the files in the backup - restart and everything is working! my IMEI returned to normal.
**********************
Original question
Hello devs,
I have Siyah kernel which auto backup my EFS, i have backup named "efs_28Aug2013-1852.tar.gz"
I want to restore from this backup because I lost my IMEI when I flashed UltimaROM
I renamed it to "efsbackup.tar.gz" and put it in the root of the sdcard
then I started adb shell & run the code
Code:
su
umount /efs
mke2fs /dev/block/mmcblk0p1
mount -w -t ext4 /dev/block/mmcblk0p1 /efs
busybox tar zxvf /sdcard/ efsbackup.tar.gz -C /
I granted ADB shell root access
then i went to recovery and run the command (because I can't run umount /efs while device's running it gives resource busy message)
However when I run the first command "su" in gives me this message
Code:
/sbin/sh: su: not found
so I skipped to the next command
but I get the message
Code:
umount: can't umount /efs: Invalid argument
Please guys any help appreciated
Click to expand...
Click to collapse
Unzip it with a file manager and use a root explorer to replace manually
Sent from my GT-I9300 using Tapatalk 4
.
I've backup my efs with adb but how do you have a file on tar format, i've got a file on .img, it's normal ?
There's about nine different ways to backup the efs, .img is fine but a little on the large side at 20mb. A .tar of the same is only 5mb.
rootSU said:
Unzip it with a file manager and use a root explorer to replace manually
Sent from my GT-I9300 using Tapatalk 4
Click to expand...
Click to collapse
Thank you for your reply, I did as you said but this only changed my IMEI from "Unknown" to the generic IMEI "004999..."
Is there something wrong in the method or my backup may be corrupt
Sent from my Nexus 7 using Tapatalk 2
Read the imei / efs thread in general.
Sent from my GT-I9300 using Tapatalk 4
Thank you again, I read the thread in the past but it looks like it has been updated recently.
I think my problem happened because a flashed a ROM with MG4 baseband, and then flashed UltimaROM with another baseband which caused my baneband to corrupt.
I tried to flash Stock ROM and install different baseband but non of this worked.
finally I flashed BTU stock ROM (Which comes with MG4) but the problem still here.
Then I installed root, deleted the efs folder and replaced all the files with the files in the backup - restart and everything is working! my IMEI returned to normal.
Thank you RootSU for your help.
hey bro,
i am stuck
help me out
- my efs(folder) is blank
- i installed stock with pit file but no help!
- right now my cell is in bootloop!
- it goes to recovery, download mode.
i have efs.tar.gz file and a folder named efs in my ext sd
how do i copy that to int memory?
can't even create a cwm flashable zip file of the same?????
help me bro.....
You are posting in a thread that tells you how to restore an efs backup, how much more could you possibly need?
Go to recovery, factory reset.
Get the phone to boot, unpack the .tar file and follow the instructions in the OP.
boomboomer said:
You are posting in a thread that tells you how to restore an efs backup, how much more could you possibly need?
Go to recovery, factory reset.
Get the phone to boot, unpack the .tar file and follow the instructions in the OP.
Click to expand...
Click to collapse
Dear boomboomer,
i am sorry, but my phone is in "bootloop" how am i suppose to delete the "EFS" ? that s what i am asking!!!!!
i have both efs.tar.gz and extracted folder ready in my ext-sd......
i wonder if somebody can help me with creating a cwm.zip from the .tar file
thanks ....
try to install stock again via odin but this time install a diffrent version (for example if you installed INU this time try INS).. before that factory reset your phone and wipe cache via recovery mode.. don't lose your efs backup it's very important copy it to your PC in case something wrong happens
i already did so
almousawi said:
try to install stock again via odin but this time install a diffrent version (for example if you installed INU this time try INS).. before that factory reset your phone and wipe cache via recovery mode.. don't lose your efs backup it's very important copy it to your PC in case something wrong happens
Click to expand...
Click to collapse
bro, thanks for your help recently i tried cm 10 also but nothing happened.
believe me i tried everything now the only option is left that is
to restore efs backup from efs.tar.gz (which is about 12 MB)
OR
create a cwm flashable zip from the efs folder which is about 22 MB)
OR
take my phone to download mode and try to push whole "efs" folder to the location with help of "ADB"
hello
mikks said:
bro, thanks for your help recently i tried cm 10 also but nothing happened.
believe me i tried everything now the only option is left that is
to restore efs backup from efs.tar.gz (which is about 12 MB)
OR
create a cwm flashable zip from the efs folder which is about 22 MB)
OR
take my phone to download mode and try to push whole "efs" folder to the location with help of "ADB"
Click to expand...
Click to collapse
hello nobody is here to help......??????
mikks said:
hello nobody is here to help......??????
Click to expand...
Click to collapse
Correct this is not a paid for service .
Suggest you take it to a service centre .
know that i did that already....
JJEgan said:
Correct this is not a paid for service .
Suggest you take it to a service centre .
Click to expand...
Click to collapse
thanks for the reply, respect to your reply and interest no disrespect ...
i took that to the center but they failed and by the way they come to me in some cases... so they give me free service...
my phone is in boot loop, i have efs.tar.... can i use phills recovery ????? or can i use someone elses backup... just to boot up my device ...then i'll be good .... i just need to get my device booted up.....
Hey guys! This thread for such difficult cases when IMEI (CSPSA parittion) is lost and you don't have any backups for this partition.
It's a long story, how exactly I recently turned my phone into a tablet without RIL working but the long story short - both EFS and CSPSA parrtitions were messed up without any obvious ways to recover the latter, since I had no backup.
First of all, I should thank @ace2nutzer since he first found in JB firmware utility, that sets the IMEI to default one (15 zeros). The below is code taken from one of JB codinap firmware:
Code:
#TA Loader to write default IMEI
service ta_load /system/bin/ta_loader recovery
user root
group radio
oneshot
The legality of the use of this I'll leave out the scopes of this topic (and thus this is up to Samsung / ST-Ericcson vendors since this utility was developed by them) - remember that this guide is not about how to change IMEI, but only to recover your original one. Also remember that changing IMEI is illegal in many of countries.
Ok, let's go to the work, but remember, any even more serious damage that you can do to your phone is not my responsibility!
There are some of prerequisites that must be met in order to recover IMEI:
at least JB 4.1.2 or any newer firmware (2.3.6 is not tested) - device must be rooted
your phone is still able to boot the system (the described below is likely not to work in recovery mode)
baseband and signal level are showed in settings, but *#06# combination shows nothing and thus your phone can't be registered in the network
Android terminal emulator installed or adb
stock CSPSA partition from XXLK2 codina / codinap . The below linked this parittion for codina (I'm not sure if codinap users can use it as well, in such case you need to download XXLK2 2.3.6 firmware and extract this partition manually): http://www.xda.mister-freeze.eu/XDA-files/ChronoMonochrome/misc/cspsa/cspsa_stock.img
proper EFS partition (or backup) - I'll leave EFS recovery out of this topic, since I haven't found much variants of recovery of this parittion other than to ask someone to upload their EFS parition. Over the Internet, you can also find some EFS partitions for Ace 2, but I haven't tested them.
ta_loader binary - can be taken from any 4.1.2 (or higher) firmware (see the path above)
Below is how I finally managed to recover IMEI: (attention! everything listed below is only for those who have messed up CSPSA partition. If you're not sure that this is the case for you - don't follow steps written below.)
firstly, backup your CSPSA partition just in case (if you are sure that this is not usable at all and is not useful anymore for anything - you can skip this step):
Code:
dd if=/dev/block/mmcblk0p6 of=/sdcard/cspsa_backup.img bs=512000
flash cspsa partition from XXLK2 stock:
Code:
dd if=/sdcard/cspsa_stock.img of=/dev/block/mmcblk0p6 bs=512000
and reboot the phone
backup /system/bin/ta_loader to some place (e.g. /sdcard or /ramdisk) and replace sequence of 15 zeroes to your original IMEI (can be found back under the battery) using sed:
Code:
sed -ie "s,000000000000000,<15_digits>," /ramdisk/ta_loader
sed -ie "s,<15_digits>0,<16_zeroes>," /ramdisk/ta_loader
I've used sed twice, because there are two occurences of 15 zeroes in ta_loader binary and we want to change only one of them (the rest occurence is not related to IMEI at all),
<15_digits> stands for your IMEI -> second sed command reverts an unwanted change.
Warning! Don't ever try to change IMEI to a non-original this way, it won't work!
now just type
Code:
/ramdisk/ta_loader recovery
, this will reboot your phone to recovery
reboot to system and voila! Original IMEI is there!
If this guide have saved your bacon then please consider donating to @ace2nutzer or me!
Permission denied
When I try to flash the cspsa_stock.img using terminal emulator, it say permission denied.. please help me..
Try
Code:
su
or:
Code:
sudo -i
Confused the 3rd step
You said to replace 15 zeroes to my imei, then you said that <15_digits> stand for my imei, so do i have to change the <15_digits> with my imei? If yes, which one? the first sed or the second? And what should I do for the <16_digits> ? Thanks
Primen2000 said:
When I try to flash the cspsa_stock.img using terminal emulator, it say permission denied.. please help me..
Click to expand...
Click to collapse
Since you're unfamiliar with image flashing, are you sure you're in the right topic? This one is for these unlike cases where CSPSA partition is broken, you might want to check first if this is not the case before you continue.
Primen2000 said:
You said to replace 15 zeroes to my imei, then you said that <15_digits> stand for my imei, so do i have to change the <15_digits> with my imei? If yes, which one? the first sed or the second? And what should I do for the <16_digits> ? Thanks
Click to expand...
Click to collapse
If yes, which one?
Click to expand...
Click to collapse
Both, consider both commands like one.
And what should I do for the <16_digits> ?
Click to expand...
Click to collapse
there is no <16_digits> mentioned in OP, <16_zeros> stands for the sequence of 16 zeroes.
Worked 100%
Oh Man... I've already give up to this old phone because no sim card detected due to IMEI issue for 1 week. And after buy new smartphone last night (Xiaomi Note 4), Now your tutorial worked. I feel sad and happy.. Thanks a lot you guys..
Permission denied
I have entered the following in an adb shell without any error message
cp /system/bin/ta_loader /sdcard
sed -ie "s,000000000000000,my imei," /sdcard/ta_loader
sed -ie "s,my imei+0,0000000000000000," /sdcard/ta_loader
but when I then try
/sdcard/ta_loader recovery
I get a "permission denied". Shell says I am root and the ta_loader's permissions are -rwxrwx---.
Any ideas? (sorry I am not quite familiar with android...)
andi_ypsilon said:
I have entered the following in an adb shell without any error message
cp /system/bin/ta_loader /sdcard
sed -ie "s,000000000000000,my imei," /sdcard/ta_loader
sed -ie "s,my imei+0,0000000000000000," /sdcard/ta_loader
but when I then try
/sdcard/ta_loader recovery
I get a "permission denied". Shell says I am root and the ta_loader's permissions are -rwxrwx---.
Any ideas? (sorry I am not quite familiar with android...)
Click to expand...
Click to collapse
That command just for rebooting to recovery. You can do it yourself.
bien2004official said:
That command just for rebooting to recovery. You can do it yourself.
Click to expand...
Click to collapse
Obviously, it's not just rebooting to recovery but also writes IMEI to a stock CSPSA partition. If CSPSA partition is already recovered (or not broken) then it will just reboot to recovery.
andi_ypsilon said:
but when I then try
/sdcard/ta_loader recovery
I get a "permission denied". Shell says I am root and the ta_loader's permissions are -rwxrwx---.
Any ideas? (sorry I am not quite familiar with android...)
Click to expand...
Click to collapse
Binaries cannot be run from sdcard partition. Copy binary to e.g. /data/local and retry.
ChronoMonochrome said:
Obviously, it's not just rebooting to recovery but also writes IMEI to a stock CSPSA partition. If CSPSA partition is already recovered (or not broken) then it will just reboot to recovery.
Binaries cannot be run from sdcard partition. Copy binary to e.g. /data/local and retry.
Click to expand...
Click to collapse
Thanks ChronoMonochrome, this has worked. Android now shows the correct IMEI.
But SIM card is still not detected even though its working in another phone (and it worked in the ACE2 before installing CustomROM). In "SIM status" all the points are "not available". Can you give me some ideas how to tackle this?
BTW, ta_loader showed some errors (don't know if relevant)
https://imgur.com/a/HsJQU6P
andi_ypsilon said:
Thanks ChronoMonochrome, this has worked. Android now shows the correct IMEI.
But SIM card is still not detected even though its working in another phone (and it worked in the ACE2 before installing CustomROM). In "SIM status" all the points are "not available". Can you give me some ideas how to tackle this?
BTW, ta_loader showed some errors (don't know if relevant)
https://imgur.com/a/HsJQU6P
Click to expand...
Click to collapse
Have you followed all the steps of this guide?
ChronoMonochrome said:
Have you followed all the steps of this guide?
Click to expand...
Click to collapse
What I did using adb:
1) Took cspsa_stock.img from the download link, copied it to sdcard, and typed dd if=/sdcard/cspsa_stock.img of=/dev/block/mmcblk0p6 bs=512000
2) sed -ie "s,000000000000000,123456789....," /local/data/ta_loader
sed -ie "s,1234567890...0,0000000000000000," /local/data/ta_loader
This gave me a modified ta_loader (pulled it to computer and found my IMEI within) and a second file called "ta_loadere". (Don't know why. Same size, contains my IMEI twice)
3) /local/data/ta_loader recovery
4) Select reboot in recovery
andi_ypsilon said:
What I did using adb:
1) Took cspsa_stock.img from the download link, copied it to sdcard, and typed dd if=/sdcard/cspsa_stock.img of=/dev/block/mmcblk0p6 bs=512000
2) sed -ie "s,000000000000000,123456789....," /local/data/ta_loader
sed -ie "s,1234567890...0,0000000000000000," /local/data/ta_loader
This gave me a modified ta_loader (pulled it to computer and found my IMEI within) and a second file called "ta_loadere". (Don't know why. Same size, contains my IMEI twice)
3) /local/data/ta_loader recovery
4) Select reboot in recovery
Click to expand...
Click to collapse
Hmm, then it might depend on what exactly happened to phone. On mine EFS and CSPSA partitions both were broken, but that was not problem (an EFS partition doesn't contains anything irrecoverable, a backup image can be found here). Flashing a full stock image might help as well (I had MF1 4.1.2 stock ROM installed at the moment I broke CSPSA & EFS partitions).
ChronoMonochrome said:
Hmm, then it might depend on what exactly happened to phone. On mine EFS and CSPSA partitions both were broken, but that was not problem (an EFS partition doesn't contains anything irrecoverable, a backup image can be found here). Flashing a full stock image might help as well (I had MF1 4.1.2 stock ROM installed at the moment I broke CSPSA & EFS partitions).
Click to expand...
Click to collapse
SOLUTION: Flashing the phone with Odin 3.2.1.4 and i8160XXNB1_OXXNB4_Android_4.1.2_service.zip from https://service-gsm.net/Samsung/I8160/i8160XXNB1_OXXNB4_Android_4.1.2_service.zip/ restored SIM card detection.