跳到正文
Hacker News· CraftThatBlock·· 8 小时前AI 评分36

如何打造一台无广告的 Android TV

An ad-free Android TV

AI 导读

用 Projectivy Launcher 替换 Google TV 主屏、SmartTube 替换 YouTube,并通过 ADB 禁用原生启动器,可让 Android TV 完全无广告。

正文 · AI 翻译

我喜欢 Android TV。它几乎能运行我关心的所有应用,在 Chromecast 上很便宜,而且很多电视都内置了它。我不喜欢的是广告。

Google TV 是大多数 Android TV 设备的默认界面,它会在主屏幕顶部放一个大横幅,推广 Google 想让你接下来看的内容。仅应用模式本应把主屏幕精简到只剩你的应用,但横幅依然存在。没有设置可以更换启动器,而且 YouTube 还会在上面叠加自己的广告。

The Google TV home screen in Apps only mode, still showing a large promotional banner 之前:处于仅应用模式的 Google TV

在家里设置了几台设备后,我最终找到了一套完全没有广告、界面也更美观的方案。

方案

  • Projectivy Launcher 替换主屏幕。它只显示你的应用,别的什么都不显示,而且非常可定制。
  • SmartTube 替换 YouTube,没有广告,界面更好,还内置了 SponsorBlock。我仍然付费订阅 YouTube Premium 来支持创作者,但我远比官方应用更喜欢 SmartTube。
  • Wholphin 是我首选的 Jellyfin 客户端,因为它的界面和自定义选项。
  • Button Mapper 重新映射遥控器,让 YouTube 按钮打开 SmartTube。

My Projectivy Launcher home screen, with just my apps 之后:Projectivy Launcher

The SmartTube home screen SmartTube,已模糊处理

我在两台搭载 Google TV 的 Chromecast 和一台海信电视上设置过这套方案,它应该适用于大多数 Android TV 设备。

教程

提示:把本文交给 AI 代理(比如 Claude Code),让它引导你完成设置。它可以替你运行 ADB 命令,并根据你的设备进行调整。

先安装应用。Projectivy、Wholphin 和 Button Mapper 在 Play Store 上,SmartTube 可以用 Downloader 侧载。其余的需要 ADB。

连接 ADB

点击 设置 → 系统 → 关于 → Android TV OS 版本 7 次以启用开发者选项。然后,在开发者选项中,启用无线调试并选择使用配对码配对设备:

adb pair <ip>:<pairing-port> <code>
adb mdns services # Find the connect port
adb connect <ip>:<connect-port>

D=<ip>:<connect-port> # Used in the commands below

无线调试只能通过 Wi-Fi 工作。如果你的设备不支持(比如我的海信电视),请改为启用USB 调试并用 adb connect <ip>:5555 连接。

替换启动器

Projectivy 有一个覆盖当前启动器选项,但原厂主屏幕仍会在它之前闪现。相反,请禁用原厂启动器以及恢复它的软件包,然后将 Projectivy 设为桌面应用:

adb -s $D shell pm disable-user --user 0 com.google.android.apps.tv.launcherx
adb -s $D shell pm disable-user --user 0 com.google.android.tungsten.setupwraith
adb -s $D shell cmd package set-home-activity com.spocky.projengmenu/.ui.home.MainActivity

在电视上,原厂启动器可能还负责切换 HDMI 输入,所以之后要检查该功能是否仍然正常。

替换 YouTube

SmartTube 设置好后,移除官方应用:

adb -s $D uninstall com.google.android.youtube.tv

如果它内置于固件中(DELETE_FAILED_INTERNAL_ERROR),请改用 adb -s $D shell pm uninstall --user 0 com.google.android.youtube.tv。

重新映射遥控器

Button Mapper 和 Projectivy 都需要启用它们的无障碍服务。这会替换整个列表,所以请先用 adb -s $D shell settings get secure enabled_accessibility_services 检查当前列表,并保留你使用的其他任何服务:

adb -s $D shell settings put secure enabled_accessibility_services \
  'flar2.homebutton/a.i:com.spocky.projengmenu/com.spocky.projengmenu.services.ProjectivyAccessibilityService'
adb -s $D shell settings put secure accessibility_enabled 1

使用 Projectivy 的完整组件名,如上所示。如果使用短形式(com.spocky.projengmenu/.services...),即使服务正在运行,Projectivy 也会显示已启用:否。

Android 有时会关闭无障碍服务。授予 Button Mapper WRITE_SECURE_SETTINGS 可以让它自行重新开启,而将其排除在电池优化之外可以保持其响应性:

adb -s $D shell pm grant flar2.homebutton android.permission.WRITE_SECURE_SETTINGS
adb -s $D shell dumpsys deviceidle whitelist +flar2.homebutton

然后,在 Button Mapper 中,将 YouTube 按钮映射到 SmartTube。

清理

趁你还连着,加快动画速度并禁用一些你大概不会用的 Google 应用:

for k in window_animation_scale transition_animation_scale animator_duration_scale; do
  adb -s $D shell settings put global $k 0.75
done

for p in com.google.android.videos com.google.android.play.games \
         com.google.android.feedback com.google.android.partnersetup; do
  adb -s $D shell pm disable-user --user 0 $p
done

一切都可以通过 adb shell pm enable <package> 撤销(YouTube 则用 adb shell cmd package install-existing <package>)。完成后请关闭无线调试。

就是这样:没有横幅、没有广告,还有一个能打开你实际使用的应用的遥控器。

来源:Hacker News · cretezy.com