Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
Update 0.2.0-pre2
Browse files Browse the repository at this point in the history
  • Loading branch information
Fox2Code committed Nov 25, 2021
1 parent 88da4ba commit 5f2f43c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
minSdk 21
targetSdk 30
versionCode 7
versionName "0.2.0-pre1"
versionName "0.2.0-pre2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/com/fox2code/mmm/AppUpdateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public boolean checkUpdate(boolean force) {
JSONArray releases = new JSONArray(new String(Http.doHttpGet(
RELEASES_API_URL, false), StandardCharsets.UTF_8));
String latestRelease = null, latestPreRelease = null;
for (int i = releases.length() - 1; i > 0; i--) {
for (int i = 0; i < releases.length(); i++) {
JSONObject release = releases.getJSONObject(i);
// Skip invalid entries
if (release.getBoolean("draft")) continue;
Expand All @@ -61,8 +61,9 @@ public boolean checkUpdate(boolean force) {
if (version.startsWith("v"))
version = version.substring(1);
if (preRelease) {
latestPreRelease = version;
} else {
if (latestPreRelease == null)
latestPreRelease = version;
} else if (latestRelease == null) {
latestRelease = version;
if (latestPreRelease == null)
preReleaseNewer = false;
Expand Down

0 comments on commit 5f2f43c

Please sign in to comment.