3 Commits
4 changed files with 34 additions and 74 deletions

No files matched your search

+2 -2
View File
@@ -3,7 +3,7 @@
<h1>港澳台直播 · Android TV</h1>
<p><b>港澳台 55 个频道,装上就能看,遥控器一点就换台</b></p>
<p>
<a href="https://github.com/personal82555/gangao-tv/releases/latest"><img src="https://img.shields.io/badge/下载-APK-1B6EF3?style=for-the-badge" alt="下载"></a>
<a href="https://gitee.com/jinghui111/gangao-tv/releases"><img src="https://img.shields.io/badge/下载-APK-1B6EF3?style=for-the-badge" alt="下载"></a>
<a href="https://t.me/+7YVPMu9EOChkYmM1"><img src="https://img.shields.io/badge/Telegram-加入交流群-26A5E4?style=for-the-badge&logo=telegram&logoColor=white" alt="Telegram"></a>
<img src="https://img.shields.io/badge/Android-5.0%2B-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android 5.0+">
<img src="https://img.shields.io/badge/平台-Android%20TV%20%7C%20电视盒子%20%7C%20手机-555?style=for-the-badge" alt="平台">
@@ -68,7 +68,7 @@
| | 好处 |
|---|---|
| 📢 | **新版本第一时间通知** —— 版本推送发布后群内同步提醒,不用天天来盯 GitHub Releases |
| 📢 | **新版本第一时间通知** —— 版本推送发布后群内同步提醒,不用天天来盯 Releases 页面 |
| 🔧 | **装不上 / 播不出来直接问** —— 带上电视型号和屏幕上的报错文字,通常几分钟就能定位 |
| 📡 | **频道与线路问题互通** —— 哪个台挂了、哪条线更稳,大家互相同步,修得更快 |
| 💡 | **功能建议真的会被采纳** —— 数字键换台、选中高亮、收藏置顶、开机自启,这些都来自群里的反馈 |
+2 -2
View File
@@ -19,8 +19,8 @@ android {
applicationId = "com.iptv807.tv"
minSdk = 21
targetSdk = 35
versionCode = 950
versionName = "9.5.0"
versionCode = 961
versionName = "9.6.1"
}
signingConfigs {
@@ -123,6 +123,13 @@ class MainActivity : Activity() {
private var updateOverlay: View? = null
private var pendingUpdate: AuthApi.UpdateInfo? = null
private var downloadId = -1L
/**
* ★ 2026-10-15 起:暂时全面免费 —— 关闭授权限制与全部授权提示。
* 保留不变:安装统计(check-update)、在线统计(heartbeat 心跳)、公告推送(announcements)。
* 将来恢复授权:把这里改回 true 即可(限制与提示逻辑均原样保留在下方各分支里)。
*/
private val authGateEnabled = false
private val heartbeatTask = object : Runnable {
override fun run() {
Thread {
@@ -380,7 +387,12 @@ class MainActivity : Activity() {
runOnUiThread {
isVip = r.ok
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"
showAuthButton(false)
showAuthState(true) // 右下角显示「✓ 已授权」
@@ -536,6 +548,8 @@ class MainActivity : Activity() {
}
private fun onUiTick() {
// ★ 暂时全面免费:不显示任何倒计时/试用提示,也不触发到期引导页
if (!authGateEnabled) { trialText.visibility = View.GONE; return }
if (isVip) return
// 每秒累计一次免费用量(试用期内 LicenseClient 内部会跳过,不计用量)
if (player?.isPlaying == true) LicenseClient.addFreeUsedMs(this, 1000)
@@ -1118,20 +1132,15 @@ class MainActivity : Activity() {
}.getOrDefault(AuthApi.UpdateInfo(msg = AuthApi.lastError))
runOnUiThread {
if (info.ok) {
val sb = StringBuilder("安装上报 ok #${info.installId} · v${AuthApi.clientVersion(this)}")
if (info.updateAvailable) sb.append(" · 发现新版 v${info.latestVersion}")
statusText.text = sb.toString()
handler.postDelayed({
val c = channels.getOrNull(currentChannel)
if (c != null) statusText.text = "▶ ${c.num} ${c.name}"
}, 8000)
// ★ 不再把「安装上报 ok #xxx」写到左上角(用户要求去掉该提示);
// 上报请求本身照常发出 → 安装统计 / 在线统计 / 版本检查均不受影响。
// statusText 交回频道显示逻辑(切换频道时显示「▶ 频道号 频道名」)。
if (info.updateAvailable) {
pendingUpdate = info
showUpdateDialog(info)
}
} else {
statusText.text = "安装上报失败: ${info.msg}"
}
// 上报失败也不再提示(保持界面干净),失败信息静默丢弃
}
}.start()
handler.removeCallbacks(heartbeatTask)
@@ -87,10 +87,7 @@ class SettingsActivity : Activity() {
} catch (e: Exception) { "1.0" }
val prefs = getSharedPreferences("iptv_license", MODE_PRIVATE)
val isVip = prefs.getBoolean("is_vip", false)
val expire = prefs.getString("vip_expire", "")
val permanent = prefs.getBoolean("is_permanent", false)
val cardKey = prefs.getString("card_key", "")
// v9.6.1:暂时全面免费,本页不再读取/展示任何授权状态(isVip/expire/permanent/cardKey 已移除)
root.addView(TextView(this).apply {
text = "版本信息"
@@ -98,7 +95,8 @@ class SettingsActivity : Activity() {
setPadding(0, 0, 0, 8)
})
root.addView(TextView(this).apply {
text = "App 版本:$versionName\n授权系统:CardAuth(app.88531.cn)\n机器码:${LicenseClient.machineCode(this@SettingsActivity)}"
// v9.6.1:暂时全面免费,不再显示授权系统 / 机器码等收费痕迹,只留版本号
text = "App 版本:$versionName\n本软件完全免费 · 无广告 · 无第三方 SDK"
textSize = 15f; setTextColor(Color.WHITE)
setLineSpacing(0f, 1.15f)
setBackgroundColor(Color.parseColor("#1C2028"))
@@ -134,22 +132,14 @@ class SettingsActivity : Activity() {
root.addView(bootSwitch, LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT).apply { bottomMargin = 40 })
// ===== 会员状态 =====
root.addView(TextView(this).apply {
text = "会员状态"
textSize = 15f; setTextColor(Color.parseColor("#7AA7D9"))
setPadding(0, 0, 0, 8)
})
// ===== 状态提示条(切换线路等操作的结果显示在这里)=====
// v9.6.1:原来的「会员状态」区块已移除(暂时全面免费,不暴露授权/收费信息)
statusText = TextView(this).apply {
textSize = 15f; setLineSpacing(0f, 1.15f)
setTextColor(Color.WHITE)
setBackgroundColor(Color.parseColor("#1C2028"))
setPadding(24, 20, 24, 20)
text = if (isVip) {
"✓ 已是会员\n${if (permanent) "永久有效" else "有效期至:$expire"}${if (cardKey?.isNotEmpty() == true) "\n卡号:$cardKey" else ""}"
} else {
"当前为免费用户(每天 1 小时)\n尚未成为会员"
}
text = ""
}
root.addView(statusText, LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT).apply { bottomMargin = 24 })
@@ -165,7 +155,7 @@ class SettingsActivity : Activity() {
textSize = 15f; setLineSpacing(0f, 1.15f)
setTextColor(Color.WHITE); setBackgroundColor(Color.parseColor("#1C2028"))
setPadding(24, 20, 24, 20)
text = "点击右侧按钮检查是否有新版本\n(安装统计会在启动时自动上报)"
text = "点击右侧按钮检查是否有新版本"
}
root.addView(statusText2, LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT).apply { bottomMargin = 12 })
@@ -174,34 +164,11 @@ class SettingsActivity : Activity() {
root.addView(checkBtn, LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT).apply { bottomMargin = 40 })
// ===== 卡密激活 =====
root.addView(TextView(this).apply {
text = "卡密激活"
textSize = 15f; setTextColor(Color.parseColor("#7AA7D9"))
setPadding(0, 8, 0, 8)
})
val cardInput = EditText(this).apply {
hint = "请输入卡密"
textSize = 16f
setTextColor(Color.WHITE)
setHintTextColor(Color.parseColor("#888888"))
setPadding(24, 20, 24, 20)
isSingleLine = true
isFocusable = true
isFocusableInTouchMode = true
background = focusBg(normal = 0xFF1C2028.toInt())
inputType = android.text.InputType.TYPE_CLASS_TEXT
}
root.addView(cardInput, LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT).apply { bottomMargin = 12 })
// ===== 卡密激活:v9.6.1 起暂时全面免费,此区块整块移除(恢复见 git 历史)=====
val actBtn = mkAction("激活") { doActivate(cardInput.text.toString().trim()) }
root.addView(actBtn, LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT).apply { bottomMargin = 24 })
// ===== ★ 售后联系方式(授权无效 / 卡密用不了时能找到人)=====
// ===== ★ 售后联系方式(安装 / 播放遇到问题时能找到人)=====
root.addView(TextView(this).apply {
text = "⚠ 授权无效、卡密激活不了?\n售后微信:q3970260761"
text = "💬 售后微信:q3970260761\n安装、播放有问题都可以找我"
textSize = 16f
setTextColor(Color.parseColor("#FFC107")) // 橙色醒目
gravity = Gravity.CENTER
@@ -214,23 +181,7 @@ class SettingsActivity : Activity() {
}, LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT).apply { bottomMargin = 40 })
if (isVip) {
root.addView(TextView(this).apply {
text = "✓ 已经是会员"
textSize = 18f; setTextColor(Color.parseColor("#4CAF50"))
gravity = Gravity.CENTER; setPadding(0, 24, 0, 12)
})
// ★ 新增:撤销本机授权(换机 / 换卡密前先解绑)
val revokeBtn = mkAction("撤销本机授权(可重新激活 / 换卡密)") { doRevoke() }
root.addView(revokeBtn, LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT).apply { bottomMargin = 20 })
} else {
val btn = mkAction("支付成为会员(月/季/年)") {
startActivity(Intent(this@SettingsActivity, ShopActivity::class.java))
}
root.addView(btn, LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT).apply { bottomMargin = 20 })
}
// v9.6.1:已移除「撤销本机授权」与「支付成为会员」入口(暂时全面免费,不出现任何收费/授权入口)
// ===== 其它操作 =====
root.addView(TextView(this).apply {