Update UpdateChecker.java

This commit is contained in:
Austin Huang 2020-09-08 15:46:19 -04:00 committed by GitHub
parent 93b80a7147
commit 43f77409ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ public final class UpdateChecker extends AsyncTask<Void, Void, Boolean> {
if (responseCode == HttpURLConnection.HTTP_OK) {
final JSONObject data = new JSONObject(Utils.readFromConnection(conn));
if (BuildConfig.VERSION_CODE < data.getInt("suggestedVersionCode")) {
version = data.getJSONArray("packages").getString("versionName");
version = data.getJSONArray("packages").getJSONObject(0).getString("versionName");
return true;
}
}
@ -55,4 +55,4 @@ public final class UpdateChecker extends AsyncTask<Void, Void, Boolean> {
if (result != null && result && fetchListener != null)
fetchListener.onResult("v"+version);
}
}
}