Patch boot image without using Magisk App

Search This thread

swimtw

Member
May 20, 2014
9
0
Hello,

I'm trying to patch my boot image without using Magisk App.(via PC) Is there any way to do this?


This is because everytime I do security update every month, I have to:
1. Download factory image
2. Unzip and get boot.img
3. Put boot.img in my phone
4. Patch boot.img with Magisk App
5. Move boot_patched.img to my pc and flash via fastboot

I find this very unefficient, and I want to automate 1~4 by just doing all the process in my PC.
 

swimtw

Member
May 20, 2014
9
0
Why wouldn't you install your update and before re-booting the phone go to the Magisk app and let it do the patching for you with "Direct Install" (or "Install to Inactive Slot" if you have device with dual partition)?
@Andrologic This is because I root for VoLTE(Voice over LTE) patch and after that, I assume that I cannot update my phone via OTA. Long ago I tried updating with OTA and for as long as I remember it failed. Ever since that happened, I usually unroot first, do an update with either sideload or OTA or factory image(very often), root again with all the steps above, and so on..
 

swimtw

Member
May 20, 2014
9
0
@Didgeridoohan Do you happen to know where I can get the essential magiskinit and magiskboot binary?
From magisk v22.0 I see that magisk core and magisk manager got merged into one, and now I can't find the latest executable. (x86 too)
 

beckno

Senior Member
Jan 7, 2018
195
28
After update, make a boot.img backup via twrp (copy in twrp folder and rename to boot.img) patch via Magisk and flash new patched boot.img.


Os. I do not like a new method too.
 

Sathors

New member
Apr 11, 2022
2
2
Thank you guys, with these ideas I have been able to write a bash script to automate the whole process of downloading the latest build of lineageos, patch it on the phone using magisk (using adb shell), and flash it in fastboot mode, without needing any user intervention whatsoever.
 
  • Love
Reactions: -CALIBAN666-

eyal1izhaki

Member
Sep 4, 2020
10
7
22
Samsung Galaxy S20 FE
Oh nice, I tried to run boot_patch.sh on my Ubuntu, didn't go well.. I'll try to run it on my samsung phone as you did.

In not running lineageos but it should be the same process.

Thanks for the script
 

swimtw

Member
May 20, 2014
9
0
Also, you should not use the x86 binaries to patch a boot img of an aarch64 device. Flashing the mispatched img will make you boot loop the device.
 

Top Liked Posts