Release 3.0.0-dev2

pull/27/head 0.3.0-dev2
Fox2Code 4 years ago
parent 00d9dc040d
commit 50c1f9c5b3

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

@ -25,6 +25,7 @@ public class AppUpdateManager {
private String latestPreRelease; private String latestPreRelease;
private long lastChecked; private long lastChecked;
private boolean preReleaseNewer; private boolean preReleaseNewer;
private boolean lastCheckSuccess;
private AppUpdateManager() { private AppUpdateManager() {
this.latestRelease = MainApplication.getBootSharedPreferences() this.latestRelease = MainApplication.getBootSharedPreferences()
@ -85,7 +86,9 @@ public class AppUpdateManager {
Log.d(TAG, "Latest pre-release: " + latestPreRelease); Log.d(TAG, "Latest pre-release: " + latestPreRelease);
Log.d(TAG, "Latest pre-release newer: " + preReleaseNewer); Log.d(TAG, "Latest pre-release newer: " + preReleaseNewer);
this.lastChecked = System.currentTimeMillis(); this.lastChecked = System.currentTimeMillis();
this.lastCheckSuccess = true;
} catch (Exception ioe) { } catch (Exception ioe) {
this.lastCheckSuccess = false;
Log.e("AppUpdateManager", "Failed to check releases", ioe); Log.e("AppUpdateManager", "Failed to check releases", ioe);
} }
} }
@ -102,4 +105,8 @@ public class AppUpdateManager {
return !BuildConfig.VERSION_NAME.equals(this.preReleaseNewer ? return !BuildConfig.VERSION_NAME.equals(this.preReleaseNewer ?
this.latestPreRelease : this.latestRelease); 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) :() -> (int) (value * PRECISION), true) :() ->
progressIndicator.setProgressCompat( progressIndicator.setProgressCompat(
(int) (value * PRECISION * 0.75F), true))); (int) (value * PRECISION * 0.75F), true)));
if (!RepoManager.getINSTANCE().hasConnectivity()) { if (!NotificationType.NO_INTERNET.shouldRemove()) {
moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET); moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET);
} else { } else {
if (AppUpdateManager.getAppUpdateManager().checkUpdate(true)) if (AppUpdateManager.getAppUpdateManager().checkUpdate(true))
@ -210,7 +210,7 @@ public class MainActivity extends CompatActivity implements SwipeRefreshLayout.O
Log.i(TAG, "Common Before"); Log.i(TAG, "Common Before");
if (MainApplication.isShowcaseMode()) if (MainApplication.isShowcaseMode())
moduleViewListBuilder.addNotification(NotificationType.SHOWCASE_MODE); moduleViewListBuilder.addNotification(NotificationType.SHOWCASE_MODE);
if (!RepoManager.getINSTANCE().hasConnectivity()) if (!NotificationType.NO_INTERNET.shouldRemove())
moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET); moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET);
else if (AppUpdateManager.getAppUpdateManager().checkUpdate(false)) else if (AppUpdateManager.getAppUpdateManager().checkUpdate(false))
moduleViewListBuilder.addNotification(NotificationType.UPDATE_AVAILABLE); moduleViewListBuilder.addNotification(NotificationType.UPDATE_AVAILABLE);
@ -241,7 +241,7 @@ public class MainActivity extends CompatActivity implements SwipeRefreshLayout.O
RepoManager.getINSTANCE().update(value -> runOnUiThread(() -> RepoManager.getINSTANCE().update(value -> runOnUiThread(() ->
this.progressIndicator.setProgressCompat( this.progressIndicator.setProgressCompat(
(int) (value * PRECISION), true))); (int) (value * PRECISION), true)));
if (!RepoManager.getINSTANCE().hasConnectivity()) if (!NotificationType.NO_INTERNET.shouldRemove())
moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET); moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET);
else if (AppUpdateManager.getAppUpdateManager().checkUpdate(true)) else if (AppUpdateManager.getAppUpdateManager().checkUpdate(true))
moduleViewListBuilder.addNotification(NotificationType.UPDATE_AVAILABLE); moduleViewListBuilder.addNotification(NotificationType.UPDATE_AVAILABLE);
@ -249,7 +249,7 @@ public class MainActivity extends CompatActivity implements SwipeRefreshLayout.O
this.progressIndicator.setVisibility(View.GONE); this.progressIndicator.setVisibility(View.GONE);
this.swipeRefreshLayout.setRefreshing(false); this.swipeRefreshLayout.setRefreshing(false);
}); });
if (!RepoManager.getINSTANCE().hasConnectivity()) { if (!NotificationType.NO_INTERNET.shouldRemove()) {
this.moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET); this.moduleViewListBuilder.addNotification(NotificationType.NO_INTERNET);
} }
this.moduleViewListBuilder.appendRemoteModules(); 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) { NO_INTERNET(R.string.fail_internet, R.drawable.ic_baseline_cloud_off_24) {
@Override @Override
public boolean shouldRemove() { 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, 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; if (this.androidacyBlockade > time) return false;
this.androidacyBlockade = time + 5_000L; this.androidacyBlockade = time + 5_000L;
String cookies = CookieManager.getInstance().getCookie("https://.androidacy.com/"); String cookies = CookieManager.getInstance().getCookie("https://.androidacy.com/");
int start = cookies.indexOf("USER="); int start = cookies == null ? -1 : cookies.indexOf("USER=");
String token = null; String token = null;
if (start != -1) { if (start != -1) {
int end = cookies.indexOf(";", start); int end = cookies.indexOf(";", start);
@ -73,7 +73,7 @@ public class AndroidacyRepoData extends RepoData {
token = new String(Http.doHttpPost( token = new String(Http.doHttpPost(
"https://api.androidacy.com/auth/register", "https://api.androidacy.com/auth/register",
"",true), StandardCharsets.UTF_8); "",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;" + "USER="+ token + "; expires=Fri, 31 Dec 9999 23:59:59 GMT;" +
" path=/; secure; domain=.androidacy.com"); " path=/; secure; domain=.androidacy.com");
} catch (Exception e) { } catch (Exception e) {

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

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

Loading…
Cancel
Save