• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[RECOVERY] [OFFICIAL] TWRP for Shield Android TV

Search This thread

elliwigy

Forum Moderator / Recognized Dev / Dev Relations
Staff member
XDA App Taskforce
Great work guys. I got the apk installed but how do I install magisk to system since I can not boot a patch boot img and do i need to unlock my bootloader for this?

if you have to ask those questions I suggest you stay away from modding it for now until a normal method is available..
 
  • Like
Reactions: powercommy

elliwigy

Forum Moderator / Recognized Dev / Dev Relations
Staff member
XDA App Taskforce
to add if you relock bl you cant disable verity or make changes to system etc. but can still get a root shell.

also the vbmeta_skip.img on unlocked bl essentially disables vbmeta as the img is zeroed out and only has the header.

there must be something in the kernel or something thats preventing device from booting with modified imgs..
 

Steel01

Recognized Developer
Dec 14, 2008
1,266
2,811
Hey look, a recovery image. That really helps with some of the stuff I do. Wish they'd uploaded one for sif too, but oh well. Maybe eventually.

Fwiw, /system will not mount directly, this is expected. Since the newer versions use system as root, the system partition mounts to /system_root and /system is a symlink to /system_root/system. I've seen some errors about unable to mount /system myself, but it's never seemed to actually break anything.
 
  • Like
Reactions: powercommy

elliwigy

Forum Moderator / Recognized Dev / Dev Relations
Staff member
XDA App Taskforce
Hey look, a recovery image. That really helps with some of the stuff I do. Wish they'd uploaded one for sif too, but oh well. Maybe eventually.

Fwiw, /system will not mount directly, this is expected. Since the newer versions use system as root, the system partition mounts to /system_root and /system is a symlink to /system_root/system. I've seen some errors about unable to mount /system myself, but it's never seemed to actually break anything.
i noticed when i locked bl while modified and rooted with vbmeta disabled it said red corrupt screen due to "no os".. oem unlocked and it booted again.. i kno this might b different but implying that could be a verty/verification issue or something we need to disable?

Sent from my SamPWND N976V or G975U
 

rootfan

Senior Member
Jul 20, 2011
201
202
@elliwigy, I believe I've figured out why Magisk doesn't work on Shield TVs. Give the attached zip a try and let me know if it works.

Edit: @powercommy, I've attached a magisk patched mdarcy developer boot.img. See if that works.
 

Attachments

  • magisk-debug.zip
    10.9 MB · Views: 211
  • mdarcy_magisk_boot.zip
    10.9 MB · Views: 174
Last edited:
  • Like
Reactions: tnomtlaw

elliwigy

Forum Moderator / Recognized Dev / Dev Relations
Staff member
XDA App Taskforce
@elliwigy, I believe I've figured out why Magisk doesn't work on Shield TVs. Give the attached zip a try and let me know if it works.
we just need a working twrp now haha.. twrp is broken atm.. experimental version is having trouble mounting system so zips are failing and older twrp mouse/keyboard not working so cant swipe when it loads..

unless the script is the reason zips arent flashing?

Sent from my SamPWND N976V or G975U
 

powercommy

Senior Member
Jul 10, 2007
77
45
Samsung Galaxy Note 10+
@elliwigy, I believe I've figured out why Magisk doesn't work on Shield TVs. Give the attached zip a try and let me know if it works.
@rootfan Tried your release a couple of times, started the shield with twrp experimental and mounted system_root and is symlink to system.

Attempt 1.
Installed your magisk and got the result mounting /dev/block/App failed.

Symlink for system was removed and a directory system has been created by your zip file.

Attempt 2.
Trough terminal I run the following command and manually created the mount like you tried in the installer.

mount /dev/block/platform/sdhci-tegra.3/by-name/APP /system

Started install magisk_debug.zip again. See pictures for results in both attempts. Rebooted got stuck at Nvidia logo again.

Then flashed the dev boot.img again to started the shield.
 

Attachments

  • 20191201_125529.jpg
    20191201_125529.jpg
    255.7 KB · Views: 187
  • 20191201_131346.jpg
    20191201_131346.jpg
    258.4 KB · Views: 187
Last edited:

powercommy

Senior Member
Jul 10, 2007
77
45
Samsung Galaxy Note 10+
@elliwigy, I believe I've figured out why Magisk doesn't work on Shield TVs. Give the attached zip a try and let me know if it works.

Edit: @powercommy, I've attached a magisk patched mdarcy developer boot.img. See if that works.

Sorry, got a busy day at work today, but finally got around to test your boot image.

Good news is that we get a step further and past the Nvidia logo.

Bad news is that the Android logo keeps loading forever.
 

elliwigy

Forum Moderator / Recognized Dev / Dev Relations
Staff member
XDA App Taskforce
@elliwigy, I believe I've figured out why Magisk doesn't work on Shield TVs. Give the attached zip a try and let me know if it works.

Edit: @powercommy, I've attached a magisk patched mdarcy developer boot.img. See if that works.

upon further review i modified a bunch of stuff.. dmesg is giving errors about tlk_daemon.. upon more research tlk properties I see

init.svc.tlk_daemon=restarting
ro.boot.secureos=tlk
ro.hardware.gatekeeper=tlk.tegra

I attached a screenshot of dmesg and cat of /proc/kmsg..

I modified /init.rc, prop.default, system/build.prop, fstab.darcy (i think this is the one for mdarcy?)

i tried setenforce 0 to permissive...

i have magisk files in system/xbin which work if i patch policy and start daemon using the adb root shell after booted up without the mods listed above.. basically unmodified devos, adb root shell, then use the magisk binaries to start magisk daemon works..

with the modifications though it sits at the android bootani.. i still have adb shell access..

another odd thing is that /data does not seem to be mounted.. not sure if this is bcuz od not fully booted or if it could be causing to not fully boot..

i think theres some security still enabled somewhere thats blocking boot..

anyone kno anything about TLK? secureos is tlk, also ro.boot.security=enabled and ro.vendor.security=enabled
 

elliwigy

Forum Moderator / Recognized Dev / Dev Relations
Staff member
XDA App Taskforce
@elliwigy, I believe I've figured out why Magisk doesn't work on Shield TVs. Give the attached zip a try and let me know if it works.

Edit: @powercommy, I've attached a magisk patched mdarcy developer boot.img. See if that works.

hm... so.. i reflashed the dev firmware and used the vbmeta_skip.img instead of vbmeta.img.. then did a fastboot -w.. then fastboot reboot bootloader... then fastboot flashed your patched boot.img.. then fastboot -w... then fastboot reboot... it actually loaded up with the magisk patched boot.img.. however magisk.apk wasn't installed.. I installed magisk.apk and when i opened it, it said that it needed to install something (like it normally does) and after selecting that device reboots then hangs on the boot animation
 

elliwigy

Forum Moderator / Recognized Dev / Dev Relations
Staff member
XDA App Taskforce
After further testing, after i got stuck again on the bootani i did adb reboot bootloader.. then fastboot -w and then fastboot reboot and it again started back up..

this time i adb installed magisk.apk.. when I opened it i pressed cancel on the pop up to install it or w.e.. then i set the access popup to always grant su.. adb shell then su gains magisk root just fine at this point..

the only issue I am having now is when I try to download/install a mod.zip it fails to install saying to install the latest magisk..

so we are almost there but not quite yet haha.. apparently though when modifications are run and you get stuck at the bootani wiping the device seems to allow it to boot with the changes made.. this is odd seeing as how I have both verity and verification disabled? I noticed the patched boot.img has avb/dm verity box checked however.
 

elliwigy

Forum Moderator / Recognized Dev / Dev Relations
Staff member
XDA App Taskforce
@elliwigy, I believe I've figured out why Magisk doesn't work on Shield TVs. Give the attached zip a try and let me know if it works.

Edit: @powercommy, I've attached a magisk patched mdarcy developer boot.img. See if that works.

so both the zip and boot work to an extent.. i used the zip and am now rooted on stock firmware..

Here are the steps I followed:

1) Unlock BL/Wipe data
2) If you are not already on full stock OS then flash full stock OS in fastboot then fastboot reboot bootloader then fastboot -w to wipe again..
3) fastboot boot experimental twrp..
4) select mount then select system_root, vendor and data.. if data doesnt mount then format data in twrp then reboot bootloader then fastboot boot twrp again and u should b able to mount it..
5) from pc type adb root then adb remount all..
6) adb push magisk-debug.zip to /data/media..
7) adb shell
8) mount -o bind /dev/block/mmcblk0p18 /system
9) install, navigate to the magisk zip and install it..
10) reboot.. if it doesnt boot then go to fastboot and wipe data again and reboot..
11) once booted n setup you take the magisk.apk from the magisk.zip and adb install -g magisk.apk
12) not sure if this matters but in adb shell, type su and grant adb shell root.. then i mounted / by "mount -o rw,remount /"
13) Open magisk again and this time install the magisk setup.. itll reboot after about 5 seconds..
14) device will seemingly sit on the android bootanimation.. the key to get it to boot is by adb root shell typing "resetprop ro.boot.verifiedbootstate orange"
15) after it boots up you can type "resetprop ro.boot.verifiedbootstate green" so you can pass safetynet again..
16) now u can open magisk and install modules etc as normal..

Part of my hunch about TLK was accurate.. when its sitting on the bootani if you run dmesg youll see TLK dolby service complaining that device boot state is not green.. magisk sets it to green by default for safetynet bypass and other reasons but tlk wont boot if its mismatched?

the resetprop command needs to b run after each reboot.. that is until someone makes a module or script that can change it to orange then back to green so it doesnt need to be manually done each reboot..

i also recommend disabling magisk updates.. im not sure if/what was modified to get it to work but updates might break root? @rootfan can probably answer this..

also to add, i havent figured out how to get disney+ working.. its not in play store and the alternate install methods it wont open.. it instantly crashes..

i tried messin with some props but no luck yet.. i dunno wat its checking.. according to nvidia it wont work on new shields while rooted but dunno
 

rootfan

Senior Member
Jul 20, 2011
201
202
@elliwigy, I notified the Magisk developers about the specific issue and it has been addressed so the next release of Magisk should just work on 2015 and 2017 shields and on 2019 shields with the steps you provided. You'll need to uninstall the Magisk Manager app and flash the Magisk uninstaller package first though before installing the next release if you installed the zip I provided as there's a problem with going from unofficial to official releases.
 

elliwigy

Forum Moderator / Recognized Dev / Dev Relations
Staff member
XDA App Taskforce
@elliwigy, I notified the Magisk developers about the specific issue and it has been addressed so the next release of Magisk should just work on 2015 and 2017 shields and on 2019 shields with the steps you provided. You'll need to uninstall the Magisk Manager app and flash the Magisk uninstaller package first though before installing the next release if you installed the zip I provided as there's a problem with going from unofficial to official releases.
nice! I just got it set up nicely. ill update to official magisk tho next update so i can continue to get the updates lol..

for now im just using a props module that sets bootstate to orange so it boots.. i also set foxy boot so i can actually see the boot log.. this way i can see y its not booting lol..

also, if anyone cares.. i also used the props tool in magisk and set the fingerprint to shield tv 2017 pie and was able to install and set up/use disney+.. i then set the fingerprint back to default and disney+ still works! so this is a workaround until nvidia fixes it on later builds..

also for you nstv 2017 owners not sure but maybe changing the fingerprint will pull the 2019 update lol.. dunno if itll flash or what but when i changed my 2019 to 2017 fingerprint it prompted to update to pie 2017 firmware.. dont think itd b much different tho than trying to flash the firmware in fastboot.. i no longer have a 2017 model..

Sent from my SamPWND N976V or G975U
 

powercommy

Senior Member
Jul 10, 2007
77
45
Samsung Galaxy Note 10+
nice! I just got it set up nicely. ill update to official magisk tho next update so i can continue to get the updates lol..

for now im just using a props module that sets bootstate to orange so it boots.. i also set foxy boot so i can actually see the boot log.. this way i can see y its not booting lol..

also, if anyone cares.. i also used the props tool in magisk and set the fingerprint to shield tv 2017 pie and was able to install and set up/use disney+.. i then set the fingerprint back to default and disney+ still works! so this is a workaround until nvidia fixes it on later builds..

also for you nstv 2017 owners not sure but maybe changing the fingerprint will pull the 2019 update lol.. dunno if itll flash or what but when i changed my 2019 to 2017 fingerprint it prompted to update to pie 2017 firmware.. dont think itd b much different tho than trying to flash the firmware in fastboot.. i no longer have a 2017 model..
Wow, you found out a lot of things in the last day or so.

Yesterday I went back to the stock images since I was having problems with Netflix. As soon its starts playing a video, Netflix started to use a lot of CPU and crashed.

Playing movies trough kodi was not a problem, also other services were working fine its was just having problems with Netflix to go back to stock. Did you didn't experience any problems with Netflix?

I will try again when I have some more time on my hands.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    Team Win Recovery Project 3.x, or twrp3 for short, is a custom recovery built with ease of use and customization in mind. Its a fully touch driven user interface no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.



    DOWNLOAD:
    Most devices can be updated quickly and easily within TWRP if you already have version 2.8.4.0 or higher installed
    1) Download the latest version from our website on your device
    2) Reboot to TWRP
    3) Hit Install and tap the "Images..." button in the lower right
    4) Browse to the location of the TWRP image on your device and select it
    5) Select recovery from the partition list and swipe to flash
    OR:
    You can find more information and download links on our website.
    SHIELD Android TV 2015/2017 direct link
    SHIELD Android TV 2019 direct link

    BUGS:
    If you have found a bug, please consider posting it to our github issues log. It's pretty much impossible for us to keep up with the more than 40 threads that we have for the devices that we "directly" support. If you have a significant problem that cannot be answered in this thread, contact us via our website, or find us in our IRC channel below. If you see someone that's struggling, feel free to point it out to us. We need your help to help us keep track of all of our devices! Thanks!

    SUPPORT:
    Live support is available via #twrp on Freenode with your IRC client or just click this link.
    7
    So we *finally* got kernel source (but not vendor prebuilts, go figure... ><). Spent a while tonight getting stuff together and have an experimental build working on the newer bootloader. Do note that I've only tested this on foster_e_hdd, but it should work on all variants that actually got the newer bootloader. Namely foster_e, foster_e_hdd, and darcy. I haven't even got the new bootloader to boot on the Jetson TX1, unfortunately. As normal, since this is an experimental build, use at your own risk, report problems, blah blah.

    twrp-20190201-foster-experimental.img
    5
    I'll try to make it more clear lol...

    1) Reboot to bootloader to start fresh...
    a) fastboot flash staging blob
    b) fastboot flash boot boot.img
    c) fastboot flash recovery recovery.img
    d) fastboot flash system system.img
    e) fastboot flash vendor vendor.img
    f) fastboot flash dtb mdarcy.dtb.img
    g) fastboot flash vbmeta vbmeta_skip.img
    h) fastboot -w
    i) fastboot reboot bootloader

    2) Now we will boot to twrp and install magisk...
    a) fastboot boot twrp.img
    b) select mount and mount everything it lets you (usually data, system_root, vendor, cache)
    c) adb remount all
    d) adb shell
    e) rm /system (removes symlinked folder)
    f) mkdir /system
    f) mount -o bind /system_root/system /system
    g) exit
    h) adb push magisk-debug.zip /data/media
    i) In twrp press install and navigate to magisk zip and flash it
    j) adb reboot bootloader
    k) fastboot -w
    l) fastboot reboot bootloader
    m) fastboot flash dtb mdarcy.dtb.img
    n) fastboot flash vbmeta vbmeta_skip.img
    o) fastboot reboot

    3) Device might reboot a few times but eventually loads.. when it does follow these steps
    a) Enable usb debugging
    b) make sure its authorized and connected
    c) adb install -g magisk.apk
    d) adb shell
    e) su (grant root to shell when it pops up)
    f) mount -o rw,remount /
    g) Open magisk.apk on the device
    h) When it pops up telling you it needs to install stuff select ok and install it.. device will reboot in 5 seconds...

    4) When device tries to boot you should now be stuck at the android boot ani (NOT the nvidia logo).. then follow these steps..
    a) adb shell
    b) su
    c) resetprop ro.boot.verifiedbootstate orange
    d) after device boots run: resetprop ro.boot.verifiedbootstate green

    After all this, you should be good to go finally lol.. it seems like a lot but its not really.. then eventually we will get proper stuff goin..

    let me kno if these steps dont work.. b sure to follow to the T.. once to this point u only need to set bootstate to orange for it to boot all the way then u can set back to green.. i tried havin a script set to orange n works but so far havent found a way to set orange then after loads back to green automatically yet.. im sure theres a simple script with a pause or somethin that can be used tho
    5
    Can you please detail your workaround method to use magisk?

    Thanks

    1) download the developer/stock OS from nvidia
    2) unpack .zip and find boot.img
    3) use the NSTV or another android device and install the magisk manager app
    4) in the app: click install
    5) in the app: choose patch boot.img
    6) in the app: remember the outpot path from the terminal log to the patched_boot.img
    7) boot to recovery (TWRP) and install/flash the patched_boot.img to boot partition
    5
    I also have a working configuration, run into a loop again but so tried some extra steps 2q trough 2w. Also I had registered for the hotfix and installed that, after that I had to do some extra steps to get root back again. After that I was fully able to use root with all it's magic. And disabling Dolby processing solved the glitchy Netflix, which doesn't matter since you don't lose Dolby sound anyway.

    Thank you @elliwigy for all your guiding in this process and @rootfan for the magisk version, now I have root and the wife still has Netflix, look like a win-win to me.

    Below are the steps I used based on your guide for the Shield 2019 PRO

    1) Reboot to bootloader to start fresh...(you will need a keyboard)
    a) fastboot oem unlock and confirm by pressing A
    b) fastboot flash staging blob
    c) fastboot flash boot boot.img
    d) fastboot flash recovery recovery.img
    e) fastboot flash system system.img
    f) fastboot flash vendor vendor.img
    g) fastboot flash dtb mdarcy.dtb.img
    h) fastboot flash vbmeta vbmeta_skip.img
    i) fastboot -w
    j) fastboot reboot bootloader

    2) Now we will boot to twrp and install magisk...
    a) fastboot boot twrp.img (you will need a mouse for this)
    b) select mount and mount everything it lets you (usually data, system_root, vendor, cache)
    c) adb remount all
    d) adb shell
    e) rm /system (removes symlinked folder)
    f) mkdir /system
    g) mount -o bind /system_root/system /system
    h) exit
    i) adb push magisk-debug.zip /data/media
    j) In twrp press install and navigate to magisk zip and flash it
    k) adb reboot bootloader
    l) fastboot -w
    m) fastboot reboot bootloader
    n) fastboot flash dtb mdarcy.dtb.img
    o) fastboot flash vbmeta vbmeta_skip.img
    p) fastboot reboot

    ------------------------------------------
    q) let it reboot a couple of times, after Nvidia blinks and then reboots).
    r) start shield with A+B pressed to get in fastboot
    s) in fastboot menu select reset factory default.
    t) fastboot flash dtb mdarcy.dtb.img
    u) fastboot flash vbmeta vbmeta_skip.img
    v) fastboot reboot
    w) let it reboot a couple of time
    --------------------------------------------

    3) Device eventually loads.. when it does follow these steps
    a) Enable usb debugging
    b) make sure its authorized and connected
    c) adb install -g magisk.apk
    d) adb shell
    e) su (grant root to shell when it pops up)
    f) mount -o rw,remount /
    g) Go to apps (trough settings), show all apps, start/open magisk manager
    h) When it pops up telling you it needs to install stuff select ok and install it.. device will reboot in 5 seconds...

    4) When device tries to boot you should now be stuck at the android boot ani (NOT the nvidia logo).. then follow these steps..
    a) adb shell
    b) su
    c) resetprop ro.boot.verifiedbootstate orange
    d) after device boots run: resetprop ro.boot.verifiedbootstate green

    5) If you have registerd for the hotfix (32.7.301.43) then you can start the upgrade now. The device will reboot and starts the upgrade, after that you lost root again.
    a) adb reboot bootloader
    b) fastboot boot twrp.img (you will need a mouse for this)
    c) select mount and mount everything it lets you (usually data, system_root, vendor, cache)
    d) adb remount all
    e) adb shell
    f) rm /system (removes symlinked folder)
    g) mkdir /system
    h) mount -o bind /system_root/system /system
    i) exit
    j) adb push magisk-debug.zip /data/media
    k) In twrp press install and navigate to magisk zip and flash it
    l) adb reboot bootloader
    m) fastboot flash dtb mdarcy.dtb.img
    n) fastboot flash vbmeta vbmeta_skip.img
    o) fastboot reboot
    p) When device tries to boot you should now be stuck at the android boot ani (NOT the nvidia logo).. then follow these steps..
    q) adb shell
    r) su
    s) resetprop ro.boot.verifiedbootstate orange
    t) after device boots run: resetprop ro.boot.verifiedbootstate green

    For others, we used to images mentioned in this post.
    https://forum.xda-developers.com/shield-tv-pro/help/nvidia-shield-2019-pro-developer-images-t4012147

    All file from nv-recovery-image-shield-atv-pro-2019-8.1.0.zip expect vbmeta_skip.img that is from nv-recovery-image-shield-atv-pro-2019-8.1.0-dev-rooted.zip

    Experimental TWRP is from https://forum.xda-developers.com/showpost.php?p=80769929&postcount=312

    Magisk is from https://forum.xda-developers.com/showpost.php?p=81067077&postcount=352

    All the credits are for @elliwigy and @rootfan