Fix Googlers Magisk Repo url.

pull/195/head
Fox2Code 2 years ago
parent 82813bcd3d
commit 4419ed1ef0

@ -4,6 +4,7 @@ import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import com.fox2code.mmm.MainApplication; import com.fox2code.mmm.MainApplication;
import com.fox2code.mmm.utils.PropUtils;
public class CustomRepoManager { public class CustomRepoManager {
private static final boolean AUTO_RECOMPILE = true; private static final boolean AUTO_RECOMPILE = true;
@ -23,7 +24,7 @@ public class CustomRepoManager {
int lastFilled = 0; int lastFilled = 0;
for (int i = 0; i < MAX_CUSTOM_REPOS; i++) { for (int i = 0; i < MAX_CUSTOM_REPOS; i++) {
String repo = sharedPreferences.getString("repo_" + i, ""); String repo = sharedPreferences.getString("repo_" + i, "");
if (!repo.isEmpty() && !RepoManager.isBuiltInRepo(repo)) { if (!PropUtils.isNullString(repo) && !RepoManager.isBuiltInRepo(repo)) {
lastFilled = i; lastFilled = i;
int index = AUTO_RECOMPILE ? int index = AUTO_RECOMPILE ?
this.customReposCount : i; this.customReposCount : i;

@ -50,6 +50,8 @@ public final class RepoManager extends SyncManager {
"https://repo.dergoogler.com/modules.json"; "https://repo.dergoogler.com/modules.json";
public static final String DG_MAGISK_REPO_GITHUB = public static final String DG_MAGISK_REPO_GITHUB =
"https://googlers-magisk-repo.github.io/modules.json"; "https://googlers-magisk-repo.github.io/modules.json";
public static final String DG_MAGISK_REPO_GITHUB_RAW =
"https://raw.githubusercontent.com/Googlers-Repo/googlers-repo.github.io/master/modules.json";
private static final Object lock = new Object(); private static final Object lock = new Object();
private static volatile RepoManager INSTANCE; private static volatile RepoManager INSTANCE;
@ -91,7 +93,7 @@ public final class RepoManager extends SyncManager {
altRepo.defaultSubmitModule = altRepo.defaultSubmitModule =
"https://github.com/Magisk-Modules-Alt-Repo/submission/issues"; "https://github.com/Magisk-Modules-Alt-Repo/submission/issues";
RepoData dgRepo = this.addRepoData( RepoData dgRepo = this.addRepoData(
DG_MAGISK_REPO_GITHUB, "Googlers Magisk Repo"); DG_MAGISK_REPO_GITHUB_RAW, "Googlers Magisk Repo");
dgRepo.defaultWebsite = "https://dergoogler.com/repo"; dgRepo.defaultWebsite = "https://dergoogler.com/repo";
this.androidacyRepoData = this.addAndroidacyRepoData(); this.androidacyRepoData = this.addAndroidacyRepoData();
this.customRepoManager = new CustomRepoManager(mainApplication, this); this.customRepoManager = new CustomRepoManager(mainApplication, this);
@ -139,8 +141,9 @@ public final class RepoManager extends SyncManager {
public RepoData addOrGet(String url, String fallBackName) { public RepoData addOrGet(String url, String fallBackName) {
if (MAGISK_ALT_REPO_JSDELIVR.equals(url)) if (MAGISK_ALT_REPO_JSDELIVR.equals(url))
url = MAGISK_ALT_REPO; url = MAGISK_ALT_REPO;
if (DG_MAGISK_REPO.equals(url)) if (DG_MAGISK_REPO.equals(url) ||
url = DG_MAGISK_REPO_GITHUB; DG_MAGISK_REPO_GITHUB.equals(url))
url = DG_MAGISK_REPO_GITHUB_RAW;
RepoData repoData; RepoData repoData;
synchronized (this.syncLock) { synchronized (this.syncLock) {
repoData = this.repoData.get(url); repoData = this.repoData.get(url);
@ -260,6 +263,7 @@ public final class RepoManager extends SyncManager {
return "androidacy_repo"; return "androidacy_repo";
case DG_MAGISK_REPO: case DG_MAGISK_REPO:
case DG_MAGISK_REPO_GITHUB: case DG_MAGISK_REPO_GITHUB:
case DG_MAGISK_REPO_GITHUB_RAW:
return "dg_magisk_repo"; return "dg_magisk_repo";
default: default:
return "repo_" + Hashes.hashSha1( return "repo_" + Hashes.hashSha1(
@ -275,6 +279,7 @@ public final class RepoManager extends SyncManager {
case RepoManager.ANDROIDACY_TEST_MAGISK_REPO_ENDPOINT: case RepoManager.ANDROIDACY_TEST_MAGISK_REPO_ENDPOINT:
case RepoManager.DG_MAGISK_REPO: case RepoManager.DG_MAGISK_REPO:
case RepoManager.DG_MAGISK_REPO_GITHUB: case RepoManager.DG_MAGISK_REPO_GITHUB:
case RepoManager.DG_MAGISK_REPO_GITHUB_RAW:
return true; return true;
} }
return false; return false;

Loading…
Cancel
Save