现场两个问题分别定位: 一、"歌曲源全部失效" —— 已确认是**源站对该出口 IP 的授权/风控**,非客户端可修 - 实测(本机与设备同一出口 188.253.112.231): · 主源 http://w.w345.my/i.php → **HTTP 403 Forbidden**(nginx 拦截页); · 镜像源(desktok.top / mm.kk456.top / w.w345.my:66 / z.w345.my / b.sktv.top / w345.my) 返回 200,但对**每一首歌(含不存在的编号 1111111/9999999)都返回同一个广告/测试资源** https://wb66.cn/f/d/7b7c9/10188555.ts; · 换全新随机设备身份(mac/sn)结果完全相同 → 限制在**出口 IP** 层面,与设备无关; · 7 host × ls=1~3 × (720/1080 × h265 0/1) 全组合探测:0 个真源; · 旧的试用领取接口 api.php 已 **404**,App 无法自行领取窗口。 - 结论:源站侧无有效授权(i.php 的 ordertype=0、mwsLogin 的 license_box_count=0 / license_duration=0 均指向此)。**需更换公网 IP 或与歌曲源服务方确认续订**。 我们拒绝这些地址是正确行为(否则就是 1.4.10 修过的"广告被当成歌曲播放")。 二、"手动更新数据库后远程日志失效" —— 数据库没问题,日志客户端有隐患,两者都已处理 - 实测新曲库 day=261003(md5 300AFD957BF332F02C17ED94A9F4E4CF,431,530,367 字节, 解压 1.01GB、69.5 万首): 用 App 的**真实 SQL**(SONG_SELECT/推荐/中文搜索/拼音搜索/ 歌手检索/歌单/语种/歌手列表)逐条跑通 → **结构完全兼容,更新曲库不会破坏 App**。 - 日志侧修复(原来确实可能"静默失效"): · MiliLog.init 改为**可重复调用并自动重启发送线程**(旧实现 `if (started.getAndSet(true)) return`, 线程一旦退出就永久不再发送且无任何迹象); · sendLoop 整体加 catch(Throwable) 兜底,任何异常都不允许发送线程退出; · 新增**本地日志文件** <存储根>/logs/ktv.log(>1MB 滚动为 .prev), 远程日志不可用时现场可直接取文件;启动打 APP-INIT 行给出路径; · MiliLog.init 提前到 KtvApplication.onCreate,早于 MainActivity,早期崩溃也有日志。 - 补 403 识别: KtvJsBridge 的 403 判定从仅 /music/do.php 扩展到 /i.php 也认 (主源 i.php 就是 403);SongUrlResolver 记录本轮是否见过 403,全部失败且见过 403 时 同样走 Eac19WindowGuard 提示换 IP。 AdVideoFilter: 仅保留高区分度标记 wb66,去掉过于宽松的 demo(避免误伤真源 URL 里的随机 token)。 版本 1.5.2(34) → 1.5.3(35);签名证书不变。测试 9 例全通过。
Maidong KTV
A local karaoke application for Android TV and landscape song-selection devices
Remote Control · Song Discovery · Request Queue · Download Management · Stable Playback
Core Features
- Full TV remote navigation with directional keys, confirmation, back, and long-press actions.
- Consistent focus feedback for buttons, lists, cards, switches, and dialogs.
- Home entries for charts, song titles, singers, frequently played songs, favorites, categories, and local songs.
- Online and local search with language filters, paging, and initial-letter keyboard input.
- Singer browsing with portrait tags and singer-specific song lists.
- Song ordering, batch ordering, queue prioritization, favorites, and file management.
- Real-time synchronization across queued, played, and downloaded song lists.
- New requests join the end of the queue without interrupting the current requested song.
- Automatic playback when requested songs are available, including smooth transitions from public playback.
Playback
- IJK-based playback for local and downloaded songs.
- Continuous playback while navigating between pages or switching between windowed and full-screen modes.
- Play, pause, skip, replay, progress display, and seeking controls.
- Original-vocal and accompaniment switching without changing the current play or pause state.
- Synchronized playback state across windowed controls, full-screen controls, and status overlays.
- Song title overlays, temporary mode prompts, and persistent pause indicators.
- Video ratio, automatic full screen, audio-video synchronization, and public playback settings.
- Maximum song volume and configurable original-vocal and accompaniment behavior.
Downloads And Data
- Background downloads with progress, resume support, and automatic retry.
- Automatic cleanup and retry after download or decryption failures.
- Recognition, counting, and playback of downloaded local songs.
- Segmented database download, verification, merge, and atomic update.
- Directory creation, database scanning, and download startup only after storage permission is granted.
- Local disk and USB song scanning, reserved storage settings, and automatic cleanup.
- Unified Maidong KTV data storage to avoid conflicts with other applications.
Settings
- Data settings for library updates, local scanning, reserved space, automatic cleanup, and database maintenance.
- Playback settings for public playback, automatic full screen, video ratio, synchronization, and title overlays.
- Sound settings for volume behavior, maximum song volume, original vocals, and accompaniment.
- Interface settings for language, floating controls, carousel content, and song title overlays.
- Dialog selections remain temporary until confirmed and provide clear remote-control focus feedback.
Interface And Interaction
- Landscape TV layout optimized for long-distance viewing.
- Consistent state and meaning across top, windowed, and full-screen playback controls.
- Stable focus during list refreshes, paging, tab changes, and song ordering.
- Focus changes color only and preserves each control's original dimensions, corners, and layout.
- A consistent circular Maidong logo across the home screen, player, and application information.
Project Notice
This repository: https://gitea.kasugano.cn/zijunchiang/maidong-ktv
UI/feature framework credit: https://gitee.com/yangyachao-X/maidong-ktv
This repository reworks the upstream "Maidong KTV" UI and feature framework, and the core/data layer was rewritten with DSH (DeepSeek Harness): library sync, song-source integration, device auth, risk-control handling, remote logging, and ad blocking are all new implementations.
Highlights of the reworked data layer:
- Library: synced exclusively from the official Muse service
(
mconn.cherryonline.cnmls-api/v1/sqlite/sync); the code host carries source only, no database files. - Song source:
w.w345.my(i.phptoken →do.phpplayback URL) with fixed device identity and reproduced signing; ad/mismatched resources (e.g.wb66.cn/.../719.ts) are blocked and retried. - JS hot-update:
app/src/main/assets/mobile/ktv_api.js, requires theKTV_BRIDGE_API: 7marker.
Building
Requirements: JDK 17, Android SDK (compileSdk 35, minSdk 21, targetSdk 25),
Gradle wrapper 8.13 (bundled).
cd maidong-ktv
export JAVA_HOME=/path/to/jdk-17
export ANDROID_HOME=/path/to/android-sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME
./gradlew assembleRelease
The release signing config in app/build.gradle expects ../../ktv_keystore.jks (one level above the
repo root) with alias ktv / password 123456; adjust paths or use signingConfigs.debug for a
quick unsigned build. Output: app/build/outputs/apk/release/app-release.apk
(dual ABI: armeabi-v7a + arm64-v8a). Install with adb install -r <apk>.
For non-commercial learning purposes only. Respect upstream copyright and song licensing.
