FIx DRK/dm-verity, Factory CSC and Serial Number - Galaxy Note 4 General

Hello,
I have posted on various threads that i can fix DRK (Device root key), but after large demand in PM for the fix i have decided to make a tutorial, since i don't have much time to help everyone, this tutorial is only tested on SM-N910C, could work on other variants of Exynos, perhaps snapdragon but NOT TESTED!!!!
So how is DRK broken? Usually when you flash roms and stuff you should have EFS backup as its most important thing while rooting samsung phones, but some people just dont do that, other people use boxes like z3x for unlocking and they wipe EFS, while unlocking phones the process sometimes changes IMEI number and leaves device root key wiped. These modifications sometimes make it hard to revert back to stock and i personally had problems with device suddenly rebooting etc... with this tutorial we will try to mitigate these problems.
PLEASE DO NOT PROCEED WITHOUT SHELL/ADB KNOWLEDGE IF YOU MESS SOMETHING UP YOU WILL LOOSE IMEI AND WILL HAVE A BRICK! You have been warned and i am not to be held liable!
First we need to make backup of your EFS, we will use TAR and shell which is most reliable way (Partition Backup is good too), with adb shell:
1. su
2. cd /efs
3. tar czf efsbackup.tgz *
4. mv efsbackup.tgz /data/media/0/
Now go to your internal memory in My Computer and there should be file called efsbackup.tgz copy it somewhere safe on your PC. This is your efs backup!
Now we need to take two files which we will reuse latter, you can extract them from efsbackup.tgz but this is easyer:
1. su
2. cd /efs
3. cp nv_data.bin /data/media/0/
4. cp nv_data.bin.md5 /data/media/0/
Now go to your internal memory and copy nv_data.bin and nv_data.bin.m5 to your desktop, we will need these files later. These files contain your imei!
Now we need to reboot to TWRP and format EFS partition via terminal (We are doing this to force radio to recreate the files we lost while flashing and make system more stable, no reboots etc..)
TWRP --> Advanced --> Terminal type these (These will also fix "Failed to mount /efs (Invalid Argument)) Don't missspell, if you get error no mount in fstab, that is ok!
1. mke2fs /dev/block/mmcblk0p3
2. mount -w -t ext4 /dev/block/mmcblk0p3
3. reboot
Now the system will be booting, once done when you dial *#06# you will see generic IMEI and it's not yours, don't freakout this is how its supposed to be. Radio also recovered your default values in FactoryApp folder which is nice. Now reboot phone twice!
Let's restore nv_data and restore imei, assuming you still have those files in your internal memory do this with ADB:
1. su
2. cd /efs
2. rm -rf /efs/nv_data.bin
3. rm -rf /efs/nv_data.bin.md5
4. mv /data/media/0/nv_data.bin* /efs/
5. chmod 700 /efs/nv_data.bin*
6. chown radio:radio nv_data.bin*
7. reboot
After phone reboots your factory IMEI is back and registering to network properly, now we have achieved stable device no random reboots and clean remade factory EFS!!!
DRK REPAIR PART!
Now lets go to the part of fixing DRK Device Root Key and dm-verity error! I have attached file called prov_data.zip, extract the prov_data folder to your internal memory (This is not a flashabe zip) And run these commands with your ADB Shell:
1. su
2. cd /efs
3. mv /data/media/0/prov_data /efs/
4. chmod -R 755 /efs/prov_data
5. chown -R root:root /efs/prov_data
Device root key is now present in your device but not yet active/validated, in order to validate this, you need to flash your factory firmware with ODIN, go to factory recovery and wipe data/factory reset, and dm-verity error is now gone!
SERIAL NUMBER FIX PART
I have attached file called serial_no.zip (Not a flashable zip file), extract the file from it called serial_no open it with notepad or whatever text editor you use and replace XXXXXXXXXXX with your own serial number that is written behind your phone. Now copy serial_no file to your internal memory again and with adb we do this:
1. su
2. cd /efs
3. mv /data/media/0/serial_no /efs/FactoryApp/
4. chmod 700 /efs/FactoryApp/serial_no
Reboot and done, you have your serial number back *#06#!
FACTORY CSC FIX PART
Download the file called csc_repair.zip, inside you will see the file called mps_code.dat, open it with notepad or whatever text editor you use, type in your factory CSC instead of XXX in my file and save. If you cant find your factory CSC, go to Kies or SmartSwitch, initialize firmware, type in your serial number and device model it will show your factory CSC for reinstall, this is your CSC. Now copy mps_code.dat file to your internal memory and again we run ADB Shell:
1. su
2. cd /efs
3. mv /data/media/0/mps_code.dat /efs/imei/
4. chown root:root /efs/imei/mps_code.dat
5. chmod 755 /efs/imei/mps_code.dat
This is it, if you can follow these steps you can get clean factory remade EFS partition, with your own IMEI, Serial Number, CSC Code, DRK/dm-verity fixed. Flashing factory ODIN firmware after this will make your phone work as it should!

i have this issue on the n910t... I have full access and a working phone but it lags a lot... youtube videos stutter and when typing some words they keyboard, well all keyboards stutter too... this began to happen when my phone started showing me this message, you see the phone was unlocked by certfile with octoplus or z3x... then it lost signal but when i tried to wipe efs, the phone recovered its own imei and serial... So i unlocked it normally with z3x but had to downgrade the modem from EPE3 to DOK2 to unlock it.... then i restored the complete firmware to the latest version of android 6.0.1 and it showed me the DRK problem..
I'm going to try this tutorial and see it this stops all the stuttering every 8 seconds,..

SeerePetrova said:
i have this issue on the n910t... I have full access and a working phone but it lags a lot... youtube videos stutter and when typing some words they keyboard, well all keyboards stutter too... this began to happen when my phone started showing me this message, you see the phone was unlocked by certfile with octoplus or z3x... then it lost signal but when i tried to wipe efs, the phone recovered its own imei and serial... So i unlocked it normally with z3x but had to downgrade the modem from EPE3 to DOK2 to unlock it.... then i restored the complete firmware to the latest version of android 6.0.1 and it showed me the DRK problem..
I'm going to try this tutorial and see it this stops all the stuttering every 8 seconds,..
Click to expand...
Click to collapse
I am not sure if it will work on N910T variant, but you can try it. DRK error happened on your note because z3x wipes EFS and then writes new nv_data.bin, but by wiping it destroys your prov_data/dev_root folder which contains DRK. If you think your EFS partition created your problem, you can start from the start and format EFS to make it factory and then proceed.

Hey there!
I recently bought a used Note 4 910C. I was told by the shopkeeper that it has never been tempered with. But OTA update fails bcuz of DRK error. I guess someone did try something with it previously. I manged to update Marshmallow via ODIN.
yesterday I rooted it and followed your DRK REPAIR Part. flashed via ODIN for validation but the error still exists. I did not do the whole method from the beginning ( I backed up EFS and nv_bin). Plz tell me what did I do wrong.
Another thing that may be of some importance. The serial no was different form phone's back in just one letter in the middle. Instead of '5' it was showing 'S'. I wonder it can not be by mistake. there must be some messing up previously.
Anyway I followed ur method of SERIAL NO repair and managed to repair the serial no. The IMEI was already a match.
Plz help me what should I do for DRK repair.
Regards.

Usually when you restore prov_data folder properly, you need to go to twrp, format system, data and cache. Then with odin flash stock firmware with your own csc code (do csc repair if its not a match). After that phone should boot to stock recovery, then do format data/factory reset from stock recovery. It should say something like "verifiyng dm-verity" when you go to reboot. After system boots when you go to recovery again it wont show drk error anymore. Tested 100% on 910c variant.

magix01 said:
Usually when you restore prov_data folder properly, you need to go to twrp, format system, data and cache. Then with odin flash stock firmware with your own csc code (do csc repair if its not a match). After that phone should boot to stock recovery, then do format data/factory reset from stock recovery. It should say something like "verifiyng dm-verity" when you go to reboot. After system boots when you go to recovery again it wont show drk error anymore. Tested 100% on 910c variant.
Click to expand...
Click to collapse
So I'm doing the drk fix on my smg925p device and when doing the drk commands the prov_data folder doesn't move to the efs folder it stays in my internal memory and i did the restore and reset and i still get the drk error clearly a command or something is wrong

Use root explorer to move the folder then

magix01 said:
This is it, if you can follow these steps you can get clean factory remade EFS partition, with your own IMEI, Serial Number, CSC Code, DRK/dm-verity fixed. Flashing factory ODIN firmware after this will make your phone work as it should!
Click to expand...
Click to collapse
1. su
2. cd /efs
3. tar czf efsbackup.tgz *
4. mv efsbackup.tgz /data/media/0/
Testing........I was able to make a backup of efsbackup.tgz on a phone without any dm-verity damage. So the command works.
But on the phone that needs efs repair, when I run the command tar czf efsbackup.tgz * with Terminal Emulator
I get the error message tar: efsbackup.tgz: file is the archive; skipping
Any thoughts anyone?

Try with busybox installed and system root not systemless.

magix01 said:
Try with busybox installed and system root not systemless.
Click to expand...
Click to collapse
Thanks, that worked. The phone I'm working on is a SM-N910V and it does not have the files nv_data.bin or nv_data.bin.md5 inside the efs folder, any suggestions?
Can I send you my efs folder for repair?
I have two SM-N910V one is Okay. could I pull some files from the good one to help fix the damaged one?

+1 N910F have dont the nv_data's...my efs it's okay, i only wanna look

magix01 said:
Try with busybox installed and system root not systemless.
Click to expand...
Click to collapse
SM-N910V I decided to give this a try.
I used Root Browser to change the name of every file and folder inside the efs folder. I just added a 1 to the end of the names so I could revert back if needed.
I rebooted the phone, went back to check the efs folder and it had regenerated everything I needed to keep. And it didn't load the junk files. The phone runs like it's using AdAway on steroids.
What do you think about that. Why did it work.
http://forum.xda-developers.com/note-4-verizon/general/spyware-fix-fixed-lag-wi-fi-problems-t3433839

HI im having trouble doing the third command in DRK repair . it say that it cant be moved becuase the directory is not empty what should i do ?

I can confirm that it doesn't work with the Samsung Galaxy S6 Edge Sprint Model (SM-G925P)

bro i use your method to recover sn number and i get my serial number back but when i reboot its gone null again what can i do bro

Thank you! I use this method to restore the serial number and fix DRK on the phone Samsung SM-A310F Galaxy A3 (2016)

This method is full working on sm-n910g but still dm verification failed messages
Efs restore and phone working well
So thank u magix01

is it possible to use your files on my note edge n915fy ??

i have done everything but i can get back original emei. DRK everthing seem ok.serial number said no when i dial *#06# but i can see it on settings -status...
my phone can no register nto network
..please help.

doctor-cool said:
Thanks, that worked. The phone I'm working on is a SM-N910V and it does not have the files nv_data.bin or nv_data.bin.md5 inside the efs folder, any suggestions?
Can I send you my efs folder for repair?
I have two SM-N910V one is Okay. could I pull some files from the good one to help fix the damaged one?
Click to expand...
Click to collapse
Did you get any fix? I'm also missing these files in my N910T.

Related

[GUIDE] how to get IMEI to stick across reboots

This is a rundown of restoring your IMEI and /efs partition. A lot of people lose their IMEI and have no problem restoring it a variety of ways. But if your restored IMEI disappears on next reboot, your problem is something else. I had this, and I believe it was a corrupted /efs partition.
solution, short answer: flash a good efs.rfs file. I did it in Heimdall; I assume it'll also work in Odin. The one I found online (see attachment) restored my efs to the dummy IMEI of 004999010640000. Where I live and on my provider, this gives me network access. From there I could restore my backup nv_data.bin file to /efs. And then my proper IMEI sticks across reboots.
also: kitch posts another way to fix this, here and here.
NOTE: Messing with IMEI has potential legal problems. The attached file restores IMEI to a fairly common dummy number, so I assume it's not a problem. (mods, please delete if this is a problem). The dummy IMEI could work in your area, but that still could pose legal problems. Check in your area, and see the next paragraph.
WARNING/DISCLAIMER: I found this file on Rapidshare. I don't know who made it, put it there, where it might have been linked from, or what exactly is in it. All I had was a filename and I googled it. And all I know about it is that if you have the problems described above and below, then this may work for you. It did for me. If anyone can "see" inside the file to check that it doesn't contain anything malicious, please comment. All I can say is that ClamXav found nothing wrong with BML3_RESTORE.tar.md5 or the efs.rfs contained within it. And that I'm not responsible for what you do to your own phone.
More ways to check if this is your problem:
- You have no signal. In System Settings > About phone, Baseband says Unknown, even if you know you have a modem in there. Also, them going to Status, your IMEI and IMEI SV also say "Unknown". Other people posting about lost IMEI say they have either all zeroes there, or the dummy IMEI 004999010640000.
The rest of this is what I did in GB. I assume if you have this problem, you tried other solutions that got you here too.
- Flashing stock Samsung ROM with repartition doesn't restore IMEI (at least in Heimdall; I can't check Odin). Flashing EZbase Recovery in Heimdall doesn't do it either. They flash, but afterward boots to recovery mode and shows errors about not being able to apply Multi-CSC.
- in Terminal Emulator or adb, running 'mount /efs' returns: 'mount: can't read 'etc/fstab/': no such file or directory'.
- From here, you can still flash a rooted kernel and flash GB ROMs in CWM recovery mode. After each flash, recovery mode shows errors about not being able to mount /efs and/or /dbdata, and not being able to apply CSC.
- From here, if you try flashing to CM7 or CM9, installation aborts. Onscreen error message shows problems with /tmp/updater.sh.
- If you tried to flash a recent kernel with Heimdall, you can get in its recovery mode. I did this trying to get to a known working JB nandroid. I flashed the JB rom again, and it completes. Rebooting sent me back to recovery mode. Repeat rebooting until fed up. Restoring nandroid completes. Rebooting sent me back to recovery mode. Repeat rebooting until fed up.
solution, long answer:
For me, this was from GB.
- Flash the attached file. For Heimdall, untar it (in command line, run 'tar -xvf /path/to/BML3_RESTORE.tar' without quotes, and replacing /path/to/ with the proper filesystem path. If you don't know what this is, try dragging and dropping the file into your terminal window on your computer.)
Then run: 'heimdall flash --efs /path/to/efs.rfs' (without quotes, again replacing path, or drag-and-drop the file into your terminal window)
On first attempt (second was other human error), I did not flash a whole package with PIT file, or repartition. I did later, and that worked fine, too.
- It automatically reboots (unless you told Heimdall not to). You may go to recovery mode and see a bunch of errors about mounting, but applying Multi-CSC is a success. Reboot, and the phone starts normally. You may momentarily see the circle-and-slash no-signal icon in the upper left corner, but soon after it should show signal bars. Your homescreen may show your network somewhere.
- Check IMEI. It should be the dummy number. You can do this with the phone's number keypad (typing *#06#). I prefer to go to System Settings > About phone > Status. This way you can see the dummy IMEI, and IMEI SV should now also show a number. Go back up one level and also check Baseband; that should now show your modem.
- Restore actual IMEI. This requires that you previously backed up your /efs folder. Restoring this is documented better and more thoroughly elsewhere. I went into my /efs backup folder and copied nv_data.bin to /efs. This is easy with Root Explorer. Press the filename, select copy, navigate back up and to /efs. At the top of the screen, click Mount R/W. Delete everything in there (menu, multi-select, select all, delete). Paste the file. Long press the file, change permissions. Make it 644 (Owner is Read+Write, others are Read), save. Long press again, scroll toward bottom of menu and Change Ownership. Make it Radio (1001) and Radio (1001), save. Click to Mount R/O and exit.
- Check it. Go back and check your IMEI and it should be your real one. IMEI SV should probably change, too. (For me, it was 01 in GB, but now it's 03 in ICS). Reboot, and it should remain. Baseband is also filled in.
From here you can flash up to ICS, or whatever, and your IMEI should remain.
note on attachment: The original filename I searched for and found on Rapidshare was BML3_RESTORE.tar.md5. I've changed the extension to be *.tar, so it can upload to XDA. I think Odin users need to add the .md5 extension.
md5 checksum for BML3_RESTORE.tar: f5ab4c90ed60105c8b50e4e9b112e50b
Credit: XDA user magarto is the one whose post led me to this file and fix, from his post here.
errata: This was originally a [Q]-tagged Question thread. I overwrote the OP with this guide and changed the thread title. Hence, the next several posts may seem out of context.
Still unsolved huh? Khmers do have limited access, due to what happened in their country, anyway you can get a better idea here http://forum.gsmhosting.com/vbb/f258/ how efs problems are solved by various box. Just search this forum about efs or post, many Filipinos there .
Having said that, the version of Galaxy S I am using is Korean (has DMB TV, so hardware differences), and to solve this in our version , we simply flash the beginning ROM (with MOVI Files) Its like the Installation Files of Windows, which does a complete setup . This is the last resort for the Korean Galaxy S, solves any and every problems, always wondered why the Galaxy S, does not have this compilation or its only with samsung service centers. anyway
If you have an efs backup, you should try using Root explorer to overwrite (copy paste) the the current efs folder, fix chmod 644 and EXIT using the menu of root explorer and reboot phone to see if it sticks.
thanks for the forum link. yeah, the phone shop nerd was stuck, too. and they did have a box, several that sounded like the octopus box you said.
i've been doing some looking, too, and wondering if it's corrupted file system. i saw several posts about corrupted internal SD, and I don't know if that could be related. my internal SD mounts fine when I boot up, and all my files are there and working. nonetheless, this post seemed interesting, about reformatting in adb with parted:
http://forum.cyanogenmod.com/topic/6433-solved-messed-up-partitions-on-internal-storage/page__st__20
but i still have yet to find out if it's related. flashing anything in recovery, i see this:
E:failed to mount /efs /dbdata your storage not prepared yet please use UI menu for format and reboot actions
ehhh... i'd put off learning more about adb on the backburner. looks like i'm diving in.
Two different issues, internal SD get corrupted when one fails to UNDO lag fix, since samsung uses rfs and lag fixing changes it to ext 4, internal SD will fail to be recognized and needs to be formated to rfs by any Rom using rfs ( mostly stock Roms (to solve that flashing a speedmod kernel, does the trick) But your problem is efs folder
and i came across one person, who had both because he had made a onenand mode lagfix and failed to undo before flashing and was pretty impossible to get over
xsenman said:
and i came across one person, who had both because he had made a onenand mode lagfix and failed to undo before flashing and was pretty impossible to get over
Click to expand...
Click to collapse
ugh ... that does not sound promising.
and i'm not even fully aware yet what lagfix is or does. it had never been an option on any kernel i used since i started flashing roms, only early this year from stock to CM7 and soon after to CM9 and other ICSes. Well, until yesterday, when i tried flashing a supercurio kernel on a GB rom, and that failed. But I did see lagfix options under recovery>advanced. at any rate, i hope i'm not in the same boat.
is there any way in adb to find out if i am?
groksteady said:
ugh ... that does not sound promising.
and i'm not even fully aware yet what lagfix is or does. it had never been an option on any kernel i used since i started flashing roms, only early this year from stock to CM7 and soon after to CM9 and other ICSes. Well, until yesterday, when i tried flashing a supercurio kernel on a GB rom, and that failed. But I did see lagfix options under recovery>advanced. at any rate, i hope i'm not in the same boat.
is there any way in adb to find out if i am?
Click to expand...
Click to collapse
what I am saying is that, you do not have this problem, cause If you had, your internal SD will become unavailable and cannot be used and cannot be formated either ...so just solve the efs problem , thats what you need to concentrate on.
xsenman said:
what I am saying is that, you do not have this problem, cause If you had, your internal SD will become unavailable and cannot be used and cannot be formated either ...so just solve the efs problem , thats what you need to concentrate on.
Click to expand...
Click to collapse
thanks, man. i just did try this, simply taking a Camera photo and opening it in Gallery. also, ran mount in terminal to see, and yeah, saw rfs not ext.
when i try to mount /efs, i get an error:
moutn: can't read '/etc/fstab/': no such file or directory. there's a vold.fstab in there, with paths for mounting the internal and external sdcards. ehhhh... still learning what all this is about.
groksteady said:
thanks, man. i just did try this, simply taking a Camera photo and opening it in Gallery. also, ran mount in terminal to see, and yeah, saw rfs not ext.
when i try to mount /efs, i get an error:
moutn: can't read '/etc/fstab/': no such file or directory. there's a vold.fstab in there, with paths for mounting the internal and external sdcards. ehhhh... still learning what all this is about.
Click to expand...
Click to collapse
efs folder has read only permission, so you cannot do anything you like...don't mess with vold.fstab...you will have problems with your SD cards .
The only thing I can suggest is to go back to th earliest eclair or froyo to recover.
you may need to unarchive the downloaded file and then unarchive the resulting TAR files too
Hence in heimdall you should have
PIT file (s1_odin_20100512.pit), CHECK repartition
IBL+PBL = boot.bin
SBL = Sbl.bin
MODEM = modem.bin
PARAM = param.lfs
CACHE = cache.rfs
DBDATAFS = dbdata.rfs
FACTORYFS = factoryfs.rfs
KERNEL = zImage
But First, try to delete the EFS Folder (using root explorer) shut down, Go into recovery and wipe everything than battery pull to shut down and go onto download mode after that Flash
just a suggestion
xsenman said:
Hence in heimdall you should have
PIT file (s1_odin_20100512.pit), CHECK repartition
Click to expand...
Click to collapse
thanks ... this is where I get hung up. Anytime I check repartition, I get libusb End of Pit errors. It runs fine without repartition. This is Heimdall 1.3.1 and 1.3.2 on a Mac 10.5.8.
I'm going to make an Ubuntu Live CD and see if I can get it that way. I used to have an old Lubuntu laptop, and I remember Heimdall working to flash a kernel when the Mac didn't. It'd be great if the repartitioning is what's holding me back.
aargh. didn't work. Heimdall on Linux does let me repartition, but on the reboot I still get errors that /efs can't be mounted, multi-CSC can't be applied, etc. I tried ezbase recovery and the full stock setup for the original provider from sammobile. I tried deleting /efs, full wiping and pulling the battery like you suggested. I tried separately flashing a dbdata.rfs in heimdall, which was suggested for someone else with mount problems. but, it seems like all the other mount problems people have are with sdcard, and not /efs.
If I restore /efs, is it supposed to write data to /dev/block/stl3? because that file is always 0kb. But I could try the dd command to restore that way... maybe later tonight. it's been a long afternoon working through this.
I also don't know what is the deal with not being able to find /etc/fstab. I saw in some other places that Android doesn't use it, so I don't know what's calling it, and why. Or if that's tied to why I can't flash anything beyond a GB rom; I get errors about /tmp/updater.sh.
EDIT: OK, so at some point with ezbase recovery and manually restoring nv_data.bin to /efs, after a little while I saw that my /sys/block/stl3 (and so /dev/block/stl3) were looking normal. I successfully restored the file, plus the IMEI folder, which has bluetooth info. I did this with flight mode on, toggled it off and connected to my network. About Phone was showing my real IMEI, plus BT and wifi MAC addresses. And I had /sys/block/stl3 looking normal. So I ran the dd if=/sys/block/stl3 of=/sdcard/efs.rfs, and used that efs.rfs file to flash full roms in heimdall, repartitioned. I used ezbase recovery and the stock firmware from sammobile.com for the original mobile provider. Neither worked. On first boot both times, I got errors about not being able to mount /efs or apply multi-CSC. My IMEI on reboot is always "unknown", not even all zeroes, until I fix it. And CWM won't flash any CM7 or CM9 zips, giving status 7 errors that it couldn't mount. I also tried flashing the efs.rfs file alone in heimdall command line, and that didn't work. Ezbase is 2.3.3 and my stock is 2.3.5, and serial number info indicates it was made in 2011 or really late 2010 (i'm loathe to pull the battery off these days), so I wouldn't think Froyo could help out. I've reached out to a few people here who had the same problem, but never posted about a fix, or finally giving up. I'm almost at my wit's end. There must be a solution, some way to reformat or push back /efs data to /stl3.
BTW, can anyone post the filenames of what is in /sys/data/stl3 for their i9000? I'd like to know if I'm missing something in there, at least when it does fill up. Right now, I'm thinking it's gotta be a bad partition.
weird..just can't help wondering why it seems so difficult, I assume you are always practicing standard requirements before and after flashing like
1. Using CWM, make sure to wipe data/factory reset,
2. Then wipe cache, and then go into advanced, and wipe the dalvik cache too.
3. From there, flash the ROM
4. Afterwards, repeat the wipe step as in step #1
5. Continuing on, go into advanced and fix permissions.
6. Finally, reboot the device.
In my version its even more stricter, take a look this is required for an uncomplicated Flash
Hm, I've always done 1-3, as that's what's prescribed in most installation instructions, and still Dalvik even if it's not specified. I've only ever wiped post-flash a couple times, and only because it was mentioned in some threads, plus a whole re-flash of the rom. And I'd never heard of fixing permissions after flashing until HellyBean, but I always did with that.
This problem came up coming off of HellyBean with the test idle2 kernel, to AOKP JB, which apparently boots after a status 7 error and abort, but I only knew that later and didn't try that. I then flashed Semaphore to get to the working CWM 6 backups, and ended up in a loop of recovery modes. In hindsight I should have flashed a whole rom -- I went from a datadata rom to one without that I never booted, then to a kernel without datadata just to get the recovery and nandroid.
Rats, I didn't even think about that.until just now typing this out.
sent from a telephonic device
IMEI BACK.
There was a link in a post here that got me there -- basically, someone uploaded an efs.rfs file. Mods, flag me if this is illegal/against rules, but I'd guess it's not because the file gives you the 0049 IMEI.
But for me that didn't matter -- my partition or the linking was screwed up somehow, and I needed a proper one to flash in Heimdall. I couldn't simply correct my nv_data.bin backup and then export bml3.
The Spanish forum link goes to a dead upload, but I was able to find the file BML3_RESTORE.tar.md5 on Rapidshare. If you need this, it was a rollercoaster. At this point I didn't expect anything to work, and I'm still suspicious of finding a file on the web and flashing it without at least some community I can "talk" to about it.
What happened with the file: I flashed it in heimdall, onto a pretty overloaded and laggy JW5. Rebooted, and immediately saw the circle-and-slash no signal logo, so thought it didn't work -- then it pops up to four bars. I swipe to unlock the screen and it completely freezes. So I went back to ezbase recovery kit and flashed the whole thing (with the CF-root kernel, not stock) plus the efs.rfs file. I didn't repartition because I'm on a Mac, and that doesn't work for some reason, and the linux live CD is painfully slow. It flashes, and after completion, I still get a bunch of errors about mounting, but i get a success message about applying multi-CSC. I reboot, and About Phone shows the fake IMEI, but the homescreen is showing my provider. Also, the file explorer showed my internal and external sdcards.
I reinstalled Root Explorer with Titanium Backup, deleted all in /efs and dropped in my backed up nv_data.bin, changed perms and ownership to radio and radio. Exited folder and reopened, and it was all repopulated. Then I dropped in my backup of the /efs/IMEI folder, only because that has a file with BT info and that didn't regenerate. Rebooted, and all was still there! Finally getting out of this weeklong rabbit hole, and able to come back up to ICS with my real IMEI.
Word of caution, though, if going back up from there to one of the latest ICSes. There's people saying to take the latest CM9 nightly -- if you do that, you're flashing up to CWM 6. If you want to go from there to any of several other ICS roms, you might run into a problem because they might be CWM 5.*. After I had CM9 booted, I went into recovery to flash AOKP M6, lost recovery and ended up having to go *back again* to heimdall. Then onto Team Hacksung's CM9 build 16, then finally to AOKP. Done. And I think at this point I'll lay off the Jellybeans for a little while.
groksteady said:
IMEI BACK.
Click to expand...
Click to collapse
This is great, Now in order to get others who may get into this situation, out of this mess, can you post a step by step guide ( simplified as much as possible)
such that I can link your post to my EFS problems and solutions post, already downloaded Bml3 and will upload to another , so a step by step guide to resolve this will be helpful to others.
xsenman said:
This is great, Now in order to get others who may get into this situation, out of this mess, can you post a step by step guide ( simplified as much as possible)
such that I can link your post to my EFS problems and solutions post, already downloaded Bml3 and will upload to another , so a step by step guide to resolve this will be helpful to others.
Click to expand...
Click to collapse
Sure thing... I'll amend the OP later today. So glad to be out of this mess. I seriously thought I'd be manually restoring my imei on every reboot until I get a new phone.
sent from a telephonic device
xsenman, I changed the OP to a guide, hopefully the symptoms and instructions are clear enough. and thanks for talking me through this; I was losing my mind, and so close to throwing my phone in the river.
for anyone else: xsenman was helping me in another thread too. There, I mention how the official Samsung Service Center here said I had a memory board problem, can't recover IMEI without replacing that, for US$150. I went to one of the many phone seller shops with decent hackers/tinkerers, and they couldn't do it either, and they had Octopus Boxes, or at least a box for Samsung.
anyway. HTH others.
and a tinfoil-hat request: anyone who is able to look at the file attached in the OP, can you see if there's anything troubling or 'weird' in it. I just found the damn thing and tried it. It wasn't the most security-conscious step, but I was in a pinch.
so i had this same problem flashing hellybean 20120820 and used one of the guides here to return to stock then copied my good efs off to my computer flashed all the way back then restored the efs folder but it wouldnt stick. I tried several times fixing permissions and a few other suggestions on this forum but nothing worked. Finally i read somewhere that the cache would restore the efs folder if it wasnt cleared, so i restored my efs thru root explorer to the good one from gingerbread rebooted to recovery, wiped cache, and rebooted. Voila it finally stuck, i dont know exactly why it worked or where i heard clear the cache but it did. Maybe it will work for oyu
Psykologikal said:
Finally i read somewhere that the cache would restore the efs folder if it wasnt cleared, so i restored my efs thru root explorer to the good one from gingerbread rebooted to recovery, wiped cache, and rebooted. Voila it finally stuck, i dont know exactly why it worked or where i heard clear the cache but it did. Maybe it will work for oyu
Click to expand...
Click to collapse
Huh, that's cool. I hadn't read that anywhere before. I'm not in that jam anymore, but its good to know.
I do wonder if I all the other 'normal' methods never worked for me because I was using Heimdall. It shouldn't make a difference, but I did run into basic common problems, like repartitioning not working on Macs.
Thanks for the tip. I hope I won't need to try it.
sent from a telephonic device
I have SC-01C docom tab. during unlocking its imei became null and baseband became unknow. I try this tutorial and result in imei 0000946xxxxx.
But when I restart tab. Imei again null.
Note: there is no option of 644 in Permission.
Please help me to solve this.
nsnobel2 said:
I have SC-01C docom tab. during unlocking its imei became null and baseband became unknow. I try this tutorial and result in imei 0000946xxxxx.
But when I restart tab. Imei again null.
Note: there is no option of 644 in Permission.
Please help me to solve this.
Click to expand...
Click to collapse
Sorry to get to this reply so late. And, that I'm not sure I can help you -- I don't know anything about this tablet. This guide helped me with a Samsung Galaxy S i9000. From a quick search online, the PIT file you'd use is different. I don't know for sure, but I would guess it's possible that your EFS partition is different from the i9000, and this method would not work for you.
For permissions, you should be able to change them by long-pressing a file in Root Explorer, Root Browser or similar apps; it's not an option you choose, you manually toggle r/w, r and r for owner, group and others, respectively. Or you can use the chmod command in Terminal to set to 644, same thing.

Bootloop after CM install. Won't restore backup, mount /data, flash stock

Hi developers. I am sorry for posting this. I spent the last week trying to solve it by myself with no hope. This is my second time installing something on a phone, but it is my only phone, so I beg anyone for a help...
-What I did:
Some days ago I downgraded to this ROM C5503_10.1.1.A.1.310_GLOBAL-LTE.ftf to use DoomLord rooting script. I did it with flashtool for linux and I applied his .bat step by step in the terminal since windows would not detect my phone.
It worked. I had root for some days, but I was still annoyed by sony default android. So I decided to install Cyanogenmod.
I unlocked the device with sony official system and wen't straight to this instructions, before the first reboot
wiki.cyanogenmod.org/w/Install_CM_for_yuga
I booted succesfully in CWM, followed everything as it says there. But that's where weird things happened:
-The problems:
-The backup
I tried, it wouldn't mount /sdcard. Since I don't understand much about this, I thought it was normal. The next choice was sdcard1, I backed up there. Or so I thought...
-The factory reset
I factory reset, again, not mounting sdcard. Here is the message that shows when I try this now:
can't mount /data!
Error mounting /sdcard.android_secure
Skipping format...
Data wipe complete.
Since it said it is complete, I went on installing the zip file from my sdcard1. Both CM 10.2.1 (dogo, the right one for my phone) and the appropriate GAPPS.
Now it loops on the CM loop animation and I have to remove the battery...
-The restore problem
It still boots on the recovery mode. So I tried recovering my backup from sdcard1. But the image name is 1970.01.01.00.03.16. And it says "md5 mismatch"
I tried flashing again the stock rom with flashtool. The proccess goes on but nothing happens. I still have CWM and the boot loop.
I read elsewhere someone with a similar problem who solved using sony "emma" software. I installed it, it won't even recocnize my phone.
It recocnizes that there is a phone, but don't know which one.
But that has alway been the case with windows. I haven't been able to do anything in windows other then accessing the sdcard (when the phone worked).
Is there something I can do? I imagine that somehow, for some reason, the /data and /sdcard partitions got corrupted. I imagine I would need to repartition this and install again, but I have no idea how this happens on phones...
I can mount /system /cache and /storage/sdcard1. just /data I canĀ“t. Says "error mounting /data"
This is my only phone and a vey recent $400 thing. I was very stupid to do that withouth a replacement and really need this phone. I greatly appreciate any help...
I found this post forum.cyanogenmod.com/topic/6433-solved-messed-up-partitions-on-internal-storage/ searching the internet. Is it possible that this would solve my problem? or would it finish bricking the phone?
Here's what you'll need:
Working recovery, basic knowledge of adb & the shell
Parted (download here)
stock PB31IMG.zip
Note also that I had run unrevoked forever (so my phone was S-OFF) ... I'm not sure if that's required or not.
So, grab parted from the link above. Now you need to extract the individual binaries from the .zip (the 6 files in the sdparted folder within the zip), ideally to your android-sdk\tools directory. Now push all 6 files (adb push [file] /sbin/). Next, we need to make them useable, so go into the shell (adb shell). Change to your /sbin/ directory, and run: chmod 0755 <file> on each of the 6 files.
Now, we need to fix the partitions. This is assuming that the partitions are there, just the wrong format (which is what happened to me .. I accidentally made them FAT32 instead of ext). So, run the following: parted /dev/block/mmcblk0 mkfs ext2. It will ask if you want to continue, hit yes. When it asks for the partition number, enter 1. Next, when it asks for the format, enter ext2. Let it do its thing. Now, once it's done, run parted again. This time, enter partition 2 (everything else is the same).
Click to expand...
Click to collapse

[Q] network problem g800f

i install an official rom 4.4.2 but after that i can't make calls then i install the "CyanogenMod 12.1 for G800F" but without result (when i shearch manually for network i found many in my country but i can't choose any one)
imei is changed (in phone): 350695200123951
in the package imei is: 352960063276330
im tired for search in internet for fixing this problem but without result. Help me please
First, I'd strongly advise against posting your IMEI publicly.
Your problem is most likely due to a corrupted EFS partition which can occur during botched firmware upgrades. If you'd like a guide to fixing it you can search again for "Samsung EFS repair", but to summarize:
- Make a backup of the current EFS partition, from ADB you can run : "adb shell su -t dd if=/dev/block/mmcblk0p3 of=/sdcard/efs.img"
- Obtain a "mkfs.ext4" ARM binary and use it to format the EFS partition: "adb shell su -t mkfs.ext4 /dev/block/mmcblk0p3"
- Re-flash the stock firmware in odin, boot up and all should be fine.
Otherwise a repair center will probably fix it for you.
NOTE: You may want to copy the EFS backup off of your device before flashing

Finger print sensor version: null??

Finger printer sensor version reads: null
Also on stock recovery: dm-verity verification failed
I think the issue started because I had another n910t phone, I made an ndroid backup of it it with twrp. I then flashed twrp, the same ROM( [ROM][5.1.1][DOK2]N5 Express 3.4D[Feb-21-16][N910T][N910W8][N910T3]), then did a ndroid restore on this new n910t phone and now finger print says null. I registered a finger print on the old phone, no private mode. I never registered one on the new phone or enabled private mode.
I tried a Kies/Smart Switch emergency recovery but no luck.
Any ideas? Possible to downgrade to 5.0.1, then do a Smartswitch emergency recovery?
Found a solution if anyone ever stumbles across this thread.
How it happened:
I did a full Twrp backup, including EFS on a n910T. I received a replacement n910t. I thought I could restore the twrp backup from the old straight to the new n910t. I was wrong. EFS is device depending and contains the individual phone info like imei,S/N,etc. Basically my new phone took characteristics of the old one and the EFS became corrupted. My fingerprint sensor didn't work and I had the "dm-vertiy verification failed. If the dm-verity fails, finger print sensor won't work.
How I repaired my EFS, or what I did to get it to work. Your mileage may vary.
All of this on stock rom: I got the stock from by using smart-switch and doing emergency recovery, entering my model number and serial number. I then cf rooted and flashed twrp using odin.
1. I check to make sure my IMEI and S/N numbers stored in the phone (about device) matched the sticker on the back. My IMEI matched but my S/N did not. My S/N was from my old phone, big whoops!
2. I corrected my S/N by editing the serial number file found under your EFS folder. You need root access to edit it. I use room toolbox lite, root browser to edit it.
3. Because my EFS became corrupted, my phone was in limp mode, eg it was slow and lagging, it was stuck in "factory mode".
4. I took the phone out of factory mode. Again you need root access and root browser. Go to EFS folder/factoryapp/factorymode and edit the file. Change it to off. Also go to efs folder/factoryapp/keystry and turn it off also. Reboot.
5. I entered this command:
mke2fs /dev/block/mmcblk0p13 (for N910G Note 4)
mkdir /efs
mount -t ext4 /dev/block/mmcblk0p13 /efs
6. Do a factory reset, reboot system
7. I then did a stock firmware flash again with smart-switch. Everything works again now. This time I will make sure I back up my efs but don't try to restore it.
Maybe this will help someone in the future.
Can you elaborate on how you do this: And by the way I have a N910T3
5. I entered this command:
mke2fs /dev/block/mmcblk0p13 (for N910G Note 4)
mkdir /efs
mount -t ext4 /dev/block/mmcblk0p13 /efs
NOTE 8 fingerprint sensor showing version null.
my note8 fingerprint sensor not working. even i did factory reset and safe mode and everything but nothing helpful.
went to *#0*# sensor, but showing null version over there.
PLz help me out with this.
Very new to android thing plz help
thanks:crying:
Varunspassion said:
my note8 fingerprint sensor not working. even i did factory reset and safe mode and everything but nothing helpful.
went to *#0*# sensor, but showing null version over there.
PLz help me out with this.
Very new to android thing plz help
thanks:crying:
Click to expand...
Click to collapse
I am having the same problem. Have not rooted or any modifications. Straight stock.

[GUIDE] Upgrade 4.5.15 rooted & encrypted -> 5.0.2 WITHOUT DATA/SETTINGS LOSS

as usual, if anything goes wrong, no responsibility etc
The official update tutorial for rooted users doesn't keep app data, only internal storage! This tutorial keeps EVERYTHING
This method allows updating from 4.5.15 (unlocked, encrypted, rooted) to 5.0.2 without any data (sys settings + app data + user data) loss
A FAQ section is present at the end of this post and will be regularly updated.
List of files to download while doing the following steps:
OOS 5.0.2 ROM
Codeworkx TWRP recovery
Latest Magisk
Terms and software used in this guide:
Fastboot / Bootloader = bootloader of the phone, it's a very low level mode of the phone that allows booting into recovery. Can be accessed by using the advanced reboot menu (enable in dev options) or by "adb reboot fastboot".
Recovery = a small operating system on the phone that allows you to do various operations even when the main OS (Android) is broken. This includes flashing ROMs, modifying stuff on the storage, etc. It's the Android swiss army knife. If you can get a phone to boot TWRP, then you can do almost anything.
Magisk = rooting software that uses a systemless method to keep SafetyNet working. Systemless = instead of modifying the system, every change is put in a separate image that is mounted "over" the system. When the system tries to access a file modified by Magisk, instead of reading it from the partition, it reads it from Magisk. It's recommended to use Magisk instead of SuperSU as of 2018.
ADB = tool that allows controlling the phone from your PC through USB. You can use it when you're in Android if USB debugging is enabled in the settings, or when you're in TWRP. Here, we mostly use it for transferring files directly (without MTP) and running commands (using "adb shell")
Note: For this guide you will be required to download and install Magisk. If you don't want your phone to be rooted, then at the end of this guide reboot into TWRP, wipe both caches and re-flash the OS. This will uninstall Magisk and any other root patch. Beware: it will reflash stock recovery, so if you ever want to re-root, you'll need to reboot to fastboot and flash TWRP manually.
Convention for commands that you will have to run:
a command line starting with "C:" means that it should be run on your PC
a command line starting with "~ #" means that it should be run on your phone (through adb shell) while in TWRP
a command line starting with "OnePlus5:/ $" means that it should be run on your phone (through adb shell) while in OxygenOS
Although the commands start with "C:", this is just for readability purposes. You should run everything from inside an empty directory with enough disk space and writing access.
Your phone will have to be plugged in to your PC from the beginning to the end. Also, make sure it has at least 80% battery before beginning, just in case.
I know, the tutorial is huge. This is simply due to the fact that if I just wrote "make a nandroid backup of this and that, flash, and restore the backup while doing this", then some people may encounter problems because not everyone knows how to do a nandroid backup, restore it, etc. Also, there are a lot of things that need to be done precisely that way and not another way, which explains why the tutorial is huge. Also, you may notice that there is a lot of commands to run throughout the tutorial, this is because that way, I'm sure that at the end, you will have done everything like I did it on my phone, so that if you have a problem it's much easier to figure out where it comes from.
Summary of what you need to do (this is only a SUMMARY to give you a preview of what the whole thing looks like, you shouldn't follow it except if you're really an expert since a lot of things need to be done precisely, instead you should follow the easier complete steps below):
Make a Nandroid backup of /data
Backup files on internal storage
Wipe everything (internal storage + /data + system + caches), and then format data (important!)
Push and flash the OOS zip
Wipe caches and reboot (to Oreo!)
When it reboots, make sure everything (features, like Wi-Fi and fingerprint sensor) works. Don't "save anything" though, everything you do will be erased when we'll restore your backup. This is just a "test drive" for Oreo.
Reboot to TWRP, wipe Data and restore the /data backup
Run the three commands to fix Wi-Fi and fingerprints
Reboot (to System) and check everything works (don't do anything, don't change any setting, just make sure it works)
Reboot to TWRP, rename the "Android" folder to "Android_oreo" on sdcard, delete everything else on sdcard and restore your internal files
Rename the freshly restored Android (nougat) folder to "Android_nougat" and rename "Android_oreo" to "Android".
Flash Magisk, wipe dalvik+cache and reboot to System
When in Android, everything should work except some apps won't have their data. This is normal. Open a terminal (either on your phone using Termux or from your PC using adb shell), elevate using su and rename "Android" to "Android_oreo" and "Android_nougat" to "Android" (this is so that it correctly restores permissions)
If everything works fine, delete the "Android_oreo" folder
First, if you have Xposed Framework (systemless or not) installed, uninstall it. Next, if needed, uninstall any Magisk module that is "Nougat-only" to prevent any problems afterwards.
Boot the phone to bootloader/fastboot (either using advanced reboot, or by using volume down button when you start your phone) and boot to the TWRP recovery by doing
Code:
C:\> fastboot boot twrp-3.2.1-0-oreo-8.1-codeworkx-cheeseburger.img
from your PC.
Next, in TWRP, make a backup of /data (using the Backup button). Then, still while in TWRP, run the following commands:
Code:
C:\> adb shell
~ # cd /sdcard
/sdcard # tar cvf twrp.tar TWRP
/sdcard # md5sum twrp.tar
<< md5 checksum of twrp.tar >>
/sdcard # exit
C:\> adb pull -p /sdcard/twrp.tar
When the above command has finished, make sure that the checksum of the received twrp.tar file matches the one previously displayed.
If it doesn't match, delete the file and run adb pull again. Don't continue following this guide until you have received a 1:1 (checksum-wise) backup of /data.
Code:
C:\> adb shell
<< WARNING: dangerous command! double check the following line is correct before pressing enter! >>
~ # rm -rf /sdcard/TWRP
~ # rm /sdcard/twrp.tar
That was for /data. Now, the backup for the internal storage:
Code:
~ # cd /sdcard
/sdcard # du -csh
<< you should see here the total size of sdcard, that'll give you an idea of how long it'll take >>
/sdcard # tar cvf sd.tar element1 element2 element... elementN
<< in the command above, replace "element1..N" by a space-separated list of what you want to have in the backup.
Keep in mind that your list HAS to contain the element "Android" (case is important). It contains the app data.
Let's say for example you want to keep only the photos you have taken (and nothing, nothing else that was on internal storage).
The photos are in the folder DCIM, so the command will look like this:
tar cvf sd.tar Android DCIM
(because you want DCIM, and Android has to be in the list, no matter where)
>>
/sdcard # md5sum sd.tar
<< md5 checksum of sd.tar >>
/sdcard # exit
C:\> adb pull -p /sdcard/sd.tar
When the above command has finished, make sure that the checksum of the received sd.tar file matches the one previously displayed.
If it doesn't match, delete the file and run adb pull again.
Keep in mind that anything you don't put in that list will not be backed up and will be lost!
Now, you have a backup for all the important stuff so we can start doing the real sh*t.
Now, the important step:
Go back to the TWRP home screen, press "Wipe", "Advanced Wipe" and there check "Dalvik / ART Cache", "Cache", "System", "Data" and "Internal Storage". Confirm using the slider at the bottom of the screen. Press the home button, then "Reboot" and "FastBoot". Now, type the same fastboot command as in the previous step to boot the recovery image. You'll enter the recovery as before.
Now, on your PC, in the terminal, type
Code:
adb push -p OnePlus5Oxygen_23_OTA_029_all_1801292040_d71af3d.zip /sideload
(note: here, we are not using "adb sideload", we are really using "adb push"). In TWRP, click Install, in the file manager go to /sideload and select the OOS zip file. Confirm by sliding. If you get an error, go back to home, click Mount and ensure System is not checked. Then try installing again. If it still does not work, reboot to fastboot, type command again, get to the recovery and install again.
When the zip-file is installed, go home, click "Wipe", "Advanced Wipe" and check both caches and confirm. Then, go home, click "Wipe" and then "Format Data". Then, go home, click "Reboot" and then "System". Your phone will now reboot to Oreo. It will take a long time, but do not turn off the phone. Let it run. On my phone, it took on average 2 minutes for that boot.
You'll be greeted by the "first boot" page. It'll ask you if you want to restore a backup or start anew, choose start anew. Connect to your Wi-Fi network and Google account. Follow all the instructions until you get to the home screen. There, make sure everything works (especially Wi-Fi and fingerprint sensor). Don't save your fingerprints yet, they will be erased afterwards. If everything works, you can continue following these instructions. If not, post a comment down there.
Now that you're at the home screen, go in the settings, About Android and click the build number 8 times to enable Developer Options. Go in there and enable advanced reboot. Then, reboot your phone into fastboot/bootloader using the power button. Type the exact same command as before to start TWRP. Once that you are in TWRP, run the following commands:
Code:
C:\> adb push -p twrp.tar /sdcard/
C:\> adb shell
~ # cd /sdcard
/sdcard # tar xvf twrp.tar
/sdcard # cp /data/misc/wifi/WifiConfigStore.xml /sdcard/
In TWRP, click "Wipe", "Advanced Wipe" and check only the "Data" partition. Confirm. Press home, then "Restore" and choose the backup in the list. Confirm to restore. Back to the terminal, we need to run the following commands otherwise Wi-Fi and fingerprints won't work:
Code:
/sdcard # cp WifiConfigStore.xml /data/misc/wifi/
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
<< WARNING: dangerous command! double check the following line is correct before pressing enter! >>
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
Note: the command above are ran from your PC in an adb shell while the phone is still in TWRP.
Reboot the phone to system and ensure Wi-Fi and fingerprints are still working. Right now you should already see your old home screen and all your apps, but the internal storage isn't there yet. Reboot in fastboot, run the command to get in TWRP.
Once TWRP has booted, run the following commands:
Code:
C:\> adb push -p sd.tar /sdcard/
C:\> adb shell
~ # cd /sdcard
<< WARNING: dangerous command! double check the following line is correct before pressing enter! >>
/sdcard # rm -rf Alarms Albums DCIM Download Movies Music Notifications Pictures Podcasts Ringtones
/sdcard # ls
<< now, look at the list of files that were printed, and rm anything left that is not called "Android" or "sd.tar"
<< WARNING: dangerous command! double check everything is correct before pressing enter! >>
if when you do rm <the thing> it tells you it's a directory, then do: rm -rf <thething>
if there's a folder called SomeFolder, do "rm -rf SomeFolder"
next, run this:
/sdcard # ls
Android sd.tar <-- expected output
/sdcard # mv Android Android_oreo
/sdcard # tar xvf sd.tar
/sdcard # mv Android Android_nougat
/sdcard # mv Android_oreo Android
If you don't have Magisk somewhere on your sd card, download it and upload it using MTP or adb. Then flash it using the Install button. Clear dalvik/cache and reboot to system.
When the phone has booted (again, it might take time), make sure USB debugging is enabled and run the following commands:
Code:
C:\> adb shell
OnePlus5:/ $ su
<< here, you might see a Magisk screen asking for superuser access. Allow. >>
OnePlus5:/ $ cd /sdcard
OnePlus5:/sdcard $ mv Android Android_oreo && mv Android_nougat Android
Now, try some apps and make sure all the data is there (especially games and Netflix/Hulu/etc). If everything is there, and the phone works properly, go back in the terminal and type:
Code:
OnePlus5:/sdcard $ rm -rf Android_oreo
Optionally, start the TWRP app and flash it, it can always be useful. You can also reboot to fastboot to do that.
Now reboot your phone (normal reboot) one last time.
There, working OOS 5.0.2 / Android 8.0.0 phone with no data loss.
Frequently Asked Questions
How long does the whole thing take?
Highly depends on the amount of data you have on your phone. Since it the USB port only supports USB 2.0, it may take 4 or 5 hours in total.
Will doing this void my warranty?
No.
Will I be able to install future OTA updates using the regular download-reboot-flash-twrp procedure?
Yep. Just use the regular method as you would have on Nougat.
Will I lose my data?
If you follow all the instructions, no. Even if you don't follow them, as soon as you have made a backup of /data and internal storage, then no matter how bad you screw up you could always get a working phone back.
I followed the instructions and now my phone doesn't work
Boot in TWRP, wipe everything, reflash.
questions will be added there in the future
Having WiFi and fingerprint issues
You sure it is a good idea to just delete those files? I would have guessed that I need to replace these (nougat version from backup) with the oreo version to have it working just like before the restore.
Code:
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
I'm having the issues with wifi and fingerprints. Neither one is working. I'll try to figure out how to fix this.
@zdimension Thanks for this guide, I don't have time to test it yet, but I have a question
pdluke said:
Code:
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
Click to expand...
Click to collapse
At this point in the procedure, adb shell is still using root (before flashing magisk) ? How is that possible ? Does the adb /sideload preserve root ?
olivier380 said:
@zdimension Thanks for this guide, I don't have time to test it yet, but I have a question
At this point in the procedure, adb shell is still using root (before flashing magisk) ? How is that possible ? Does the adb /sideload preserve root ?
Click to expand...
Click to collapse
These commands should be run while the phone is in TWRP. Also note that adb /sideload is not used here, only adb push.
pdluke said:
You sure it is a good idea to just delete those files? I would have guessed that I need to replace these (nougat version from backup) with the oreo version to have it working just like before the restore.
Code:
/sdcard # rm /data/misc/wifi/wpa_supplicant.conf
/sdcard # rm -rf /data/system/users/0/fpdata
/sdcard # rm /data/system/users/0/settings_fingerprint.xml
I'm having the issues with wifi and fingerprints. Neither one is working. I'll try to figure out how to fix this.
Click to expand...
Click to collapse
If you delete them, they will be generated automatically at the next system boot. But you could also make a backup of those three files before wiping /data, store that somewhere, restore Nougat /data and then restore your backup of those three files. The result would be the same.
Note: actually, not exactly. Erasing the first file won't change anything since it's not used anymore in Oreo, but the two other files contain the fingerprint configuration (list of saved fingerprints). So,
Either you remove the files and you have to save your fingerprints again at next boot
Either you restore them from an Oreo backup and you'll get the fingerprints you had saved during the "first boot" procedure when you rebooted the phone right after flashing the OS
But the result is mostly the same: everything works. Deleting the files ensures you get something clean. If you restore from an Oreo backup I can't guarantee the result (as it may interfere with other files from the Nougat backup).
10 bucks to make a script to do this all for me haha.
@zdimension Thanks for the clarification Another thing you might add to the files to download would be Magisk (optionally). In this kind of guide, I've always find it useful to download everything first.
olivier380 said:
@zdimension Thanks for the clarification Another thing you might add to the files to download would be Magisk (optionally). In this kind of guide, I've always find it useful to download everything first.
Click to expand...
Click to collapse
Oops, forgot to add it
I added the link, and also instructions for how to un-root afterwards for those who would want it.
To improve the guide, here are some ideas :
- You should highlight that rm -rf is a very dangerous command, and that it needs to be checked twice (especially the targeted folder)
- It could be useful to use the du -csh command to check the size of a folder (to estimate the backup time for example).
- As a safety measure, one could md5sum the tar file before and after using adb pull
What do you think ?
olivier380 said:
To improve the guide, here are some ideas :
- You should highlight that rm -rf is a very dangerous command, and that it needs to be checked twice (especially the targeted folder)
- It could be useful to use the du -csh command to check the size of a folder (to estimate the backup time for example).
- As a safety measure, one could md5sum the tar file before and after using adb pull
What do you think ?
Click to expand...
Click to collapse
Thanks for the ideas! I updated the post (and I added a changelog at the bottom for future reference).
Followed guide for successful upgrade from 4.5.15 encrypted, unlocked bootloader w/ Magisk root.
One note, after the first complete wipe and flash of the full ROM, it was getting stuck on first boot and never completed. Discovered that I needed to not just wipe the Data partition but Format it in TWRP, to clear out the old encryption I think. Magisk wouldn't install either until I did this.
@debork thanks for the positive feedback (all the merit goes to @zdimension of course)
@zdimension there are many people in the other thread https://forum.xda-developers.com/oneplus-5/how-to/official-oxygenos-4-5-2-7-1-1-ota-t3627003 that tried (unsucessfully) to upgrade from 4.5.15 to 5.0.1, maybe a link to this topic could be useful for them (if it's not too late).
Regarding the
Go back to the TWRP home screen, press "Wipe", "Advanced Wipe" and there check "Dalvik / ART Cache", "Cache", "System", "Data" and "Internal Storage".
Click to expand...
Click to collapse
I think it should be highlighted in red, since it is the actual "clean flash" (AFAIU, correct me if I'm wrong).
if we only have the BL unlocked non root and stock recovery can we only ota without any loss of data ?
debork said:
Followed guide for successful upgrade from 4.5.15 encrypted, unlocked bootloader w/ Magisk root.
One note, after the first complete wipe and flash of the full ROM, it was getting stuck on first boot and never completed. Discovered that I needed to not just wipe the Data partition but Format it in TWRP, to clear out the old encryption I think. Magisk wouldn't install either until I did this.
Click to expand...
Click to collapse
Thanks for feedback, I will add that to the guide (although it worked with just Wipe for me )
zdimension said:
Thanks for feedback, I will add that to the guide (although it worked with just Wipe for me )
Click to expand...
Click to collapse
Have you rooted the 4.5.15 with Magisk or SuperSU (which is not compatible with Oreo anymore) ?
olivier380 said:
Have you rooted the 4.5.15 with Magisk or SuperSU (which is not compatible with Oreo anymore) ?
Click to expand...
Click to collapse
I stopped using SuperSU when it was sold to that shady company. Also, Magisk is better imo.
quick05 said:
if we only have the BL unlocked non root and stock recovery can we only ota without any loss of data ?
Click to expand...
Click to collapse
Official OnePlus support said that nothing is guaranteed if your bootloader is unlocked. But since you're on stock recovery + non rooted, you could always try. But backup everything first. Some people here on XDA have reported that it doesn't work, though.
Just followed your guide with no problems. Thank you very much!! I can confirm also that you need to format data after the wipe otherwise it gets stuck in a bootloop!
Thanks so much for this. I was able to successfully follow the guide and get upgraded to 5.0.1 without losing any data. In fact, I even messed up one step by failing to include the Android directory in the sdcard.tar backup (perhaps that should be more explicit), but it doesn't seem to have affected everything; all of my apps seem to have retained their data.
A few notes:
1. The file size of twrp.tar was ~14GB but when executing the pull command, it recognized it as only ~1.3 GB. As a result, the pull was not complete until it reached over 1000%. All the more reason to do the md5 check.
2. As others stated, I needed to format the data partition, not just wipe it.
3. I might recommend also including a "summary" version somewhere on what this guide does. Scrolling through the guide the first time, it seemed pretty daunting, but really all that you're doing is: backing up data partition and internal storage; wiping device; flashing Oreo ROM; tweaking a few files; and restoring backed up data and internal storage.
Thank you again so much! Glad to finally be on Oreo.
elight3 said:
Thanks so much for this. I was able to successfully follow the guide and get upgraded to 5.0.1 without losing any data. In fact, I even messed up one step by failing to include the Android directory in the sdcard.tar backup (perhaps that should be more explicit), but it doesn't seem to have affected everything; all of my apps seem to have retained their data.
A few notes:
1. The file size of twrp.tar was ~14GB but when executing the pull command, it recognized it as only ~1.3 GB. As a result, the pull was not complete until it reached over 1000%. All the more reason to do the md5 check.
2. As others stated, I needed to format the data partition, not just wipe it.
3. I might recommend also including a "summary" version somewhere on what this guide does. Scrolling through the guide the first time, it seemed pretty daunting, but really all that you're doing is: backing up data partition and internal storage; wiping device; flashing Oreo ROM; tweaking a few files; and restoring backed up data and internal storage.
Thank you again so much! Glad to finally be on Oreo.
Click to expand...
Click to collapse
Thanks for the feedback! I'll add a summary to the guide.

Categories

Resources