[GUIDE]: How to root Android TV using Magisk (MR. Duhaz Build)
Written By: thebootsie123
Requirements:
- USB Flash Drive
- Ubuntu Live ISO (https://ubuntu.com/download/desktop)
- Rufus (https://rufus.ie/)
OPTIONAL:
- Patched ramdisk.img file (https://drive.google.com/file/d/1EGBx2o4R4k-6VbLet4uTPRX2I3rPkJhR/view?usp=sharing)
STEPS:
- First, download the Ubuntu Desktop install ISO from the link above. You will NOT need to install Ubuntu Desktop. Instead, we will be using the live Ubuntu feature which runs Ubuntu Desktop from the USB flash drive itself
- Download Rufus from the link above and install it. Once that's finished insert a USB flash driver and open up Rufus
- Select your flash drive under the "Device" dropdown and then click on the "SELECT" button and navigate to where you downloaded the Ubuntu ISO
- Click on the Ubuntu ISO and then verify that the name of the ISO appears under the "Boot selection" dropdown. After that click on "START" at the bottom to write the ISO file to the flash drive. A popup might come up, in that case select "Write in ISO Image mode (Recommended) and then click "OK". THIS WILL DELETE ALL DATA on the flash drive so verify that you don't need any of the files first.
- Once the green status bar says "READY" you are all set to remove the flash driver from your computer and move on to the next steps
- Boot into the flash drive from your computer. Once the Ubuntu Installer UI comes up click on "Try Ubuntu". DO NOT INSTALL UBUNTU
- Click on the 3x3 array of dots on the lower left hand corner, and then in the search bar find and open the terminal
- In the terminal run the command "sudo nautilus"
- From there click on your main disk partition. The root folder of the partition should include two directories. One with android in the title and one named "grub". If you can't find it then try clicking on "Other Locations" If it still doesn't show up then close the window and terminal. From there click on the file cabinet icon on the left sidebar (should be named "files"). Once opened click on "Other Locations" and then find your drive with the two folders inside. Once you find it then close the window and repeat steps 8 and 9.
- Once you're in the correct directory open the android folder. It should be named something like "android-2019-07-06". Remain the "ramdisk.img" file to "ramdisk.bak" (this is to create a backup of the file in case something goes wrong)
- Then replace the "ramdisk.img" file with the patched file. This can be obtained by downloading the patched file through the firefox browser within Ubuntu. Or you can find the file on another usb flash drive and move it over that way
- After the "ramdisk.img" file is replaced with the new one then you can shutdown Ubuntu and your computer and then boot into Android TV
- If you open the Magisk Manager app it should say you're all set. If you run into any errors you can go through the process to patch the file yourself.
PATCHING THE RAMDISK FILE:
- From Ubuntu click on the 3x3 dot array in the lower left hand corner and search for and open "Software & Updates"
- From there tick the checkbox where it says "Community-maintained free and open-source software (universe)" and then click on "close" and press "Reload" when the out-of-date dialog box comes up
- Now open up the terminal and run the following command to install the required packages:
- Open the android directory from your drive (should be named something like "android-2019-07-06") and copy the "kernel" file and "ramdisk.img" file to a directory of your choice. It can be in the downloads, on the Desktop, etc.
- From the terminal cd into the directory where you placed the two files from the previous step
- Then run the following command:
- Copy the resulting file "boot.img" and place it in your-android-folder/data/media/0/
- Now reboot your computer into Android TV and open up Magisk Manager
- Inside Magisk Manager click on the install button (it may be labeled patch) next to where it says "Magisk Manager" (Should be under download the zip)
- Then select the "boot.img" file. If you are unable to find the file then reboot into Ubuntu and move the "boot.img" to your-android-folder/data/media/0/Download
- After there should be a generated file called "patched_boot.img". Save it into the Download folder as this will be easy to get to later
-
Then hold down ALT+F1 (ALT+Fn+F1) to get into the TTY (it should look like a terminal) and run the following command
This will backup the su file in case something goes wrong
- Now reboot into Ubuntu and open up the android directory from your drive just like before and navigate to your-android-folder/data/media/0/Download
- Copy the "patched_boot.img" to a directory of your choice and then open up terminal and cd into that directory
-
Next run the following command
If the following command cannot be found then redo steps 1-3
- This should generate two files ("kernel" and "initrd.img") in the directory where you ran the command
- Rename the "initrd.img" file to "ramdisk.img" and replace it with the "ramdisk.img" file in your-android-folder
- Once done you can reboot into Android TV and check Magisk Manager to make sure you have root access
Have any questions?
Have any further questions? Feel free to send me an email or a DM on Discord! You can find me email and Discord details below:
Email: [email protected]
Discord: thebootsie123#3621