v9.6.0: 暂时全面免费 — 关闭授权限制与全部授权提示(authGateEnabled=false),保留安装统计/在线统计/公告推送,去掉左上角安装上报文本

This commit is contained in:
Hermes Agent committed 2026-10-17 18:09:47 +08:00
1 parent 42b38f5b81
commit 65dd927d07
2 files changed
+21 -12

No files matched your search

+2 -2
View File
@@ -19,8 +19,8 @@ android {
applicationId = "com.iptv807.tv" applicationId = "com.iptv807.tv"
minSdk = 21 minSdk = 21
targetSdk = 35 targetSdk = 35
versionCode = 950 versionCode = 960
versionName = "9.5.0" versionName = "9.6.0"
} }
signingConfigs { signingConfigs {
@@ -123,6 +123,13 @@ class MainActivity : Activity() {
private var updateOverlay: View? = null private var updateOverlay: View? = null
private var pendingUpdate: AuthApi.UpdateInfo? = null private var pendingUpdate: AuthApi.UpdateInfo? = null
private var downloadId = -1L private var downloadId = -1L
/**
* ★ 2026-10-15 起:暂时全面免费 —— 关闭授权限制与全部授权提示。
* 保留不变:安装统计(check-update)、在线统计(heartbeat 心跳)、公告推送(announcements)。
* 将来恢复授权:把这里改回 true 即可(限制与提示逻辑均原样保留在下方各分支里)。
*/
private val authGateEnabled = false
private val heartbeatTask = object : Runnable { private val heartbeatTask = object : Runnable {
override fun run() { override fun run() {
Thread { Thread {
@@ -380,7 +387,12 @@ class MainActivity : Activity() {
runOnUiThread { runOnUiThread {
isVip = r.ok isVip = r.ok
prefs.edit().putBoolean("is_vip", r.ok).apply() prefs.edit().putBoolean("is_vip", r.ok).apply()
if (r.ok) { if (!authGateEnabled) {
// 暂时全面免费:隐藏所有授权相关 UI,不进入任何限制模式
trialText.visibility = View.GONE
showAuthButton(false)
showAuthState(false)
} else if (r.ok) {
trialText.visibility = View.GONE; trialText.text = "VIP" trialText.visibility = View.GONE; trialText.text = "VIP"
showAuthButton(false) showAuthButton(false)
showAuthState(true) // 右下角显示「✓ 已授权」 showAuthState(true) // 右下角显示「✓ 已授权」
@@ -536,6 +548,8 @@ class MainActivity : Activity() {
} }
private fun onUiTick() { private fun onUiTick() {
// ★ 暂时全面免费:不显示任何倒计时/试用提示,也不触发到期引导页
if (!authGateEnabled) { trialText.visibility = View.GONE; return }
if (isVip) return if (isVip) return
// 每秒累计一次免费用量(试用期内 LicenseClient 内部会跳过,不计用量) // 每秒累计一次免费用量(试用期内 LicenseClient 内部会跳过,不计用量)
if (player?.isPlaying == true) LicenseClient.addFreeUsedMs(this, 1000) if (player?.isPlaying == true) LicenseClient.addFreeUsedMs(this, 1000)
@@ -1118,20 +1132,15 @@ class MainActivity : Activity() {
}.getOrDefault(AuthApi.UpdateInfo(msg = AuthApi.lastError)) }.getOrDefault(AuthApi.UpdateInfo(msg = AuthApi.lastError))
runOnUiThread { runOnUiThread {
if (info.ok) { if (info.ok) {
val sb = StringBuilder("安装上报 ok #${info.installId} · v${AuthApi.clientVersion(this)}") // ★ 不再把「安装上报 ok #xxx」写到左上角(用户要求去掉该提示);
if (info.updateAvailable) sb.append(" · 发现新版 v${info.latestVersion}") // 上报请求本身照常发出 → 安装统计 / 在线统计 / 版本检查均不受影响。
statusText.text = sb.toString() // statusText 交回频道显示逻辑(切换频道时显示「▶ 频道号 频道名」)。
handler.postDelayed({
val c = channels.getOrNull(currentChannel)
if (c != null) statusText.text = "▶ ${c.num} ${c.name}"
}, 8000)
if (info.updateAvailable) { if (info.updateAvailable) {
pendingUpdate = info pendingUpdate = info
showUpdateDialog(info) showUpdateDialog(info)
} }
} else {
statusText.text = "安装上报失败: ${info.msg}"
} }
// 上报失败也不再提示(保持界面干净),失败信息静默丢弃
} }
}.start() }.start()
handler.removeCallbacks(heartbeatTask) handler.removeCallbacks(heartbeatTask)