Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

Merge PR #1313: Settings menu: offer the vendor settings app as "Native settings"

Gathin23071f751d3380
diff --cc docs/devices/xiaomi-mitv-mteq0/xiaomi-mitv-mteq0.md
index 000000000,4f0d391e5..6d73b4aeb
mode 000000,100644..100644
--- a/docs/devices/xiaomi-mitv-mteq0/xiaomi-mitv-mteq0.md
+++ b/docs/devices/xiaomi-mitv-mteq0/xiaomi-mitv-mteq0.md
@@@ -1,0 -1,45 +1,45 @@@
+ # Xiaomi MiTV-MTEQ0: package-name Home allowlist and the vendor settings app
+
+ Tested on MiTV-MTEQ0 (`baymax`, Android 10 / API 29), HyperOS build `22.6.27.2363`.
+ Stock Home is `com.mitv.tvhome/.MainActivityUserMode`. This is a launcher-only record;
+ no debloat list was applied.
+
+ ## The Home allowlist
+
+ `MitvConfigParser` prints the cloud-controlled `mitv_security_center.xml` whitelist to logcat
+ at boot (`adb shell logcat -d -s MitvConfigParser | grep "\[White\]"`; reboot first if the
+ ring buffer has already wrapped). Only package names on that list may become Home. On this
+ firmware `com.ts.launcher=511` is on it, `com.gathin.tvhome` is not, and
+ `com.dangbei.tvlauncher=1280` is on the `[Black]` list - which is why a stock launcher APK
+ installs fine but `set-home-activity` reports Success while HOME still resolves to Xiaomi.
+
-Build with the opt-in identity, exactly as on [xiaomi-mitv-aetp0-dofus](xiaomi-mitv-aetp0-dofus.md):
++Build with the opt-in identity, exactly as on [xiaomi-mitv-aetp0-dofus](../xiaomi-mitv-aetp0-dofus.md):
+
+ ```bash
+ (cd launcher && ./gradlew assembleRelease -PlauncherApplicationId=com.ts.launcher)
+ ```
+
+ The Home component is then `com.ts.launcher/com.gathin.tvhome.MainActivity`; the Java
+ namespace stays `com.gathin.tvhome`. Check `pm path com.ts.launcher` first: if another
+ application owns that name, stop rather than overwrite it.
+
+ ## The settings button and the vendor settings app
+
+ This firmware ships the AOSP TV settings (`com.android.tv.settings`) next to Xiaomi's own
+ (`com.xiaomi.mitv.settings`). The standard `android.settings.SETTINGS` action resolves to the
+ AOSP one, which has no Account & Security page - where the ADB switch lives - while the
+ launcher's Settings button would open it. Xiaomi's own entry,
+ `com.xiaomi.mitv.settings/.entry.MainActivity`, opens the native settings main page.
+
+ With the "Native settings" row in the Settings long-press menu (see the pull request that
+ added it), the vendor app is one press away regardless of what the standard action resolves
+ to. Its Account & Security page is also reachable directly:
+ `com.xiaomi.mitv.settings/.entry.SecurityActivity`.
+
+ ## Notes from this set
+
+ - ADB stays enabled across standby; the port needs about 8 seconds to come back after a wake.
+ - The voice remote's "open settings" opens Xiaomi's own settings app, not the AOSP one.
+
+ ![Settings long-press menu with the Native settings row](native-settings-menu.png)
+ ![Xiaomi's native settings main page](native-settings.png)
diff --cc launcher/app/src/main/java/com/gathin/tvhome/SystemSettings.java
index 03aca91ee,6e9a8ecaa..20eb8e01f
--- a/launcher/app/src/main/java/com/gathin/tvhome/SystemSettings.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/SystemSettings.java
@@@ -32,12 -39,6 +41,12 @@@ final class SystemSettings
}
return new Intent().setComponent(component);
}
- return standard;
+ return null;
}
+
+ /** The TV's App info page for pkg, or null where the firmware has none (CVTE's settings app, #1202). */
+ static Intent appInfo(Context context, String pkg) {
+ Intent info = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + pkg));
+ return context.getPackageManager().resolveActivity(info, PackageManager.MATCH_DEFAULT_ONLY) != null ? info : null;
+ }
}