Release 3.0.0-dev2

pull/55/head 0.3.0-dev2
Fox2Code 2 years ago
parent 00d9dc040d
commit 50c1f9c5b3

@ -10,8 +10,8 @@ android {
applicationId "com.fox2code.mmm"
minSdk 21
targetSdk 32
versionCode 22
versionName "3.0.0-dev1"
versionCode 23
versionName "3.0.0-dev2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
@ -37,9 +37,7 @@ android {
}
aboutLibraries {
additionalLicenses {
LGPL_3_0_only
}
additionalLicenses = ["LGPL_3_0_only"]
}
configurations {

@ -25,6 +25,7 @@ public class AppUpdateManager {
private String latestPreRelease;
private long lastChecked;
private boolean preReleaseNewer;
private boolean lastCheckSuccess;
private AppUpdateManager() {
this.latestRelease = MainApplication.getBootSharedPreferences()
@ -85,7 +86,9 @@ public class AppUpdateManager {
Log.d(TAG, "Latest pre-release: " + latestPreRelease);
Log.d(TAG, "Latest pre-release newer: " + preReleaseNewer);
this.lastChecked = System.currentTimeMillis();
this.lastCheckSuccess = true;
} catch (Exception ioe) {
this.lastCheckSuccess = false;
Log.e("AppUpdateManager", "Failed to check releases", ioe);
}
}
@ -102,4 +105,8 @@ public class AppUpdateManager {
return !BuildConfig.VERSION_NAME.equals(this.preReleaseNewer ?
this.latestPreRelease : this.latestRelease);
}
public boolean isLastCheckSuccess() {
return lastCheckSuccess;
}
}

@ -124,7 +124,7 @@ public class MainActivity extends CompatActivity implements SwipeRefreshLayout.O
(int) (value * PRECISION), true) :() ->
progressIndicator.setProgressCompat(
(int) (value * PRECISION * 0.75F), true)));
if (!RepoManager.getINSTANCE().hasConnectivity()) {
if (!NotificationType.NO_INTERNET.shouldRemove()) {
moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET);
} else {
if (AppUpdateManager.getAppUpdateManager().checkUpdate(true))
@ -210,7 +210,7 @@ public class MainActivity extends CompatActivity implements SwipeRefreshLayout.O
Log.i(TAG, "Common Before");
if (MainApplication.isShowcaseMode())
moduleViewListBuilder.addNotification(NotificationType.SHOWCASE_MODE);
if (!RepoManager.getINSTANCE().hasConnectivity())
if (!NotificationType.NO_INTERNET.shouldRemove())
moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET);
else if (AppUpdateManager.getAppUpdateManager().checkUpdate(false))
moduleViewListBuilder.addNotification(NotificationType.UPDATE_AVAILABLE);
@ -241,7 +241,7 @@ public class MainActivity extends CompatActivity implements SwipeRefreshLayout.O
RepoManager.getINSTANCE().update(value -> runOnUiThread(() ->
this.progressIndicator.setProgressCompat(
(int) (value * PRECISION), true)));
if (!RepoManager.getINSTANCE().hasConnectivity())
if (!NotificationType.NO_INTERNET.shouldRemove())
moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET);
else if (AppUpdateManager.getAppUpdateManager().checkUpdate(true))
moduleViewListBuilder.addNotification(NotificationType.UPDATE_AVAILABLE);
@ -249,7 +249,7 @@ public class MainActivity extends CompatActivity implements SwipeRefreshLayout.O
this.progressIndicator.setVisibility(View.GONE);
this.swipeRefreshLayout.setRefreshing(false);
});
if (!RepoManager.getINSTANCE().hasConnectivity()) {
if (!NotificationType.NO_INTERNET.shouldRemove()) {
this.moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET);
}
this.moduleViewListBuilder.appendRemoteModules();

@ -48,7 +48,8 @@ public enum NotificationType implements NotificationTypeCst {
NO_INTERNET(R.string.fail_internet, R.drawable.ic_baseline_cloud_off_24) {
@Override
public boolean shouldRemove() {
return RepoManager.getINSTANCE().hasConnectivity();
return AppUpdateManager.getAppUpdateManager().isLastCheckSuccess() ||
RepoManager.getINSTANCE().hasConnectivity();
}
},
UPDATE_AVAILABLE(R.string.app_update_available, R.drawable.ic_baseline_system_update_24,

@ -43,7 +43,7 @@ public class AndroidacyRepoData extends RepoData {
if (this.androidacyBlockade > time) return false;
this.androidacyBlockade = time + 5_000L;
String cookies = CookieManager.getInstance().getCookie("https://.androidacy.com/");
int start = cookies.indexOf("USER=");
int start = cookies == null ? -1 : cookies.indexOf("USER=");
String token = null;
if (start != -1) {
int end = cookies.indexOf(";", start);
@ -73,7 +73,7 @@ public class AndroidacyRepoData extends RepoData {
token = new String(Http.doHttpPost(
"https://api.androidacy.com/auth/register",
"",true), StandardCharsets.UTF_8);
CookieManager.getInstance().setCookie(".androidacy.com",
CookieManager.getInstance().setCookie("https://.androidacy.com/",
"USER="+ token + "; expires=Fri, 31 Dec 9999 23:59:59 GMT;" +
" path=/; secure; domain=.androidacy.com");
} catch (Exception e) {

@ -197,9 +197,11 @@ public class InstallerActivity extends CompatActivity {
private void doInstall(File file,boolean noExtensions,boolean rootless) {
this.setOnBackPressedCallback(DISABLE_BACK_BUTTON);
this.setDisplayHomeAsUpEnabled(false);
if (this.canceled) return;
UiThreadHandler.runAndWait(() -> {
this.setOnBackPressedCallback(DISABLE_BACK_BUTTON);
this.setDisplayHomeAsUpEnabled(false);
});
Log.i(TAG, "Installing: " + moduleCache.getName());
InstallerController installerController = new InstallerController(
this.progressIndicator, this.installerTerminal,

@ -5,7 +5,7 @@ buildscript {
mavenCentral()
gradlePluginPortal()
}
project.ext.latestAboutLibsRelease = "10.0.0-b08"
project.ext.latestAboutLibsRelease = "10.0.0-b09"
dependencies {
classpath 'com.android.tools.build:gradle:7.1.0'
classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:${latestAboutLibsRelease}"

Loading…
Cancel
Save