[GUIDE]: How to root Android TV using Magisk (MR. Duhaz Build)

Written By: thebootsie123


Requirements:

OPTIONAL:

STEPS:

  1. 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
  2. Download Rufus from the link above and install it. Once that's finished insert a USB flash driver and open up Rufus
  3. Select your flash drive under the "Device" dropdown and then click on the "SELECT" button and navigate to where you downloaded the Ubuntu ISO
  4. 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.
  5. 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
  6. Boot into the flash drive from your computer. Once the Ubuntu Installer UI comes up click on "Try Ubuntu". DO NOT INSTALL UBUNTU
  7. Click on the 3x3 array of dots on the lower left hand corner, and then in the search bar find and open the terminal
  8. In the terminal run the command "sudo nautilus"
  9. 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.
  10. 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)
  11. 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
  12. 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
  13. 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:

  1. From Ubuntu click on the 3x3 dot array in the lower left hand corner and search for and open "Software & Updates"
  2. 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
  3. Now open up the terminal and run the following command to install the required packages:
    sudo apt install android-tools-mkbootimg abootimg
    
  4. 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.
  5. From the terminal cd into the directory where you placed the two files from the previous step
  6. Then run the following command:
    mkbootimg --kernel kernel --ramdisk ramdisk.img --output boot.img
    
  7. Copy the resulting file "boot.img" and place it in your-android-folder/data/media/0/
  8. Now reboot your computer into Android TV and open up Magisk Manager
  9. 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)
  10. 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
  11. 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
  12. Then hold down ALT+F1 (ALT+Fn+F1) to get into the TTY (it should look like a terminal) and run the following command

    cd /system/xbin && mv su su.bak
    

    This will backup the su file in case something goes wrong

  13. 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
  14. Copy the "patched_boot.img" to a directory of your choice and then open up terminal and cd into that directory
  15. Next run the following command

    abootimg -x patched_boot.img
    

    If the following command cannot be found then redo steps 1-3

  16. This should generate two files ("kernel" and "initrd.img") in the directory where you ran the command
  17. Rename the "initrd.img" file to "ramdisk.img" and replace it with the "ramdisk.img" file in your-android-folder
  18. 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

Edit

Pub: 15 Aug 2019 00:26 UTC

Edit: 04 Oct 2019 23:24 UTC

Views: 2051