fix(aprs): passcode compute button, crash log, notif permission, login verify
User feedback round 2 (4.5.4): no notification shown, report not sending, no error visibility on crash. Diagnosis: APRS-IS port 14580 reachable (verified with real login test), 24580 SSL refused; login format OK. Fixes: - Settings dialog: "Compute passcode" button - fills passcode from callsign via the ported 0x73E2 algorithm (user can see the result) - Global crash handler in MainApplication: stack trace appended to files/crash_log.txt so crashes are diagnosable (user: no crash logs were available before) - POST_NOTIFICATIONS runtime permission requested when enabling APRS (Android 13+ otherwise silently hides the service notification) - AprsIsClient: read the login response (aprsc "# logresp ... unverified"/"Invalid") and surface the server message as the error - AprsForegroundService: Toast on manual report result (OK / failure with server reason) - Strings EN/ZH/TR/IN/ID +3 keys Verified: compileDebugKotlin all modules BUILD SUCCESSFUL, check_strings 9 files OK.
This commit is contained in:
1 parent
920af7bde2
commit
012ea1eeb6
9 files changed
+85
-1
No files matched your search
@@ -46,6 +46,17 @@ class AprsIsClient(
|
||||
// 登录行
|
||||
val login = AprsPacket.formatLogin(callsign, ssid, passcode, version) + filter
|
||||
writer?.println(login)
|
||||
// 读登录响应(aprsc 返回 # logresp ... verified/unverified)
|
||||
runCatching {
|
||||
s.soTimeout = 8000
|
||||
val resp = reader?.readLine()
|
||||
if (resp != null && (resp.contains("Invalid", ignoreCase = true) ||
|
||||
resp.contains("unverified", ignoreCase = true))) {
|
||||
throw IllegalArgumentException(resp.trim())
|
||||
}
|
||||
// 恢复超时
|
||||
s.soTimeout = timeoutSec * 1000
|
||||
}
|
||||
}
|
||||
|
||||
/** 发送一个 APRS 包(一行) */
|
||||
|
||||
Reference in new issue
Block a user