[TUT] [ROOT] Backup restore IMEI manually - Xiaomi Redmi 1S

Automatic Backup Restore IMEI TOOL by Sector1369 is HERE .
(Only Require Custom recovery)
Automatic backup restore CMD script added by "deadlyindian" at Post#5
(Require PC ,ADB drivers & Root permissions )
If you still want to do this manually, look below
IMEI backup of redmi 1s
Require ROOT permissions
We all known that EFS partition holds the imei,sn ,wifi mac & other important data.
In Snapdragon the EFS partition are modemst1 ,modemst2 & FSG partitions. so it's important to take backup of these partitions.
1.connect your phone to PC , adb debugging enabled & goto adb shell by,
Code:
adb shell su
OR
Open terminal emulator app in your phone & take super user permissions, by
Code:
su
2.type following commands to backup imei partitions.
Code:
dd if=/dev/block/mmcblk0p16 of=/sdcard/mmcblk0p16_modemst1
dd if=/dev/block/mmcblk0p17 of=/sdcard/mmcblk0p17_modemst2
dd if=/dev/block/mmcblk0p20 of=/sdcard/mmcblk0p20_fsg
also these are some important partition you should consider to backup.
modem, fsc, bk1, ddr.
Code:
dd if=/dev/block/mmcblk0p23 of=/sdcard/mmcblk0p23_modem
dd if=/dev/block/mmcblk0p9 of=/sdcard/mmcblk0p9_DDR
dd if=/dev/block/mmcblk0p12 of=/sdcard/mmcblk0p12_bk1
dd if=/dev/block/mmcblk0p18 of=/sdcard/mmcblk0p18_fsc
Now the backup is stored in you internal storage ,store these files in safe place.
in case u get invalid imei or unknown, restore these partitions.
To restore these partitions,
Code:
dd if=/sdcard/mmcblk0p16_modemst1 of=/dev/block/mmcblk0p16
dd if=/sdcard/mmcblk0p17_modemst2 of=/dev/block/mmcblk0p17
dd if=/sdcard/mmcblk0p20_fsg of=/dev/block/mmcblk0p20
dd if=/sdcard/mmcblk0p23_modem of=/dev/block/mmcblk0p23
dd if=/sdcard/mmcblk0p9_DDR of=/dev/block/mmcblk0p9
dd if=/sdcard/mmcblk0p12_bk1 of=/dev/block/mmcblk0p12
dd if=/sdcard/mmcblk0p18_fsc of=/dev/block/mmcblk0p18
Working on Aroma EFS backup restore tool..
NOTE:-
Don't use tools or commands from other device because different devices has different partition address, that will result in wrong backups.
To use this method to backup other phones EFS , u should find your partition info.
Redmi 1s Partition tables can be found HERE
ENJOY,

Thanks man...it would be alot helpful if i gone to any trouble [emoji7]

But the problem with lost imei is for Redmi with MediaTek processor. Redmi Qualcomm don't suffer from this problem.

pgreed said:
But the problem with lost imei is for Redmi with MediaTek processor. Redmi Qualcomm don't suffer from this problem.
Click to expand...
Click to collapse
i know but it's always better to take bakup,who knows what 'll happen...
there is no way to generate imei,wifi mac data for qualcomm (as far as i know) ...
so it will come handy...

Auto IMEI Backup & Restore Tool
Backup restore IMEI Automatically
FIRST INSTALL THE ADB DRIVERS FOR THE 1S ► GO HERE ◄
Requires Phone to be ROOTED & USB Debugging turned ON
This is for Xiaomi Redmi 1S Only
I've created a CMD script that will automatically backup the IMEI & Also Restore it back again if you want to...
Backed Up files are inside MYIMEI folder of your selected backup storage.
NOTE : Enable root access for adb if you're on Custom ROM based on CyanogenMod
to do that ► Open Settings ► Superuser ► Superuser Access ► Select Apps and ADB ► done
► Download it from attachment
► Extract it
► Run R1SBAR.exe & follow instructions.
While restoring make sure the backed up files are inside the MYIMEI folder of either Internal Memory or External or it wont work.
If you face any error do tell me!
AGAIN ITS ONLY FOR REDMI 1S

deadlyindian said:
Backup restore IMEI Automatically
Requires Phone to be ROOTED & USB Debugging turned ON
This is for Xiaomi Redmi 1S Only
I've created a CMD script that will automatically backup the IMEI & Also Restore it back again if you want to...
Backed Up files are inside MYIMEI folder of your selected backup storage.
► Download it from attachment
► Extract it
► Run R1SBAR.exe & follow instructions.
While restoring make sure the backed up files are inside the MYIMEI folder of either Internal Memory or External or it wont work.
If you face any error do tell me!
AGAIN ITS ONLY FOR REDMI 1S
Click to expand...
Click to collapse
It working perfectly.Thank you.

pgreed said:
It working perfectly.Thank you.
Click to expand...
Click to collapse
You're Welcome :good:

[Backup restore IMEI Automatically] works like charm. thanks :good:

lavizta said:
[Backup restore IMEI Automatically] works like charm. thanks :good:
Click to expand...
Click to collapse
im glad it help :good:

deadlyindian said:
Backup restore IMEI Automatically
Requires Phone to be ROOTED & USB Debugging turned ON
This is for Xiaomi Redmi 1S Only
I've created a CMD script that will automatically backup the IMEI & Also Restore it back again if you want to...
Backed Up files are inside MYIMEI folder of your selected backup storage.
► Download it from attachment
► Extract it
► Run R1SBAR.exe & follow instructions.
While restoring make sure the backed up files are inside the MYIMEI folder of either Internal Memory or External or it wont work.
If you face any error do tell me!
AGAIN ITS ONLY FOR REDMI 1S
Click to expand...
Click to collapse
Great work :good::good:

None of the usual ROM / kernel flashing result in loss of these partitions .
If someone is able to screw up partitions, chances are that he will remove the partition table too ..
and with that he will not be able to fastboot anymore , to use backups made here.
Don't get me wrong, but its of little use imo.
Sector1369 said:
Code:
dd if=/dev/block/mmcblk0p23 of=/sdcard/mmcblk0p23_modem
dd if=/dev/block/mmcblk0p9 of=/sdcard/mmcblk0p9_DDR
dd if=/dev/block/mmcblk0p12 of=/sdcard/mmcblk0p12_bk1
dd if=/dev/block/mmcblk0p18 of=/sdcard/mmcblk0p18_fsc
ENJOY,
Click to expand...
Click to collapse

kapil.git said:
None of the usual ROM / kernel flashing result in loss of these partitions .
If someone is able to screw up partitions, chances are that he will remove the partition table too ..
and with that he will not be able to fastboot anymore , to use backups made here.
Don't get me wrong, but its of little use imo.
Click to expand...
Click to collapse
U never know when sh*t happens there is no harm in taking the backup. Had personally lost imei on couple of Samsung phone while flashing roms and was able to restore it with the efs backup.

rkkaranrk said:
U never know when sh*t happens there is no harm in taking the backup. Had personally lost imei on couple of Samsung phone while flashing roms and was able to restore it with the efs backup.
Click to expand...
Click to collapse
I mean backing up DRM keys and TA partitions made sense since they are wiped in some bootloader unlocking..
You almost make it sound like, I can restore someone else's IMEI too :silly: ..
I still have my old nokia phones with me of which I can rob their identities ?
Some random Redmi dev can give surprise to actually make an app for this..
Chinese phones have already been a pain in a$$ for Indian Govt due to lack / duplicate of this IMEI modules.

kapil.git said:
I mean backing up DRM keys and TA partitions made sense since they are wiped in some bootloader unlocking..
You almost make it sound like, I can restore someone else's IMEI too :silly: ..
I still have my old nokia phones with me of which I can rob their identities ?
Some random Redmi dev can give surprise to actually make an app for this..
Chinese phones have already been a pain in a$$ for Indian Govt due to lack / duplicate of this IMEI modules.
Click to expand...
Click to collapse
I'm pretty sure u have been using a Sony phone and have limited knowledge so don't jump and compare the phones with the same thing.
As for the imei take help of google and search for z3x/cyclone/nspro/magma what are they used for:silly:

it might come in handy or it might not
nevertheless i'm putting it in safekeeping.
thanks for the work & effort.
:good:

rkkaranrk said:
I'm pretty sure u have been using a Sony phone and have limited knowledge so don't jump and compare the phones with the same thing.
Click to expand...
Click to collapse
Yes you are correct , been using Sony for a while
As for the imei take help of google and search for z3x/cyclone/nspro/magma what are they used for:silly:
Click to expand...
Click to collapse
mmmkaay..

@deadlyindian,
Thanks for providing the automated script to back up imie.
I did go through your post and did as per the instructions mentioned step by step. However, I am unable to proceed after getting the message "Please connect usb cable now" after running R1SBAR. I do have root access(checked from root checker app) and have also enabled USB Debugging. I also inserted cable after getting the message.
Does it take a lot of time(more than 5 mins) to backup imei cause I continued till 5 mins before closing the cmd prompt.
Hope you can help me here.
PS: I am using MIUI v45 global version "JHCCNBH45.0 (V5) " in case if you need.

ADB Drivers & instructions...
fanboy_android said:
@deadlyindian,
Thanks for providing the automated script to back up imie.
I did go through your post and did as per the instructions mentioned step by step. However, I am unable to proceed after getting the message "Please connect usb cable now" after running R1SBAR. I do have root access(checked from root checker app) and have also enabled USB Debugging. I also inserted cable after getting the message.
Does it take a lot of time(more than 5 mins) to backup imei cause I continued till 5 mins before closing the cmd prompt.
Hope you can help me here.
PS: I am using MIUI v45 global version "JHCCNBH45.0 (V5) " in case if you need.
Click to expand...
Click to collapse
Have you installed the ADB drivers for the 1S? ► ADB Drivers ◄
After installing Run R1SBAR.exe & follow the below screens
{
"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"
}

deadlyindian said:
Have you installed the ADB drivers for the 1S? ► ADB Drivers ◄
After installing Run R1SBAR.exe & follow the below screens
Click to expand...
Click to collapse
Yes, it seems adb drivers were missing after which I was able to successfully backup my IMIE. Thanks for your help.
Perhaps you could add this link in your earlier post as a pre-requisite so that newcomers won't face this issue. Just a suggestion
Kudos and keep rocking.

fanboy_android said:
Yes, it seems adb drivers were missing after which I was able to successfully backup my IMIE. Thanks for your help.
Perhaps you could add this link in your earlier post as a pre-requisite so that newcomers won't face this issue. Just a suggestion
Kudos and keep rocking.
Click to expand...
Click to collapse
Done!!

Related

Backup/Restore N2E

Backup/Restore N2E OS X/LINUX
Rule one: Make a backup of your factory fresh Nook ROM.
Linux/Mac: Become root
Boot nook with noogie.img and connect to your computer via USB.
New link here
Linux:
use df -h to get your nook's /dev/sd? address.
typically something like: /dev/sdb
OS X:
use diskutil list to get your nook's memory address.
typically something like: /dev/disk3
Once you know the address, unmount the Nook.
Code:
Linux: umount /dev/sdb*
OS X: diskutil unmountdisk /dev/disk1
Make the backup
Code:
Linux: dd if=/dev/sdb of=my_backup.img bs=1M
OS X: dd if=/dev/disk3 of=my_backup.img bs=1M
After it is finished, double check and make sure the backup img file is exactly 1958739968 bytes long.
dd can wipe your computer's hard drive, so be careful! Make sure your're plugging the correct drives into the command above.
Restoring your N2E to factory-fresh is a simple reversal of the commands above:
(boot with the noogie sd card first!)
Code:
Linux: dd if=my_backup.img of=/dev/sdb bs=1M
OS X: dd if=my_backup.img of=/dev/disk3 bs=1M
Substitute sdb or disk3 above with your Nook's actual address.
This wipes your N2E, restoring the specified image file.
Windows users, see the next post.
BACKUP/RESTORE N2E Win7
Grab a copy of Roadkil's free DiskImager for backup and restore. http://www.roadkil.net/program.php?ProgramID=12
and a copy of free MiniTool Partition Wizard at:
http://www.partitionwizard.com/
Boot nook with noogie.img : http://nookdevs.com/NookTouch_Rooting (the "Rooted Forever" screen) and connect to your computer via USB.
Use DiskImager to copy your Nook partition to a file, being sure to select "Physical Disk" in the drop down list.
{
"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"
}
If the process completes, you now have a backup.
To restore your backup:
(Boot Nook with the noogie sd)
Run Partition Wizard and delete all partitions on your Nook. Careful in disk selection here, wiping the wrong drive could be catastrophic! This is required, because DiskImager won't write to a partitioned drive.
Now run DiskImager and restore your backup to the Nook drive. When done, pull the noogie sd card from the Nook and reboot.
You should be fully restored now.
jocala said:
Rule one: Make a backup of your factory fresh Nook ROM.
Click to expand...
Click to collapse
Well that's probably quite a lot of us early adopter hackers stuffed, then.
Loccy said:
Well that's probably quite a lot of us early adopter hackers stuffed, then.
Click to expand...
Click to collapse
Then make a backup now. For most of the stuff that's being done, a factory restore will put you back to pure stock.
jocala said:
Then make a backup now. For most of the stuff that's being done, a factory restore will put you back to pure stock.
Click to expand...
Click to collapse
Already doing so - my current state is quite solid at the moment so it'll do as a known good restore point, if not as a "get me back to being a virgin" state.
Factory restore only seems to wipe /data, though - so anything you've done in system is not restored to stock.
Loccy said:
Well that's probably quite a lot of us early adopter hackers stuffed, then.
Click to expand...
Click to collapse
I'm stuffed too. Is there any hope of a full factory install method that doesn't include making an image of the original ROM?
cymoze said:
I'm stuffed too. Is there any hope of a full factory install method that doesn't include making an image of the original ROM?
Click to expand...
Click to collapse
I don't see one on the horizon because the /rom/devconf data is individual to each N2E. Hopefully, I'm wrong.
As long as you're not currently in a horrible broken state, can't you force a factory refresh then backup?
may you can add the link for the nookie.img ?!
thank you
rev0l said:
may you can add the link for the nookie.img ?!
thank you
Click to expand...
Click to collapse
Done, thank you for reminding me.
jocala said:
I don't see one on the horizon because the /rom/devconf data is individual to each N2E. Hopefully, I'm wrong.
As long as you're not currently in a horrible broken state, can't you force a factory refresh then backup?
Click to expand...
Click to collapse
I did that and was able to backup. I noticed my 1.82GB image was actually on Physical Disk 7, but other than that it went by the book.
cymoze said:
I did that and was able to backup. I noticed my 1.82GB image was actually on Physical Disk 7, but other than that it went by the book.
Click to expand...
Click to collapse
I'm glad it worked for you.
Sent from my SPH-D700 using Tapatalk
Hi,
I made my backup without umounting the nook first (sadly, this step isn't mentioned on the rooting guide on NookDevs...) ,
tryied to restore it seems I bricked my nook... stuck at boot time.
it seems that (at least) /boot/uRamdisk is defected, thus my nook is not booting
I've wrote everthing here... but seems that the relavant part is what I wrote above...
http://forum.xda-developers.com/showthread.php?t=1149714
EDIT: seems that umounting before restoring and then restoring again solved the problem... aperantly the image was OK after all.
Fresh NookieT backed up, thanks for the guide.
You're welcome
And after some problems with TouchNooter I was able to restore to that image too! Thanks again.
I rooted my Nook Touch then decided to try to return back to original "virgin" state. I successfully backed up (verified the file size was 1958739968 bytes) and restored but after I registered my Nook and then restarted, the screen with the android logo and prompt appeared.
I can skip all the Android stuff but one thing I found that I can't do anymore is link to facebook in settings.
It seems if you didn't back up your ROM before you rooted, you will never be able to return to the original state. Hope I am wrong. If B&N release an update, will that help clean the Nook and free it of touchnooter?
Any help is appreciated
homesik_alien said:
I rooted my Nook Touch then decided to try to return back to original "virgin" state. I successfully backed up (verified the file size was 1958739968 bytes) and restored but after I registered my Nook and then restarted, the screen with the android logo and prompt appeared.
I can skip all the Android stuff but one thing I found that I can't do anymore is link to facebook in settings.
It seems if you didn't back up your ROM before you rooted, you will never be able to return to the original state. Hope I am wrong. If B&N release an update, will that help clean the Nook and free it of touchnooter?
Any help is appreciated
Click to expand...
Click to collapse
Yeah I had a similar problem. It seems you can't actually factory restore it. It gets rid of the launcher you installed but whenever I've tried doing the restore it's only a matter of time before the "Tap on the Android to begin" part reappears.
So I've re-rooted, and am leaving it as be until better progress comes out. I don't have market or Gmail working, but Kindle and other apps I need to work so I'll make due for now. I don't want to risk bricking the device as I'm in Canada and there's no Barnes and Nobles to return the Nook to,
oops - tried following these instructions for my Nook Color. DOH
Figured I should post this incase anyone has a similar problem.
After I made my backup, I began the process to restore. I opened the Partition Magic program and deleted all the partitions on the Nook device. I then opened up Win32 Disk Imager, tried to load up my backup and got this error:
"An error occurred when trying to get the devices geometry. Error 8:".
I tried it on another machine, same thing. The workaround for that problem is going into device manager and disabling your Floppy Disk controller and Floppy Drive. Also, moving the Nook backup image you made to the root of your C drive may work.
Or just try the Linux method, much easier
who can give me a backed up file, I use linux and use 'dd' command ,but the file is wrong ,so my nook touch can not be use anymore. I need a full backup file to recovery it . Where can I download this file ? Thanks.

[GUIDE] Full Phone Backup without Unlock or Root

Like a lot of you, I have been putting off unlocking the bootloader on my Nexus because I didn't want to have to go through the hassle of backing up everything manually and restoring individual application data; logging back into apps; saving settings; etc. I found an undocumented (at least as far as my googling was able to find) feature in the latest version of the ADB platform tools (for Android 4.0+) that allows you to create a full system backup, including app apks, their respective data, as well as the internal storage.
Keep in mind this is experimental and not exactly publicized as a feature of ICS, so don't count on this as your only method of backup!
This guide assumes you have already installed the Android SDK, and updated the Android SDK Platform Tools to the latest version (currently Rev 10) using the SDK Manager.
1. Connect your device via USB, and open a command prompt.
2. Optionally, type the command 'adb devices' to ensure that your device is properly recognized. If you're comfortable with ADB already, just skip this.
There is a command, 'adb backup' (to be detailed shortly), that will now allow you to create a full system backup.
The command parameters format is:
adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|nosystem] [<packages...>]
Click to expand...
Click to collapse
The most basic command you can use* is simply:
adb backup -all
Click to expand...
Click to collapse
This will use the defaults to backup only app and device data (not the APKs themselves) to the current directory as 'backup.ab'
* This may not work for every setup. If you get an error such as "adb: cannot open file ./backup.ab", use:
adb backup -all -f C:\backup.ab
Click to expand...
Click to collapse
Or substitute the path of your choice in place of C:\.
To explain the parameters:
-f <file>
Click to expand...
Click to collapse
Use this to choose where the backup file will be stored, e.g. '-f /backup/mybackup.ab', which will save it at the root of your drive (C:\ for Windows, etc.) in a folder called backup, as a file named 'mybackup.ab'. I recommend using this flag to set a location manually, as with my first backup test, it said that it completed successfully, but I was unable to locate the backup file. I have no idea where it was saved, but it wasn't where it should have been located.
-apk|-noapk
Click to expand...
Click to collapse
This flags whether or not the APKs should be included in the backup or just the apps' respective data. I personally use -apk just in case the app isn't available in the Market, so that I don't have to go hunt it down again. The default is -noapk.
-shared|-noshared
Click to expand...
Click to collapse
This flag is used to "enable/disable backup of the device's shared storage / SD card contents; the default is noshared.", which for the Nexus I would certainly flag to -shared, but from my test, it did not restore all of the contents of my internal storage, so I recommend backing up music, pictures, video, and other internal storage items manually, just to be on the safe side. The default is -noshared.
-all
Click to expand...
Click to collapse
This flag is just an easy way to say to backup ALL apps. The packages flag (further on) can be used to choose individual packages, but unless you're just wanting to backup a specific application, use -all for a full system backup.
-system|-nosystem
Click to expand...
Click to collapse
This flag sets whether or not the -all flag also includes system applications or not. I used -system, but this is probably unnecessary, and I would almost guess that it is safer to use -nosystem, but use your own judgment on this. The default is -system.
<packages...>
Click to expand...
Click to collapse
Here you can list the package names (e.g. com.google.android.apps.plus) specifically that you would like to backup. Use this only if you're looking to backup a specific application.
3. Once you've made your decision on how to perform the backup, simply type the command as you would like it; in my case, this is the command that I used:
adb backup -apk -shared -all -f C:\backup20111230.ab
Click to expand...
Click to collapse
4. You will see a screen like the following:
{
"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"
}
5. Enter a password (if desired) for encryption of the backup file. RETAIN THIS PASSWORD FOR RESTORING LATER.
6. This process will take several minutes to complete, depending on the settings you've chosen, but when completed, you will get a toast on-screen saying 'Backup Complete', or if you miss that, you'll know once your phone returns to the home screen.
7. Now go unlock your bootloader (not going to go into the process for this guide, but you probably know how already, and if not, there are several guides a search away).
8. Once you're booted back into Android, you can choose to add your account now, or skip that for later. I skipped it for later, but I think it might make the process more smooth to sign in before the restore. YMMV.
9. To restore, with your device connected open your command prompt again, and type:
adb restore C:\backup20111230.ab
Click to expand...
Click to collapse
replacing 'C:\backup20111230.ab' with the location of your backup file.
10. You will see a screen like the one below:
11. Simply type in your current encryption password (if you've set one), and the password with which the backup was encrypted (if you chose to set a password), and the restore will begin. It again will take several minutes depending on the size of the backup and the options chosen.
12. You're back to normal, short of possibly some widgets on the home screen. My wallpaper was even restored, my app folders remained just as I had them before, my alarms remained, and for most applications, I didn't even have to log back in; it kept everything.
________________________
NOTE: I did have an issue with not all files being restored to the Internal Storage; in particular, the Gallery still displayed all the folders and files that it had cached (which it expected to be there) as only gray boxes, and would not display the images, nor would it rescan the media. I simply copied the files back to the Internal Storage directory manually, and all was well again. Again, YMMV.
NOTE 12/31: Also to note, this will not back up SMS messages, so if you're concerned about those, you may want to look into an alternative application to back up SMS.
NOTE 06/12: There seems to be a bug in which backup and restore operations will fail unless a desktop backup password is set under Developer Options. It will not work with a blank password.
Hope this is able to help! If so, give me a thanks )) and let me know how your experience goes.
- Kevin
In earlier build of ics there's an option to do such backup under back up and restore settings.
However it's not there in final ics.
I've done it once when I flashed one of those early build of ics on nexus s.
faizalmzain said:
In earlier build of ics there's an option to do such backup under back up and restore settings.
However it's not there in final ics.
I've done it once when I flashed one of those early build of ics on nexus s.
Click to expand...
Click to collapse
Interesting. They must have deemed it not quite ready for primetime yet. Seems like it should show up in a future version sometime in the not-too-distant future, then. Until then, this seems to work pretty well.
I just finally rooted. The longer you wait the more painful it will be to start over, so just get it over with. If the adb method qorkks then great. I've flashed and rooted so many phones that its just better to get it over with as pukemon will tell you.
RogerPodacter said:
I just finally rooted. The longer you wait the more painful it will be to start over, so just get it over with. If the adb method qorkks then great. I've flashed and rooted so many phones that its just better to get it over with as pukemon will tell you.
Click to expand...
Click to collapse
While that's true, if you're already past the point of painful return, why start over when this backup method is available? It's not a question of if it works (it does work).
my first post. i have successfully taken a full backup using your guide and it worked great. thanks! my question is can i now unlock the boot loader and root then restore my backup and i will have all my settings and apps along with still having the unlocked boot loader and root?
sahakiap said:
my first post. i have successfully taken a full backup using your guide and it worked great. thanks! my question is can i now unlock the boot loader and root then restore my backup and i will have all my settings and apps along with still having the unlocked boot loader and root?
Click to expand...
Click to collapse
Yes, as shown in the guide, just use the 'adb restore' command after unlocking the bootloader. You may wish to backup your Internal Storage manually, just to be safe, and backup your SMS with a third party app, if you care to keep them. Obtaining root isn't covered in this guide, but yeah, you can root it once you've unlocked the bootloader.
I have been trying to do this, but when after i "backup" the backup file shows no size. Am I missing a step?
ktulu029 said:
I have been trying to do this, but when after i "backup" the backup file shows no size. Am I missing a step?
Click to expand...
Click to collapse
Interesting. Could you post the exact command that you used, and also what OS you're running?
copkay said:
Interesting. Could you post the exact command that you used, and also what OS you're running?
Click to expand...
Click to collapse
Code:
adb backup -apk -shared -all -f /c/backup.ab
I am running win 7 x64, and my phone is running 4.0.2 if that is useful information.
It runs everything on the phone like prompted, just doesn't save any data.
ktulu029 said:
Code:
adb backup -apk -shared -all -f /c/backup.ab
I am running win 7 x64
Click to expand...
Click to collapse
Did the screen show up on your phone requesting permission? If so, did you allow it permission, and wait until it said that the backup was completed to check the file size?
Wow, this should be a freakin STICKY!!!
copkay said:
Did the screen show up on your phone requesting permission? If so, did you allow it permission, and wait until it said that the backup was completed to check the file size?
Click to expand...
Click to collapse
Correct. I went through all of the permissions asked on the phone.
i.e. the screen you posted in step 4.
ktulu029 said:
Correct. I went through all of the permissions asked on the phone.
i.e. the screen you posted in step 4.
Click to expand...
Click to collapse
After allowing the backup, did you get a Toast saying "Backup Started"?
I do. And shortly after, maybe 5 sec I get one saying backup complete. I just did one just using the -apk code, and it took about 10 min, but still rendered me with a .ab file with 0kb.
ktulu029 said:
I do. And shortly after, maybe 10 sec I get one saying backup complete. I just did one just using the -apk code, and it took about 10 min, but still rendered me with a .ab file with 0kb.
Click to expand...
Click to collapse
I apologize if this is a stupid question, but it's one worth asking: have you tried refreshing the folder? Initially the file starts out as 0b and builds up as it goes, and it's possible the file has a size, but the window just hasn't updated to show it.
copkay said:
I apologize if this is a stupid question, but it's one worth asking: have you tried refreshing the folder? Initially the file starts out as 0b and builds up as it goes, and it's possible the file has a size, but the window just hasn't updated to show it.
Click to expand...
Click to collapse
Ha, it is ok and very reasonable to ask that. I have, and same result. I have been going through and toggling things to see what I have on or off that should be otherwise. Just to get the next one out of the way, USB debugging is on.
ktulu029 said:
Ha, it is ok and very reasonable to ask that. I have, and same result. I have been going through and toggling things to see what I have on or off that should be otherwise. Just to get the next one out of the way, USB debugging is on.
Click to expand...
Click to collapse
Haha, okay. Hmm, well if it's getting as far as that there's no question that ADB is connecting. For some reason, it's just not writing out the files. You're on 4.0.2, I'm sure? (not that it should make a difference), and are you GSM or LTE? I really don't think it should matter; I'm just grasping at straws...
I just tried the same exact command you mentioned; I'm also on Win7 x64; LTE Nexus with 4.0.2; backed up directly to C:/c/backup.ab.
copkay said:
Haha, okay. Hmm, well if it's getting as far as that there's no question that ADB is connecting. For some reason, it's just not writing out the files. You're on 4.0.2, I'm sure? (not that it should make a difference), and are you GSM or LTE? I really don't think it should matter; I'm just grasping at straws...
I just tried the same exact command you mentioned; I'm also on Win7 x64; LTE Nexus with 4.0.2; backed up directly to C:/c/backup.ab.
Click to expand...
Click to collapse
I am running the same setup as you. Would the version of SDK tools and Platform tools matter? I am running Rev 16 and 10 repectively. When I run the comands I am in the C:/ prompt, but that doesnt seem to matter from what I can tell. I am using the USB computer connection of MTP rather than PTP if that matters.
I am still pretty green to this, as the last phone I really messed with was the Eris, and with that it has still been awhile. Things have really come a long way since then.
ktulu029 said:
I am running the same setup as you. Would the version of SDK tools and Platform tools matter? I am running Rev 16 and 10 repectively. When I run the comands I am in the C:/ prompt, but that doesnt seem to matter from what I can tell. I am using the USB computer connection of MTP rather than PTP if that matters.
I am still pretty green to this, as the last phone I really messed with was the Eris, and with that it has still been awhile. Things have really come a long way since then.
Click to expand...
Click to collapse
The versions might matter, but you're on the same revisions I'm on. Now, I will say that I am running from C:/Program Files(x86)/Android/android-sdk/platform-tools/ rather than just the straight C:/ prompt, just because I've been too lazy to add ADB to my system variables. I'm also using MTP, which shouldn't affect it.
Yeah, things have changed quite a bit; going from the Droid line to the Fascinate was my last jump.
The only thing I can think of to try is to make sure that you are running your Command Prompt as Administrator. The fact that it's creating a file at all seems to disprove that this would have an effect, but it's worth a try.

[Tools][How-To][Guides] Backup & Restore EFS + Get out from Permanent Safe mode

Note to forum managers: Please make it a Sticky Thread, It should help to all users and there is no use for this tutorial if it is in page 3
Hello XDA Users,
I think some people here know who I am, so I will jump on the "Introduction of myself" for now.
Recently, I have faced many questions & problem of fake IMEI, of damaged EFS folder. So I made a little experiment on my device(GN2).
First, I backuped my EFS folder in 2 types - one is .img and the second is tar.gz.
Then, I deleted my EFS folder using ES Root Explorer. Which made my device to be on somethine called "Permanent Safe Mode" - You can not get out untill you fix your EFS folder and change some values.
This is permanent safe mode:
{
"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"
}
After I did my "research" I have managed to make several methods to backup & restore EFS, which should make your life easier and better.
First of all, Disclaimer:
I'm not responsible for any damage caused by using these methods, all methods tested by me, so it should work on your device too.
This is for I9500 Only!!!!!!!
Let's continue.
What you must have:
Latest base with latest modem and latest kernel - very important since in the latest versions samsung prevented the option to install old modems/kernels, so if you install old kernell/modem it can show you wrong IMEI.
Rooted device with the latest Super User
Latest busybox
CWM / PhilZ Recovery
Terminal Emulator
Root explorer - Can be ES File Explorer with working root option or just a root explorer from the market
A working EFS backup(In order to restore it...)
Time & Patient.
Important Notes:
When installing XWUBMG5, several people suffered from Fake IMEI. This is because the new firmware messed up your EFS folder, which means that you can not restore EFS backup until you are on older version, recommended is XXUBMG9(right to 05/08/2013)
Some custom roms include modem installation in their rom installer. Due to modem flashing in recovery, some devices might get Fake IMEI. My recommendation is before even starting to use this guide, please try to install the latest modem via odin from this thread:
http://forum.xda-developers.com/showthread.php?t=2192025
You will find at least one method that works on your device, so don't give up after one method.
Note II & S4 has the same EFS partition (mmcblk0p3), All methods were checked by me on my Note II and fully work. So it should work on S4 too. At least 90% of them
Read all guide and pay attention to all small details.
Backup methods
Method 1 - .img backup
First method, is an automatic backup/restore software.
Special thanks to A.S._id for his software.
Original thread:
http://forum.xda-developers.com/showthread.php?t=2430177&nocache=1&styleid=19
The software:
A.S._id said:
SAMSUNG_I9500_EFS_BACKUP_RESTORE_AUTOMATIC
Instructions:
! Need for backup Root access, debugging USB and busybox
1. Extract from the zip and run. Bat file
2. Is okay to your PC and follow the menu
Automatically create a text file of all the parameters of the device at the time of the copy
Automatic backup of efs:
* Odin flash file. Tar.md5,
* raw.img
* Tar.gz archive
Automatic naming of files and backup archive version of the firmware
Restore to choose from archives and backup images
Automatic start of Odin and the transition to the flashing mode when selecting Odin Restore
DOWNLOAD
Thanks to:
shoma_81, tester99,
For help and assist in the creation of tool
p.s. * Deposit assured recovery - to have the device firmware version corresponding to the backup copy
Click to expand...
Click to collapse
Method 2 - .img backup
Method number 2 will create you efs.img backup on your internal sd. After that you can copy it to your computer.
What you have to do is this:
Open terminal emulator
Write the following:
Code:
su
Then click enter. It will ask for super user permission, give it permissions.
Then write:
Code:
dd if=/dev/block/mmcblk0p3 of=/sdcard/efs.img bs=4096
Then click enter.
When it finishes, check if you have efs.img on your phone memory. If so, copy it to comupter, if not, you did something wrong try again.
Click to expand...
Click to collapse
Method 3 - .tar.gz backup
This method will compress your efs folder into tar.gz file. This method is the same as choosing backup EFS folder in my rom(PhoeniX ROM)/Omega/Wanam/etc.
A tar.gz backup should look like this(On some devices there might be more files, but this picture was taken from Note II N7100 backup and it fully works):
What you have to do is this:
Download this and copy it to your device:
http://d-h.st/f4I
Reboot into recovery
Flash the zip
Reboot your device.
Connect your device to your pc, and copy the backup in "efs_backup" folder.
Click to expand...
Click to collapse
Restore methods
Now the fun begins
You will have to restore your backup when you have one or more of the folowing problem:
Fake IMEI (usually 004999010640000) or "null" IMEI
Blinking SIM card icon on the top tray… ETC
Unable to unlock your SIM card using your PIN
Fake Serial Number (usually 0000000) or "null" Serial
Unable to register to the network (usually comes with Fake IMEI & Fake Serial so check them.)
Attention please,
If you are 100% that your EFS folder is damaged and you have a working EFS backup with the right IMEI number, my recommendation is this:
With root explorer, go to your efs folder and delete all files inside
Long press on power button will turn off your device.
Then turn on the device, you will be in "Permanent Safe Mode".
Continue to one of the following methods.
Click to expand...
Click to collapse
Method 1 - restore .img backup
First method, is an automatic backup/restore software.
Special thanks to A.S._id for his software.
Original thread:
http://forum.xda-developers.com/showthread.php?t=2430177&nocache=1&styleid=19
The software:
A.S._id said:
SAMSUNG_I9500_EFS_BACKUP_RESTORE_AUTOMATIC
Instructions:
! Need for backup Root access, debugging USB and busybox
1. Extract from the zip and run. Bat file
2. Is okay to your PC and follow the menu
Automatically create a text file of all the parameters of the device at the time of the copy
Automatic backup of efs:
* Odin flash file. Tar.md5,
* raw.img
* Tar.gz archive
Automatic naming of files and backup archive version of the firmware
Restore to choose from archives and backup images
Automatic start of Odin and the transition to the flashing mode when selecting Odin Restore
DOWNLOAD
Thanks to:
shoma_81, tester99,
For help and assist in the creation of tool
p.s. * Deposit assured recovery - to have the device firmware version corresponding to the backup copy
Click to expand...
Click to collapse
Method 2 - Restore .img backup
Method number 2 will restore your efs.img backup from your internal sd.
What you have to do is this:
Put your efs.img on your phone memory(not external sd card!) in the main memory, not inside folder.
Open terminal emulator
Write the following:
Code:
su
Then click enter. It will ask for super user permission, give it permissions.
Then write:
Code:
dd if=/sdcard/efs.img of=/dev/block/mmcblk0p3 bs=4096
Then click enter.
Now, reboot your device. If you still don't have IMEI/You are still in Safe Mod, reboot again.
In the second reboot, the bootanimation might stuck and the device will reboot automatically again. Don't worry, it is ok because it installs your efs.img.
Click to expand...
Click to collapse
Method 3 - restore .tar.gz backup
This method will restore .tar.gz backup.
A tar.gz backup should look like this(On some devices there might be more files, but this picture was taken from Note II N7100 backup and it fully works):
If you have like this, continue to the guide:
Create on your Phone Memory(Not Extrenal sd!!) a folder called "efsbackup"(without quotes)
Copy all files & folders from the EFS backup into "efsbackup" folder(The files are like in the picture)
Download this script & copy it to your device:
http://d-h.st/XcL
Reboot into recovery
Go to mount section and click on(Very important!):
Mount /efs
Click to expand...
Click to collapse
Now install the script you have downloaded.
After it finishes, reboot.
Now everything should be fixed, of course if your backup is 100% ok.
If it doesn't work, try method 4.
Click to expand...
Click to collapse
Method 4 - restore .tar.gz backup
This method will restore .tar.gz backup.
A tar.gz backup should look like this(On some devices there might be more files, but this picture was taked from Note II N7100 backup and it fully works):
If you have like this, continue to the guide:
Create on your Phone Memory(Not Extrenal sd!!) a folder called "efsbackup"(without quotes)
Copy all files & folders from the EFS backup into "efsbackup" folder(The files are like in the picture)
Using root explorer, go to "efsbackup folder, select all files & folders there, and click Copy.
Still in root explorer, go to "efs" folder of your device(It is located where all main folders like data, system, etc.).
In "efs" folder, click paste. It will ask you if you want to replace your files, select replace to all files(So all your files from "efsbackup" folder will be in "efs" folder)
Now open terminal emulator
Write the following:
Code:
su
Then click enter. It will ask for super user permission, give it permissions.
Now write:
Code:
busybox chown 1001:1001 /efs/nv_data.bin
Then click enter.
Now write:
Code:
busybox chmod 06755 /efs/nv_data.bin
Then click enter.
Reboot device. Now everything should work.
Click to expand...
Click to collapse
Exit "Permanent Safe Mode"
When you in "Permanent Safe Mode" situation, it means that your EFS folder is broken.
If you succeeded in restoring your IMEI and you still stuck in this Safe Mode, use this guide:
Method 1
Open root explorer.
Navigate to /efs/FactoryApp/
Open "factorymode" file as Text and edit it:
Change this:
Code:
OFF
To:
Code:
ON
Open "keystr" file as Text and edit it:
Change this:
Code:
OFF
To:
Code:
ON
Reboot device.
Click to expand...
Click to collapse
Method 2
Open Terminal emulator
Write the following:
Code:
su
Then click enter. It will ask for super user permission, give it permissions.
Write the following & click enter:
Code:
rm /efs/FactoryApp/keystr
Write the following & click enter:
Code:
rm /efs/FactoryApp/factorymode
Write the following & click enter:
Code:
echo -n ON >> /efs/FactoryApp/keystr
Write the following & click enter:
Code:
echo -n ON >> /efs/FactoryApp/factorymode
Write the following & click enter:
Code:
chown 1000.1000 /efs/FactoryApp/keystr
Write the following & click enter:
Code:
chown 1000.1000 /efs/FactoryApp/factorymode
Write the following & click enter:
Code:
chmod 0744 /efs/FactoryApp/keystr
Write the following & click enter:
Code:
chmod 0744 /efs/FactoryApp/factorymode
Reboot your device
Click to expand...
Click to collapse
This is all I can do for you friends, Worked alot on these methods to give you the best information.
Each method was tested by me and fully works.
If this helped you please press the "Thanks" button.
If you like & appreciate my work please consider a donation!
Credits:
shnizlon
Candanga
A.S._id
dhiru1602
UtkarshGupta
P.M If you think that I forgot you
XDA:DevDB Information
Backup & Restore EFS + Get out from Permanent Safe mode I9500, a Tool/Utility for the Samsung Galaxy S 4
Contributors
tamirda
Version Information
Status: Stable
Created 2013-09-05
Last Updated 2013-09-05
Awesome my friend 5 stars hit, I will link you in my post.
I hope people read in detail and take precautions
Hugs
Sent from my GT-I9500
Crash 1976 said:
Awesome my friend 5 stars hit, I will link you in my post.
I hope people read in detail and take precautions
Hugs
Sent from my GT-I9500
Click to expand...
Click to collapse
Thank you my friend,
In my note II I did like 20 backups before I deleted my EFS folder around 20 times ahah.
People should be aware that samsung is trying to mess up our devices.
Thank you Tarmida, This is the best userful topic ever for my S4 :good:. This will saving many lives of XDA member :good:
Excellent my friend tamirda! :good:
regards!
5 stars! and sticky please!
great topic and guide tamir.5 stars from me :thumbup: will help me a lot if i get stuck with any prob like before arghhhh
Sent from my GT-N7000 using Tapatalk 2
galza said:
great topic and guide tamir.5 stars from me :thumbup: will help me a lot if i get stuck with any prob like before arghhhh
Sent from my GT-N7000 using Tapatalk 2
Click to expand...
Click to collapse
I am happy to help you any time
» Arrow « said:
Excellent my friend tamirda! :good:
regards!
5 stars! and sticky please!
Click to expand...
Click to collapse
Thank you friend!
bafknight said:
Thank you Tarmida, This is the best userful topic ever for my S4 :good:. This will saving many lives of XDA member :good:
Click to expand...
Click to collapse
Thank you friend, and yes this can be very useful for alot of users.
Sent from my GT-N7100 using xda app-developers app
@tamirda
Hi I'm using crash rom 5.5
I made full wipe and flash MG5
By odin and now I have fake imei
I restore crash rom 5.5 backup from cwm and the problem still exsist
I don't make EFS backup before
How to fix it ?
Sent From my i9500 With Crash Rom
--------------------------------
ادعوا لي بالتوفيق في امتحاناتي
wish me good luck for my exams
AL_IRAQI said:
@tamirda
Hi I'm using crash rom 5.5
I made full wipe and flash MG5
By odin and now I have fake imei
I restore crash rom 5.5 backup from cwm and the problem still exsist
I don't make EFS backup before
How to fix it ?
Sent From my i9500 With Crash Rom
--------------------------------
ادعوا لي بالتوفيق في امتحاناتي
wish me good luck for my exams
Click to expand...
Click to collapse
Hello,
It seems that crash backuped your Fake IMEI.
Something that I thing it might help, helped for some other, download latest modem from here:
http://forum.xda-developers.com/showthread.php?t=2192025
install it as a Phone in Odin.
it is importand to mark phone, and flash via odin.
Then try..
If you don't have any other backup, I think you might have to use your warranty.
When I backup the rom I forget my phone in flight mode maybe this the reason why I lost my imei ?
And my baseband now is
I9500DDUBMF8
+Edit
I found these in my internal storage
The First One From Crash Rom 5.0
And The Second From Stock MG5 Where I have fake imei
Sent From my i9500 With Crash Rom
--------------------------------
ادعوا لي بالتوفيق في امتحاناتي
wish me good luck for my exams
AL_IRAQI said:
When I backup the rom I forget my phone in flight mode maybe this the reason why I lost my imei ?
And my baseband now is
I9500DDUBMF8
Sent From my i9500 With Crash Rom
--------------------------------
ادعوا لي بالتوفيق في امتحاناتي
wish me good luck for my exams
Click to expand...
Click to collapse
I don't think there is connection between these two.
Downlaod this:
http://d-h.st/esG
Open odin, Select Phone, select the modem's tar, connect phoen and flash.
After that check if you have IMEI.
If not, Try to install stock XXUBMG9 or XXUBMG5 - If you had MG5 before, it seems that you can not downgrade your phone, so try to install MG5.
If after MG5 there is still no IMEI,
Flash again as Phone via odin this modem:
http://d-h.st/Xxk
If still there is no IMEI, try to restore your current EFS backup.(Make sure you have Root and busybox and all I asked in the main thread)
If after that no IMEI,
Restore to stock and use warranty( make a story that you woke up one morning and you couldn't conect to your network, and you tried to mnake factory reset and still it didn't help)
Good luck
tamirda said:
I don't think there is connection between these two.
Downlaod this:
http://d-h.st/esG
Open odin, Select Phone, select the modem's tar, connect phoen and flash.
After that check if you have IMEI.
If not, Try to install stock XXUBMG9 or XXUBMG5 - If you had MG5 before, it seems that you can not downgrade your phone, so try to install MG5.
If after MG5 there is still no IMEI,
Flash again as Phone via odin this modem:
http://d-h.st/Xxk
If still there is no IMEI, try to restore your current EFS backup.(Make sure you have Root and busybox and all I asked in the main thread)
If after that no IMEI,
Restore to stock and use warranty( make a story that you woke up one morning and you couldn't conect to your network, and you tried to mnake factory reset and still it didn't help)
Good luck
Click to expand...
Click to collapse
Thanks I'll Try These Method
If not working I'll use my warranty
EDIT
I directly flash I9500_UBUBMG9_MODEM
And know it's work fine with me
I Should Try it before ask sorry for that
this is the first time I have this problem
Thank you very much
Sent From my i9500 With Crash Rom
AL_IRAQI said:
Thanks I'll Try These Method
If not working I'll use my warranty
EDIT
I directly flash I9500_UBUBMG9_MODEM
And know it's work fine with me
I Should Try it before ask sorry for that
this is the first time I have this problem
Thank you very much
Sent From my i9500 With Crash Rom
Click to expand...
Click to collapse
Hi mate,
First of all,
I am more than happy that I helped you.
Second, this is ok to ask questions, that is why I am here.
Now backup at leat 5 times your EFS .img & tar.gz.
Enjoy!
tamirda said:
Hi mate,
First of all,
I am more than happy that I helped you.
Second, this is ok to ask questions, that is why I am here.
Now backup at leat 5 times your EFS .img & tar.gz.
Enjoy!
Click to expand...
Click to collapse
I backup 3 times with every method
Thanks
Sent From my i9500 With Crash Rom
--------------------------------
ادعوا لي بالتوفيق في امتحاناتي
wish me good luck for my exams
Awesome guide.
Burned up whole weekend over the issue and now fixed my issue following the guide.
Cannot thank you enough man!
Regards,
Pdash
pdash79 said:
Awesome guide.
Burned up whole weekend over the issue and now fixed my issue following the guide.
Cannot thank you enough man!
Regards,
Pdash
Click to expand...
Click to collapse
I am happy to help & hear that you succeed in restoring IMEI.
Sent from my GT-N7100 using xda app-developers app
I read your post, all most the method use terminal emulator, so what is that ?, and can you give me link of that ?
thanks you very much
daogiahieu said:
I read your post, all most the method use terminal emulator, so what is that ?, and can you give me link of that ?
thanks you very much
Click to expand...
Click to collapse
Linux command line shell on Android. Here's it, mate https://play.google.com/store/apps/details?id=jackpal.androidterm&hl=vi
Thanxs @tamirda
I could see everyday a new post related to messed up EFS folder.
It would surely help people out
Anyhow i had already backed up mine using the EFS professional Software. Is it enough or should i backup using your methods also?
manu44 said:
Thanxs @tamirda
I could see everyday a new post related to messed up EFS folder.
It would surely help people out
Anyhow i had already backed up mine using the EFS professional Software. Is it enough or should i backup using your methods also?
Click to expand...
Click to collapse
I think it is enough, depands on your feeling

[Tools][How-To][Guides] Backup & Restore EFS + Get out from Permanent Safe mode

Note to forum managers: Please make it a Sticky Thread, It should help to all users and there is no use for this tutorial if it is in page 3
Hello XDA Users,
I think some people here know who I am, so I will jump on the "Introduction of myself" for now.
Recently, I have faced many questions & problem of fake IMEI, of damaged EFS folder. So I made a little experiment on my device(GN2).
First, I backuped my EFS folder in 2 types - one is .img and the second is tar.gz.
Then, I deleted my EFS folder using ES Root Explorer. Which made my device to be on somethine called "Permanent Safe Mode" - You can not get out untill you fix your EFS folder and change some values.
This is permanent safe mode:
{
"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"
}
After I did my "research" I have managed to make several methods to backup & restore EFS, which should make your life easier and better.
First of all, Disclaimer:
I'm not responsible for any damage caused by using these methods, all methods tested by me, so it should work on your device too.
This is for I9505 Only!!!!!!!
Let's continue.
What you must have:
Latest base with latest modem and latest kernel - very important since in the latest versions samsung prevented the option to install old modems/kernels, so if you install old kernell/modem it can show you wrong IMEI.
Rooted device with the latest Super User
Latest busybox
PhilZ Recovery
Terminal Emulator
Root explorer - Can be ES File Explorer with working root option or just a root explorer from the market
A working EFS backup(In order to restore it...)
Time & Patient.
Important Notes:
When installing/downgrading firmwares, several people suffered from Fake IMEI. This is because the new firmware messed up your EFS folder, which means that you can not restore EFS backup until you are on the latest version, latest modem and latest stock kernel, recommended is XXUBMH1(right to 05/09/2013)
Some custom roms include modem installation in their rom installer. Due to modem flashing in recovery, some devices might get Fake IMEI. My recommendation is before even starting to use this guide, please try to install the latest modem via odin from this thread:
http://forum.xda-developers.com/showthread.php?t=2192025
When installing modem via odin, make sure you select PHONE and not PDA
You will find at least one method that works on your device, so don't give up after one method.
Read all guide and pay attention to all small details.
Backup methods
Method 1 - .img backup
First method, is an automatic backup/restore software.
Special thanks to A.S._id for his software.
The software:
I9505 EFS Backup / Restore
Help to preserve and restore the image of EFS partition:
* Need Root
For Windows
* Extract from the archive, connect the device to the USB debugging mode (System settings/Developer options/USB debugging) and run selected .bat (depending on the backup or restore)
* To retain the image of efs.img must be in a folder with Restore_EFS.bat
* Extract from the archive, connect the device to the USB debugging mode (System settings/Developer options/USB debugging) and run RUN_ME into terminal (double click), select option...
What is EFS, Why it is necessary to backup
Click to expand...
Click to collapse
Method 2 - .img backup
Method number 2 will create you efs.img backup on your internal sd. After that you can copy it to your computer.
What you have to do is this:
Open terminal emulator
Write the following:
Code:
su
Then click enter. It will ask for super user permission, give it permissions.
Then write:
Code:
dd if=/dev/block/mmcblk0p10 of=/sdcard/efs.img bs=4096
Then click enter.
When it finishes, check if you have efs.img on your phone memory. If so, copy it to comupter, if not, you did something wrong try again.
Click to expand...
Click to collapse
Method 3 - .tar.gz backup
This method will compress your efs folder into tar.gz file. This method is the same as choosing backup EFS folder in my rom(PhoeniX ROM)/Omega/Wanam/etc.
A tar.gz backup should look like this(On some devices there might be more files, but this picture was taken from Note II N7100 backup and it fully works):
What you have to do is this:
Download this and copy it to your device:
http://d-h.st/SaK
Reboot into recovery
Flash the zip
Reboot your device.
Connect your device to your pc, and copy the backup in "efs_backup" folder.
Click to expand...
Click to collapse
Restore methods
Now the fun begins
You will have to restore your backup when you have one or more of the folowing problem:
Fake IMEI (usually 004999010640000) or "null" IMEI
Blinking SIM card icon on the top tray… ETC
Unable to unlock your SIM card using your PIN
Fake Serial Number (usually 0000000) or "null" Serial
Unable to register to the network (usually comes with Fake IMEI & Fake Serial so check them.)
Attention please,
If you are 100% that your EFS folder is damaged and you have a working EFS backup with the right IMEI number, my recommendation is this:
With root explorer, go to your efs folder and delete all files inside
Long press on power button will turn off your device.
Then turn on the device, you will be in "Permanent Safe Mode".
Continue to one of the following methods.
Click to expand...
Click to collapse
Method 1 - restore .img backup
First method, is an automatic backup/restore software.
Special thanks to A.S._id for his software.
The software:
I9505 EFS Backup / Restore
Help to preserve and restore the image of EFS partition:
* Need Root
For Windows
* Extract from the archive, connect the device to the USB debugging mode (System settings/Developer options/USB debugging) and run selected .bat (depending on the backup or restore)
* To retain the image of efs.img must be in a folder with Restore_EFS.bat
* Extract from the archive, connect the device to the USB debugging mode (System settings/Developer options/USB debugging) and run RUN_ME into terminal (double click), select option...
What is EFS, Why it is necessary to backup
Click to expand...
Click to collapse
Method 2 - Restore .img backup
Method number 2 will restore your efs.img backup from your internal sd.
What you have to do is this:
Put your efs.img on your phone memory(not external sd card!) in the main memory, not inside folder.
Open terminal emulator
Write the following:
Code:
su
Then click enter. It will ask for super user permission, give it permissions.
Then write:
Code:
dd if=/sdcard/efs.img of=/dev/block/mmcblk0p10 bs=4096
Then click enter.
Now, reboot your device. If you still don't have IMEI/You are still in Safe Mod, reboot again.
In the second reboot, the bootanimation might stuck and the device will reboot automatically again. Don't worry, it is ok because it installs your efs.img.
Click to expand...
Click to collapse
Method 3 - restore .tar.gz backup
This method will restore .tar.gz backup.
A tar.gz backup should look like this(On some devices there might be more files, but this picture was taken from Note II N7100 backup and it fully works):
If you have like this, continue to the guide:
Create on your Phone Memory(Not Extrenal sd!!) a folder called "efsbackup"(without quotes)
Copy all files & folders from the EFS backup into "efsbackup" folder(The files are like in the picture)
Download this script & copy it to your device:
http://d-h.st/zwR
Reboot into recovery
Go to mount section and click on(Very important!):
Mount /efs
Click to expand...
Click to collapse
Now install the script you have downloaded.
After it finishes, reboot.
Now everything should be fixed, of course if your backup is 100% ok.
If it doesn't work, try method 4.
Click to expand...
Click to collapse
Method 4 - restore .tar.gz backup
This method will restore .tar.gz backup.
A tar.gz backup should look like this(On some devices there might be more files, but this picture was taked from Note II N7100 backup and it fully works):
If you have like this, continue to the guide:
Create on your Phone Memory(Not Extrenal sd!!) a folder called "efsbackup"(without quotes)
Copy all files & folders from the EFS backup into "efsbackup" folder(The files are like in the picture)
Using root explorer, go to "efsbackup folder, select all files & folders there, and click Copy.
Still in root explorer, go to "efs" folder of your device(It is located where all main folders like data, system, etc.).
In "efs" folder, click paste. It will ask you if you want to replace your files, select replace to all files(So all your files from "efsbackup" folder will be in "efs" folder)
Now open terminal emulator
Write the following:
Code:
su
Then click enter. It will ask for super user permission, give it permissions.
Now write:
Code:
busybox chown 1001:1001 /efs/nv_data.bin
Then click enter.
Now write:
Code:
busybox chmod 06755 /efs/nv_data.bin
Then click enter.
Reboot device. Now everything should work.
Click to expand...
Click to collapse
Exit "Permanent Safe Mode"
When you in "Permanent Safe Mode" situation, it means that your EFS folder is broken.
If you succeeded in restoring your IMEI and you still stuck in this Safe Mode, use this guide:
Method 1
Open root explorer.
Navigate to /efs/FactoryApp/
Open "factorymode" file as Text and edit it:
Change this:
Code:
OFF
To:
Code:
ON
Open "keystr" file as Text and edit it:
Change this:
Code:
OFF
To:
Code:
ON
Reboot device.
Click to expand...
Click to collapse
Method 2
Open Terminal emulator
Write the following:
Code:
su
Then click enter. It will ask for super user permission, give it permissions.
Write the following & click enter:
Code:
rm /efs/FactoryApp/keystr
Write the following & click enter:
Code:
rm /efs/FactoryApp/factorymode
Write the following & click enter:
Code:
echo -n ON >> /efs/FactoryApp/keystr
Write the following & click enter:
Code:
echo -n ON >> /efs/FactoryApp/factorymode
Write the following & click enter:
Code:
chown 1000.1000 /efs/FactoryApp/keystr
Write the following & click enter:
Code:
chown 1000.1000 /efs/FactoryApp/factorymode
Write the following & click enter:
Code:
chmod 0744 /efs/FactoryApp/keystr
Write the following & click enter:
Code:
chmod 0744 /efs/FactoryApp/factorymode
Reboot your device
Click to expand...
Click to collapse
This is all I can do for you friends, Worked alot on these methods to give you the best information.
Each method was tested by me and fully works.
If this helped you please press the "Thanks" button & Rate this thread 5 Stars.
If you like & appreciate my work please consider a donation!
Credits:
shnizlon
Candanga
A.S._id
dhiru1602
UtkarshGupta
P.M If you think that I forgot you
XDA:DevDB Information
Backup & Restore EFS + Get out from Permanent Safe mode - I9505, a Tool/Utility for the Samsung Galaxy S 4
Contributors
tamirda
Version Information
Status: Stable
Created 2013-09-05
Last Updated 2013-09-05
Amm i guess no one need it?
they do need it and i for one would like to thank you for the guide and time and effort in sharing ..mods and fixes are always welcome on xda thanks man:thumbup::thumbup:
Sent from my GT-I9505 using XDA Premium 4 mobile app
port76 said:
they do need it and i for one would like to thank you for the guide and time and effort in sharing ..mods and fixes are always welcome on xda thanks man:thumbup::thumbup:
Sent from my GT-I9505 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Thanks first real comment in the thread
Sent from my GT-N7100 boosted by PhoeniX ROM
:thumbup:its ok any time my friend ....iv told my friends about the fix and I'm sure they will pop into this very useful and informative thread .. Thanks again iv added it to my subscribed topics and I'm sure people will be popping in to view and post on the thread thanks :thumbup::thumbup:
Sent from my GT-I9505 using XDA Premium 4 mobile app
Nice guide, the command line is the best! :good:
Will heimdall work as an alternative to restore the efs.img? Like this: heimdall flash --efs efs.img ?
It is used from download mode, like odin, so would work even if you cannot boot.
This Method, in Moto x?
tamirda said:
Note to forum managers: Please make it a Sticky Thread, It should help to all users and there is no use for this tutorial if it is in page 3
Hello XDA Users,
I think some people here know who I am, so I will jump on the "Introduction of myself" for now.
Recently, I have faced many questions & problem of fake IMEI, of damaged EFS folder. So I made a little experiment on my device(GN2).
First, I backuped my EFS folder in 2 types - one is .img and the second is tar.gz.
Then, I deleted my EFS folder using ES Root Explorer. Which made my device to be on somethine called "Permanent Safe Mode" - You can not get out untill you fix your EFS folder and change some values.
This is permanent safe mode:
After I did my "research" I have managed to make several methods to backup & restore EFS, which should make your life easier and better.
First of all, Disclaimer:
I'm not responsible for any damage caused by using these methods, all methods tested by me, so it should work on your device too.
This is for I9505 Only!!!!!!!
Let's continue.
What you must have:
Latest base with latest modem and latest kernel - very important since in the latest versions samsung prevented the option to install old modems/kernels, so if you install old kernell/modem it can show you wrong IMEI.
Rooted device with the latest Super User
Latest busybox
PhilZ Recovery
Terminal Emulator
Root explorer - Can be ES File Explorer with working root option or just a root explorer from the market
A working EFS backup(In order to restore it...)
Time & Patient.
Important Notes:
When installing/downgrading firmwares, several people suffered from Fake IMEI. This is because the new firmware messed up your EFS folder, which means that you can not restore EFS backup until you are on the latest version, latest modem and latest stock kernel, recommended is XXUBMH1(right to 05/09/2013)
Some custom roms include modem installation in their rom installer. Due to modem flashing in recovery, some devices might get Fake IMEI. My recommendation is before even starting to use this guide, please try to install the latest modem via odin from this thread:
http://forum.xda-developers.com/showthread.php?t=2192025
When installing modem via odin, make sure you select PHONE and not PDA
You will find at least one method that works on your device, so don't give up after one method.
Read all guide and pay attention to all small details.
Backup methods
Method 1 - .img backup
First method, is an automatic backup/restore software.
Special thanks to A.S._id for his software.
The software:
Method 2 - .img backup
Method number 2 will create you efs.img backup on your internal sd. After that you can copy it to your computer.
What you have to do is this:
Method 3 - .tar.gz backup
This method will compress your efs folder into tar.gz file. This method is the same as choosing backup EFS folder in my rom(PhoeniX ROM)/Omega/Wanam/etc.
A tar.gz backup should look like this(On some devices there might be more files, but this picture was taken from Note II N7100 backup and it fully works):
What you have to do is this:
Restore methods
Now the fun begins
You will have to restore your backup when you have one or more of the folowing problem:
Fake IMEI (usually 004999010640000) or "null" IMEI
Blinking SIM card icon on the top tray… ETC
Unable to unlock your SIM card using your PIN
Fake Serial Number (usually 0000000) or "null" Serial
Unable to register to the network (usually comes with Fake IMEI & Fake Serial so check them.)
Attention please,
If you are 100% that your EFS folder is damaged and you have a working EFS backup with the right IMEI number, my recommendation is this:
Method 1 - restore .img backup
First method, is an automatic backup/restore software.
Special thanks to A.S._id for his software.
The software:
Method 2 - Restore .img backup
Method number 2 will restore your efs.img backup from your internal sd.
What you have to do is this:
Method 3 - restore .tar.gz backup
This method will restore .tar.gz backup.
A tar.gz backup should look like this(On some devices there might be more files, but this picture was taken from Note II N7100 backup and it fully works):
If you have like this, continue to the guide:
Method 4 - restore .tar.gz backup
This method will restore .tar.gz backup.
A tar.gz backup should look like this(On some devices there might be more files, but this picture was taked from Note II N7100 backup and it fully works):
If you have like this, continue to the guide:
Exit "Permanent Safe Mode"
When you in "Permanent Safe Mode" situation, it means that your EFS folder is broken.
If you succeeded in restoring your IMEI and you still stuck in this Safe Mode, use this guide:
Method 1
Method 2
This is all I can do for you friends, Worked alot on these methods to give you the best information.
Each method was tested by me and fully works.
If this helped you please press the "Thanks" button & Rate this thread 5 Stars.
If you like & appreciate my work please consider a donation!
Credits:
shnizlon
Candanga
A.S._id
dhiru1602
UtkarshGupta
P.M If you think that I forgot you
XDA:DevDB Information
Backup & Restore EFS + Get out from Permanent Safe mode - I9505, a Tool/Utility for the Samsung Galaxy S 4
Contributors
tamirda
Version Information
Status: Stable
Created 2013-09-05
Last Updated 2013-09-05
Click to expand...
Click to collapse
Mr Tamirda
The method this, made in terminal, working in one moto x? it's my question
Pika71 said:
Mr Tamirda
The method this, made in terminal, working in one moto x? it's my question
Click to expand...
Click to collapse
?????
slugthru said:
Will heimdall work as an alternative to restore the efs.img? Like this: heimdall flash --efs efs.img ?
It is used from download mode, like odin, so would work even if you cannot boot.
Click to expand...
Click to collapse
You can try and share your experiences.
From my personal experience with another device the dd method in terminal works just fine
Sorry but null IMEI isn't fake IMEI
Difference:
Null IMEI means you don't even have any data for the IMEI oh and it's bad!
fake IMEI means you do have a data which is corrupt. Nothing more only digits has been changed.
There's a different between those
I remember having null IMEI and my backup didn't help at all service center was forced to swap motherboard to get IMEI working.
---------- Post added at 02:26 PM ---------- Previous post was at 02:26 PM ----------
Pika71 said:
Mr Tamirda
The method this, made in terminal, working in one moto x? it's my question
Click to expand...
Click to collapse
It depends if it uses same permission. Also there is a way to fix a corrupt IMEI while in recovery
Also don't quote whole op
My brothers phone is in safe mode could i backup my efs folder and restore onto his device?
ok, i am stuck in factory mode but none of the methods described work because there is nothing in my efs folder - it is empty so there are no files to actually edit.

[! DISCONTINUED !] [TUTORIAL][LOCKED][UNLOCKED][ANY G4] DLM Backup

This thread is superseeded by: https://tinyurl.com/SALTatXDA
NO FURTHER SUPPORT HERE!
DLM Backup is a NANDROID BACKUP IN DOWNLOAD MODE!
(DLM Backup = [D]own[l]oad [M]ode Backup)
The following does not require an unlocked device and so even no TWRP.
Believe it or not but you are able to backup full partitions nevertheless!!! :victory:
.. and all this even for partitions you usually have NO ACCESS TO (e.g. laf, aboot etc) and all this even without root ! wtf its not a dream its true! :victory:
It's really awesome especially for those having a locked device but still wanted to have a nandroid backup
or for those encountering the ILAPO (Infinite Loop Auto Power off or just called "bootloop issue") wanting to save their data!
The following will make full disk dumps of all or only the system essential ones of your device. Choose whichever option you need.
Preparation
First of all you should download FWUL ( https://tinyurl.com/FWULatXDA ).
Every other Linux is fine as well as long as you can handle it! (do not expect support from me then - I support FWUL only)
You may still should consider FWUL as it has everything onboard and is preconfigured to work with Android devices out-of-the-box.
Keep in mind the FWUL password as you need it for the sudo commands within the terminal later.
Once FWUL is running open a terminal (little black icon in the panel):
Code:
git clone [url]https://github.com/steadfasterX/lglaf.git[/url]
cd lglaf
Leave this terminal window open - we need it in the next step.
Then boot your phone into download mode --> the following guide is 100% working and bulletproof:
take out battery and unplug USB cable
plugin USB cable to your PC (while battery ist still out)
wait until you see the missing battery icon (question mark within a battery symbol)
press Volume up and while keeping it pressed put battery in (take care that you do not press the power button)
keep pressing Volume up until you see "Download mode"
If that does not work for you try it this way instead:
unplug USB cable
power down device or pull out battery
put battery back
press Volume up and while keeping it pressed plugin USB cable to your PC (take care that you do not press the power button)
keep pressing Volume up until you see "Download mode"
Your phones screen should look similar to this afterwards:
{
"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"
}
You need a USB stick or disk which is big enough to hold the backup.
Depending on the method you need either a ~8 GB one or a 64 GB..
Plugin the USB stick and find out the path to it by just double clicking on the USB stick icon which appears on the desktop after plugging in the stick.
Then write down / copy the path to the stick as shown in the screenshot:
If you encounter problems with the above (e.g. no icon appears after plugging in the USB stick) you can do this in a terminal instead:
Code:
df
Filesystem 1K-blocks Used Available Use%[COLOR="Red"] Mounted on[/COLOR]
dev 16439340 264744 16174596 2% /dev
[............]
/dev/sdd3 2978320 9532 2797780 1%[COLOR="red"] [B]/run/media/android/myusb-stick[/B][/COLOR]
When you are running LL you can skip this step but when you are on MM (or higher...) you need to do the following:
Execute this in your terminal left open from the "Preparation" topic:
Code:
sudo python2 auth.py
you should see something like:
LGLAF.py: DEBUG: Detaching kernel driver for intf 0
LGLAF.py: DEBUG: Using endpoints 83 (IN), 02 (OUT)
auth: DEBUG: Challenge: c0:45:6c:78
auth: DEBUG: Response: b4:1d:1e:cd:e8:f1:5f:b5:fa:78:9e:f8:2d:c6:83:86
Click to expand...
Click to collapse
Now you are authenticated with the download mode and we can continue:
Option A) FULL backup (includes everything e.g. system, cache and userdata / internal storage)
When to use:
if you want to flash new ROMs or bootloader stacks
if you want to backup all your internal storage (e.g. pictures, videos and stuff) - keep in mind TWRP does NOT backup your internal storage!!
if you want to have a real FULL NANDROID (e.g. TWRP will not backup partitions like misc, persistent, persistent-lg etc)
Requirements:
- FWUL
- a 64 GB or bigger USB stick / disk
Execute this in your terminal left open from the "Preparation" topic:
Code:
sudo python2 extract-partitions.py --max-size 0 -d [I]YOURUSBSTICKpath[/I]
(replace YOURUSBSTICKpath with the path you discovered in the Preparation topic!)
Be patient.. this can take a loooong time!
You can watch the progress e.g with executing this in a NEW terminal (just click the terminal icon in the panel again):
Code:
watch 'ls -lathr [I]YOURUSBSTICKpath[/I] | tail '
(replace YOURUSBSTICKpath with the path you discovered in the Preparation topic!)
Once finished you can reboot by either taking out the battery or typing:
Code:
sudo python2 lglaf.py --skip-hello -c '!CTRL RSET'
Option B) system essentials backup (does *NOT* include system, cache and userdata / internal storage!!)
When to use:
if you want to flash new bootloader stacks
if you want to backup your current lock/unlock state
if you want to backup your IMEI and EFS
Requirements:
FWUL
a 4 - 8 GB or bigger USB stick / disk
Execute this in your terminal left open from the "Preparation" topic:
Code:
sudo python2 extract-partitions.py -d [I]YOURUSBSTICKpath[/I]
(replace YOURUSBSTICKpath with the path you discovered in the Preparation topic!)
Be patient.. this can take some time!
You can watch the progress e.g with executing this in a NEW terminal (just click the terminal icon in the panel again):
Code:
watch 'ls -lathr [I]YOURUSBSTICKpath[/I] | tail '
(replace YOURUSBSTICKpath with the path you discovered in the Preparation topic!)
Once finished you can reboot by either taking out the battery or typing:
Code:
sudo python2 lglaf.py --skip-hello -c '!CTRL RSET'
... and the last 2 things which need to be done
1) Click the thanks button here
2) Enjoy
Restore a DLM Backup
Checkout Post #2 for the restore howto
Credits
Peter Wu for his absolutely awesome job on reverse engineering the LAF protocol and offering the lglaf code as python code.
Main thread for lglaf: https://forum.xda-developers.com/android/software-hacking/tool-lg-download-mode-laf-t3285946/page1
Donations: https://forum.xda-developers.com/member.php?u=4790426
.
Restore a previously taken backup or partitions of an already extracted KDZ
There are 2 methods available - choose the one matching your needs:
A) Restore a previously taken DLM Backup
B) Flash a KDZ / LGUP NG by sfX
Unfortunately this may not work on every firmware so you may try different firmwares then and you will receive the same error regarding communication port closing but in general it should work this way.
A) Restore a previously taken DLM Backup / Restore partitions from an extracted KDZ
To restore single partitions use the following
sudo python2 auth.py
sudo python2 partitions.py --restore /path/to/dumpfile partitionname
e.g.
sudo python2 auth.py
sudo python2 partitions.py --restore /tmp/misc misc (would restore the misc partition)
To restore ALL partitions in a folder
For this the best is to use the new LGUP NG kdzmanager which is explained in the next topic.
Install LGUP NG but skip the steps to extract a KDZ if you don't need it.
Then:
bash kdzmanager.sh --test --flash /path/to/imagefiles
(/path/to/imagefiles must contain your previously taken DLM backup files or an extracted KDZ)
This will just test flashing and not actually flash.
If that looks fine do it again but without --test parameter:
bash kdzmanager.sh --flash /path/to/imagefiles
B) Flash a KDZ / LGUP NG (next generation) by sfX
Forget LGUP to flash a KDZ from now on!
Just use my KDZManager
Features:
No worries anymore about those crappy DLL issues
Extract a KDZ
Test flashing partitions (dry run without actually flashing anything)
Flash partitions from a KDZ
when flashing avoid erasing/wiping userdata (keep your data between KDZ flashes)
Hint: not wiping userdata can occur in a bootloop when its not compatible with the ROM! So use that option with care.
will work on any Linux (but FWUL is the only supported)
Keep in mind that this is an early release and there are NO CHECKS like ARB or even if the device model matches with the KDZ but THIS WILL ALL COME (even with an option to override and flash regardless)
Roadmap:
GUI
Check for matching device model
Check for ARB
Instructions:
Boot FWUL (or your Linux but keep in mind that only FWUL is supported), choose language & login
Download the KDZ file you want to flash (we need to know the path later e.g. /home/android/Downloads/)
Open the folder LG
Connect device in download mode to the PC
Double click "LG laf NG" icon
Type in the new opened terminal:
sudo python2 auth.py
[*]sudo python2 partitions.py --list
If this lists your partitions then we can proceed with flashing.
Download my brand new kdzmanager tool in FWUL: (right click and save as)
When you are not using the persistent mode of FWUL: plug in a big USB stick (e.g. 32 GB or more) into FWUL and extract the attached file there
When you are using the persistent mode of FWUL: just extract it in your download folder
You need to know the full path so best is copying the path from the file manager (e.g. /home/android/Downloads/ ) or leave the file manager open there
Open another terminal (black little icon in the panel)
cd and directly behind this paste the path you copied (e.g. cd /home/android/Downloads/ )
press ENTER
bash kdzmanager.sh -x FILLINFULLPATH-TO-DOWNLOADED-KDZ
(e.g. bash kdzmanager.sh -x /home/android/Downloads/h811blablubb.kdz)
WARNING-1: Keep in mind that atm kdzmanager is not able to proof if you choose a compatible KDZ file for your device!
Check your device model and the KDZ twice!
WARNING-2: Keep in mind that atm kdzmanager is not able to proof your current ARB version so flashing an smaller ARB then your current one will BRICK your device.
Check ARB first: CLICK
If you understood the above 2 warnings proceed like this:
bash kdzmanager.sh --test --flash extracteddz/
(just like this as "extracteddz" is the path generated by the kdzmanager)
This will just test flashing and not actually flash. Let me know the results of this (copy & paste output)
if you can't wait the next step would be actually flashing ofc:
WARNING: by default the kdzmanager will not overwrite userdata (which would be like a factory reset) and I would recommend to leave it out always and better choose the LG factory reset menu (after flashing completed) if required. If you still want to flash it use --with-userdata as a parameter (can take a loooong time then btw).
bash kdzmanager.sh --flash extracteddz/
last step ( will be included in the next release): wipe your userdata:
sudo partitions.py --wipe userdata
Or just use the factory reset hardware key combo to do the same.
If you skip this step you may encounter a bootloop. If that happens you can at any time use the hardware key combo to boot into factory reset to fix that.
sfX
FAQ
1. Q: You get the error message: "Expected arrow in ls output" when executing lglaf
A: update to the latest version of lglaf (thx to @tulen_kobi for this patch!). For updating lglaf on FWUL check Q4.
If the error still persists your download mode version is not supported by lglaf. Its very likely that your carrier has a very strict policy activated in download mode. The only chance is to try other download mode version meaning to flash different KDZ files (on locked devices) or just the laf.img in fastboot (on unlocked devices).
On Nougat and when unlocked it is enough to just flash the laf.img of MM and you can use lglaf again.
2. Q: You get not an error but messages or files containing just "Hello, I am LAF. Nice to meet you."
A: your download mode version is not supported by lglaf. Its very likely that your carrier has a very strict policy activated in download mode. The only chance is to try other download mode version meaning to flash different KDZ files (on locked devices) or just the laf.img in fastboot (on unlocked devices).
On Nougat and when unlocked it is enough to just flash the laf.img of MM and you can use lglaf again.
3. Q: All seems fine but at the end of a command you see: "comm.call(close_cmd) [....someotherstuff...] Command failed with error code 0x8000010a"
A: This is known and not a serious issue. Once I have the time I will fix it but in the meanwhile pls ignore..
This has been fixed. please update your LGlaf like described in the next FAQ
4. Q: I want to update lglaf on FWUL v2 or higher
ok here is the correct way to achieve this on FWUL v2:
cd ~programs/lglafng/
git pull
git checkout g4
then you're up2date and can try again while in this folder!
sfX
I'm so happy that you were able to finally get this working. It's dumping my system partition right now. I'll report back when it's done.
Also. You should note that the sudo password is "linux" and to view progress on the dump, you should specify that the command should be opened in a new terminal window.
Over all. Awesome tutorial!
EDIT: Was able to retrieve 7gb of lost pictures thanks to this method! Thank you!
How to restore? Is it possible?
mateus.sc said:
How to restore? Is it possible?
Click to expand...
Click to collapse
Yes even that.. I will write down a restore guide soon.
.
Sent from my LG-H815 using XDA Labs
I cannot Auth with my device.
I get the first 2 lines from the auth.py command
No challenge or response.
Using Virtualbox.
OllieD said:
I cannot Auth with my device.
I get the first 2 lines from the auth.py command
No challenge or response.
Using Virtualbox.
Click to expand...
Click to collapse
what Android version is installed currently?
.
steadfasterX said:
what Android version is installed currently?
.
Click to expand...
Click to collapse
20G Stock Locked Bootloader.
Rebooted into live environment and worked.
Extract partitions errored out
Traceback (most recent call last):
File "extract-partitions.py", line 63, in <module>
main()
File "extract-partitions.py", line 60, in main
dump_partitions(comm, disk_fd, args.outdir, args.max_size * 1024)
File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/home/android/lglaf/partitions.py", line 78, in laf_open_disk
comm.call(close_cmd)
File "/home/android/lglaf/lglaf.py", line 176, in call
raise RuntimeError('Command failed with error code %#x' % errCode)
RuntimeError: Command failed with error code 0x8000010a
After Dumping, Option B
Also the Firefox installer although it installs Firefox it wont launch and gives a SQLite Version Error so it will not run.
Chromium works fine.
Now i've backed up i can try and install V29
OllieD said:
20G Stock Locked Bootloader.
Rebooted into live environment and worked.
Extract partitions errored out
Traceback (most recent call last):
File "extract-partitions.py", line 63, in <module>
main()
File "extract-partitions.py", line 60, in main
dump_partitions(comm, disk_fd, args.outdir, args.max_size * 1024)
File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/home/android/lglaf/partitions.py", line 78, in laf_open_disk
comm.call(close_cmd)
File "/home/android/lglaf/lglaf.py", line 176, in call
raise RuntimeError('Command failed with error code %#x' % errCode)
RuntimeError: Command failed with error code 0x8000010a
After Dumping, Option B
Also the Firefox installer although it installs Firefox it wont launch and gives a SQLite Version Error so it will not run.
Chromium works fine.
Now i've backed up i can try and install V29
Click to expand...
Click to collapse
well it sounds like u have not much RAM attached to your VM then. 4 GB are recommended.
The dump error can be ignored as long as auth.py has worked before and everything gets dumped..
.
steadfasterX said:
Just a quick note:
I completely re-worked the guide and fixed an issue for devices running MM!
Just re-do the guide if you encountered an issue before.
.
Click to expand...
Click to collapse
what if .. i dont have USB.? am planning of backing up my IMEI. as i been reading this on the new N roms..
what can i do.?
raptorddd said:
what if .. i dont have USB.? am planning of backing up my IMEI. as i been reading this on the new N roms..
what can i do.?
Click to expand...
Click to collapse
If you have an unlocked device you have luck and you could use dd commands in TWRP. I know that yours is unlocked so you could use dd on every partition available on your device.
Tbh the most important seems to be persistent, fsg, misc but until I know for sure I would just backup EVERY partition. It's only needed once in the phones life usually so it doesn't hurt..
I need to have my device repaired before I can test it further so this can take a while.. Until then the backup of every partition is the best choice.
if the device is locked and on LL then TWRP in FIsH plus the mentioned dd commands can be used as well. I would still recommend the download mode backup though..
if the device is locked and on MM or N (haven't tested N in download mode though) then USB plus download mode is the only choice.
.
Sent from my LG-H815 using XDA Labs
Similar question. What's the quick and dirty way to backup these partitions from terminal app / busybox?
Dd if=??? Etc
not sure if different between models but mines h815 international running 'stock' nougat
steadfasterX said:
If you have an unlocked device you have luck and you could use dd commands in TWRP. I know that yours is unlocked so you could use dd on every partition available on your device.
Tbh the most important seems to be persistent, fsg, misc but until I know for sure I would just backup EVERY partition. It's only needed once in the phones life usually so it doesn't hurt..
I need to have my device repaired before I can test it further so this can take a while.. Until then the backup of every partition is the best choice.
if the device is locked and on LL then TWRP in FIsH plus the mentioned dd commands can be used as well. I would still recommend the download mode backup though..
if the device is locked and on MM or N (haven't tested N in download mode though) then USB plus download mode is the only choice.
.
Sent from my LG-H815 using XDA Labs
Click to expand...
Click to collapse
OMG so basically if this works in locked N, can I flash the korean v30 kdz and then restore a backup the modem.img from v29a made for my H815 with this method?
The possibilities are amazing
obvious said:
Similar question. What's the quick and dirty way to backup these partitions from terminal app / busybox?
Dd if=??? Etc
not sure if different between models but mines h815 international running 'stock' nougat
Click to expand...
Click to collapse
I will add it in the TWRP thread ASAP
mateus.sc said:
OMG so basically if this works in locked N, can I flash the korean v30 kdz and then restore a backup the modem.img from v29a made for my H815 with this method?
The possibilities are amazing
Click to expand...
Click to collapse
Technically this method can provide that (as said I can't test N atm though so I don't know if this works in general for N but if LG hasn't changed anything.. )
but:
keep in mind that cross flashing partitions can result in a soft brick on locked devices!! I don't know how N behaves here tbh so it may just work or it may soft brick in the specific case of modem.
So it would be nice to have someone trying to use the auth command on a N bootloader stack. This will not harm anything but then we know for sure if this is usable for N or not
.
Sent from my LG-H815 using XDA Labs
steadfasterX said:
If you have an unlocked device you have luck and you could use dd commands in TWRP. I know that yours is unlocked so you could use dd on every partition available on your device.
Tbh the most important seems to be persistent, fsg, misc but until I know for sure I would just backup EVERY partition. It's only needed once in the phones life usually so it doesn't hurt..
I need to have my device repaired before I can test it further so this can take a while.. Until then the backup of every partition is the best choice.
if the device is locked and on LL then TWRP in FIsH plus the mentioned dd commands can be used as well. I would still recommend the download mode backup though..
if the device is locked and on MM or N (haven't tested N in download mode though) then USB plus download mode is the only choice.
.
Sent from my LG-H815 using XDA Labs
Click to expand...
Click to collapse
yes unlocked.. i downloaded FWUL but on step to place the command for python i had directiry not found and gave up use twrp for EFS.
for DD what are commands is this using ternimal? where can i find all the command to extract say boot ,system modem ect.?
raptorddd said:
yes unlocked.. i downloaded FWUL but on step to place the command for python i had directiry not found and gave up use twrp for EFS.
for DD what are commands is this using ternimal? where can i find all the command to extract say boot ,system modem ect.?
Click to expand...
Click to collapse
just try my new twrp version which will be uploaded in 5 minutes..
.
Hey I'm getting an error in running this - phone is in download mode and connected. Using FWUL on my machine and trying to dump to an extrernal HD (path below in first line).
Code:
[[email protected] lglaf]$ sudo python2 extract-partitions.py --max-size 0 -d /run/media/android/16a064ee-96de-4c4d-8c30-29cbcc2e5441/
Traceback (most recent call last):
File "extract-partitions.py", line 63, in <module>
main()
File "extract-partitions.py", line 60, in main
dump_partitions(comm, disk_fd, args.outdir, args.max_size * 1024)
File "extract-partitions.py", line 24, in dump_partitions
parts = partitions.get_partitions(comm)
File "/home/android/lglaf/partitions.py", line 41, in get_partitions
assert arrow == '->', "Expected arrow in ls output"
AssertionError: Expected arrow in ls output
ReeS86 said:
Hey I'm getting an error in running this - phone is in download mode and connected. Using FWUL on my machine and trying to dump to an extrernal HD (path below in first line).
Click to expand...
Click to collapse
Yea... I saw that on another phone as well. Weird.
I need your help to fix it..
Could you come into IRC on Monday?
sfX
Sent from my LG-H815 using XDA Labs
steadfasterX said:
Yea... I saw that on another phone as well. Weird.
I need your help to fix it..
Could you come into IRC on Monday?
sfX
Sent from my LG-H815 using XDA Labs
Click to expand...
Click to collapse
Ya I'll try to pop on after work. Can also see if the secure boot thing works once I get that backup.

Categories

Resources