fix: 空渠道检测改用JSONObject.has + 移除gitignore误排除manifest
This commit is contained in:
@@ -147,16 +147,16 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
// 2. 解析
|
||||
appendLog("[2/4] 解析 manifest...")
|
||||
if (!manifestJson.contains("\"android\"")) {
|
||||
appendLog(" ℹ️ 该渠道暂无可用更新")
|
||||
appendLog("=== $channel 渠道测试完成 ===")
|
||||
return@withContext
|
||||
}
|
||||
var manifestSha256 = ""
|
||||
var manifestApkUrl = ""
|
||||
var manifestTag = ""
|
||||
try {
|
||||
val json = JSONObject(manifestJson)
|
||||
if (!json.getJSONObject("builds").has("android")) {
|
||||
appendLog(" ℹ️ 该渠道暂无可用更新")
|
||||
appendLog("=== $channel 渠道测试完成 ===")
|
||||
return@withContext
|
||||
}
|
||||
val android = json.getJSONObject("builds").getJSONObject("android")
|
||||
manifestSha256 = android.getString("sha256")
|
||||
manifestApkUrl = android.getString("url")
|
||||
|
||||
Reference in New Issue
Block a user