DISCLAIMER: You may brick/damage your box, do only if you know what you're doing and at your own risk
Only tested for H96 Max v58 (Rockchip RK3588).
By default the device has hardware features wrong that will make some apps (like Plex) thing it is a mobile phone and enter a layout change loop. Since this is a tv box I needed to change one of the feature xml file and change it so it does not happen.
Android TV devices usually implement a set of features and disable others. These are checked by the apps to understand what layout should they use, and restrict devices that are not the type they want. The ones that I found that may be missing are the following:
<feature name="android.hardware.screen.landscape" />
<feature name="android.hardware.type.television" />
<feature name="android.software.leanback" />
<feature name="android.software.leanback_only" />
<feature name="android.software.live_tv" />
In the case of my H96 Max V58 box the only one missing was:
<feature name="android.software.leanback_only" />
It was commented out and this was making Plex enter a loop asking to change layout between mobile and tv.
I also disabled per google documentation the features that usually aren't active on tv.
We need adb, so check Activating OTG to get adb working.
adb pull /system/etc/permissions/tv_core_hardware.xml ./tv_core_hardware.xml
Open the file in an editor and search android.software.leanback_only and uncomment it (remove the <!--
and --!>
around it).
If it's not there just add it. Should look like this:
<feature name="android.software.leanback_only" />
You can check the example tv_core_hardware.xml.
adb root
adb remount
adb push ./tv_core_hardware.xml /system/etc/permissions/tv_core_hardware.xml
adb reboot
Everything should work as a tv box now.