Skip to content

Commit

Permalink
fix: 修复云规则获取失败导致的崩溃
Browse files Browse the repository at this point in the history
  • Loading branch information
xz-dev committed Sep 2, 2021
1 parent 02cd718 commit 6627acc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "net.xzos.upgradeall"
minSdkVersion 21
targetSdkVersion 30
versionCode 57
versionName "0.1.5.1-rc.4"
versionCode 58
versionName "0.1.5.1-rc.5"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
kapt {
arguments {
Expand Down
11 changes: 8 additions & 3 deletions core/src/main/java/net/xzos/upgradeall/core/network/WebApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ internal object WebApi {

fun getCloudConfig(): String? {
val url = "http://$host/v1/rules/download/master"
return callApiCore {
OkHttpApi.get(url)
}?.body?.string()
return try {
callApiCore {
OkHttpApi.get(url)
}?.body?.string()
}catch (e:Throwable){
Log.w(objectTag, TAG, "getCloudConfig: {$e.stackTraceToString()}")
null
}
}

fun getAppRelease(
Expand Down

0 comments on commit 6627acc

Please sign in to comment.