Initial import of ADIF API reverse-engineering toolkit
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
package dagger.hilt.android.internal.lifecycle;
|
||||
|
||||
import androidx.fragment.app.K;
|
||||
import androidx.lifecycle.y0;
|
||||
import b.o;
|
||||
import dagger.Module;
|
||||
import dagger.hilt.EntryPoint;
|
||||
import dagger.hilt.EntryPoints;
|
||||
import dagger.hilt.InstallIn;
|
||||
import dagger.hilt.android.components.ActivityComponent;
|
||||
import dagger.hilt.android.components.FragmentComponent;
|
||||
import dagger.hilt.android.internal.builders.ViewModelComponentBuilder;
|
||||
import dagger.hilt.android.internal.lifecycle.HiltViewModelMap;
|
||||
import dagger.hilt.internal.Preconditions;
|
||||
import dagger.multibindings.Multibinds;
|
||||
import java.util.Set;
|
||||
import javax.inject.Inject;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class DefaultViewModelFactories {
|
||||
|
||||
@EntryPoint
|
||||
@InstallIn({ActivityComponent.class})
|
||||
/* loaded from: classes3.dex */
|
||||
public interface ActivityEntryPoint {
|
||||
InternalFactoryFactory getHiltInternalFactoryFactory();
|
||||
}
|
||||
|
||||
@Module
|
||||
@InstallIn({ActivityComponent.class})
|
||||
/* loaded from: classes3.dex */
|
||||
public interface ActivityModule {
|
||||
@HiltViewModelMap.KeySet
|
||||
@Multibinds
|
||||
Set<String> viewModelKeys();
|
||||
}
|
||||
|
||||
@EntryPoint
|
||||
@InstallIn({FragmentComponent.class})
|
||||
/* loaded from: classes3.dex */
|
||||
public interface FragmentEntryPoint {
|
||||
InternalFactoryFactory getHiltInternalFactoryFactory();
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public static final class InternalFactoryFactory {
|
||||
private final Set<String> keySet;
|
||||
private final ViewModelComponentBuilder viewModelComponentBuilder;
|
||||
|
||||
@Inject
|
||||
public InternalFactoryFactory(@HiltViewModelMap.KeySet Set<String> set, ViewModelComponentBuilder viewModelComponentBuilder) {
|
||||
this.keySet = set;
|
||||
this.viewModelComponentBuilder = viewModelComponentBuilder;
|
||||
}
|
||||
|
||||
private y0 getHiltViewModelFactory(y0 y0Var) {
|
||||
return new HiltViewModelFactory(this.keySet, (y0) Preconditions.checkNotNull(y0Var), this.viewModelComponentBuilder);
|
||||
}
|
||||
|
||||
public y0 fromActivity(o oVar, y0 y0Var) {
|
||||
return getHiltViewModelFactory(y0Var);
|
||||
}
|
||||
|
||||
public y0 fromFragment(K k4, y0 y0Var) {
|
||||
return getHiltViewModelFactory(y0Var);
|
||||
}
|
||||
}
|
||||
|
||||
private DefaultViewModelFactories() {
|
||||
}
|
||||
|
||||
public static y0 getActivityFactory(o oVar, y0 y0Var) {
|
||||
return ((ActivityEntryPoint) EntryPoints.get(oVar, ActivityEntryPoint.class)).getHiltInternalFactoryFactory().fromActivity(oVar, y0Var);
|
||||
}
|
||||
|
||||
public static y0 getFragmentFactory(K k4, y0 y0Var) {
|
||||
return ((FragmentEntryPoint) EntryPoints.get(k4, FragmentEntryPoint.class)).getHiltInternalFactoryFactory().fromFragment(k4, y0Var);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package dagger.hilt.android.internal.lifecycle;
|
||||
|
||||
import dagger.hilt.android.internal.builders.ViewModelComponentBuilder;
|
||||
import dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories;
|
||||
import dagger.internal.DaggerGenerated;
|
||||
import dagger.internal.Factory;
|
||||
import dagger.internal.QualifierMetadata;
|
||||
import dagger.internal.ScopeMetadata;
|
||||
import java.util.Set;
|
||||
import javax.inject.Provider;
|
||||
|
||||
@ScopeMetadata
|
||||
@DaggerGenerated
|
||||
@QualifierMetadata({"dagger.hilt.android.internal.lifecycle.HiltViewModelMap.KeySet"})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class DefaultViewModelFactories_InternalFactoryFactory_Factory implements Factory<DefaultViewModelFactories.InternalFactoryFactory> {
|
||||
private final Provider<Set<String>> keySetProvider;
|
||||
private final Provider<ViewModelComponentBuilder> viewModelComponentBuilderProvider;
|
||||
|
||||
public DefaultViewModelFactories_InternalFactoryFactory_Factory(Provider<Set<String>> provider, Provider<ViewModelComponentBuilder> provider2) {
|
||||
this.keySetProvider = provider;
|
||||
this.viewModelComponentBuilderProvider = provider2;
|
||||
}
|
||||
|
||||
public static DefaultViewModelFactories_InternalFactoryFactory_Factory create(Provider<Set<String>> provider, Provider<ViewModelComponentBuilder> provider2) {
|
||||
return new DefaultViewModelFactories_InternalFactoryFactory_Factory(provider, provider2);
|
||||
}
|
||||
|
||||
public static DefaultViewModelFactories.InternalFactoryFactory newInstance(Set<String> set, ViewModelComponentBuilder viewModelComponentBuilder) {
|
||||
return new DefaultViewModelFactories.InternalFactoryFactory(set, viewModelComponentBuilder);
|
||||
}
|
||||
|
||||
@Override // javax.inject.Provider
|
||||
public DefaultViewModelFactories.InternalFactoryFactory get() {
|
||||
return newInstance(this.keySetProvider.get(), this.viewModelComponentBuilderProvider.get());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package dagger.hilt.android.internal.lifecycle;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import javax.inject.Qualifier;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER})
|
||||
@Qualifier
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes3.dex */
|
||||
public @interface HiltViewModelAssistedMap {
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
package dagger.hilt.android.internal.lifecycle;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import androidx.lifecycle.q0;
|
||||
import androidx.lifecycle.w0;
|
||||
import androidx.lifecycle.y0;
|
||||
import dagger.Module;
|
||||
import dagger.hilt.EntryPoint;
|
||||
import dagger.hilt.EntryPoints;
|
||||
import dagger.hilt.InstallIn;
|
||||
import dagger.hilt.android.components.ActivityComponent;
|
||||
import dagger.hilt.android.components.ViewModelComponent;
|
||||
import dagger.hilt.android.internal.builders.ViewModelComponentBuilder;
|
||||
import dagger.hilt.android.internal.lifecycle.HiltViewModelMap;
|
||||
import dagger.multibindings.Multibinds;
|
||||
import java.io.Closeable;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.inject.Provider;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.reflect.KClass;
|
||||
import l0.b;
|
||||
import l0.c;
|
||||
import v0.f;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class HiltViewModelFactory implements y0 {
|
||||
public static final b CREATION_CALLBACK_KEY = new b() { // from class: dagger.hilt.android.internal.lifecycle.HiltViewModelFactory.1
|
||||
};
|
||||
private final y0 delegateFactory;
|
||||
private final y0 hiltViewModelFactory;
|
||||
private final Set<String> hiltViewModelKeys;
|
||||
|
||||
@EntryPoint
|
||||
@InstallIn({ActivityComponent.class})
|
||||
/* loaded from: classes3.dex */
|
||||
public interface ActivityCreatorEntryPoint {
|
||||
ViewModelComponentBuilder getViewModelComponentBuilder();
|
||||
|
||||
@HiltViewModelMap.KeySet
|
||||
Set<String> getViewModelKeys();
|
||||
}
|
||||
|
||||
@EntryPoint
|
||||
@InstallIn({ViewModelComponent.class})
|
||||
/* loaded from: classes3.dex */
|
||||
public interface ViewModelFactoriesEntryPoint {
|
||||
@HiltViewModelAssistedMap
|
||||
Map<String, Object> getHiltViewModelAssistedMap();
|
||||
|
||||
@HiltViewModelMap
|
||||
Map<String, Provider<w0>> getHiltViewModelMap();
|
||||
}
|
||||
|
||||
@Module
|
||||
@InstallIn({ViewModelComponent.class})
|
||||
/* loaded from: classes3.dex */
|
||||
public interface ViewModelModule {
|
||||
@HiltViewModelAssistedMap
|
||||
@Multibinds
|
||||
Map<String, Object> hiltViewModelAssistedMap();
|
||||
|
||||
@HiltViewModelMap
|
||||
@Multibinds
|
||||
Map<String, w0> hiltViewModelMap();
|
||||
}
|
||||
|
||||
public HiltViewModelFactory(Set<String> set, y0 y0Var, final ViewModelComponentBuilder viewModelComponentBuilder) {
|
||||
this.hiltViewModelKeys = set;
|
||||
this.delegateFactory = y0Var;
|
||||
this.hiltViewModelFactory = new y0() { // from class: dagger.hilt.android.internal.lifecycle.HiltViewModelFactory.2
|
||||
private <T extends w0> T createViewModel(ViewModelComponent viewModelComponent, Class<T> cls, c cVar) {
|
||||
Provider<w0> provider = ((ViewModelFactoriesEntryPoint) EntryPoints.get(viewModelComponent, ViewModelFactoriesEntryPoint.class)).getHiltViewModelMap().get(cls.getName());
|
||||
Function1 function1 = (Function1) cVar.a(HiltViewModelFactory.CREATION_CALLBACK_KEY);
|
||||
Object obj = ((ViewModelFactoriesEntryPoint) EntryPoints.get(viewModelComponent, ViewModelFactoriesEntryPoint.class)).getHiltViewModelAssistedMap().get(cls.getName());
|
||||
if (obj == null) {
|
||||
if (function1 != null) {
|
||||
throw new IllegalStateException("Found creation callback but class " + cls.getName() + " does not have an assisted factory specified in @HiltViewModel.");
|
||||
}
|
||||
if (provider != null) {
|
||||
return (T) provider.get();
|
||||
}
|
||||
throw new IllegalStateException("Expected the @HiltViewModel-annotated class " + cls.getName() + " to be available in the multi-binding of @HiltViewModelMap but none was found.");
|
||||
}
|
||||
if (provider != null) {
|
||||
throw new AssertionError("Found the @HiltViewModel-annotated class " + cls.getName() + " in both the multi-bindings of @HiltViewModelMap and @HiltViewModelAssistedMap.");
|
||||
}
|
||||
if (function1 != null) {
|
||||
return (T) function1.invoke(obj);
|
||||
}
|
||||
throw new IllegalStateException("Found @HiltViewModel-annotated class " + cls.getName() + " using @AssistedInject but no creation callback was provided in CreationExtras.");
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.y0
|
||||
public /* bridge */ /* synthetic */ w0 create(Class cls) {
|
||||
super.create(cls);
|
||||
throw null;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.y0
|
||||
public /* bridge */ /* synthetic */ w0 create(KClass kClass, c cVar) {
|
||||
return super.create(kClass, cVar);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.y0
|
||||
public <T extends w0> T create(Class<T> cls, c cVar) {
|
||||
final RetainedLifecycleImpl retainedLifecycleImpl = new RetainedLifecycleImpl();
|
||||
T t2 = (T) createViewModel(viewModelComponentBuilder.savedStateHandle(q0.e(cVar)).viewModelLifecycle(retainedLifecycleImpl).build(), cls, cVar);
|
||||
t2.addCloseable(new Closeable() { // from class: dagger.hilt.android.internal.lifecycle.a
|
||||
@Override // java.io.Closeable, java.lang.AutoCloseable
|
||||
public final void close() {
|
||||
RetainedLifecycleImpl.this.dispatchOnCleared();
|
||||
}
|
||||
});
|
||||
return t2;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static y0 createInternal(Activity activity, f fVar, Bundle bundle, y0 y0Var) {
|
||||
return createInternal(activity, y0Var);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.y0
|
||||
public /* bridge */ /* synthetic */ w0 create(KClass kClass, c cVar) {
|
||||
return super.create(kClass, cVar);
|
||||
}
|
||||
|
||||
public static y0 createInternal(Activity activity, y0 y0Var) {
|
||||
ActivityCreatorEntryPoint activityCreatorEntryPoint = (ActivityCreatorEntryPoint) EntryPoints.get(activity, ActivityCreatorEntryPoint.class);
|
||||
return new HiltViewModelFactory(activityCreatorEntryPoint.getViewModelKeys(), y0Var, activityCreatorEntryPoint.getViewModelComponentBuilder());
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.y0
|
||||
public <T extends w0> T create(Class<T> cls, c cVar) {
|
||||
if (this.hiltViewModelKeys.contains(cls.getName())) {
|
||||
return (T) this.hiltViewModelFactory.create(cls, cVar);
|
||||
}
|
||||
return (T) this.delegateFactory.create(cls, cVar);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.y0
|
||||
public <T extends w0> T create(Class<T> cls) {
|
||||
if (this.hiltViewModelKeys.contains(cls.getName())) {
|
||||
return (T) this.hiltViewModelFactory.create(cls);
|
||||
}
|
||||
return (T) this.delegateFactory.create(cls);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package dagger.hilt.android.internal.lifecycle;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import javax.inject.Qualifier;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER})
|
||||
@Qualifier
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes3.dex */
|
||||
public @interface HiltViewModelMap {
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER})
|
||||
@Qualifier
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes3.dex */
|
||||
public @interface KeySet {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package dagger.hilt.android.internal.lifecycle;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.hilt.InstallIn;
|
||||
import dagger.hilt.android.components.ActivityComponent;
|
||||
import dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories;
|
||||
import dagger.hilt.codegen.OriginatingElement;
|
||||
|
||||
@OriginatingElement(topLevelClass = DefaultViewModelFactories.class)
|
||||
@Module(includes = {DefaultViewModelFactories.ActivityModule.class})
|
||||
@InstallIn({ActivityComponent.class})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class HiltWrapper_DefaultViewModelFactories_ActivityModule {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package dagger.hilt.android.internal.lifecycle;
|
||||
|
||||
import dagger.hilt.EntryPoint;
|
||||
import dagger.hilt.InstallIn;
|
||||
import dagger.hilt.android.components.ActivityComponent;
|
||||
import dagger.hilt.android.internal.lifecycle.HiltViewModelFactory;
|
||||
import dagger.hilt.codegen.OriginatingElement;
|
||||
|
||||
@EntryPoint
|
||||
@OriginatingElement(topLevelClass = HiltViewModelFactory.class)
|
||||
@InstallIn({ActivityComponent.class})
|
||||
/* loaded from: classes3.dex */
|
||||
public interface HiltWrapper_HiltViewModelFactory_ActivityCreatorEntryPoint extends HiltViewModelFactory.ActivityCreatorEntryPoint {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package dagger.hilt.android.internal.lifecycle;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.hilt.InstallIn;
|
||||
import dagger.hilt.android.components.ViewModelComponent;
|
||||
import dagger.hilt.android.internal.lifecycle.HiltViewModelFactory;
|
||||
import dagger.hilt.codegen.OriginatingElement;
|
||||
|
||||
@OriginatingElement(topLevelClass = HiltViewModelFactory.class)
|
||||
@Module(includes = {HiltViewModelFactory.ViewModelModule.class})
|
||||
@InstallIn({ViewModelComponent.class})
|
||||
/* loaded from: classes3.dex */
|
||||
public final class HiltWrapper_HiltViewModelFactory_ViewModelModule {
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package dagger.hilt.android.internal.lifecycle;
|
||||
|
||||
import dagger.hilt.android.ActivityRetainedLifecycle;
|
||||
import dagger.hilt.android.ViewModelLifecycle;
|
||||
import dagger.hilt.android.internal.ThreadUtil;
|
||||
import dagger.hilt.android.lifecycle.RetainedLifecycle;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class RetainedLifecycleImpl implements ActivityRetainedLifecycle, ViewModelLifecycle {
|
||||
private final Set<RetainedLifecycle.OnClearedListener> listeners = new HashSet();
|
||||
private boolean onClearedDispatched = false;
|
||||
|
||||
private void throwIfOnClearedDispatched() {
|
||||
if (this.onClearedDispatched) {
|
||||
throw new IllegalStateException("There was a race between the call to add/remove an OnClearedListener and onCleared(). This can happen when posting to the Main thread from a background thread, which is not supported.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override // dagger.hilt.android.lifecycle.RetainedLifecycle
|
||||
public void addOnClearedListener(RetainedLifecycle.OnClearedListener onClearedListener) {
|
||||
ThreadUtil.ensureMainThread();
|
||||
throwIfOnClearedDispatched();
|
||||
this.listeners.add(onClearedListener);
|
||||
}
|
||||
|
||||
public void dispatchOnCleared() {
|
||||
ThreadUtil.ensureMainThread();
|
||||
this.onClearedDispatched = true;
|
||||
Iterator<RetainedLifecycle.OnClearedListener> it = this.listeners.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().onCleared();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // dagger.hilt.android.lifecycle.RetainedLifecycle
|
||||
public void removeOnClearedListener(RetainedLifecycle.OnClearedListener onClearedListener) {
|
||||
ThreadUtil.ensureMainThread();
|
||||
throwIfOnClearedDispatched();
|
||||
this.listeners.remove(onClearedListener);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user