You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Make main app fully independent from the stub
- Skip 0x7f01XXXX - 0x7f05XXXX resource IDs in the main app; they are reserved for stub resources - Support sending additional data from host to guest - Use resource mapping passed from host when they are being sent to the system framework (notifications and shortcuts)
This commit is contained in:
41
stub/src/main/java/com/topjohnwu/magisk/Mapping.java
Normal file
41
stub/src/main/java/com/topjohnwu/magisk/Mapping.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.topjohnwu.magisk;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.topjohnwu.magisk.utils.DynAPK.*;
|
||||
|
||||
class Mapping {
|
||||
private static Map<String, String> map = new HashMap<>();
|
||||
|
||||
// This mapping will be sent into the guest app
|
||||
static Data data = new Data();
|
||||
|
||||
static {
|
||||
map.put(a.z.class.getName(), "a.c");
|
||||
map.put("a.x", "a.f");
|
||||
map.put("a.o", "a.b");
|
||||
map.put("a.g", "a.m");
|
||||
map.put(a.w.class.getName(), "a.h");
|
||||
map.put("a.v", "a.j");
|
||||
map.put("a.j", "androidx.work.impl.background.systemjob.SystemJobService");
|
||||
|
||||
data.componentMap = new HashMap<>(map.size());
|
||||
for (Map.Entry<String, String> e : map.entrySet()) {
|
||||
data.componentMap.put(e.getValue(), e.getKey());
|
||||
}
|
||||
int[] res = new int[5];
|
||||
res[NOTIFICATION] = R.drawable.ic_magisk_outline;
|
||||
res[SUPERUSER] = R.drawable.sc_superuser;
|
||||
res[MAGISKHIDE] = R.drawable.sc_magiskhide;
|
||||
res[DOWNLOAD] = R.drawable.sc_cloud_download;
|
||||
res[MODULES] = R.drawable.sc_extension;
|
||||
data.resourceMap = res;
|
||||
}
|
||||
|
||||
static String get(String name) {
|
||||
String n = map.get(name);
|
||||
return n != null ? n : name;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user