Remove usage of AndroidX CoreComponentFactory

This commit is contained in:
topjohnwu 2022-08-26 01:25:08 -07:00
parent eadf6e8b96
commit e9af773901
2 changed files with 7 additions and 2 deletions

View File

@ -7,6 +7,7 @@
android:extractNativeLibs="true"
android:icon="@drawable/ic_launcher"
android:multiArch="true"
tools:remove="android:appComponentFactory"
tools:ignore="UnusedAttribute,GoogleAppIndexingWarning">
<activity

View File

@ -150,9 +150,13 @@ public class DynLoad {
// Create the receiver component factory
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && componentFactory != null) {
Object factory = cl.loadClass(appInfo.appComponentFactory).newInstance();
var delegate = (DelegateComponentFactory) componentFactory;
delegate.receiver = (AppComponentFactory) factory;
if (appInfo.appComponentFactory == null) {
delegate.receiver = new AppComponentFactory();
} else {
Object factory = cl.loadClass(appInfo.appComponentFactory).newInstance();
delegate.receiver = (AppComponentFactory) factory;
}
}
activeClassLoader = cl;