yashsingh1/xdaforums huggingface dataset:
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Making an EFS Backup
​

All too often, we've seen folks who have a corrupted or missing EFS Partition. This results in your IMEI being lost and no cellular activity on the device at all. This can be a royal PITA to fix, and some folks haven't been able to fix it at all. You can take a precautionary measure to safeguard yourself against this by taking a couple of minutes to back up your modemst files.

Download & Open up Terminal Emulator on your phone from here

Once it's open you'll be greeted with a command line prompt, in which you can enter text commands, the first thing you need to do is enable root access by entering this line (press the enter key on your on-screen keyboard after each command to issue it):

su

If this is the first time you've used Terminal Emulator a Superuser or SuperSU popup will appear, make sure you grant root access.

Now enter these two commands:

dd if=/dev/block/sdf1 of=/sdcard/modemst1.bin bs=512

dd if=/dev/block/sdf2 of=/sdcard/modemst2.bin bs=512

This will place two files (modemst1.bin & modemst2.bin) on your internal storage.

Make sure you copy them to your PC and Cloud immediately so that you have a backup there to use if you need to restore it in future.

That's it !! In case you ever need to restore Nanroid or EFS Backups, please continue and follow the next post...

Restoring an EFS Backup​

If by chance you end up with a corrupt EFS partition all you need to do is flash the files back to your device using fastboot.

Boot into fastboot mode (power + volume up) and connect your phone to your PC via usb cable.

Keep modemst1.bin and modemst2.bin (backed up earlier) on your desktop and open command window there.

These fastboot commands will restore the files:

fastboot flash modemst1 modemst1.bin

fastboot flash modemst2 modemst2.bin

Reboot your device.

fastboot reboot

Now disconnect phone from PC. Your IMEI should be back.

That's it for this guide, Enjoy :highfive:
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Thank you for your support !!
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
First OTA 4.5.1
[OnePlus 5 Guides, News, & Discussion] jmazzamj:
Theoretically unlocking the bootloader and flashing TWRP should be identical to the OnePlus 3/3T and previous devices, i.e. just like a Nexus (R.I.P.).
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Indeed its similar. Just making it clear for the new users here in one thread so there is no confusion.
[OnePlus 5 Guides, News, & Discussion] rickysidhu_:
Thank you for this! I'm going to get this device as soon as it's back in stock. It will be my first ever OnePlus device (coming from a Pixel XL). I'll still be using that but the dev support seems to be the highest with these devices.

Definitely going to use this guide to get all setup, so thanks again!

Just wondering though, I've never dealt with this dm-verity thing, what is this exactly?

Also, the day I decide to sell this phone for the next generation OnePlus (6), is it relatively simple to get back to stock and relock the bootloader?

Sorry for all the questions, just want to be thorough before doing all of this and potentially bricking my new device lol
[OnePlus 5 Guides, News, & Discussion] _MartyMan_:
Thank you!
[OnePlus 5 Guides, News, & Discussion] MrMeeseeks:
Link to TWRP? :p
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
First of all Welcome to the Oneplus Community Buddy, hope your get the device soon, i am also waiting for my unit likewise :fingers-crossed:

DM Verity is just another screen warning just like the secure boot screen, which depicts an unlocked bootloader and a modified recovery, it can be taken care off easily and even if you dont it wont harm in any way just take some addition 5 to 7 seconds on boot. I am here to help so it will be taken care off.

Also its easy to get back to stock as all full zips and both TWRP and Stock Recovery Flashable so just a process of 5 minutes to be precise once you have the required downloads and once stock bootloader can also be locked again via fastboot command.

If you just follow the steps on the guide, everything will be fine. Just wait for the official TWRP source to be released, should not be long though.

Thanks again for supporting Oneplus and Welcome to the Community :highfive:
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Will update when released, waiting for the official maintainer to be assigned, or if someone can build an unofficial build to begin with :fingers-crossed:
[OnePlus 5 Guides, News, & Discussion] Jayram2000:
So fast?

You guys are the best!
[OnePlus 5 Guides, News, & Discussion] igotroot:
Hey, many thanks for the guide.

I will be coming from an LG G6.

Question: since there is no external SD card, if we place SuperSU, DM-Verify etc on our internal memory...when we unlock the bootloader will the phone also wipe the internal sd memory??
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Yes you can via fastboot traditional method (format userdata) but i followed the verity way for 3/3T as it can be done from within TWRP only and flashing the zip also allows you to use to completely disable encryption by Formatting Data. Just depends on your preference :fingers-crossed:
[OnePlus 5 Guides, News, & Discussion] néonaloj:
[MENTION=6143932]Funk Wizard[/MENTION] , first, thanks for your reply in the TWRP thread!

So I came back here and did what you say :

I did all what you say, flash the no-verity-opt-encrypt zip, then "format data" in TWRP.

I indeed lost all my data as expected, but I'm still encrypted!!!

As I said, I also tried in fastboot : "fastboot format uyserdata" with same result.

Any idea? Someone got to decrypt the phone yet? Thanks!!!

​
[OnePlus 5 Guides, News, & Discussion] Interceptor777:
Wait so OnePlus releases TWRP flashable ZIPs?

And to be clear, reflash 4.5.0 and then flash 4.5.x OTA?
[OnePlus 5 Guides, News, & Discussion] Robfozz:
I cant flash TWRP, fastboot gives me an error that says the download size is too large. Anyone have a solution?
[OnePlus 5 Guides, News, & Discussion] BigOn1:
I try to transfer the files on my phone, but every time I complete the transfer of either one of the system file (winxxx file), when I try to load the other file it freezes mid transfer. If I delete the file currently on my phone and go vice-versa, same thing with the other file. It's the weirdest thing...
[OnePlus 5 Guides, News, & Discussion] c_86:
What twrp are your trying too flash. Have your restarted your computer since installing fastboot to computer?
[OnePlus 5 Guides, News, & Discussion] xdvs23:
Try another port, try Windows, try another fastboot version.
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
I hope you also flashed SuperSU immediately after the format userdata, i personally prefer staying encrypted so haven't tested decryption.

Yes Oneplus will release TWRP flashable zips, both OOS and H2OS full zips and TWRP Flashable Zips.

Try a different port and make sure you have the command prompt open in the same location where you have the TWRP image.

What are you trying to transfer, MTP works fine for me in OS and Recovery both.
[OnePlus 5 Guides, News, & Discussion] xperia_c4_hater:
Thanks so much for the useful, clear, and straightforward guide!

So, I just noticed an updated for OxygenOS for my 1+5 device. Where can I find more details about going about applying this update without bricking my device, considering I have TWRP and have SuperSU?

---------- Post added at 05:26 ---------- Previous post was at 04:58 ----------

This is great advice and the first time I've come across it. So, I did the commands, and everything seems to have run without any errors, but I can't seem to find these two files. Where are they stored and how do I access them? I tried every folder in my internal storage but can't seem to find them.
[OnePlus 5 Guides, News, & Discussion] néonaloj:
I never had to flash Su after decrypting the OP3, but I did flash Magisk this time with OP5 !

Decryption failed, with your method, aswell as with "mine" (="fastboot format userdata")... :rolleyes:

Does someone here decrypt the phone succesfully ?

Thanks !
[OnePlus 5 Guides, News, & Discussion] freakzapster:
[MENTION=6143932]Funk Wizard[/MENTION] when i enter to flash super su zip its showing very wierd folders in storage option and i couldnt find super su zip what to do ???
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
You can find them on the internal storage

/sdcard/modemst1.bin

I've attached the screenshots for your reference

No luck on decrypting may be have to wait for the official TWRP as the process should be the same.
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Recovery decryption problem, use the cheeseburger-46 for now and remove all lock screen pattern/pin/password if its still unable to decrypt.

SU should be on your download folder or wherever you've kept it on internal, i recommend Magisk over SU though
[OnePlus 5 Guides, News, & Discussion] tristaoeast:
[MENTION=6143932]Funk Wizard[/MENTION]

So, in order to clarify the whole process regarding OTAs on a rooted OP5.

Imagine OTA 4.5.2 is released.

First I need to have a backup of my Stock ROM without any modifications, restore it, and then I can finally install the OTA normally? Or would I have to flash Stock Recovery in order to be able to install the new OTA?

This, of course, assuming that the full zip of the ROM has not been released at the time of teh OTA
[OnePlus 5 Guides, News, & Discussion] freakzapster:
thanks dude it worked
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
4.5.2 already released, for the update process, refer to this post

I shall be updating the thread with the detailed instructions and full zip for 4.5.2 :good:

Glad i could help :highfive:
[OnePlus 5 Guides, News, & Discussion] panart:
4.5.2 OTA Full zip
[OnePlus 5 Guides, News, & Discussion] ph1dft:
Manual works perfectly.....thenx OP.
[OnePlus 5 Guides, News, & Discussion] néonaloj:
Thanks for your reply !

So you did try to decrypt the OP5, did you ?

Does anybody else try to decrypt the phone ?

Of course, it's only for later multirom purpose, but it will come, I'm confident, so I better like to decrypt my phone now. But, it doesn't work...

If someone has an idea on how to proceed, it'd be awesome !

Thanks !
[OnePlus 5 Guides, News, & Discussion] dansou901:
I'll try decrypting tomorrow as soon as I get the device. Did you use the latest stable recovery image?
[OnePlus 5 Guides, News, & Discussion] mohan_kr:
Can we relock the bootloader and return the phone to it's original state unlike the previous OnePlus phones? No Q-Fuse burning once unlocked etc..? Tried to search this thread but looks like it is not possible to relock the bootloader as shipped once unlocked?
[OnePlus 5 Guides, News, & Discussion] seblu:
I have the same issue posted earlier. I tried with another port and on a Windows 10 laptop. It changes nothing.

I also tried with OOS 4.5.2 (freshly released).

$ fastboot flash recovery recovery.img
target reported max download size of 536870912 bytes
sending 'recovery' (24404 KB)...
FAILED (remote: Requested download size is more than max allowed
)
finished. total time: 0.001s
[OnePlus 5 Guides, News, & Discussion] néonaloj:
Thanks buddy for trying!!!

I tried with TWRP 46, 50 and 56.

I followed the guide of [MENTION=6143932]Funk Wizard[/MENTION], also I tried to do "fastboot format userdata" in fastboot mode. Both method wiped the phone, but failed to decrypt it.

Thanks again for trying it!
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Same here failed to decrypt, may have to wait for a workaround
[OnePlus 5 Guides, News, & Discussion] dansou901:
Good to know, then I'll wait with decrypting and use it encrypted for the time being.
[OnePlus 5 Guides, News, & Discussion] néonaloj:
There is no risk to try, and it can help... At least you don't have any data to loose in your phone. If it doesn't work, that's it !

But years, it's up to you..
[OnePlus 5 Guides, News, & Discussion] dansou901:
That's true. Hopefully I have the time to try it out.
[OnePlus 5 Guides, News, & Discussion] CroW_D:
i followed all the steps you mentioned and now i cannot take for example screenshots or downloading a app via chrome. It says no sd card found i looked at da datamanger and i have acess to all but strange there is no download folder only folder in sdcard is android and data ... [MENTION=6143932]Funk Wizard[/MENTION]

I got it fixed with using the twrp 46 version the latest 58 seems to have issues.
[OnePlus 5 Guides, News, & Discussion] rickysidhu_:
Okay so since the day is getting closer to finally having a OP5 in my hands, I've been doing more and more research. I still have a couple of questions I hope someone is kind enough to answer!

1. I was trying to help my friend flash TWRP and a custom ROM on his OP3T, and I found this thread in the 3T forums:

https://xdaforums.com/oneplus-3/one.../recovery-official-twrp-oneplus-3-3t-t3543391

In this thread, it says:

If you want to be rooted with something else or just want a bootable system:

Download the latest dm-verity and forced encryption disabler zip.

Without exiting TWRP, transfer the no-verity-opt-encrypt zip to your device over MTP* and flash it using [Install] in TWRP.

This will also allow you to use [Format Data] to completely disable your encryption if desired.

The part that is bolded is where I have my question. If I unlock bootloader, flash TWRP and then try rebooting into system without rooting or flashing the no-verity-opt-encrypt zip, will that result in me having an un-bootable system?

In other words, do I need to either flash root or the no-verity-opt-encrypt zip, or is this just a 3T thing, and I can get back in to the OS without flashing either?

1. b. If the answer is yes to above, then, if I were to clean flash a custom ROM, would I need to flash the no-verity-opt-encrypt zip or root every time after I flash a custom ROM zip? (or even the stock ROM zip for that matter)?

2. I may be oversimplifying this, so I just wanted to make sure I have the correct steps for if I ever wanted to go back to stock and relock the bootloader

- Wipe everything in TWRP

- Transfer & flash the full stock OOS zip in TWRP, from the OnePlus website

- Flash the stock recovery via fastboot

- Issue the oem lock command in fastboot to relock the bootloader

I just want to make sure I have the correct steps before I end up relocking the bootloader when I am not on stock!

Apologies for the length of this post, but I just wanted to be really thorough, as I want to reduce the amount of headache once I get the device, or worse, potentially soft or even hard brick the thing :silly:

Thanks a ton in advance, to anyone who can provide some answers :)
[OnePlus 5 Guides, News, & Discussion] M1K__:
After user adb I noticed that my System partition thought it was 12PB(!) in size, flashing your Nandroid backup fixed all my problems :)
[OnePlus 5 Guides, News, & Discussion] Flint2:
If you don't flash dm-verity opt zip, and you allow system modification, using a stock OOS will trigger the dm-verity flag (booting is possible, an additional warning will appear on boot). On 3T we had a simpler way to restore this flag to normal flashing a buggy old firmware and issue fastboot commands. I suspect for the 5 we will need to flash full OOS (not yet released by oneplus)

If you unlock bootloader and flash TWRP and root, I don't recommend you to try to lock bootloader again, wait for proper tutorials that will be issued.

Also we still does not have the unbrick tools in case you made mistakes to recover from softbrick.

For now I recommend you to follow instructions in the OP of the OnePlus 5 forums.
[OnePlus 5 Guides, News, & Discussion] rickysidhu_:
Hey, thanks for going through my super long post and answering my questions! :good:

So if I don't flash the dm verity zip or root, I'll just be introduced with an additional warning message on boot? And if I do flash the dm verity zip or boot, this warning message will go away?

I will not be locking my bootloader unless I'm on stock unrooted, and have flashed the stock recovery - I was just wanting to make sure my steps to getting there are correct.

I'll definitely be following instructions in the OP for now though, and sorry for harassing you with more questions lol, again, I really appreciate the help :)
[OnePlus 5 Guides, News, & Discussion] Flint2:
Once dm-verity flag tripped, it will be difficult to revert, flashing one zip will not fixit

Not sure if someone managed to lock again after flashing twrp and root.

Short answer : flash the zip before, don't try to block again the bootloader.
[OnePlus 5 Guides, News, & Discussion] rickysidhu_:
So let's say for example, I need to sell the phone and in which case, I need to get back to stock and relock the bootloader, this is possible once guides on it eventually come out, right?

Because if I were to sell to a non tech-savvy buyer, they probably would be put off by the warning messages on boot
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Use V56 works fine for me.

No verity now required only first time, root depends on the custom rom you select, most ROMs are pre rooted and either include supersu or Magisk so not needed. Check the rom OP before flashing and go through installation instructions.

Just flash the latest stock rom and stock recovery and lock the bootloader via fastboot.

Glad to help buddy, enjoy :svetius:
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Yes you can lock when that stage comes, no big deal. For now enjoy the unlocked device
[OnePlus 5 Guides, News, & Discussion] xperia_c4_hater:
I've always used SuperSU and have no experience with Magisk. Why do you recommend the latter over the former? I tried reading up on the difference in the forums here and couldn't find a clear distinction that lists pros and cons rather than difference between how they work.
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Using Magisk makes it easier to hide root from banking apps, android pay and games that check safetynet. Also Netflix and other live TV apps so I use Magisk over SU

Sent from Funk Tuned 3T
[OnePlus 5 Guides, News, & Discussion] xperia_c4_hater:
Thats a good point considering there's no XPosed Framework for Nougat yet. I used to use RootCloak, which I found worked very well quite easily, but I guess Magisk offers a great built-in solution. Thanks again for helping out so many other users!
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Glad to contribute towards the entire community [emoji6]

Sent from Funk Tuned 3T
[OnePlus 5 Guides, News, & Discussion] rickysidhu_:
[MENTION=6143932]Funk Wizard[/MENTION] thanks for all the info kind sir!

Just one more day and I can finally order this thing!! :D

Definitely stress free in terms of my confusion on how OnePlus devices work now, thanks again :svetius:
[OnePlus 5 Guides, News, & Discussion] y.pango:
Hi all,

I've successfully unlocked bootloader, installed twrp 46 and rooted with Magisk v13.0 on Oxygenos 4.5.1 thanks to the guide!

A couple of questions...

What are the steps for updating to a rooted 4.5.2?

Why would you decrypt / leave encryption?

Many thanks
[OnePlus 5 Guides, News, & Discussion] arescool:
Hi [MENTION=6143932]Funk Wizard[/MENTION],

I have followed the steps mentioned here ( did not take steps related to DM verity ) , but now I am not able to access the storage.

Similarly as mentioned in this post :

https://forums.oneplus.net/threads/...s-backup-and-more.548216/page-3#post-16363869

Please help.

Thanks,

Raj
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Flash V56 and follow my seperate thread for OOS 4.5.2, instructions on that thread.

Flash V56 works fine for me
[OnePlus 5 Guides, News, & Discussion] TwinAdk:
I have a question regarding this. I'm on stock rom, only rooted, with twrp installed. Running like this since Friday, no problems. I have an OTA offered to me now (520mb), and if I understand the above correctly, then I must

Flash stock recovery

Take OTA

Let the phone boot

Reboot and flash twrp

Boot twrp and root the phone

Reboot into system and be all good

Key part is to have stock recovery when accepting the partial OTA, correct?

I use SuperSU for root, no Magisk, and would like to remain on stock ROM for now at least :good:

Thank you for your time and assistance! :highfive:

Kind Regards

TwinAdk
[OnePlus 5 Guides, News, & Discussion] lou2s:
To make it easier, u can download the latest 1.5gb full ROM, boot into your TWRP, clear both caches, dirty flash the full ROM (don't reboot yet) , flash SuperSU, clear caches again, reboot. Done!
[OnePlus 5 Guides, News, & Discussion] tristaoeast:
You're saying that you followed the procedure with V56 of TWRP and WITHOUT flashing DM verify and it worked for you, is that it? You're still encrypted?

Sorry for hammering you with so many questions xb
[OnePlus 5 Guides, News, & Discussion] vtec_screamer:
Hi,

I followed the steps carefully and I'm having a few issues. Basic stuff, I believe.

- After flashing TWRP following the keep encryption route steps, after a reboot I lose TWRP and I get back to the OEM recovery.

- In TWRP, when trying to flash Magisk zip file, Internal Storage is encrypted and I can't see the zip file to flash.

I'm already on 4.5.2.

Thanks in advance for any help...

Update: Meanwhile I managed to fix it. Starting the OS and removing the PIN security I was able to find the file in TWRP to flash it and TWRP remains even after setting up PIN security again.
[OnePlus 5 Guides, News, & Discussion] TwinAdk:
OK thanks! I'll find the full zip :good:

Kind Regards

TwinAdk
[OnePlus 5 Guides, News, & Discussion] tristaoeast:
Which version of TWRP did you use?
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Please take a look on the update thread, i have posted easy instructions and as advised please always flash the full zip.

Would be dirty flash so no data loss

https://xdaforums.com/oneplus-5/how-to/official-oxygenos-4-5-2-7-1-1-ota-t3627003

Decryption not working for now, but V58 is better and works fine for flashing updates and other stuff.

Just ignore the DM verity for now.

Update TWRP to V58 & Download and flash Magisk Beta as you are already on 4.5.2 so no update needed :good:
[OnePlus 5 Guides, News, & Discussion] Funk Wizard:
Thanks for your support buddy :fingers-crossed:

You can follow the update thread, also update your recovery to V58 for full zip flash.

https://xdaforums.com/oneplus-5/how-to/official-oxygenos-4-5-2-7-1-1-ota-t3627003
[OnePlus 5 Guides, News, & Discussion] vtec_screamer:
58
[OnePlus 5 Guides, News, & Discussion] _MartyMan_:
Tutorial is great, but i did everything as you wrote and i just can't make my phone decrypted... :/

EDIT: Tutorial is working with decrypting when using 46 cheeseburger TWRP.
[OnePlus 5 Guides, News, & Discussion] néonaloj:
We know that, at the moment, we (I) tried every possible method to decrypt, without succes.. Nor the guide [MENTION=6143932]Funk Wizard[/MENTION], nor the "fastboot format userdata" worked. Phone is erased but still encrypted. Very strange... A workaround as to be found yet.
[OnePlus 5 Guides, News, & Discussion] _MartyMan_:
Flash the 46 cheeseburger TWRP by [MENTION=6584600]xdvs23[/MENTION]. It can decrypt if you follow the tutorial. ;) :good:
[OnePlus 5 Guides, News, & Discussion] fracman:
Device is on truck for delivery. Is it ok to update out of the box and then unlock bootloader, flash twrp, and root. Or do I do these first and then update? New to op devices. Thanks.
[OnePlus 5 Guides, News, & Discussion] néonaloj:
You only need to decrypt your phone for multirom purposes, it's not needed, and all will work fine if you're still encrypted!

As I said before, I tried with TWRP 46, 50, 56 and 58, with no luck, and I'm not the only one... So do you have your phone decrypted yet?

Update first, then go to the unlocking/TWRP'ing, and rooting process. Good luck.
[OnePlus 5 Guides, News, & Discussion] Eng91:
I am not able to flash the recovery, I'm stuck here, trying different releases and checked varius drivers =(
[OnePlus 5 Guides, News, & Discussion] ph1dft:
Also with adb which you can install when you connect your phone?

Tried different USB port?