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

Commit 50c1f9c

Browse files
committed
Release 3.0.0-dev2
1 parent 00d9dc0 commit 50c1f9c

File tree

7 files changed

+23
-15
lines changed

7 files changed

+23
-15
lines changed

app/build.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
applicationId "com.fox2code.mmm"
1111
minSdk 21
1212
targetSdk 32
13-
versionCode 22
14-
versionName "3.0.0-dev1"
13+
versionCode 23
14+
versionName "3.0.0-dev2"
1515

1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
}
@@ -37,9 +37,7 @@ android {
3737
}
3838

3939
aboutLibraries {
40-
additionalLicenses {
41-
LGPL_3_0_only
42-
}
40+
additionalLicenses = ["LGPL_3_0_only"]
4341
}
4442

4543
configurations {

app/src/main/java/com/fox2code/mmm/AppUpdateManager.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public static AppUpdateManager getAppUpdateManager() {
2525
private String latestPreRelease;
2626
private long lastChecked;
2727
private boolean preReleaseNewer;
28+
private boolean lastCheckSuccess;
2829

2930
private AppUpdateManager() {
3031
this.latestRelease = MainApplication.getBootSharedPreferences()
@@ -85,7 +86,9 @@ public boolean checkUpdate(boolean force) {
8586
Log.d(TAG, "Latest pre-release: " + latestPreRelease);
8687
Log.d(TAG, "Latest pre-release newer: " + preReleaseNewer);
8788
this.lastChecked = System.currentTimeMillis();
89+
this.lastCheckSuccess = true;
8890
} catch (Exception ioe) {
91+
this.lastCheckSuccess = false;
8992
Log.e("AppUpdateManager", "Failed to check releases", ioe);
9093
}
9194
}
@@ -102,4 +105,8 @@ public boolean peekHasUpdate() {
102105
return !BuildConfig.VERSION_NAME.equals(this.preReleaseNewer ?
103106
this.latestPreRelease : this.latestRelease);
104107
}
108+
109+
public boolean isLastCheckSuccess() {
110+
return lastCheckSuccess;
111+
}
105112
}

app/src/main/java/com/fox2code/mmm/MainActivity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public void commonNext() {
124124
(int) (value * PRECISION), true) :() ->
125125
progressIndicator.setProgressCompat(
126126
(int) (value * PRECISION * 0.75F), true)));
127-
if (!RepoManager.getINSTANCE().hasConnectivity()) {
127+
if (!NotificationType.NO_INTERNET.shouldRemove()) {
128128
moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET);
129129
} else {
130130
if (AppUpdateManager.getAppUpdateManager().checkUpdate(true))
@@ -210,7 +210,7 @@ public void commonNext() {
210210
Log.i(TAG, "Common Before");
211211
if (MainApplication.isShowcaseMode())
212212
moduleViewListBuilder.addNotification(NotificationType.SHOWCASE_MODE);
213-
if (!RepoManager.getINSTANCE().hasConnectivity())
213+
if (!NotificationType.NO_INTERNET.shouldRemove())
214214
moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET);
215215
else if (AppUpdateManager.getAppUpdateManager().checkUpdate(false))
216216
moduleViewListBuilder.addNotification(NotificationType.UPDATE_AVAILABLE);
@@ -241,15 +241,15 @@ public void onRefresh() {
241241
RepoManager.getINSTANCE().update(value -> runOnUiThread(() ->
242242
this.progressIndicator.setProgressCompat(
243243
(int) (value * PRECISION), true)));
244-
if (!RepoManager.getINSTANCE().hasConnectivity())
244+
if (!NotificationType.NO_INTERNET.shouldRemove())
245245
moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET);
246246
else if (AppUpdateManager.getAppUpdateManager().checkUpdate(true))
247247
moduleViewListBuilder.addNotification(NotificationType.UPDATE_AVAILABLE);
248248
runOnUiThread(() -> {
249249
this.progressIndicator.setVisibility(View.GONE);
250250
this.swipeRefreshLayout.setRefreshing(false);
251251
});
252-
if (!RepoManager.getINSTANCE().hasConnectivity()) {
252+
if (!NotificationType.NO_INTERNET.shouldRemove()) {
253253
this.moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET);
254254
}
255255
this.moduleViewListBuilder.appendRemoteModules();

app/src/main/java/com/fox2code/mmm/NotificationType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ public boolean shouldRemove() {
4848
NO_INTERNET(R.string.fail_internet, R.drawable.ic_baseline_cloud_off_24) {
4949
@Override
5050
public boolean shouldRemove() {
51-
return RepoManager.getINSTANCE().hasConnectivity();
51+
return AppUpdateManager.getAppUpdateManager().isLastCheckSuccess() ||
52+
RepoManager.getINSTANCE().hasConnectivity();
5253
}
5354
},
5455
UPDATE_AVAILABLE(R.string.app_update_available, R.drawable.ic_baseline_system_update_24,

app/src/main/java/com/fox2code/mmm/androidacy/AndroidacyRepoData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected boolean prepare() {
4343
if (this.androidacyBlockade > time) return false;
4444
this.androidacyBlockade = time + 5_000L;
4545
String cookies = CookieManager.getInstance().getCookie("https://.androidacy.com/");
46-
int start = cookies.indexOf("USER=");
46+
int start = cookies == null ? -1 : cookies.indexOf("USER=");
4747
String token = null;
4848
if (start != -1) {
4949
int end = cookies.indexOf(";", start);
@@ -73,7 +73,7 @@ protected boolean prepare() {
7373
token = new String(Http.doHttpPost(
7474
"https://api.androidacy.com/auth/register",
7575
"",true), StandardCharsets.UTF_8);
76-
CookieManager.getInstance().setCookie(".androidacy.com",
76+
CookieManager.getInstance().setCookie("https://.androidacy.com/",
7777
"USER="+ token + "; expires=Fri, 31 Dec 9999 23:59:59 GMT;" +
7878
" path=/; secure; domain=.androidacy.com");
7979
} catch (Exception e) {

app/src/main/java/com/fox2code/mmm/installer/InstallerActivity.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,11 @@ protected void onCreate(Bundle savedInstanceState) {
197197

198198

199199
private void doInstall(File file,boolean noExtensions,boolean rootless) {
200-
this.setOnBackPressedCallback(DISABLE_BACK_BUTTON);
201-
this.setDisplayHomeAsUpEnabled(false);
202200
if (this.canceled) return;
201+
UiThreadHandler.runAndWait(() -> {
202+
this.setOnBackPressedCallback(DISABLE_BACK_BUTTON);
203+
this.setDisplayHomeAsUpEnabled(false);
204+
});
203205
Log.i(TAG, "Installing: " + moduleCache.getName());
204206
InstallerController installerController = new InstallerController(
205207
this.progressIndicator, this.installerTerminal,

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
mavenCentral()
66
gradlePluginPortal()
77
}
8-
project.ext.latestAboutLibsRelease = "10.0.0-b08"
8+
project.ext.latestAboutLibsRelease = "10.0.0-b09"
99
dependencies {
1010
classpath 'com.android.tools.build:gradle:7.1.0'
1111
classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:${latestAboutLibsRelease}"

0 commit comments

Comments
 (0)