package androidx.core.app;

import android.app.Activity;
import android.app.Application;
import android.os.Build;
import android.os.Handler;
import java.lang.reflect.Method;
import org.drive_hunter.R;
import xyz.stream.view.UiUtils;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class a implements Runnable {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f1522a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Activity f1523b;

    public /* synthetic */ a(Activity activity, int i10) {
        this.f1522a = i10;
        this.f1523b = activity;
    }

    @Override // java.lang.Runnable
    public final void run() {
        Object obj;
        int i10 = this.f1522a;
        int i11 = 0;
        Activity activity = this.f1523b;
        switch (i10) {
            case 0:
                if (activity.isFinishing()) {
                    return;
                }
                int i12 = Build.VERSION.SDK_INT;
                if (i12 >= 28) {
                    Class cls = j.f1583a;
                    activity.recreate();
                    return;
                }
                Class cls2 = j.f1583a;
                boolean z10 = i12 == 26 || i12 == 27;
                Method method = j.f1588f;
                if ((!z10 || method != null) && (j.f1587e != null || j.f1586d != null)) {
                    try {
                        Object obj2 = j.f1585c.get(activity);
                        if (obj2 != null && (obj = j.f1584b.get(activity)) != null) {
                            Application application = activity.getApplication();
                            i iVar = new i(activity);
                            application.registerActivityLifecycleCallbacks(iVar);
                            Handler handler = j.f1589g;
                            handler.post(new l.l(iVar, obj2, 3, 0));
                            try {
                                if (i12 == 26 || i12 == 27) {
                                    Boolean bool = Boolean.FALSE;
                                    method.invoke(obj, obj2, null, null, 0, bool, null, null, bool, bool);
                                } else {
                                    activity.recreate();
                                }
                                handler.post(new l.l(application, iVar, 4, 0));
                                return;
                            } finally {
                                handler.post(new l.l(application, iVar, 4, 0));
                            }
                        }
                    } catch (Throwable unused) {
                    }
                }
                activity.recreate();
                return;
            case 1:
                activity.finish();
                return;
            case 2:
                UiUtils.dismissProgressDialog();
                UiUtils.showTip(activity, activity.getString(R.string.submit_success));
                return;
            default:
                uf.r.d(activity, activity, activity.getString(R.string.region_error) + "\n" + xyz.stream.utils.e.d().b(), activity.getString(R.string.exit), null, false, new xyz.netfly.viewmodel.a(i11));
                return;
        }
    }
}
