package io.flutter.plugins.urllauncher;

import android.content.Intent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.browser.customtabs.l;
import ed.i;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Map;

/* JADX INFO: loaded from: classes.dex */
public interface d {
    static void setUp(@NonNull i iVar, @Nullable d dVar) {
        setUp(iVar, "", dVar);
    }

    static void setUp(@NonNull i iVar, @NonNull String str, @Nullable final d dVar) {
        String strConcat = str.isEmpty() ? "" : ".".concat(str);
        String strI = defpackage.e.i("dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.canLaunchUrl", strConcat);
        b bVar = b.f28324d;
        ed.e eVar = new ed.e(iVar, strI, bVar, null);
        if (dVar != null) {
            final int i10 = 0;
            eVar.setMessageHandler(new ed.c(dVar) { // from class: io.flutter.plugins.urllauncher.c

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

                {
                    this.f28326b = dVar;
                }

                @Override // ed.c
                public final void onMessage(Object obj, ed.d dVar2) {
                    int i11 = i10;
                    boolean z10 = true;
                    d dVar3 = this.f28326b;
                    switch (i11) {
                        case 0:
                            ArrayList arrayList = new ArrayList();
                            try {
                                arrayList.add(0, ((f) dVar3).a((String) ((ArrayList) obj).get(0)));
                            } catch (Throwable th) {
                                arrayList = hb.a.I0(th);
                            }
                            dVar2.reply(arrayList);
                            break;
                        case 1:
                            ArrayList arrayList2 = new ArrayList();
                            ArrayList arrayList3 = (ArrayList) obj;
                            try {
                                arrayList2.add(0, ((f) dVar3).c((String) arrayList3.get(0), (Map) arrayList3.get(1)));
                            } catch (Throwable th2) {
                                arrayList2 = hb.a.I0(th2);
                            }
                            dVar2.reply(arrayList2);
                            break;
                        case 2:
                            ArrayList arrayList4 = new ArrayList();
                            ArrayList arrayList5 = (ArrayList) obj;
                            try {
                                arrayList4.add(0, ((f) dVar3).d((String) arrayList5.get(0), (Boolean) arrayList5.get(1), (e) arrayList5.get(2), (a) arrayList5.get(3)));
                            } catch (Throwable th3) {
                                arrayList4 = hb.a.I0(th3);
                            }
                            dVar2.reply(arrayList4);
                            break;
                        case 3:
                            ArrayList arrayList6 = new ArrayList();
                            try {
                                if (l.getPackageName(((f) dVar3).f28330a, Collections.emptyList()) == null) {
                                    z10 = false;
                                }
                                arrayList6.add(0, Boolean.valueOf(z10));
                            } catch (Throwable th4) {
                                arrayList6 = hb.a.I0(th4);
                            }
                            dVar2.reply(arrayList6);
                            break;
                        default:
                            ArrayList arrayList7 = new ArrayList();
                            try {
                                f fVar = (f) dVar3;
                                fVar.getClass();
                                fVar.f28330a.sendBroadcast(new Intent("close action"));
                                arrayList7.add(0, null);
                            } catch (Throwable th5) {
                                arrayList7 = hb.a.I0(th5);
                            }
                            dVar2.reply(arrayList7);
                            break;
                    }
                }
            });
        } else {
            eVar.setMessageHandler(null);
        }
        ed.e eVar2 = new ed.e(iVar, defpackage.e.i("dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.launchUrl", strConcat), bVar, null);
        if (dVar != null) {
            final int i11 = 1;
            eVar2.setMessageHandler(new ed.c(dVar) { // from class: io.flutter.plugins.urllauncher.c

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

                {
                    this.f28326b = dVar;
                }

                @Override // ed.c
                public final void onMessage(Object obj, ed.d dVar2) {
                    int i112 = i11;
                    boolean z10 = true;
                    d dVar3 = this.f28326b;
                    switch (i112) {
                        case 0:
                            ArrayList arrayList = new ArrayList();
                            try {
                                arrayList.add(0, ((f) dVar3).a((String) ((ArrayList) obj).get(0)));
                            } catch (Throwable th) {
                                arrayList = hb.a.I0(th);
                            }
                            dVar2.reply(arrayList);
                            break;
                        case 1:
                            ArrayList arrayList2 = new ArrayList();
                            ArrayList arrayList3 = (ArrayList) obj;
                            try {
                                arrayList2.add(0, ((f) dVar3).c((String) arrayList3.get(0), (Map) arrayList3.get(1)));
                            } catch (Throwable th2) {
                                arrayList2 = hb.a.I0(th2);
                            }
                            dVar2.reply(arrayList2);
                            break;
                        case 2:
                            ArrayList arrayList4 = new ArrayList();
                            ArrayList arrayList5 = (ArrayList) obj;
                            try {
                                arrayList4.add(0, ((f) dVar3).d((String) arrayList5.get(0), (Boolean) arrayList5.get(1), (e) arrayList5.get(2), (a) arrayList5.get(3)));
                            } catch (Throwable th3) {
                                arrayList4 = hb.a.I0(th3);
                            }
                            dVar2.reply(arrayList4);
                            break;
                        case 3:
                            ArrayList arrayList6 = new ArrayList();
                            try {
                                if (l.getPackageName(((f) dVar3).f28330a, Collections.emptyList()) == null) {
                                    z10 = false;
                                }
                                arrayList6.add(0, Boolean.valueOf(z10));
                            } catch (Throwable th4) {
                                arrayList6 = hb.a.I0(th4);
                            }
                            dVar2.reply(arrayList6);
                            break;
                        default:
                            ArrayList arrayList7 = new ArrayList();
                            try {
                                f fVar = (f) dVar3;
                                fVar.getClass();
                                fVar.f28330a.sendBroadcast(new Intent("close action"));
                                arrayList7.add(0, null);
                            } catch (Throwable th5) {
                                arrayList7 = hb.a.I0(th5);
                            }
                            dVar2.reply(arrayList7);
                            break;
                    }
                }
            });
        } else {
            eVar2.setMessageHandler(null);
        }
        ed.e eVar3 = new ed.e(iVar, defpackage.e.i("dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.openUrlInApp", strConcat), bVar, null);
        if (dVar != null) {
            final int i12 = 2;
            eVar3.setMessageHandler(new ed.c(dVar) { // from class: io.flutter.plugins.urllauncher.c

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

                {
                    this.f28326b = dVar;
                }

                @Override // ed.c
                public final void onMessage(Object obj, ed.d dVar2) {
                    int i112 = i12;
                    boolean z10 = true;
                    d dVar3 = this.f28326b;
                    switch (i112) {
                        case 0:
                            ArrayList arrayList = new ArrayList();
                            try {
                                arrayList.add(0, ((f) dVar3).a((String) ((ArrayList) obj).get(0)));
                            } catch (Throwable th) {
                                arrayList = hb.a.I0(th);
                            }
                            dVar2.reply(arrayList);
                            break;
                        case 1:
                            ArrayList arrayList2 = new ArrayList();
                            ArrayList arrayList3 = (ArrayList) obj;
                            try {
                                arrayList2.add(0, ((f) dVar3).c((String) arrayList3.get(0), (Map) arrayList3.get(1)));
                            } catch (Throwable th2) {
                                arrayList2 = hb.a.I0(th2);
                            }
                            dVar2.reply(arrayList2);
                            break;
                        case 2:
                            ArrayList arrayList4 = new ArrayList();
                            ArrayList arrayList5 = (ArrayList) obj;
                            try {
                                arrayList4.add(0, ((f) dVar3).d((String) arrayList5.get(0), (Boolean) arrayList5.get(1), (e) arrayList5.get(2), (a) arrayList5.get(3)));
                            } catch (Throwable th3) {
                                arrayList4 = hb.a.I0(th3);
                            }
                            dVar2.reply(arrayList4);
                            break;
                        case 3:
                            ArrayList arrayList6 = new ArrayList();
                            try {
                                if (l.getPackageName(((f) dVar3).f28330a, Collections.emptyList()) == null) {
                                    z10 = false;
                                }
                                arrayList6.add(0, Boolean.valueOf(z10));
                            } catch (Throwable th4) {
                                arrayList6 = hb.a.I0(th4);
                            }
                            dVar2.reply(arrayList6);
                            break;
                        default:
                            ArrayList arrayList7 = new ArrayList();
                            try {
                                f fVar = (f) dVar3;
                                fVar.getClass();
                                fVar.f28330a.sendBroadcast(new Intent("close action"));
                                arrayList7.add(0, null);
                            } catch (Throwable th5) {
                                arrayList7 = hb.a.I0(th5);
                            }
                            dVar2.reply(arrayList7);
                            break;
                    }
                }
            });
        } else {
            eVar3.setMessageHandler(null);
        }
        ed.e eVar4 = new ed.e(iVar, defpackage.e.i("dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.supportsCustomTabs", strConcat), bVar, null);
        if (dVar != null) {
            final int i13 = 3;
            eVar4.setMessageHandler(new ed.c(dVar) { // from class: io.flutter.plugins.urllauncher.c

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

                {
                    this.f28326b = dVar;
                }

                @Override // ed.c
                public final void onMessage(Object obj, ed.d dVar2) {
                    int i112 = i13;
                    boolean z10 = true;
                    d dVar3 = this.f28326b;
                    switch (i112) {
                        case 0:
                            ArrayList arrayList = new ArrayList();
                            try {
                                arrayList.add(0, ((f) dVar3).a((String) ((ArrayList) obj).get(0)));
                            } catch (Throwable th) {
                                arrayList = hb.a.I0(th);
                            }
                            dVar2.reply(arrayList);
                            break;
                        case 1:
                            ArrayList arrayList2 = new ArrayList();
                            ArrayList arrayList3 = (ArrayList) obj;
                            try {
                                arrayList2.add(0, ((f) dVar3).c((String) arrayList3.get(0), (Map) arrayList3.get(1)));
                            } catch (Throwable th2) {
                                arrayList2 = hb.a.I0(th2);
                            }
                            dVar2.reply(arrayList2);
                            break;
                        case 2:
                            ArrayList arrayList4 = new ArrayList();
                            ArrayList arrayList5 = (ArrayList) obj;
                            try {
                                arrayList4.add(0, ((f) dVar3).d((String) arrayList5.get(0), (Boolean) arrayList5.get(1), (e) arrayList5.get(2), (a) arrayList5.get(3)));
                            } catch (Throwable th3) {
                                arrayList4 = hb.a.I0(th3);
                            }
                            dVar2.reply(arrayList4);
                            break;
                        case 3:
                            ArrayList arrayList6 = new ArrayList();
                            try {
                                if (l.getPackageName(((f) dVar3).f28330a, Collections.emptyList()) == null) {
                                    z10 = false;
                                }
                                arrayList6.add(0, Boolean.valueOf(z10));
                            } catch (Throwable th4) {
                                arrayList6 = hb.a.I0(th4);
                            }
                            dVar2.reply(arrayList6);
                            break;
                        default:
                            ArrayList arrayList7 = new ArrayList();
                            try {
                                f fVar = (f) dVar3;
                                fVar.getClass();
                                fVar.f28330a.sendBroadcast(new Intent("close action"));
                                arrayList7.add(0, null);
                            } catch (Throwable th5) {
                                arrayList7 = hb.a.I0(th5);
                            }
                            dVar2.reply(arrayList7);
                            break;
                    }
                }
            });
        } else {
            eVar4.setMessageHandler(null);
        }
        ed.e eVar5 = new ed.e(iVar, defpackage.e.i("dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.closeWebView", strConcat), bVar, null);
        if (dVar == null) {
            eVar5.setMessageHandler(null);
        } else {
            final int i14 = 4;
            eVar5.setMessageHandler(new ed.c(dVar) { // from class: io.flutter.plugins.urllauncher.c

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

                {
                    this.f28326b = dVar;
                }

                @Override // ed.c
                public final void onMessage(Object obj, ed.d dVar2) {
                    int i112 = i14;
                    boolean z10 = true;
                    d dVar3 = this.f28326b;
                    switch (i112) {
                        case 0:
                            ArrayList arrayList = new ArrayList();
                            try {
                                arrayList.add(0, ((f) dVar3).a((String) ((ArrayList) obj).get(0)));
                            } catch (Throwable th) {
                                arrayList = hb.a.I0(th);
                            }
                            dVar2.reply(arrayList);
                            break;
                        case 1:
                            ArrayList arrayList2 = new ArrayList();
                            ArrayList arrayList3 = (ArrayList) obj;
                            try {
                                arrayList2.add(0, ((f) dVar3).c((String) arrayList3.get(0), (Map) arrayList3.get(1)));
                            } catch (Throwable th2) {
                                arrayList2 = hb.a.I0(th2);
                            }
                            dVar2.reply(arrayList2);
                            break;
                        case 2:
                            ArrayList arrayList4 = new ArrayList();
                            ArrayList arrayList5 = (ArrayList) obj;
                            try {
                                arrayList4.add(0, ((f) dVar3).d((String) arrayList5.get(0), (Boolean) arrayList5.get(1), (e) arrayList5.get(2), (a) arrayList5.get(3)));
                            } catch (Throwable th3) {
                                arrayList4 = hb.a.I0(th3);
                            }
                            dVar2.reply(arrayList4);
                            break;
                        case 3:
                            ArrayList arrayList6 = new ArrayList();
                            try {
                                if (l.getPackageName(((f) dVar3).f28330a, Collections.emptyList()) == null) {
                                    z10 = false;
                                }
                                arrayList6.add(0, Boolean.valueOf(z10));
                            } catch (Throwable th4) {
                                arrayList6 = hb.a.I0(th4);
                            }
                            dVar2.reply(arrayList6);
                            break;
                        default:
                            ArrayList arrayList7 = new ArrayList();
                            try {
                                f fVar = (f) dVar3;
                                fVar.getClass();
                                fVar.f28330a.sendBroadcast(new Intent("close action"));
                                arrayList7.add(0, null);
                            } catch (Throwable th5) {
                                arrayList7 = hb.a.I0(th5);
                            }
                            dVar2.reply(arrayList7);
                            break;
                    }
                }
            });
        }
    }
}
