[Q] network problem g800f - Galaxy S5 Mini Q&A, Help & Troubleshooting

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

Related

24A Backup EFS

I have a VS980(24A)
I want to get data working on AT&T, so I want to install a custom ROM, which requires TWRP, which in turn requires root. Here is my problem: I believe the latest OTA version (24A) must be rooted using IOroot v.25 which apparently DOES NOT backup the EFS unlike the previous versions. So I went to adb shell and typed in su so I could backup the EFS. I got "su: not found"
I'm trying to run these commands:
adb shell
su
dd if=/dev/block/platform/msm_sdcc.1/by-name/modemst1 of=/sdcard/modemst1.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/modemst2 of=/sdcard/modemst2.img
Is there any way to backup the EFS??
Your help is much appreciated,
Nathan

Bootloop after installing Xposed framework

Hello,
I am hoping someone can assist with interpreting my log file or provide suggestions on how to convert my backups into a usable format that can be flashed back to the phone thus recovering it to a usable state. I have a logcat and dmesg in a text log file. I have put the file up on Google drive, the link is here-
https://drive.google.com/file/d/0B9e...ew?usp=sharing
I also spent time reading and studying the post about using logcat and dmesg posted here-
http://forum.xda-developers.com/showthread.php?t=2274119
I believe the last operation I tried before softbricking was installing the Xposed framework module for my device (running Lollipop 5.1.1).
I have tried one solution so far, go into recovery, clear cache and reboot.
To recover from this issue I think I have two basic options-
#1 restore from backup
#2 locate the problem that is causing the system to hang at startup in the first place
At the end of the day I am trying to find the simplest, quickest method to get back up and running. Both methods are acceptable to me. I am not worried about losing any data.
My phone is a BLU Studio C 5+5 LTE and therefore can't use TWRP or CWM (At least that is my assumption, maybe someone knows different). Before getting into the softbrick state I took 3 different types of backups in the hopes that one of them could be used in case it was needed. (like this)
Type 1 - I did an ADB shell backup from a completely stock device (unrooted). I used this command-
adb backup -apk -all -f fullbackup.adb
For this method I followed this guide here-
https://linuxiswonderful.wordpress.com/2015/04/04/full-backup-of-nonrooted-android/
Type 2 - I used Titanium backup and performed a complete system and application backup
Type 3 - I rooted the phone and backed up all partitions using dd after reviewing the partition layout of the device. For example, to backup the system partition I did the following at an ADB shell-
dd if=/dev/block/mmcblk0p21 of=/storage/sdcard1/firmware-img/system.img
I am able to still communicate to my device using ADB and I can get an ADB shell or enter fastboot mode.
My challenge/sticking point is how to turn my backups into a usable format to get me back on track or understand the boot process enough to get out of the boot loop. I am familiar with how Linux boots as I am a SysAdmin. I know Android is similar but just different enough to make me research this further.
The first thing I tried was mounting my raw image files created from the dd process. I followed this guide-
https://samindaw.wordpress.com/2012/03/21/mounting-a-file-as-a-file-system-in-linux/
I ran these commands-
#losetup /dev/loop0 /path/to/my/system.img
# mkfs -t ext3 -m 1 -v /dev/loop0
# mount -t ext3 /dev/loop0 /mnt
# cd /mnt
# ls
The various image files I created all seemed to mount "ok" OK meaning that the loopback mount process worked but it appears there is nothing but a lost+found folder in the mounted image. (I'm not sure why that is.)
I am still researching methods to turn my other backups into something usable for recovery purposes.
For using the adb backup file I created, this is what my understanding is-
Adb backup uses a type of compression (don’t remember what kind). I would need to uncompress the file first. After uncompressing and being able to view the file contents I would think I should be able to put together a flashable zip file of some sort.
I think the process for Titanium backup would generally be the same- uncompress/convert file format, create/assemble a flashable zip file
If there is any other info you need to see, please let me know. I made a lot of notes about the system architecture, partition layout, etc.
Many Thanks in Advance for your Advice!
Found my answer. Used ADB shell and mounted /system in RW mode. Changed /system/bin/dex2oat filename and the device booted normally. Issue solved!

FIx DRK/dm-verity, Factory CSC and Serial Number

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.

[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.

[GUIDE] Backup EFS Partition Without A Decryptable TWRP [No Root Required]

As there is no decryptable TWRP, it isn't as easy as before to bakcup the EFS partition. But doing it via Terminal isn't too difficult. I didn't find a good tutorial that isn't burried somewhere on the internet. And none for the 7T Pro (though the commands and partitions are the same on older OnePlus devices.
If you already know how to boot TWRP or you already have it, go to the second instructions list and skip the first one.
I am not responsible if anything goes wrong. You do this at your own risk!
Requirements:
- An unlocked bootloader
- Working adb and fastboot (e.g. Google's Platform Tools)
- Download a bootable TWRP
Instructions to boot TWRP:
- Connect your device via USB
- Go to Settings > Developer Settings > Enable Advanced Reboot Menu
- Hold down the power button and select "Bootloader"
- In the bootloader use (It won't modify anything, you simply boot into TWRP once and after a reboot it's "gone".)
Code:
fastboot boot NameOfTWRPImage.img
Instructions to backup EFS:
If TWRP has booted, type the following into your computers' terminal one after the other:
Code:
adb shell
dd if=/dev/block/sdf2 of=/tmp/modemst1.bin bs=2048
dd if=/dev/block/sdf3 of=/tmp/modemst2.bin bs=2048
exit
adb pull /tmp/modemst1.bin modemst1.bin
adb pull /tmp/modemst2.bin modemst2.bin
This will copy modemst files to the temporary folder on the phone (which can be accessed though the data is lost after a reboot) and "adb pull" copies them from the device to the user's profile folder on Windows or Mac. You have successfully backed up the EFS partition!
Please note that this could be performed with root permissions on a booted device. Though I always prefer backing up files with a non-booted system. Also this guide will work if you're not rooted.
Is it possible to backup all system and data so we dont have to setup everything in the device after a factory reset? I mean, that backup we all were used to in TWRP.
Best regards
lucfig said:
Is it possible to backup all system and data so we dont have to setup everything in the device after a factory reset? I mean, that backup we all were used to in TWRP.
Best regards
Click to expand...
Click to collapse
Unfortunately not. Backing up EFS doesn't require decryption as it's not stored on /data. Everything on /data can't be backed up afaik.
Also /vendor and /system can't be mounted as of now making a Nandroid backup impossible.
Macusercom said:
Unfortunately not. Backing up EFS doesn't require decryption as it's not stored on /data. Everything on /data can't be backed up afaik.
Also /vendor and /system can't be mounted as of now making a Nandroid backup impossible.
Click to expand...
Click to collapse
Thanks.
That is a shame. At least titanium backup still working great.
Enviado de meu HD1903 usando o Tapatalk
Macusercom, thank you for the guide!
Now how do we restore them? With the opposite dd command?
Or we can just flash them directly via fastboot?
Also, what is the full list of partitions which contain data unique to this specific device?
I mean all these EFS, persist, IMEI, screen/touch calibration data, all sensors factory calibration data, fingerprints, etc.
Is it only EFS + persist or there are more of them?

Categories

Resources