[solved]How to install stock ROM + custom kernel and Magisk? - Samsung Galaxy S20 FE Questions & Answers

Hello everyone,
I currently use the stock ROM + WirusMOD Nethunter modified Kernel and Magisk on my SM-G781B/DS.
I installed it quite a while ago using TWRP. I'm still on Android 11 and I'd like to upgrade my system. OTA doesn't work, and I decided to just wipe and completly re-install the stock rom. The Magisk installation guide recommends patching the AP of the ROM over flashing via custom recovery. A custom recovery prohibits OTA upgrades as far as I know, so I would prefer to just keep the stock recovery.
So this is what I planned:
1. modify freshly downloaded stock ROM with Magisk
2. *somehow* install kernel in stock ROM if possible?
3. flash via ODIN
4. finish Magisk setup
I couldn't find that much information and I'm fairly new to rooting in general. So here are the questions I have:
1. Is it possible to flash a custom Kernel without custom recovery, if it is, how?
3. Will OTA updates be accessible with the custom Kernel?
4. Is there another way or did I miss something obvious?
Thanks for any feedback in advance.

you definitely can't flash an AP archive with a custom recovery.
a custom kernel is designed to be flashed by a custom recovery unless it's a single IMG file inside the zip for it.
there's a sizeable chunk of us who manually flash updates, redo twrp, flash a magisk patched boot.img with twrp (once it's been extracted from the AP archive (using a PC app that supports .LZ4 compression)) and then flash a custom kernel finally... every month!
using something like Swift Backup to save apps n data, messages etc helps cut down the misery a bit.

3mel said:
you definitely can't flash an AP archive with a custom recovery.
a custom kernel is designed to be flashed by a custom recovery unless it's a single IMG file inside the zip for it.
there's a sizeable chunk of us who manually flash updates, redo twrp, flash a magisk patched boot.img with twrp (once it's been extracted from the AP archive (using a PC app that supports .LZ4 compression)) and then flash a custom kernel finally... every month!
using something like Swift Backup to save apps n data, messages etc helps cut down the misery a bit.
Click to expand...
Click to collapse
thank you so much! I guess Ill do it that way. Maybe some day there will be an easier way.

Gurkinator said:
thank you so much! I guess Ill do it that way. Maybe some day there will be an easier way.
Click to expand...
Click to collapse
the trend seems to be that it's not getting easier sadly.

Related

OTA update with root and TWRP?

hi! my OP3T is rooted and have a custom recovery (TWRP). now i get an ota update. i have read somewhere in this case its necessary to flash the ota manually in TWRP because i will lost root after this and if i flash it in TWRP i can after ota update flash superSU and will have no problems after reboot the phone.
i have tried this but get "Error 7" in TWRP while flashing ota update. isn't it possible at this way? what is my mistake?
thanks a lot for help and pardon for my bad english!
RotesMeerJogger said:
hi! my OP3T is rooted and have a custom recovery (TWRP). now i get an ota update. i have read somewhere in this case its necessary to flash the ota manually in TWRP because i will lost root after this and if i flash it in TWRP i can after ota update flash superSU and will have no problems after reboot the phone.
i have tried this but get "Error 7" in TWRP while flashing ota update. isn't it possible at this way? what is my mistake?
thanks a lot for help and pardon for my bad english!
Click to expand...
Click to collapse
I have a detailed thread already running on how to update here
http://forum.xda-developers.com/oneplus-3t/how-to/rom-oxygenos-3-5-4-mm-ota-update-t3519074
I shall keep it up to date with further releases
Sent from Funk Tuned 3T
okay, i have searched in the wrong category thanks a lot for the link!
this thread can be closed.
how can i receive the updates when i root my phone?
and is there anyway to change the emoji without root?
a7mad-911 said:
how can i receive the updates when i root my phone?
Click to expand...
Click to collapse
You should still receive OTA notifications with root. And it should detect you have root, and will download the full update zip, and it will install with TWRP.
Otherwise, you can manually download the full zip update from Funk WIzard's thread which he linked in Post #2 above (which also has detailed instructions on how to update when rooted and TWRP installed).
Works like a charm with magisk 13.6
I just did it with my OP3t and was super easy.
1) download update.
2) go to hidden folder .Ota
3) move zip file to another folder
4) put Magisk in the folder, too
5) reboot to recovery, flash ROM, then Magisk
6) wipe dalvik/cache and reboot
Edit: updated following testing of redpoint73's correct advice
LeighR said:
4) put twrp and Magisk in the folder, too
5) reboot to recovery, flash ROM, then twrp, then Magisk
Click to expand...
Click to collapse
As long as you already have TWRP installed (which is the situation we are talking about) you just need to flash the OTA update zip, then flash Magisk.
Magisk prevents TWRP from being over-written (replaced) with stock recovery. In other words, you don't need to flash TWRP, since TWRP is already there.
redpoint73 said:
As long as you already have TWRP installed (which is the situation we are talking about) you just need to flash the OTA update zip, then flash Magisk.
Magisk prevents TWRP from being over-written (replaced) with stock recovery. In other words, you don't need to flash TWRP, since TWRP is already there.
Click to expand...
Click to collapse
This means I will keep all apps/settings/files?
Thank you.
JayDz said:
This means I will keep all apps/settings/files?
Click to expand...
Click to collapse
Yes.
Although I will caveat that with my rule of thumb: "hope for the best, prepare for the worst". In that a "dirty" flash of an update is often possible (saving your a lot of work setting up the device again). But you should still be prepared to wipe and do a "clean" install if you run into any problems. So back up your data, by your method of choice, before you try to update.
In particular, for a major update (such as OOS 4.x to 5.x) a clean install (default wipe in TWRP - data, cache and Dalvik) is typically advised.
Shall?? You used the word 'shall' properly in context? Kudos to the school system (I here assume India's) you attended, and to you for paying attention, using the 'King's English' in it's most proper form.

New to device and the whole firmware thing

OK, long story short. Came for the nexus 6 and nexus 6p to oneplus 3t. The 6p had to flash vendor.IMG after every new ROM flash. But what is this whole firmware thing in this device? I have tried to find answers before asking but, what should I DO and NOT DO to have a brick? Like, wanting to go from a nougat ROM to an Oreo ROM, but not sure how. And then if I wanted to go from a n/o ROM to a beta, not sure how...then if I wanted to downgrade from an o or beta ROM.......please help
Treat the OP3T pretty much the same as you would the Nexus 6. The only difference is, like you've discovered, that OnePlus provides firmware files rather than factory images.
The installation instructions for the different firmwares (stable and beta) are found in the first few posts of the respective threads:
https://forum.xda-developers.com/oneplus-3t/how-to/rom-oxygenos-3-5-4-mm-ota-update-t3519074
https://forum.xda-developers.com/oneplus-3t/how-to/coming-update-oos-based-7-1-t3564240
It's pretty much the same as flashing vendor image. OnePlus just simply offers Firmware images which flash the Modem and the Firmware.
If you're gonna be on OxygenOS and Custom OxygenOS ROMs then you wont need to worry about flashing the firmware. Some of the Custom ROMs such as Paranoid Android and PureFusionOS also flash the recommended firmware automatically.
However, others don't and require you to flash a particular fimware image manually. Usually the Firmware to be used would be mentioned on the ROM thread itself.
Once you've Unlocked the bootloader and flashed a custom recovery, The most common process for flashing ROMs which do not have an included firmwares goes as follows:
1. Reboot To Recovery
2. Wipe Cache & Dalvik Cache, System and Data Partitions
3. Flash Firmware
4. Flash ROM Zip
5. Flash GAPPS
6. Flash Magisk/SuperSU (Optional).
7. Reboot
And that's it.
That is the standard procedure for most of the ROMs, but, I'd advice reading the OP Instructions properly first in case theres anything different.
PS. For moving to Oreo from Nougat, follow the same, but be warned, If your current ROM is encrypted and the new one isn't you'll be locked out of your device until you flash the old ROM back OR wipe userdata with fastboot, which wipes the Internal Storage.
PPS. For moving from a Custom ROM to Oxygen OS, best way to go would be to flash the official recovery again and sideload the official ROM zip via ADB (In some cases, encryption still might cause the same issue as above)
Mizart said:
It's pretty much the same as flashing vendor image. OnePlus just simply offers Firmware images which flash the Modem and the Firmware.
If you're gonna be on OxygenOS and Custom OxygenOS ROMs then you wont need to worry about flashing the firmware. Some of the Custom ROMs such as Paranoid Android and PureFusionOS also flash the recommended firmware automatically.
However, others don't and require you to flash a particular fimware image manually. Usually the Firmware to be used would be mentioned on the ROM thread itself.
Once you've Unlocked the bootloader and flashed a custom recovery, The most common process for flashing ROMs which do not have an included firmwares goes as follows:
1. Reboot To Recovery
2. Wipe Cache & Dalvik Cache, System and Data Partitions
3. Flash Firmware
4. Flash ROM Zip
5. Flash GAPPS
6. Flash Magisk/SuperSU (Optional).
7. Reboot
And that's it.
That is the standard procedure for most of the ROMs, but, I'd advice reading the OP Instructions properly first in case theres anything different.
PS. For moving to Oreo from Nougat, follow the same, but be warned, If your current ROM is encrypted and the new one isn't you'll be locked out of your device until you flash the old ROM back OR wipe userdata with fastboot, which wipes the Internal Storage.
PPS. For moving from a Custom ROM to Oxygen OS, best way to go would be to flash the official recovery again and sideload the official ROM zip via ADB (In some cases, encryption still might cause the same issue as above)
Click to expand...
Click to collapse
That was very informative, thank you!!! Just one more question tho. What would happen if I didn't flash the correct firmware? Like, there is a RR ROM with custom sultan or something that looks like it needs a beta firmware, I'm not in beta firmware, so would I have any issues?
jamescable said:
That was very informative, thank you!!! Just one more question tho. What would happen if I didn't flash the correct firmware? Like, there is a RR ROM with custom sultan or something that looks like it needs a beta firmware, I'm not in beta firmware, so would I have any issues?
Click to expand...
Click to collapse
I'm not entirely sure but in most cases the ROM would simply refuse to flash. Like for RR, if you don't flash a correct firmware then the flashing returns an "Error 7" and the installation stops. But even if it does flash through, it would either not connect to a network or get stuck in a bootloop, but nothing too serious which you can't rectify.

How to swap between kernels with out Magisk brick?

I like to switch between two different developer's kernels and they seem to work better when flashed over the stock kernel and not custom kernel 2 being flashed over custom kernel 1.
My resolution to this is to restore to my stock rooted with magisk kernel then flash the other custom kernel. This results in a Magisk brick where you can't uninstall Magisk and you can't install magisk again due to the stock boot image being modified. The only answer to fix the Magisk brick is a system wipe and rom re-install.
If I uninstall between kernels, all of my Magisk settings and modules are uninstalled too if it doesn't just give the modified boot img thing again.
How can I swap between kernels while restoring stock without getting Magisk bricked?
Example: Custom Kernel 1 > Stock Kernel > Custom Kernel 2. This always leads to the Magisk brick.
Nexus 6, 7.1.2 NitrogenOS, Stock kernel, ElementalX kernel, FK Kernel.
Whenever I have to move between kernels, I do the following:
Dirty flash ROM zip (to restore the stock boot.img that ships with the ROM) or manually extract the boot.img from your ROM's flashable zip and fastboot flash it
Flash Magisk zip
Flash new kernel zip
Reboot and profit!
I haven't faced any issues ever with this process, following the order listed above. Give it a shot. Good luck! :good:
shadowstep said:
Whenever I have to move between kernels, I do the following:
Dirty flash ROM zip (to restore the stock boot.img that ships with the ROM) or manually extract the boot.img from your ROM's flashable zip and fastboot flash it
Flash Magisk zip
Flash new kernel zip
Reboot and profit!
I haven't faced any issues ever with this process, following the order listed above. Give it a shot. Good luck! :good:
Click to expand...
Click to collapse
Y no back up stock boot from the starting?
redsun_ravi said:
Y no back up stock boot from the starting?
Click to expand...
Click to collapse
Why do you need to backup the stock boot image from the beginning? It's already a part of the ROM zip that you flash. You can always dirty flash to go back to the boot image that ships with the ROM that you are using or extract it from your ROM's flashable zip.
shadowstep said:
Why do you need to backup the stock boot image from the beginning? It's already a part of the ROM zip that you flash. You can always dirty flash to go back to the boot image that ships with the ROM that you are using or extract it from your ROM's flashable zip.
Click to expand...
Click to collapse
Y unpack rom and repack boot
Y flash whole rom and loss magisk setting, fonts, adblock host and other stuff
While u can just give 10 sec to back up boot
xNotta said:
I like to switch between two different developer's kernels and they seem to work better when flashed over the stock kernel and not custom kernel 2 being flashed over custom kernel 1.
My resolution to this is to restore to my stock rooted with magisk kernel then flash the other custom kernel. This results in a Magisk brick where you can't uninstall Magisk and you can't install magisk again due to the stock boot image being modified. The only answer to fix the Magisk brick is a system wipe and rom re-install.
If I uninstall between kernels, all of my Magisk settings and modules are uninstalled too if it doesn't just give the modified boot img thing again.
How can I swap between kernels while restoring stock without getting Magisk bricked?
Example: Custom Kernel 1 > Stock Kernel > Custom Kernel 2. This always leads to the Magisk brick.
Nexus 6, 7.1.2 NitrogenOS, Stock kernel, ElementalX kernel, FK Kernel.
Click to expand...
Click to collapse
shadowstep said:
Whenever I have to move between kernels, I do the following:
Dirty flash ROM zip (to restore the stock boot.img that ships with the ROM) or manually extract the boot.img from your ROM's flashable zip and fastboot flash it
Flash Magisk zip
Flash new kernel zip
Reboot and profit!
I haven't faced any issues ever with this process, following the order listed above. Give it a shot. Good luck! :good:
Click to expand...
Click to collapse
No real need to fastboot flash it, just flash the boot.img in TWRP, only takes a second before you flash Magisk
Sent from my H1611 using Tapatalk
redsun_ravi said:
Y unpack rom and repack boot
Y flash whole rom and loss magisk setting, fonts, adblock host and other stuff
While u can just give 10 sec to back up boot
Click to expand...
Click to collapse
Repack boot? I never said that anywhere. Also, I hope you mean unzip the ROM zip file.
Anyway, backing up the boot image would serve no purpose as the OP wants to switch to a different kernel, which means a different boot image that the one he/she is using right now. It'll be pointless.
BurnedDrake said:
No real need to fastboot flash it, just flash the boot.img in TWRP, only takes a second before you flash Magisk
Click to expand...
Click to collapse
Of course the boot image can be flashed via TWRP too. I just gave that as an alternative option. Never said it has to be done a certain way.
shadowstep said:
Repack boot? I never said that anywhere. Also, I hope you mean unzip the ROM zip file.
Anyway, backing up the boot image would serve no purpose as the OP wants to switch to a different kernel, which means a different boot image that the one he/she is using right now. It'll be pointless.
Of course the boot image can be flashed via TWRP too. I just gave that as an alternative option. Never said it has to be done a certain way.
Click to expand...
Click to collapse
Oh I know, it wasn't a criticism, just one less reboot is all
Sent from my H1611 using Tapatalk
redsun_ravi said:
Y unpack rom and repack boot
Y flash whole rom and loss magisk setting, fonts, adblock host and other stuff
While u can just give 10 sec to back up boot
Click to expand...
Click to collapse
U don't lose all the magisk stuff on dirty flash. The only way u lose all that is running the magisk uninstaller. I wipe system, boot, and cache, dirty flash ROM, then magisk, then new kernel. All magisk modules, host files, settings are still present no matter what device or what ROM. Boot is included in ROM so dirty flash flashes that stock boot.img and starts fresh.
You can flash kernel with fastboot.
Extract boot.img from zip, then run
fastboot flash boot boot.img
After that you can backup boot in twrp and flash magisk.
Repeat with other kernel.

Few questions regarding rooting and flashing.

Hello XDA fam, I just picked up a 3T and unlocked the bootloader.
I was just wondering what the general flashing process was for this
device (A3000). Also a tad confused about this dm-verity ...
disabler zip, is this and format data required every time you flash a
new ROM?
MoistPicklez said:
Hello XDA fam, I just picked up a 3T and unlocked the bootloader.
I was just wondering what the general flashing process was for this
device (A3000). Also a tad confused about this dm-verity ...
disabler zip, is this and format data required every time you flash a
new ROM?
Click to expand...
Click to collapse
Dm-verity warnings are similar to the unlocked bootloader screen you get, but are red. You get them if you are running stock OOS and modify the system partition.
You don't need the dm-verity disabler unless you've got a dm-verity warnings screen.
Note that you cannot disable the unlocked bootloader warning you get every time the phone boots except by re-locking the phone.
Another thing to note: if you are running stock OOS and flash TWRP, then TWRP will be replaced by the stock recovery when your reboot the phone unless you:
- use a patched boot image like the one from @Xennet's thread https://forum.xda-developers.com/oneplus-3t/how-to/dm-verity-disable-oxygen-os-t3922324/post79357241
- use a custom kernel, or
- use Magisk.
Flashing using TWRP is just like any other phone. If you're changing ROMs then you need to do a clean install (wipe /data and/system).
Some ROMs don't handle an encrypted phone (most Android 10 ones except for Los and PE), so you you have to remove the encryption before using those ROMs (TWRP>wipe>format data).
Finally if your phone is unlocked and running OOS 5.x or lower, and you want to upgrade to OOS 9.x then you'll either have to:
- remove the encryption (but can re-encrypt after installing 9.x) or
- use the modded firmware (that keeps the 5.x bootloader and keys) so that you don't have to remove the encryption. See https://forum.xda-developers.com/on...-5-0-8-firmware-barrier-t3941164/post79758055
Sent from my OnePlus3T using XDA Labs
BillGoss said:
Dm-verity warnings are similar to the unlocked bootloader screen you get, but are red. You get them if you are running stock OOS and modify the system partition.
You don't need the dm-verity disabler unless you've got a dm-verity warnings screen.
Note that you cannot disable the unlocked bootloader warning you get every time the phone boots except by re-locking the phone.
Another thing to note: if you are running stock OOS and flash TWRP, then TWRP will be replaced by the stock recovery when your reboot the phone unless you:
- use a patched boot image like the one from @Xennet's thread https://forum.xda-developers.com/oneplus-3t/how-to/dm-verity-disable-oxygen-os-t3922324/post79357241
- use a custom kernel, or
- use Magisk.
Flashing using TWRP is just like any other phone. If you're changing ROMs then you need to do a clean install (wipe /data and/system).
Some ROMs don't handle an encrypted phone (most Android 10 ones except for Los and PE), so you you have to remove the encryption before using those ROMs (TWRP>wipe>format data).
Finally if your phone is unlocked and running OOS 5.x or lower, and you want to upgrade to OOS 9.x then you'll either have to:
- remove the encryption (but can re-encrypt after installing 9.x) or
- use the modded firmware (that keeps the 5.x bootloader and keys) so that you don't have to remove the encryption. See https://forum.xda-developers.com/on...-5-0-8-firmware-barrier-t3941164/post79758055
Click to expand...
Click to collapse
Wow thank you for the detailed info, I really appreciate the insight.
I am currently running the latest OOS update 9.0.6 I believe.
Once I have TWRP installed do I swipe and enable modifications?
Flashing Magisk afterwards avoids the bootloop and allows me to
keep TWRP in place of the stock recovery as you said, correct?
So installing most ROMs seems fairly straightforward, following
the flashing instructions. However if I were to install an Android
10 ROM wouldn't formatting data remove all zips and everything
from the internal storage? So at that point I'd have to copy back
all my ROMs and zips back to the phone in TWRP and flash from
this point correct?
Sorry for the loads of questions, my most recent device was a
Note 9, which has a locked bootloader, so it has been a while since
I have flashed anything or used TWRP.
MoistPicklez said:
Wow thank you for the detailed info, I really appreciate the insight.
I am currently running the latest OOS update 9.0.6 I believe.
Once I have TWRP installed do I swipe and enable modifications?
Flashing Magisk afterwards avoids the bootloop and allows me to
keep TWRP in place of the stock recovery as you said, correct?
Click to expand...
Click to collapse
You don't need you enable modifications of the system partition. Any zip you flash will make the system writable if required.
So, just flash Magisk.
MoistPicklez said:
So installing most ROMs seems fairly straightforward, following the flashing instructions. However if I were to install an Android
10 ROM wouldn't formatting data remove all zips and everything from the internal storage? So at that point I'd have to copy back all my ROMs and zips back to the phone in TWRP and flash from this point correct?
Click to expand...
Click to collapse
Correct. So it's best to take a backup of your current system and backing up everything on internal storage (/sdcard) to an external drive or PC.
The fastest way to take the backup is to use ADB.
Code:
adb pull /sdcard
MoistPicklez said:
Sorry for the loads of questions, my most recent device was a
Note 9, which has a locked bootloader, so it has been a while since
I have flashed anything or used TWRP.
Click to expand...
Click to collapse
You'll find that nearly all the rom, kernel, and recovery development threads are under the OnePlus 3 forum in https://forum.xda-developers.com/oneplus-3/oneplus-3--3t-cross-device-development as they are unified: good to flash on both the 3 and 3T.
Sent from my OnePlus3T using XDA Labs
BillGoss said:
You don't need you enable modifications of the system partition. Any zip you flash will make the system writable if required.
So, just flash Magisk.
Correct. So it's best to take a backup of your current system and backing up everything on internal storage (/sdcard) to an external drive or PC.
The fastest way to take the backup is to use ADB.
You'll find that nearly all the rom, kernel, and recovery development threads are under the OnePlus 3 forum in https://forum.xda-developers.com/oneplus-3/oneplus-3--3t-cross-device-development as they are unified: good to flash on both the 3 and 3T.
Click to expand...
Click to collapse
Awesome info, big thanks to you my good sir. Finally
on Havoc 2.9 and decrypted. Now just gotta get a feel
for this phone and keep on reading. Cheers!

going to back to custom ROMS

hello, I used to be a custom ROM junkie in the past but after some time i got bored and never did it again.
now looking at my current device which i never installed a customer ROM before its quite old as its running Android 8 and i would like to jump to 10 or 11.
I am confident i understand the process but its been a few years and i have some questions:
-for example this is the 1st device i encrypt so i am not sure if this affects.
-the device has no custom recovery so i have to start there but not sure if i have to remove encryption or if its ok.
-Also i would like to see if you have any advice for me or somehting i should pay attention beside install TWRP, format all but storage and install zip file for custom ROM
Thanks
masterchop said:
hello, I used to be a custom ROM junkie in the past but after some time i got bored and never did it again.
now looking at my current device which i never installed a customer ROM before its quite old as its running Android 8 and i would like to jump to 10 or 11.
I am confident i understand the process but its been a few years and i have some questions:
-for example this is the 1st device i encrypt so i am not sure if this affects.
-the device has no custom recovery so i have to start there but not sure if i have to remove encryption or if its ok.
-Also i would like to see if you have any advice for me or somehting i should pay attention beside install TWRP, format all but storage and install zip file for custom ROM
Thanks
Click to expand...
Click to collapse
You've missed all the fun with the upgrade to OOS 9.
So, you'll need to upgrade your firmware to 9.0.6 because all the latest ROMs require it. Take your time and carefully read https://forum.xda-developers.com/on...5-0-8-firmware-barrier-t3941164/post79758055.
You do not need to remove encryption (depending on how you upgrade your firmware).
If you've got a locked bootloader (which I'm expecting you do), them you need to unlock it so that you can flash TWRP. And unlocking will wipe all data from your phone. So backup everything you want to keep to your PC.
If you don't boot into recovery after flashing TWRP and install a patched boot image (see https://forum.xda-developers.com/on...ty-disable-oxygen-os-t3922324/post79357241)or flash Magisk, and reboot your phone, you'll lose TWRP because OOS automatically restores the stock recovery.
So the order is:
1. Backup
2. Unlock bootloader
3. Flash TWRP
3. In TWRP flash patched boot image (remember you're still on OOS 5.x so use the right one!) or Magisk.
4. Have fun moving to a custom rom.
Sent from my OnePlus 3T using XDA Labs

Categories

Resources