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

Commit e0dd5a3

Browse files
committed
Expand XRepo and XHook interface for XPosed modules.
1 parent eeda837 commit e0dd5a3

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import com.fox2code.mmm.manager.ModuleManager;
1111
import com.fox2code.mmm.repo.RepoManager;
1212

13+
import java.util.Collection;
14+
1315
/**
1416
* Class made to expose some manager functions to xposed modules.
1517
* It will not be obfuscated on release builds
@@ -57,4 +59,9 @@ public static XRepo addXRepo(String url, String fallbackName) {
5759
public static XRepo getXRepo(String url) {
5860
return RepoManager.getINSTANCE_UNSAFE().get(url);
5961
}
62+
63+
@Keep
64+
public static Collection<XRepo> getXRepos() {
65+
return RepoManager.getINSTANCE_UNSAFE().getXRepos();
66+
}
6067
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ public abstract class XRepo {
1616

1717
@Keep
1818
public abstract void setEnabled(boolean enabled);
19+
20+
@Keep
21+
public abstract String getName();
1922
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ private static boolean isNonNull(String str) {
222222

223223
// Repo data info getters
224224
@NonNull
225+
@Override
225226
public String getName() {
226227
if (isNonNull(this.name))
227228
return this.name;

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import com.fox2code.mmm.MainApplication;
1010
import com.fox2code.mmm.XHooks;
11+
import com.fox2code.mmm.XRepo;
1112
import com.fox2code.mmm.androidacy.AndroidacyRepoData;
1213
import com.fox2code.mmm.manager.ModuleInfo;
1314
import com.fox2code.mmm.utils.Files;
@@ -19,6 +20,7 @@
1920

2021
import java.io.File;
2122
import java.nio.charset.StandardCharsets;
23+
import java.util.Collection;
2224
import java.util.HashMap;
2325
import java.util.LinkedHashMap;
2426
import java.util.LinkedHashSet;
@@ -367,4 +369,8 @@ public AndroidacyRepoData getAndroidacyRepoData() {
367369
public CustomRepoManager getCustomRepoManager() {
368370
return customRepoManager;
369371
}
372+
373+
public Collection<XRepo> getXRepos() {
374+
return new LinkedHashSet<>(this.repoData.values());
375+
}
370376
}

0 commit comments

Comments
 (0)