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

Commit f8707bb

Browse files
committed
Remove Magisk-Modules-Repo. (See #79)
1 parent 41074c8 commit f8707bb

File tree

3 files changed

+3
-40
lines changed

3 files changed

+3
-40
lines changed

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

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,20 @@
2020

2121
public final class RepoManager {
2222
private static final String TAG = "RepoManager";
23-
private static final String MAGISK_REPO_MANAGER =
24-
"https://magisk-modules-repo.github.io/submission/modules.json";
25-
public static final String MAGISK_REPO =
26-
"https://raw.githubusercontent.com/Magisk-Modules-Repo/submission/modules/modules.json";
27-
public static final String MAGISK_REPO_JSDELIVR =
28-
"https://cdn.jsdelivr.net/gh/Magisk-Modules-Repo/submission@modules/modules.json";
2923
public static final String MAGISK_ALT_REPO =
3024
"https://raw.githubusercontent.com/Magisk-Modules-Alt-Repo/json/main/modules.json";
3125
public static final String MAGISK_ALT_REPO_JSDELIVR =
3226
"https://cdn.jsdelivr.net/gh/Magisk-Modules-Alt-Repo/json@main/modules.json";
3327
public static final String ANDROIDACY_MAGISK_REPO_ENDPOINT =
3428
"https://api.androidacy.com/magisk/repo";
3529

36-
public static final String MAGISK_REPO_HOMEPAGE =
37-
"https://github.com/Magisk-Modules-Repo";
3830
public static final String MAGISK_ALT_REPO_HOMEPAGE =
3931
"https://github.com/Magisk-Modules-Alt-Repo";
4032
public static final String ANDROIDACY_MAGISK_REPO_HOMEPAGE =
4133
"https://www.androidacy.com/modules-repo";
4234

4335
private static final Object lock = new Object();
44-
private static RepoManager INSTANCE;
36+
private static volatile RepoManager INSTANCE;
4537

4638
public static RepoManager getINSTANCE() {
4739
if (INSTANCE == null) {
@@ -69,7 +61,6 @@ private RepoManager(MainApplication mainApplication) {
6961
this.modules = new HashMap<>();
7062
// We do not have repo list config yet.
7163
this.addRepoData(MAGISK_ALT_REPO);
72-
this.addRepoData(MAGISK_REPO);
7364
this.addAndroidacyRepoData();
7465
// Populate default cache
7566
for (RepoData repoData:this.repoData.values()) {
@@ -92,13 +83,8 @@ private RepoManager(MainApplication mainApplication) {
9283

9384
public RepoData get(String url) {
9485
if (url == null) return null;
95-
switch (url) {
96-
case MAGISK_REPO_JSDELIVR:
97-
case MAGISK_REPO_MANAGER:
98-
url = MAGISK_REPO;
99-
break;
100-
case MAGISK_ALT_REPO_JSDELIVR:
101-
url = MAGISK_ALT_REPO;
86+
if (MAGISK_ALT_REPO_JSDELIVR.equals(url)) {
87+
url = MAGISK_ALT_REPO;
10288
}
10389
return this.repoData.get(url);
10490
}
@@ -244,10 +230,6 @@ public boolean hasConnectivity() {
244230

245231
public static String internalIdOfUrl(String url) {
246232
switch (url) {
247-
case MAGISK_REPO_MANAGER:
248-
case MAGISK_REPO:
249-
case MAGISK_REPO_JSDELIVR:
250-
return "magisk_repo";
251233
case MAGISK_ALT_REPO:
252234
case MAGISK_ALT_REPO_JSDELIVR:
253235
return "magisk_alt_repo";

app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,6 @@ public static class RepoFragment extends PreferenceFragmentCompat {
162162
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
163163
getPreferenceManager().setSharedPreferencesName("mmm");
164164
setPreferencesFromResource(R.xml.repo_preferences, rootKey);
165-
setRepoData(RepoManager.MAGISK_REPO,
166-
"Magisk Modules Repo (Official)", RepoManager.MAGISK_REPO_HOMEPAGE,
167-
null, null,null);
168165
setRepoData(RepoManager.MAGISK_ALT_REPO,
169166
"Magisk Modules Alt Repo", RepoManager.MAGISK_ALT_REPO_HOMEPAGE,
170167
null, null,

app/src/main/res/xml/repo_preferences.xml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
3-
<PreferenceCategory
4-
app:key="pref_magisk_repo"
5-
app:title="@string/loading">
6-
<SwitchPreferenceCompat
7-
app:defaultValue="true"
8-
app:key="pref_magisk_repo_enabled"
9-
app:icon="@drawable/ic_baseline_extension_24"
10-
app:switchTextOn="@string/repo_enabled"
11-
app:switchTextOff="@string/repo_enabled"
12-
app:singleLineTitle="false" />
13-
<Preference
14-
app:key="pref_magisk_repo_website"
15-
app:icon="@drawable/ic_baseline_language_24"
16-
app:title="@string/website"
17-
app:singleLineTitle="false" />
18-
</PreferenceCategory>
193
<PreferenceCategory
204
app:key="pref_magisk_alt_repo"
215
app:title="@string/loading">

0 commit comments

Comments
 (0)