mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-06-13 05:37:47 +02:00
@ -19,12 +19,12 @@ public class DelegateApplication extends Application {
|
||||
|
||||
static File MANAGER_APK;
|
||||
|
||||
private Object factory;
|
||||
private DelegateComponentFactory factory;
|
||||
private Application delegate;
|
||||
|
||||
public DelegateApplication() {}
|
||||
|
||||
public DelegateApplication(Object o) {
|
||||
public DelegateApplication(DelegateComponentFactory o) {
|
||||
factory = o;
|
||||
}
|
||||
|
||||
@ -46,7 +46,6 @@ public class DelegateApplication extends Application {
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private void setUpDynAPK() {
|
||||
DelegateComponentFactory factory = (DelegateComponentFactory) this.factory;
|
||||
MANAGER_APK = DynAPK.current(this);
|
||||
File update = DynAPK.update(this);
|
||||
if (update.exists())
|
||||
@ -55,7 +54,8 @@ public class DelegateApplication extends Application {
|
||||
ClassLoader cl = new DynamicClassLoader(MANAGER_APK, factory.loader);
|
||||
try {
|
||||
// Create the delegate AppComponentFactory
|
||||
AppComponentFactory df = (AppComponentFactory) cl.loadClass("a.a").newInstance();
|
||||
AppComponentFactory df = (AppComponentFactory)
|
||||
cl.loadClass("androidx.core.app.CoreComponentFactory").newInstance();
|
||||
|
||||
// Create the delegate Application
|
||||
delegate = (Application) cl.loadClass("a.e").getConstructor(Object.class)
|
||||
|
@ -29,8 +29,7 @@ public class Mapping {
|
||||
|
||||
public static Data data() {
|
||||
Data data = new Data();
|
||||
data.componentMap = inverseMap;
|
||||
data.classToComponent = inverseMap;
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user