Minor changes

This commit is contained in:
topjohnwu
2019-10-30 04:15:53 -04:00
parent fdf04f77f2
commit dc9f69bab0
9 changed files with 30 additions and 34 deletions
@@ -55,11 +55,11 @@ public class DelegateApplication extends Application {
ClassLoader cl = new DynamicClassLoader(MANAGER_APK, factory.loader);
try {
// Create the delegate AppComponentFactory
Object df = cl.loadClass("a.a").newInstance();
AppComponentFactory df = (AppComponentFactory) cl.loadClass("a.a").newInstance();
// Create the delegate Application
delegate = (Application) cl.loadClass("a.e").getConstructor(Object.class)
.newInstance(DynAPK.pack(Mapping.data));
.newInstance(DynAPK.pack(Mapping.data()));
// Call attachBaseContext without ContextImpl to show it is being wrapped
Method m = ContextWrapper.class.getDeclaredMethod("attachBaseContext", Context.class);
@@ -67,7 +67,7 @@ public class DelegateApplication extends Application {
m.invoke(delegate, this);
// If everything went well, set our loader and delegate
factory.delegate = (AppComponentFactory) df;
factory.delegate = df;
factory.loader = cl;
} catch (Exception e) {
Log.e(getClass().getSimpleName(), "", e);