Magisk boot.img patching/flashing (Root) with a side of Viper4Android and AdAway

lmt1979

Senior Member
Feb 23, 2010
105
43
58
Havelock
(Problems I had when attempting a "dry" flash and patch:)
Just got the phone today (November 18) then attempted to flash the boot.img after patching it with magisk manager (after magisk patches the boot.img it renames it to "magisk_patched.img"). Got the usb debugging authorized after updating my adb drivers. If you want to make sure your phone is authorized you may need to run commands: adb kill-server and adb devices to check and stop/restart adb.

Anyone able to get it flashed? Getting error:
Code:
FAILED (remote: Failed to write to partition Not Found)
after running
Code:
fastboot flash boot magisk_patched.img
from fastboot, bootloader is unlocked. Running version
Code:
bramble-rd1a.200810.022.a4 (October)
I'd recommend patching up to the November update: Settings, System, System Update to the newest November update (11.0.0 (RD1A.201105.003.C1, Nov 2020).

EDIT: I'd recommend installing 15 second ADB https://forum.xda-developers.com/showthread.php?t=2588979, then overwriting it with the newest adb tools from google. 15 second ADB will add the ADB folder to your system's PATH (ENVIRONMENT VARIABLES) allowing you to run adb commands from any folder (not just the folder adb resides in).

Ok, updating to usb_driver_r13-windows.zip and platform-tools_r30.0.5-windows.zip and updating the build to the Nov RD1A.201105.003.C1 will report back lol

EDIT 2: So yeah, update your drivers and platform tools, successfully patched it:
Code:
fastboot flash boot magisk_patched.img
OUTPUT:
Code:
Sending 'boot_b' (98304 KB)                        OKAY [  2.310s]
Writing 'boot_b'                                   OKAY [  0.480s]
Finished. Total time: 3.122s
How to flash and patch:

https://www.xda-developers.com/google-pixel-4a-how-to-unlock-bootloader-root-pass-safetynet/

Prerequisites:

Download the applicable factory image https://developers.google.com/android/images The Pixel 4A 5G is codenamed "Bramble" (Pull down your shade or look in Settings, "About phone" for Build number) and extract the boot.img from factory image, then transfer it to phone and patch it with magisk manager:
Open Magisk manager -> select ‘Install’ -> ‘Select and Patch File’ -> select your boot.img file
The patched boot image should be found inside your Download folder
After magisk patches it, mount your phone's storage, copy to your computer and flash it from fastboot. Hold down the Power and Volume Down buttons to enter fastboot.
Run command
Code:
fastboot flash boot magisk_patched.img
Platform Tools (includes ADB)
https://dl.google.com/android/repository/platform-tools-latest-windows.zip

Usb Drivers
https://dl.google.com/android/repository/usb_driver_r13-windows.zip?hl=ru

Magisk

Direct Link https://github.com/topjohnwu/Magisk/releases/download/v21.1/Magisk-v21.1.zip
Direct Link https://github.com/topjohnwu/Magisk/releases/download/manager-v8.0.3/MagiskManager-v8.0.3.apk
Magisk Releases page (in case of an update to magisk or magisk manager) https://github.com/topjohnwu/Magisk/releases/

VIPER4Android (great Digital Signal Processor)
I have been struggling with getting Viper4Android installed.

Stop-gap here:
I flashed this one, but it's distorting my external speakers and is buggy, but it does process...so BE CAREFUL. This will get you there until a more stable version is out. And the video was just taken down. All you have to do is flash it with Magisk here's a link:

https://drive.google.com/file/d/17-NTL0miBYzk4o4v26MstAL9lOPXF3GN/view?usp=sharing

AdAway (system-wide ad blocking)
tried version 5.10 with no luck, let me know if it works for you.
AdAway 4.34 working for me on Android 11.0.0 (RD1A.201105.003.C1, Nov 2020)
Here: https://f-droid.org/repo/org.adaway_40304.apk
AdAway 4.36 (haven't tested)
https://f-droid.org/repo/org.adaway_40306.apk
Make sure to enable "Systemless Hosts" in Magisk Manager before attempting to enable ad-blocking. It's under Settings (the cog/gear in the top right) in the Magisk section.

Good luck all!
 
Last edited:

Colchiro

Senior Member
Dec 17, 2010
792
210
73
Good to see someone working on this. My phone won't be here until tomorrow.

The last time I had trouble flashing, I wasn't running the canary build of Magisk.
 

andrew207

Member
Jan 31, 2011
8
0
21
/dev/null/
After successfully fastboot unlocking, when I try to patch my boot.img I get the following error from Magisk:

Code:
-Device platform: arm64-v8a
- Copying image to cache
- Checking ramdisk status
- Stock boot image detected
- Patching ramdisk
! Installation failed
- Repacking boot image
! Unable to repack boot image!
I first tried using the Australian factory image, labelled "11.0.0 (RD1A.201105.003.A1, Nov 2020, AU carriers)" and got the above error.
Then I tried with the Australian + Japan factory image, labelled "11.0.0 (RD1A.200810.020, Oct 2020, AU & JP carriers)" and got the same error.

What fixed it was switching to the BETA update channel in Magisk manager.

Once I changed to the BETA channel I saw in the changelog that they added support for a new boot.img format used by Pixel 5 and Pixel 4a 5G.

Anyone who ends up here from Google, swap to the beta update channel in Magisk manager :).
 

bkdodger

Senior Member
Jan 30, 2011
1,452
738
143
After successfully fastboot unlocking, when I try to patch my boot.img I get the following error from Magisk:



Code:
-Device platform: arm64-v8a

- Copying image to cache

- Checking ramdisk status

- Stock boot image detected

- Patching ramdisk

! Installation failed

- Repacking boot image

! Unable to repack boot image!


I first tried using the Australian factory image, labelled "11.0.0 (RD1A.201105.003.A1, Nov 2020, AU carriers)" and got the above error.

Then I tried with the Australian + Japan factory image, labelled "11.0.0 (RD1A.200810.020, Oct 2020, AU & JP carriers)" and got the same error.



What fixed it was switching to the BETA update channel in Magisk manager.



Once I changed to the BETA channel I saw in the changelog that they added support for a new boot.img format used by Pixel 5 and Pixel 4a 5G.



Anyone who ends up here from Google, swap to the beta update channel in Magisk manager :).
Thanks for info ..I changed to beta but still having issues patching boot IMG..is this correct MagiskScreenshot_20201120-154336.jpg
 

WhiteAsIce

Senior Member
Dec 1, 2010
75
3
28
Do you have a custom recovery installed? I'm trying to figure out how to install Magisk, but I can't find a custom recovery, neither TWRP nor ClockworkMod.
 

Simma

Member
Jul 30, 2010
11
1
23
Do you have a custom recovery installed? I'm trying to figure out how to install Magisk, but I can't find a custom recovery, neither TWRP nor ClockworkMod.
There's no custom recovery. You need to fastboot flash a patched boot.img as described in this guide: https://www.xda-developers.com/googl...ass-safetynet/ using the links from the OP.

Just make sure you're using the latest platform tools, download the matching factory image and change magisk manager to "beta mode" before patching the boot.img.
 

lmt1979

Senior Member
Feb 23, 2010
105
43
58
Havelock
Android 10 and TWRP

There's no custom recovery. You need to fastboot flash a patched boot.img as described in this guide: https://www.xda-developers.com/googl...ass-safetynet/ using the links from the OP.

Just make sure you're using the latest platform tools, download the matching factory image and change magisk manager to "beta mode" before patching the boot.img.
Do you have a custom recovery installed? I'm trying to figure out how to install Magisk, but I can't find a custom recovery, neither TWRP nor ClockworkMod.
More information on Android 10 and TWRP, though there are some devices slowly getting support for TWRP. Haven't heard clockworkmod in a long time.

https://twrp.me/site/update/2019/10/23/twrp-and-android-10.html
 

[Jan]

Member
May 21, 2019
9
9
3
Hof
[...]
Adaway (system-wide ad blocking)

tried version 5.10 with no luck, let me know if it works for you.
Adaway 4.34 working for me on Android 11.0.0 (RD1A.201105.003.C1, Nov 2020)
Here: https://f-droid.org/repo/org.adaway_40304.apk
Adaway 4.36 (haven't tested)
https://f-droid.org/repo/org.adaway_40306.apk
Make sure to enable "Systemless Hosts" in Magisk Manager before attempting to enable ad-blocking. It's under Settings (the cog/gear in the top right) in the Magisk section.
[...]
Got v5.1.0 (from F-Droid) working properly with Magisk running with systemless hostfile. Try installing BusyBox (i have v1.32.0 installed) to '/system/bin', which will be used by Adaway (instead of running native commands on root level, which apparently cause the issue).
 
Last edited:
  • Like
Reactions: fyrmd

mmarcz

Senior Member
Nov 22, 2006
122
36
48
I can't seem to flash version of Viper in Magisk, it won't let me. I've also tried every combination of the latest viper versions, and their settings, and nothing will run. Perhaps it will on the next version of Magisk. I had posted in the Magisk forum, and none of the suggestions helped.

If anyone has any luck, let us know!
 

brandontowey

Senior Member
Mar 10, 2009
220
90
48
I can't seem to flash version of Viper in Magisk, it won't let me. I've also tried every combination of the latest viper versions, and their settings, and nothing will run. Perhaps it will on the next version of Magisk. I had posted in the Magisk forum, and none of the suggestions helped.

If anyone has any luck, let us know!
The linked version worked for me after trying the magical downloaded version. I had the audio modification library and audio compatibility modules installed. I don't remember the exact sequence bit all I have now is the posted module l.

It does have some odd issues with file storage. I can save a new preset but putting my old one in the viper folder in internal storage doesn't work. I also can't rename or delete presets. I ended up having to go to /root/storage/self/primary which seems to be internal storage by another path. Pasting my presets in that viper folder worked. No idea how systemless works so can't even guess what's going on.
 

lmt1979

Senior Member
Feb 23, 2010
105
43
58
Havelock
I can't seem to flash version of Viper in Magisk, it won't let me. I've also tried every combination of the latest viper versions, and their settings, and nothing will run. Perhaps it will on the next version of Magisk. I had posted in the Magisk forum, and none of the suggestions helped.

If anyone has any luck, let us know!
Just flash the https://drive.google.com/file/d/17-NTL0miBYzk4o4v26MstAL9lOPXF3GN/view?usp=sharing with Magisk. Choose "Modules" the right option on the bottom https://drive.google.com/file/d/1BWLVPtypCjCiqUSEHiRc8sCuMtjqKdY5/view?usp=sharing
 
  • Like
Reactions: crubbish

mmarcz

Senior Member
Nov 22, 2006
122
36
48
Thank you!!!!! Works as advertised!!!!
This was 75% of the reason I bought a pixel!!!
I'm so happy this morning, you have no idea.
It was even processing Amazon music, which didn't work before, so far so good. I only had a chance to listen in the car for 5mins this morning.
 

lmt1979

Senior Member
Feb 23, 2010
105
43
58
Havelock
Thank you!!!!! Works as advertised!!!!
This was 75% of the reason I bought a pixel!!!
I'm so happy this morning, you have no idea.
It was even processing Amazon music, which didn't work before, so far so good. I only had a chance to listen in the car for 5mins this morning.
If it stops processing, long press on the icon on the desktop, select App info, Force Stop and reopen and it'll usually start up again. I had to do this much more often on my Pixel 3 than I have on the 4A 5G.
 

VerneVerne

Senior Member
Jun 21, 2011
179
52
46
I've followed the steps posted above. Flashed the Drive file in magisk but I'm still getting abnormal status, audio format unsupported. Tips?
 

lmt1979

Senior Member
Feb 23, 2010
105
43
58
Havelock
I've followed the steps posted above. Flashed the Drive file in magisk but I'm still getting abnormal status, audio format unsupported. Tips?
If you're sure you're rooted, some people have noted they needed to use/install Audio Modification Library and possibly Busybox. I'd attempt to clear the cache on Magisk and Viper4Android, as well.

I am on the November build and did not need Audio Modification Library, audio compatibility module (Magisk) or Busybox. I'm using Magisk 21.1 (21180) and Magisk Manager 8.0.3 (314)(14). There's a "puzzle piece" on the far right of the new Magisk Manager menu that has "Install from Storage", this is where I pointed to the Viper.zip and flashed it.
 
Last edited:

VerneVerne

Senior Member
Jun 21, 2011
179
52
46
If you're sure you're rooted, some people have noted they needed to use/install Audio Modification Library and possibly Busybox. I'd attempt to clear the cache on Magisk and Viper4Android, as well.

I am on the November build and did not need Audio Modification Library, audio compatibility module (Magisk) or Busybox. I'm using Magisk 21.1 (21180) and Magisk Manager 8.0.3 (314)(14). There's a "puzzle piece" on the far right of the new Magisk Manager menu that has "Install from Storage", this is where I pointed to the Viper.zip and flashed it.
Tried all the above. No luck though. I remember it being very finicky on my pixel 3. I'll try again when I'm not actually at work. Thanks for the help though
 

brandontowey

Senior Member
Mar 10, 2009
220
90
48
Tried all the above. No luck though. I remember it being very finicky on my pixel 3. I'll try again when I'm not actually at work. Thanks for the help though
I've been glhaving issues too after it worked for awhile. Couldn't deal with no presets thing so tried different Magisks, etc with no luck and now it won't process. I'll update if I find something.

EDIT: the module at https://zackptg5.com/android.php#viper works if run in legacy mode.

EDIT AGAIN: can't save presets for some reason with above module but the ViperFX XDA Labs release before the most current one works in legacy mode https://labs.xda-developers.com/store/app/com.pittvandewitt.viperfx
 
Last edited:

VerneVerne

Senior Member
Jun 21, 2011
179
52
46
You need to go into the settings for the app force stop it and then reopen it.
I've already tried. Started from scratch. Still unsupported status.


Edit: after reading somewhere on here that if you use legacy mode it will process. Followed all steps, set it to legacy and now it works. Thank you everyone
 
Last edited: