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

Commit 414caf3

Browse files
Working setup box
Also bumps minimum android sdk to 23 (aka Marshmallow) Android 5.x just isn't popular anymore and magisk even has poor support for it. Also warn about blur on low-end devices Signed-off-by: androidacy-user <opensource@androidacy.com>
1 parent 2c67557 commit 414caf3

File tree

12 files changed

+273
-164
lines changed

12 files changed

+273
-164
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ android {
2525

2626
defaultConfig {
2727
applicationId "com.fox2code.mmm"
28-
minSdk 21
28+
minSdk 23
2929
targetSdk 33
3030
versionCode 61
3131
versionName "1.0.1"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ public boolean checkUpdate(boolean force) {
111111
this.latestPreRelease = "";
112112
this.preReleaseNewer = false;
113113
}
114-
Log.d(TAG, "Latest release: " + latestRelease);
115-
Log.d(TAG, "Latest pre-release: " + latestPreRelease);
116-
Log.d(TAG, "Latest pre-release newer: " + preReleaseNewer);
114+
if (BuildConfig.DEBUG) Log.d(TAG, "Latest release: " + latestRelease);
115+
if (BuildConfig.DEBUG) Log.d(TAG, "Latest pre-release: " + latestPreRelease);
116+
if (BuildConfig.DEBUG) Log.d(TAG, "Latest pre-release newer: " + preReleaseNewer);
117117
this.lastChecked = System.currentTimeMillis();
118118
this.lastCheckSuccess = true;
119119
} catch (Exception ioe) {

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

Lines changed: 123 additions & 71 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public static String generateDeviceId() throws NoSuchAlgorithmException {
108108
deviceId = output;
109109
}
110110
}
111-
// Now, get device model, manufacturer, and Android version
111+
// Now, get device model, manufacturer, and Android version originally from
112112
String deviceModel = android.os.Build.MODEL;
113113
String deviceManufacturer = android.os.Build.MANUFACTURER;
114114
String androidVersion = android.os.Build.VERSION.RELEASE;

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void forceQuitRaw(String error) {
6363

6464
void openNativeModuleDialogRaw(String moduleUrl, String moduleId, String installTitle,
6565
String checksum, boolean canInstall) {
66-
Log.d(TAG, "ModuleDialog, downloadUrl: " + AndroidacyUtil.hideToken(moduleUrl) +
66+
if (BuildConfig.DEBUG) Log.d(TAG, "ModuleDialog, downloadUrl: " + AndroidacyUtil.hideToken(moduleUrl) +
6767
", moduleId: " + moduleId + ", installTitle: " + installTitle +
6868
", checksum: " + checksum + ", canInstall: " + canInstall);
6969
this.downloadMode = false;
@@ -145,7 +145,7 @@ void openNativeModuleDialogRaw(String moduleUrl, String moduleId, String install
145145

146146
void notifyCompatModeRaw(int value) {
147147
if (this.consumedAction) return;
148-
Log.d(TAG, "Androidacy Compat mode: " + value);
148+
if (BuildConfig.DEBUG) Log.d(TAG, "Androidacy Compat mode: " + value);
149149
this.notifiedCompatMode = value;
150150
if (value < 0) {
151151
value = 0;
@@ -180,7 +180,7 @@ public void openUrl(String url) {
180180
if (this.consumedAction) return;
181181
this.consumedAction = true;
182182
this.downloadMode = false;
183-
Log.d(TAG, "Received openUrl request: " + url);
183+
if (BuildConfig.DEBUG) Log.d(TAG, "Received openUrl request: " + url);
184184
if (Uri.parse(url).getScheme().equals("https")) {
185185
IntentHelper.openUrl(this.activity, url);
186186
}
@@ -194,7 +194,7 @@ public void openCustomTab(String url) {
194194
if (this.consumedAction) return;
195195
this.consumedAction = true;
196196
this.downloadMode = false;
197-
Log.d(TAG, "Received openCustomTab request: " + url);
197+
if (BuildConfig.DEBUG) Log.d(TAG, "Received openCustomTab request: " + url);
198198
if (Uri.parse(url).getScheme().equals("https")) {
199199
IntentHelper.openCustomTab(this.activity, url);
200200
}
@@ -238,7 +238,7 @@ public void install(String moduleUrl, String installTitle, String checksum) {
238238
}
239239
this.consumedAction = true;
240240
this.downloadMode = false;
241-
Log.d(TAG, "Received install request: " +
241+
if (BuildConfig.DEBUG) Log.d(TAG, "Received install request: " +
242242
moduleUrl + " " + installTitle + " " + checksum);
243243
if (!AndroidacyUtil.isAndroidacyLink(moduleUrl)) {
244244
this.forceQuitRaw("Non Androidacy module link used on Androidacy");
@@ -375,6 +375,7 @@ public void showActionBar(final String title) {
375375
/**
376376
* Return true if the module is an Andoridacy module.
377377
*/
378+
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
378379
@JavascriptInterface
379380
public boolean isAndroidacyModule(String moduleId) {
380381
LocalModuleInfo localModuleInfo = ModuleManager.getINSTANCE().getModules().get(moduleId);
@@ -447,7 +448,7 @@ public int getMagiskVersionCode() {
447448

448449
/**
449450
* Return current android sdk-int version code, see:
450-
* https://source.android.com/setup/start/build-numbers
451+
* <a href="https://source.android.com/setup/start/build-numbers">right here</a>
451452
*/
452453
@JavascriptInterface
453454
public int getAndroidVersionCode() {

app/src/main/java/com/fox2code/mmm/manager/ModuleManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ protected void scanInternal(@NonNull UpdateListener updateListener) {
113113
PropUtils.readProperties(moduleInfo,
114114
"/data/adb/modules/" + module + "/module.prop", true);
115115
} catch (Exception e) {
116-
Log.d(TAG, "Failed to parse metadata!", e);
116+
if (BuildConfig.DEBUG) Log.d(TAG, "Failed to parse metadata!", e);
117117
moduleInfo.flags |= FLAG_MM_INVALID;
118118
}
119119
}
@@ -136,7 +136,7 @@ protected void scanInternal(@NonNull UpdateListener updateListener) {
136136
PropUtils.readProperties(moduleInfo,
137137
"/data/adb/modules_update/" + module + "/module.prop", true);
138138
} catch (Exception e) {
139-
Log.d(TAG, "Failed to parse metadata!", e);
139+
if (BuildConfig.DEBUG) Log.d(TAG, "Failed to parse metadata!", e);
140140
moduleInfo.flags |= FLAG_MM_INVALID;
141141
}
142142
}

app/src/main/java/com/fox2code/mmm/repo/RepoData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class RepoData extends XRepo {
4242
public String name, website, support, donate, submitModule;
4343
private boolean forceHide, enabled; // Cache for speed
4444

45-
protected RepoData(String url, File cacheRoot, SharedPreferences cachedPreferences) {
45+
public RepoData(String url, File cacheRoot, SharedPreferences cachedPreferences) {
4646
this.url = url;
4747
this.id = RepoManager.internalIdOfUrl(url);
4848
this.cacheRoot = cacheRoot;

app/src/main/java/com/fox2code/mmm/repo/RepoManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ private RepoManager(MainApplication mainApplication) {
7575
this.repoData = new LinkedHashMap<>();
7676
this.modules = new HashMap<>();
7777
// We do not have repo list config yet.
78+
this.androidacyRepoData = this.addAndroidacyRepoData();
7879
RepoData altRepo = this.addRepoData(
7980
MAGISK_ALT_REPO, "Magisk Modules Alt Repo");
8081
altRepo.defaultWebsite = RepoManager.MAGISK_ALT_REPO_HOMEPAGE;
8182
altRepo.defaultSubmitModule =
8283
"https://github.com/Magisk-Modules-Alt-Repo/submission/issues";
83-
this.androidacyRepoData = this.addAndroidacyRepoData();
8484
this.customRepoManager = new CustomRepoManager(mainApplication, this);
8585
XHooks.onRepoManagerInitialize();
8686
// Populate default cache
@@ -145,10 +145,10 @@ public static String internalIdOfUrl(String url) {
145145

146146
static boolean isBuiltInRepo(String repo) {
147147
switch (repo) {
148-
case RepoManager.MAGISK_ALT_REPO:
149-
case RepoManager.MAGISK_ALT_REPO_JSDELIVR:
150148
case RepoManager.ANDROIDACY_MAGISK_REPO_ENDPOINT:
151149
case RepoManager.ANDROIDACY_TEST_MAGISK_REPO_ENDPOINT:
150+
case RepoManager.MAGISK_ALT_REPO:
151+
case RepoManager.MAGISK_ALT_REPO_JSDELIVR:
152152
return true;
153153
}
154154
return false;

0 commit comments

Comments
 (0)