rename: a2i -> GotMsg (user-facing name only, package unchanged)
- App display name: "GotMsg 有消息" - HomeScreen brand: "GotMsg" - Test push titles: "GotMsg 测试" - Update notifications: "GotMsg 新版本" - UpdateChecker User-Agent: "gotmsg-android" - README title: "# GotMsg ·有消息" - Package name com.a2i.forwarder kept for compatibility - version 1.8.11 -> 1.9.0 (code 28 -> 29) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -108,7 +108,7 @@ class UpdateChecker(private val context: Context) {
|
|||||||
val req = Request.Builder()
|
val req = Request.Builder()
|
||||||
.url(api)
|
.url(api)
|
||||||
.header("Accept", "application/json")
|
.header("Accept", "application/json")
|
||||||
.header("User-Agent", "a2i-android")
|
.header("User-Agent", "gotmsg-android")
|
||||||
.get()
|
.get()
|
||||||
.build()
|
.build()
|
||||||
return http.newCall(req).execute().use { res ->
|
return http.newCall(req).execute().use { res ->
|
||||||
@@ -123,7 +123,7 @@ class UpdateChecker(private val context: Context) {
|
|||||||
/** 发现新版后,自动通过所有已开启的推送通道通知用户 */
|
/** 发现新版后,自动通过所有已开启的推送通道通知用户 */
|
||||||
private fun notifyNewVersion(prev: UpdateInfo?, info: UpdateInfo) {
|
private fun notifyNewVersion(prev: UpdateInfo?, info: UpdateInfo) {
|
||||||
val s = app.settings
|
val s = app.settings
|
||||||
val title = "🆕 a2i 新版本 v${info.latestVersion}"
|
val title = "🆕 GotMsg 新版本 v${info.latestVersion}"
|
||||||
val body = "发现 v${info.latestVersion}(当前 v${currentVersionName()})\n${formatSize(info.apkSize)} · 点击更新\n\n${info.releaseNotes.take(300)}"
|
val body = "发现 v${info.latestVersion}(当前 v${currentVersionName()})\n${formatSize(info.apkSize)} · 点击更新\n\n${info.releaseNotes.take(300)}"
|
||||||
val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ class UpdateChecker(private val context: Context) {
|
|||||||
val body = res.body ?: run { lastError.value = "空响应"; return@use null }
|
val body = res.body ?: run { lastError.value = "空响应"; return@use null }
|
||||||
val total = body.contentLength()
|
val total = body.contentLength()
|
||||||
val dir = context.getExternalFilesDir(null) ?: context.cacheDir
|
val dir = context.getExternalFilesDir(null) ?: context.cacheDir
|
||||||
val target = File(dir, "a2i-${info.latestVersion}.apk")
|
val target = File(dir, "gotmsg-${info.latestVersion}.apk")
|
||||||
target.outputStream().use { sink ->
|
target.outputStream().use { sink ->
|
||||||
val input = body.byteStream()
|
val input = body.byteStream()
|
||||||
val buf = ByteArray(8 * 1024)
|
val buf = ByteArray(8 * 1024)
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ private fun HomeHero(
|
|||||||
}
|
}
|
||||||
Spacer(Modifier.width(12.dp))
|
Spacer(Modifier.width(12.dp))
|
||||||
Column(Modifier.weight(1f)) {
|
Column(Modifier.weight(1f)) {
|
||||||
Text("a2i", style = MaterialTheme.typography.displaySmall, color = Color.White)
|
Text("GotMsg", style = MaterialTheme.typography.displaySmall, color = Color.White)
|
||||||
Text("安卓通知多通道转发", style = MaterialTheme.typography.bodyMedium, color = Color.White.copy(alpha = 0.82f))
|
Text("安卓通知多通道转发", style = MaterialTheme.typography.bodyMedium, color = Color.White.copy(alpha = 0.82f))
|
||||||
}
|
}
|
||||||
StatusBadge(
|
StatusBadge(
|
||||||
|
|||||||
@@ -628,7 +628,7 @@ private fun BarkHelpDialog(onDismiss: () -> Unit) {
|
|||||||
HelpStep("2", "打开 Bark,复制首页显示的推送地址,通常类似 $BARK_OFFICIAL_SERVER/你的Key。")
|
HelpStep("2", "打开 Bark,复制首页显示的推送地址,通常类似 $BARK_OFFICIAL_SERVER/你的Key。")
|
||||||
HelpStep("3", "回到 a2i,点击本区域底部的「添加」。服务器地址填 $BARK_OFFICIAL_SERVER,自建服务则填你的自建地址。")
|
HelpStep("3", "回到 a2i,点击本区域底部的「添加」。服务器地址填 $BARK_OFFICIAL_SERVER,自建服务则填你的自建地址。")
|
||||||
HelpStep("4", "Device Key 填推送地址最后一段 Key,不要把完整 URL 都填进去。")
|
HelpStep("4", "Device Key 填推送地址最后一段 Key,不要把完整 URL 都填进去。")
|
||||||
HelpStep("5", "保存后点服务器行里的发送按钮测试;iPhone 收到「a2i 测试」就说明 Bark 通道已通。")
|
HelpStep("5", "保存后点服务器行里的发送按钮测试;iPhone 收到「GotMsg 测试」就说明 Bark 通道已通。")
|
||||||
HelpStep("6", "最后回首页开启「通知转发」,并按提示授予系统通知监听权限。")
|
HelpStep("6", "最后回首页开启「通知转发」,并按提示授予系统通知监听权限。")
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
@@ -678,7 +678,7 @@ private fun NtfyHelpDialog(onDismiss: () -> Unit) {
|
|||||||
HelpStep("2", "打开 ntfy,添加订阅。服务器通常填 $NTFY_OFFICIAL_SERVER;Topic 建议用一串不容易猜到的随机名字,例如 a2i_xxxxxxxx。")
|
HelpStep("2", "打开 ntfy,添加订阅。服务器通常填 $NTFY_OFFICIAL_SERVER;Topic 建议用一串不容易猜到的随机名字,例如 a2i_xxxxxxxx。")
|
||||||
HelpStep("3", "回到 a2i,点击本区域底部的「添加」。服务器和 Topic 要与接收端订阅完全一致。")
|
HelpStep("3", "回到 a2i,点击本区域底部的「添加」。服务器和 Topic 要与接收端订阅完全一致。")
|
||||||
HelpStep("4", "Token 是可选项。只有你在 ntfy 账号或自建服务里把 topic 设成需要鉴权时,才填写 access token。")
|
HelpStep("4", "Token 是可选项。只有你在 ntfy 账号或自建服务里把 topic 设成需要鉴权时,才填写 access token。")
|
||||||
HelpStep("5", "保存后点 topic 行里的发送按钮测试;接收端收到「a2i 测试」就说明 ntfy 通道已通。")
|
HelpStep("5", "保存后点 topic 行里的发送按钮测试;接收端收到「GotMsg 测试」就说明 ntfy 通道已通。")
|
||||||
HelpStep("6", "后续只要这一行左侧保持勾选,它就会参与转发;取消勾选就是停用这个 topic。")
|
HelpStep("6", "后续只要这一行左侧保持勾选,它就会参与转发;取消勾选就是停用这个 topic。")
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
@@ -730,7 +730,7 @@ private fun MeowHelpDialog(onDismiss: () -> Unit) {
|
|||||||
HelpStep("3", "回到 a2i,点击本区域底部的「添加」。名称按你的鸿蒙设备填写,方便以后区分。")
|
HelpStep("3", "回到 a2i,点击本区域底部的「添加」。名称按你的鸿蒙设备填写,方便以后区分。")
|
||||||
HelpStep("4", "服务器地址可以填 Meow 给出的完整 API 地址;如果 Meow 只给了服务根地址,a2i 也会尝试常见的 /push 路径。")
|
HelpStep("4", "服务器地址可以填 Meow 给出的完整 API 地址;如果 Meow 只给了服务根地址,a2i 也会尝试常见的 /push 路径。")
|
||||||
HelpStep("5", "Device Key 填 Meow 给你的设备 Key 或 Token,不要填写鸿蒙手机锁屏密码、华为账号密码等敏感账号密码。")
|
HelpStep("5", "Device Key 填 Meow 给你的设备 Key 或 Token,不要填写鸿蒙手机锁屏密码、华为账号密码等敏感账号密码。")
|
||||||
HelpStep("6", "保存后点设备行里的发送按钮测试;鸿蒙手机收到「a2i 测试」就说明 Meow 通道已通。")
|
HelpStep("6", "保存后点设备行里的发送按钮测试;鸿蒙手机收到「GotMsg 测试」就说明 Meow 通道已通。")
|
||||||
HelpStep("7", "后续只要这一行左侧保持勾选,它就会参与转发;取消勾选就是停用这个鸿蒙设备。")
|
HelpStep("7", "后续只要这一行左侧保持勾选,它就会参与转发;取消勾选就是停用这个鸿蒙设备。")
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
@@ -975,7 +975,7 @@ private fun EmailServerRow(
|
|||||||
|
|
||||||
private suspend fun testEmail(server: EmailServer): String {
|
private suspend fun testEmail(server: EmailServer): String {
|
||||||
if (server.host.isBlank() || server.to.isBlank()) return "SMTP 主机或收件人未填"
|
if (server.host.isBlank() || server.to.isBlank()) return "SMTP 主机或收件人未填"
|
||||||
val r = EmailSender.send(server.host, server.port, server.user, server.password, server.from, server.to, "a2i 测试", "电邮配置测试")
|
val r = EmailSender.send(server.host, server.port, server.user, server.password, server.from, server.to, "GotMsg 测试", "电邮配置测试")
|
||||||
return if (r.isSuccess) "已发送,请查看邮箱" else "发送失败:${r.exceptionOrNull()?.message}"
|
return if (r.isSuccess) "已发送,请查看邮箱" else "发送失败:${r.exceptionOrNull()?.message}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1076,20 +1076,20 @@ private fun ConfigDialogSkeleton(title: String, onDismiss: () -> Unit, onConfirm
|
|||||||
|
|
||||||
private suspend fun testPush(app: A2iApp, server: BarkServer): String {
|
private suspend fun testPush(app: A2iApp, server: BarkServer): String {
|
||||||
if (server.deviceKey.isBlank()) return "未填写 device key"
|
if (server.deviceKey.isBlank()) return "未填写 device key"
|
||||||
val msg = BarkMessage(deviceKey = server.deviceKey, title = "a2i 测试", body = "如果你在 iOS 看到这条推送,说明配置成功", level = "active")
|
val msg = BarkMessage(deviceKey = server.deviceKey, title = "GotMsg 测试", body = "如果你在 iOS 看到这条推送,说明配置成功", level = "active")
|
||||||
val r = BarkClient(server).push(msg)
|
val r = BarkClient(server).push(msg)
|
||||||
return if (r.isSuccess) "已发送,请查看 iOS 端" else "发送失败:${r.exceptionOrNull()?.message}"
|
return if (r.isSuccess) "已发送,请查看 iOS 端" else "发送失败:${r.exceptionOrNull()?.message}"
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun testNtfy(server: NtfyServer): String {
|
private suspend fun testNtfy(server: NtfyServer): String {
|
||||||
if (server.topic.isBlank()) return "未填写 topic"
|
if (server.topic.isBlank()) return "未填写 topic"
|
||||||
val r = NtfySender.send(server.server, server.topic, server.token, "a2i 测试", "如果你在 ntfy 看到这条推送,说明配置成功")
|
val r = NtfySender.send(server.server, server.topic, server.token, "GotMsg 测试", "如果你在 ntfy 看到这条推送,说明配置成功")
|
||||||
return if (r.isSuccess) "已发送,请查看 ntfy 接收端" else "发送失败:${r.exceptionOrNull()?.message}"
|
return if (r.isSuccess) "已发送,请查看 ntfy 接收端" else "发送失败:${r.exceptionOrNull()?.message}"
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun testMeow(server: MeowServer): String {
|
private suspend fun testMeow(server: MeowServer): String {
|
||||||
if (server.server.isBlank()) return "未填写服务器地址"
|
if (server.server.isBlank()) return "未填写服务器地址"
|
||||||
if (server.deviceKey.isBlank()) return "未填写 Device Key"
|
if (server.deviceKey.isBlank()) return "未填写 Device Key"
|
||||||
val r = MeowSender.send(server.server, server.deviceKey, "a2i 测试", "如果你在鸿蒙 Meow 看到这条推送,说明配置成功")
|
val r = MeowSender.send(server.server, server.deviceKey, "GotMsg 测试", "如果你在鸿蒙 Meow 看到这条推送,说明配置成功")
|
||||||
return if (r.isSuccess) "已发送,请查看鸿蒙 Meow" else "发送失败:${r.exceptionOrNull()?.message}"
|
return if (r.isSuccess) "已发送,请查看鸿蒙 Meow" else "发送失败:${r.exceptionOrNull()?.message}"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">a2i</string>
|
<string name="app_name">GotMsg 有消息</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user