Support stub APK loading down to Android 5.0

This commit is contained in:
topjohnwu
2021-01-26 07:27:35 -08:00
parent f1295cb7d6
commit fba83e2330
11 changed files with 141 additions and 116 deletions
@@ -1,27 +1,42 @@
package com.topjohnwu.magisk;
import com.topjohnwu.magisk.dummy.DummyReceiver;
import java.util.HashMap;
import java.util.Map;
/**
* These are just some random class names hardcoded as an example.
* For the actual release builds, these mappings will be auto generated.
*/
public class Mapping {
private static Map<String, String> map = new HashMap<>();
public static Map<String, String> inverseMap;
private static final Map<String, String> map = new HashMap<>();
public static final Map<String, Class<?>> internalMap = new HashMap<>();
public static final Map<String, String> inverseMap;
static {
map.put("a.Qzw", "a.e");
map.put("a.u7", "a.c");
map.put("a.ii", "a.p");
map.put("a.r", "a.h");
map.put("xt.R", "a.b");
map.put("lt5.a", "a.m");
map.put("d.s", "a.j");
map.put("a.Q", "com.topjohnwu.magisk.core.App");
map.put("f.u7", "com.topjohnwu.magisk.core.SplashActivity");
map.put("fxQ.lk", "com.topjohnwu.magisk.core.Provider");
map.put("yy.E", "com.topjohnwu.magisk.core.Receiver");
map.put("xt.R", "com.topjohnwu.magisk.ui.MainActivity");
map.put("lt5.a", "com.topjohnwu.magisk.ui.surequest.SuRequestActivity");
map.put("d.s", "com.topjohnwu.magisk.core.download.DownloadService");
map.put("w.d", "androidx.work.impl.background.systemjob.SystemJobService");
internalMap.put("a.Q", DelegateApplication.class);
internalMap.put("f.u7", DownloadActivity.class);
internalMap.put("fxQ.lk", FileProvider.class);
internalMap.put("yy.E", DummyReceiver.class);
inverseMap = new HashMap<>(map.size());
for (Map.Entry<String, String> e : map.entrySet()) {
inverseMap.put(e.getValue(), e.getKey());
}
map.put("APP", "com.topjohnwu.magisk.core.App");
map.put("ACF", "androidx.core.app.CoreComponentFactory");
}
public static String get(String name) {