I want to unlock bootloader install twrp, flash xposed and magisk zip files through twrp. Flash the stock roms recovery again relock the bootloader to be able to use those mods.

Is this possible, i think it was as i've seen it suggested before however issue here is lots of phones delete data during the unlock relock, so that would remove all the mods relocking it defeats the point.

Also my current phone the Samsung S7 Edge, has factory reset protection. I have to unlock the bootloader to flash, tho if i lock the bootloader after flash. Reboot it is permantly stuck on a screen saying locked with factory reset protection in red.

Only way out of this is to go into download mode and flash stock through odin. So i'm guessing Samsungs factory reset protection, ontop of data be deleted even more impossible.

Samsung has dm-verity so magisk or a file to remove dm-verity has to be flashed or rom won't boot.

Maybe i can root without twrp and use flashify, i don't no if it can install xposed magisk.

Looking for suggestions of phones this could work with.


  • 1
    I would advise against relocking BL after any sort of modding, since you're effectively sealing the easiest (and often the only) way of recovery. – Andy Yan Aug 13 '18 at 4:35
  • Yes i no, flashing a rom with flashify without a recovery is risky tho seems flashify can install twrp, and restore stock recovery with locked bootloader.Looking into that, I no the point you make, except there's actually dozens of attack vectors! your exposed to leaving bootloader unlocked. So using an exploit to gain root and maybe using flashify. Hope some devices allow installing twrp removing it then relocking the bootloader while retaining the modifications. – Alister Aug 13 '18 at 9:37
  • Also if a device did allow unlocking and relocking the bootloader without removing all the mods, then while it would be a pain you could just unlock the bootloader and install twrp in situations that really required it, then lock it again afterwards. – Alister Aug 13 '18 at 9:39
  • It's not about whether the OS allows retaining the mods on locked BL (although indeed many stock OS have implemented this); it's about being able to recover from faults if it's allowed. You do know that if the phone can't boot you won't even be able to flip that "allow OEM unlocking" switch (Samsung), right? – Andy Yan Aug 13 '18 at 10:02
  • So are you saying some phone brands do allow to retain mods after locking the bootloader? If the phone can't boot with a locked bootloader, odin doesn't require OEM unlocking to be turned on to flash the stock rom files. Just boot the phone into download mode odin detects it, flash stock rom, start all over again. Problem should be solved. Twrp isn't the only way to recover depending on the phone brand, maybe fastboot requires oem unlocking to be turned on i'm unsure of that samsung does it's own thing. – Alister Aug 14 '18 at 10:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.