package om;

import android.util.Log;
import androidx.fragment.app.f;
import androidx.fragment.app.k;
import nm.b;
import nm.e;
import pm.g;

/* loaded from: classes3.dex */
public abstract class a {
    /* JADX WARN: Multi-variable type inference failed */
    private static e a(f fVar) {
        f fVar2 = fVar;
        do {
            fVar2 = fVar2.getParentFragment();
            if (fVar2 == 0) {
                k activity = fVar.getActivity();
                if (activity instanceof e) {
                    return (e) activity;
                }
                if (activity.getApplication() instanceof e) {
                    return (e) activity.getApplication();
                }
                throw new IllegalArgumentException(String.format("No injector was found for %s", fVar.getClass().getCanonicalName()));
            }
        } while (!(fVar2 instanceof e));
        return (e) fVar2;
    }

    public static void b(f fVar) {
        g.c(fVar, "fragment");
        e a10 = a(fVar);
        if (Log.isLoggable("dagger.android.support", 3)) {
            Log.d("dagger.android.support", String.format("An injector for %s was found in %s", fVar.getClass().getCanonicalName(), a10.getClass().getCanonicalName()));
        }
        c(fVar, a10);
    }

    private static void c(Object obj, e eVar) {
        b a10 = eVar.a();
        g.d(a10, "%s.androidInjector() returned null", eVar.getClass());
        a10.a(obj);
    }
}
