package androidx.activity;

import android.app.Activity;
import android.content.Intent;
import android.content.IntentSender;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.View;
import android.widget.SeekBar;
import androidx.media3.common.util.ListenerSet;
import androidx.media3.exoplayer.drm.DrmSessionEventListener;
import com.google.android.gms.internal.ads.cv1;
import ie.l5;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.Random;
import java.util.TimeZone;
import java.util.Timer;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.TimeUnit;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.Request;
import okhttp3.RequestBody;
import xyz.netfly.mobile.player.VideoDetailActivity;
import xyz.netfly.ui.live.epg.EPGView;
import xyz.netfly.ui.log.LogActivity;
import xyz.netfly.ui.main.home.adult.AdultLibraryActivity;
import xyz.netfly.ui.vod_library.VodLibraryActivity;
import xyz.netfly.ui.vod_player.PlayerActivity;
import xyz.stream.api.entity.LiveCategoryEntity;
import xyz.stream.api.entity.LiveChannelEntity;
import xyz.stream.api.entity.SeriesEntity;
import xyz.stream.utils.k0;
import xyz.stream.view.RecyclerWithPositionView;
import xyz.stream.view.UiUtils;

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

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

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

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

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

    public /* synthetic */ n(Object obj, int i10, Object obj2, int i11) {
        this.f491a = i11;
        this.f492b = obj;
        this.f493c = i10;
        this.f494d = obj2;
    }

    /* JADX WARN: Removed duplicated region for block: B:218:0x0621  */
    /* JADX WARN: Removed duplicated region for block: B:219:0x0624  */
    @Override // java.lang.Runnable
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void run() {
        LiveChannelEntity liveChannelEntity;
        FileOutputStream fileOutputStream;
        ZipOutputStream zipOutputStream;
        FileInputStream fileInputStream;
        byte[] bArr;
        int i10 = 1;
        int i11 = 0;
        switch (this.f491a) {
            case 0:
                o oVar = (o) this.f492b;
                Object obj = ((xyz.stream.utils.a0) this.f494d).f36098a;
                String str = (String) oVar.f519a.get(Integer.valueOf(this.f493c));
                if (str == null) {
                    return;
                }
                androidx.activity.result.f fVar = (androidx.activity.result.f) oVar.f523e.get(str);
                if ((fVar != null ? fVar.f511a : null) == null) {
                    oVar.f525g.remove(str);
                    oVar.f524f.put(str, obj);
                    return;
                }
                androidx.activity.result.c cVar = fVar.f511a;
                nb.g.g(cVar, "null cannot be cast to non-null type androidx.activity.result.ActivityResultCallback<O of androidx.activity.result.ActivityResultRegistry.dispatchResult>");
                if (oVar.f522d.remove(str)) {
                    cVar.c(obj);
                    return;
                }
                return;
            case 1:
                ((o) this.f492b).a(this.f493c, 0, new Intent().setAction("androidx.activity.result.contract.action.INTENT_SENDER_REQUEST").putExtra("androidx.activity.result.contract.extra.SEND_INTENT_EXCEPTION", (IntentSender.SendIntentException) this.f494d));
                return;
            case 2:
                androidx.browser.customtabs.c0 c0Var = (androidx.browser.customtabs.c0) this.f492b;
                Bundle bundle = (Bundle) this.f494d;
                int i12 = androidx.browser.customtabs.x.f892c;
                c0Var.onGreatestScrollPercentageIncreased(this.f493c, bundle);
                return;
            case 3:
                ListenerSet.lambda$queueEvent$0((CopyOnWriteArraySet) this.f492b, this.f493c, (ListenerSet.Event) this.f494d);
                return;
            case 4:
                ((DrmSessionEventListener.EventDispatcher) this.f492b).lambda$drmSessionAcquired$0((DrmSessionEventListener) this.f494d, this.f493c);
                return;
            case 5:
                ((d3.a) this.f492b).f24942c.onResultReceived(this.f493c, this.f494d);
                return;
            case 6:
                com.google.common.util.concurrent.m mVar = (com.google.common.util.concurrent.m) this.f492b;
                com.google.common.util.concurrent.w wVar = (com.google.common.util.concurrent.w) this.f494d;
                cv1 cv1Var = com.google.common.util.concurrent.m.Q;
                mVar.s(this.f493c, wVar);
                return;
            case 7:
                xyz.netfly.mobile.player.t tVar = (xyz.netfly.mobile.player.t) this.f492b;
                xyz.netfly.mobile.player.y yVar = (xyz.netfly.mobile.player.y) this.f494d;
                String str2 = tVar.D;
                int i13 = this.f493c;
                VideoDetailActivity videoDetailActivity = yVar.f35043a;
                videoDetailActivity.f34924f = i13;
                videoDetailActivity.f34922e = str2;
                xyz.netfly.player.q qVar = new xyz.netfly.player.q(videoDetailActivity.f34930i);
                videoDetailActivity.f34920d = qVar;
                qVar.f35271e = new WeakReference(videoDetailActivity.f34915a0);
                videoDetailActivity.b0(true);
                yVar.b();
                return;
            case 8:
                xyz.netfly.mobile.player.t tVar2 = (xyz.netfly.mobile.player.t) this.f492b;
                SeekBar seekBar = (SeekBar) this.f494d;
                int i14 = this.f493c;
                tVar2.f35022p = i14;
                seekBar.setProgress(i14);
                tVar2.f35008b.setSpeed(Float.parseFloat(((String) tVar2.Y.get(i14)).replace("x", "").replace("\nNormal", "")));
                return;
            case 9:
                xyz.netfly.mobile.player.r rVar = (xyz.netfly.mobile.player.r) this.f492b;
                ke.p pVar = (ke.p) this.f494d;
                xyz.netfly.mobile.player.t tVar3 = rVar.f35005b;
                int i15 = this.f493c;
                tVar3.f35022p = i15;
                pVar.f29147b = i15;
                pVar.notifyDataSetChanged();
                float f10 = Float.parseFloat(((String) tVar3.Y.get(i15)).replace("x", "").replace("\nNormal", ""));
                xyz.netfly.api.c.b().k(f10);
                tVar3.f35008b.setSpeed(f10);
                return;
            case 10:
                VideoDetailActivity videoDetailActivity2 = (VideoDetailActivity) this.f492b;
                String str3 = (String) this.f494d;
                WeakReference weakReference = VideoDetailActivity.f34914n0;
                int i16 = this.f493c;
                if (i16 >= 100) {
                    ((ie.y) videoDetailActivity2.binding).f27706g.getSubtitleProgressView().setVisibility(8);
                    return;
                }
                ((ie.y) videoDetailActivity2.binding).f27706g.getSubtitleProgressView().setVisibility(0);
                ((ie.y) videoDetailActivity2.binding).f27706g.getSubtitleProgressView().setText(str3.replace("(AI)", "") + " " + i16 + "%");
                return;
            case 11:
                VideoDetailActivity videoDetailActivity3 = (VideoDetailActivity) this.f492b;
                List list = (List) this.f494d;
                int i17 = this.f493c;
                xyz.netfly.mobile.player.t tVar4 = videoDetailActivity3.f34926g;
                tVar4.p();
                videoDetailActivity3.a0();
                videoDetailActivity3.Y();
                videoDetailActivity3.f34920d.b();
                videoDetailActivity3.f34920d.c();
                tVar4.f35031y = (SeriesEntity) list.get(tVar4.C);
                tVar4.f35012f.getTitle().setText("S" + tVar4.f35031y.getSeasonNumber() + ".E" + tVar4.f35031y.getEpisodeNumber() + " · " + ((ie.y) videoDetailActivity3.binding).f27702d0.getText().toString());
                tVar4.f35032z = tVar4.f35031y.getVideoId();
                tVar4.v(((SeriesEntity) list.get(tVar4.C)).getSeasonNumber());
                String wideBackdropPath = tVar4.B;
                if (wideBackdropPath != null && !wideBackdropPath.isEmpty() && ((wideBackdropPath = tVar4.f35030x.getWideBackdropPath()) == null || wideBackdropPath.isEmpty())) {
                    wideBackdropPath = tVar4.f35030x.getBackdropPath();
                }
                tVar4.f35007a.runOnUiThread(new xyz.netfly.mobile.player.h(tVar4, wideBackdropPath, 1));
                videoDetailActivity3.f34932j.e();
                xyz.netfly.player.n nVarH = xyz.netfly.player.n.h();
                videoDetailActivity3.f34932j = nVarH;
                nVarH.n(videoDetailActivity3, tVar4.M, i17, true, videoDetailActivity3.S());
                xyz.netfly.player.n nVar = videoDetailActivity3.f34932j;
                ie.y yVar2 = (ie.y) videoDetailActivity3.binding;
                nVar.v(videoDetailActivity3, yVar2.I, yVar2.W);
                xyz.netfly.player.n nVar2 = videoDetailActivity3.f34932j;
                xyz.netfly.mobile.player.c0 c0Var2 = videoDetailActivity3.f34925f0;
                nVar2.getClass();
                nVar2.f35223i = new WeakReference(c0Var2);
                tVar4.f35013g = videoDetailActivity3.f34932j;
                videoDetailActivity3.b0(true);
                return;
            case 12:
                pe.g gVar = (pe.g) this.f492b;
                gVar.G0.f27211b.setText((String) this.f494d);
                gVar.G0.f27212c.setText(String.valueOf(this.f493c));
                if (gVar.G0.f27210a.getVisibility() != 0) {
                    View view = gVar.M0;
                    gVar.N0 = view;
                    kotlinx.coroutines.y.N(view);
                    kotlinx.coroutines.y.V(gVar.G0.f27210a, null);
                    gVar.M0 = gVar.G0.f27210a;
                    return;
                }
                return;
            case 13:
                EPGView ePGView = (EPGView) this.f492b;
                Integer id2 = (Integer) this.f494d;
                ArrayList arrayList = ePGView.S;
                if (id2 == null) {
                    id2 = arrayList.isEmpty() ? null : ((LiveChannelEntity) arrayList.get(0)).getId();
                }
                if (kotlinx.coroutines.flow.h.G(ePGView.f35324j0)) {
                    int i18 = this.f493c;
                    if (i18 < 0 || i18 >= arrayList.size() || (id2 != null && ((liveChannelEntity = (LiveChannelEntity) arrayList.get(i18)) == null || liveChannelEntity.getId() == null || !liveChannelEntity.getId().equals(id2)))) {
                        if (id2 != null) {
                            i18 = 0;
                            while (i18 < arrayList.size()) {
                                LiveChannelEntity liveChannelEntity2 = (LiveChannelEntity) arrayList.get(i18);
                                if (liveChannelEntity2 == null || liveChannelEntity2.getId() == null || !liveChannelEntity2.getId().equals(id2)) {
                                    i18++;
                                }
                            }
                            i18 = !arrayList.isEmpty() ? -1 : 0;
                        } else {
                            i18 = !arrayList.isEmpty() ? -1 : 0;
                        }
                    }
                    if (i18 < 0) {
                        ePGView.f35318d0 = null;
                        return;
                    }
                    LiveChannelEntity liveChannelEntity3 = (LiveChannelEntity) arrayList.get(i18);
                    ePGView.f35318d0 = liveChannelEntity3;
                    ePGView.f35331q0 = i18;
                    ePGView.f35315a0.f(liveChannelEntity3.getId().intValue(), i18);
                    ePGView.i(ePGView.f35331q0);
                    int i19 = ePGView.f35331q0;
                    if (i19 >= 0 && i19 < arrayList.size()) {
                        xyz.netfly.ui.live.epg.c cVar2 = new xyz.netfly.ui.live.epg.c(ePGView, i19, 1);
                        l5 l5Var = ePGView.R;
                        l5Var.f27183b.post(cVar2);
                        RecyclerWithPositionView recyclerWithPositionView = l5Var.f27183b;
                        recyclerWithPositionView.postDelayed(cVar2, 80L);
                        recyclerWithPositionView.postDelayed(new xyz.netfly.ui.live.epg.a(ePGView, 4), 160L);
                    }
                    ePGView.n();
                    return;
                }
                return;
            case 14:
                xyz.netfly.ui.live.epg.z zVar = (xyz.netfly.ui.live.epg.z) this.f492b;
                com.google.gson.internal.a aVar = (com.google.gson.internal.a) this.f494d;
                int i20 = this.f493c;
                if (!zVar.j(i20)) {
                    return;
                }
                LiveChannelEntity liveChannelEntity4 = zVar.f35416a;
                int iC = zVar.c(liveChannelEntity4 != null ? liveChannelEntity4.getId() : null);
                zVar.f35419d.f27803d.setVisibility(8);
                EPGView ePGView2 = zVar.f35419d.f27802c;
                Activity activity = zVar.f35418c;
                ArrayList arrayList2 = zVar.f35417b;
                ArrayList arrayList3 = zVar.f35424i;
                LiveChannelEntity liveChannelEntity5 = zVar.f35416a;
                Integer id3 = liveChannelEntity5 != null ? liveChannelEntity5.getId() : null;
                String strY = zVar.f35435t;
                ePGView2.f();
                ePGView2.f35318d0 = null;
                ePGView2.f35331q0 = 0;
                ePGView2.f35332r0 = -1;
                ePGView2.f35333s0 = -1;
                ePGView2.f35317c0 = 0;
                if (strY == null || strY.isEmpty()) {
                    strY = kotlinx.coroutines.flow.h.y("yyyy-MM-dd");
                }
                ePGView2.f35324j0 = strY;
                ArrayList arrayList4 = ePGView2.T;
                arrayList4.clear();
                String str4 = ePGView2.f35324j0;
                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault());
                Calendar calendarD = kotlinx.coroutines.y.D(str4);
                Calendar calendarU = kotlinx.coroutines.y.u(str4);
                calendarU.set(11, 23);
                calendarU.set(12, 59);
                calendarU.set(13, 0);
                calendarU.set(14, 0);
                ArrayList arrayList5 = new ArrayList();
                while (true) {
                    if (!calendarD.before(calendarU) && !calendarD.equals(calendarU)) {
                        arrayList4.addAll(arrayList5);
                        ePGView2.f35319e0 = aVar;
                        se.f fVar2 = new se.f(arrayList4, activity);
                        l5 l5Var2 = ePGView2.R;
                        l5Var2.f27185d.setAdapter(fVar2);
                        ArrayList arrayList6 = ePGView2.S;
                        arrayList6.clear();
                        arrayList6.addAll(arrayList2);
                        se.b bVar = new se.b(arrayList6, activity);
                        ePGView2.f35315a0 = bVar;
                        l5Var2.f27183b.setAdapter(bVar, true);
                        ArrayList arrayList7 = ePGView2.U;
                        arrayList7.clear();
                        arrayList7.addAll(arrayList3);
                        se.e eVar = new se.e(arrayList7, activity, arrayList4, ePGView2.f35324j0, ePGView2.V);
                        ePGView2.f35316b0 = eVar;
                        l5Var2.f27184c.setAdapter(eVar, true);
                        ePGView2.post(new n(ePGView2, id3, iC, 13));
                        ePGView2.f35315a0.setOnItemListener(new pe.n(ePGView2, 1));
                        se.e eVar2 = ePGView2.f35316b0;
                        eVar2.f32760g = new xyz.netfly.ui.live.epg.b(ePGView2);
                        eVar2.f32759f = new xyz.netfly.ui.live.epg.b(ePGView2);
                        eVar2.f32761h = new xyz.netfly.ui.live.epg.b(ePGView2);
                        zVar.f35419d.f27802c.setOnTopFocusRequestListener(new xyz.netfly.ui.live.epg.s(zVar, 1));
                        zVar.f35419d.f27802c.setOnFocusedChannelChangeListener(new xyz.netfly.ui.live.epg.u(zVar, i20));
                        zVar.f35419d.f27802c.setOnVisibleChannelRangeChangeListener(new xyz.netfly.ui.live.epg.u(zVar, i20));
                        zVar.f35419d.f27802c.setOnDateNavigateRequestListener(new com.google.gson.internal.a(zVar, 17));
                        int i21 = zVar.A;
                        zVar.A = -1;
                        if (i21 < 0 || i21 >= zVar.f35417b.size()) {
                            zVar.f35419d.f27804e.postDelayed(new xyz.netfly.ui.live.epg.s(zVar, 0), 120L);
                        } else {
                            zVar.f35419d.f27802c.postDelayed(new xyz.netfly.ui.live.epg.t(zVar, i21, 1), 120L);
                        }
                        Timer timer = zVar.f35420e;
                        if (timer != null) {
                            timer.cancel();
                        }
                        Timer timer2 = new Timer();
                        zVar.f35420e = timer2;
                        timer2.schedule(new xyz.netfly.mobile.plugin.l(zVar, 1), 0L, 60000L);
                        if (!xyz.stream.utils.e.d().f36119h) {
                            zVar.o(iC, i20);
                            return;
                        }
                        EPGView ePGView3 = zVar.f35419d.f27802c;
                        Objects.requireNonNull(ePGView3);
                        ePGView3.postDelayed(new xyz.netfly.ui.live.epg.a(ePGView3, 5), 220L);
                        return;
                    }
                    arrayList5.add(simpleDateFormat.format(calendarD.getTime()));
                    calendarD.add(12, 30);
                    arrayList4 = arrayList4;
                }
                break;
            case 15:
                AdultLibraryActivity adultLibraryActivity = (AdultLibraryActivity) this.f492b;
                int i22 = this.f493c;
                List list2 = (List) this.f494d;
                int i23 = AdultLibraryActivity.f35601h;
                adultLibraryActivity.getClass();
                try {
                    adultLibraryActivity.f35604d.notifyItemRangeInserted(i22, list2.size());
                    return;
                } catch (Exception unused) {
                    adultLibraryActivity.f35604d.notifyDataSetChanged();
                    return;
                }
            case 16:
                VodLibraryActivity vodLibraryActivity = (VodLibraryActivity) this.f492b;
                int i24 = this.f493c;
                List list3 = (List) this.f494d;
                int i25 = VodLibraryActivity.f35674l0;
                vodLibraryActivity.getClass();
                try {
                    vodLibraryActivity.f35687g0.notifyItemRangeInserted(i24, list3.size());
                    return;
                } catch (Exception unused2) {
                    vodLibraryActivity.f35687g0.notifyDataSetChanged();
                    return;
                }
            case 17:
                PlayerActivity playerActivity = (PlayerActivity) this.f492b;
                String str5 = (String) this.f494d;
                int i26 = PlayerActivity.f35698q0;
                int i27 = this.f493c;
                if (i27 >= 100) {
                    ((ie.s) playerActivity.binding).f27439d.getSubtitleProgressView().setVisibility(8);
                    return;
                }
                ((ie.s) playerActivity.binding).f27439d.getSubtitleProgressView().setVisibility(0);
                ((ie.s) playerActivity.binding).f27439d.getSubtitleProgressView().setText(str5.replace("(AI)", "") + " " + i27 + "%");
                return;
            case 18:
                xyz.stream.api.d dVar = (xyz.stream.api.d) this.f492b;
                List list4 = (List) this.f494d;
                dVar.getClass();
                xyz.stream.api.o oVarF = xyz.stream.api.o.f();
                xyz.stream.api.b bVar2 = new xyz.stream.api.b(dVar, this.f493c, i11);
                oVarF.getClass();
                int i28 = new Random(1000L).nextInt() % 2 != 0 ? 3 : 2;
                String str6 = "video/random";
                HashMap map = new HashMap();
                if (list4 == null || list4.isEmpty()) {
                    map.put("source_type", String.valueOf(i28));
                } else {
                    map.put("certificate", kotlinx.coroutines.y.L(",", list4));
                }
                xyz.stream.api.o.g("video/random", oVarF.n(), map, new xyz.stream.api.j(oVarF, str6, map, bVar2, 16));
                return;
            case 19:
                ((xyz.stream.api.u) this.f492b).c(this.f493c, (xyz.stream.api.t) this.f494d);
                return;
            case 20:
                xyz.stream.api.s sVar = (xyz.stream.api.s) this.f492b;
                xyz.stream.api.t tVar5 = (xyz.stream.api.t) this.f494d;
                xyz.stream.api.u uVar = sVar.f35936c;
                ArrayList arrayList8 = uVar.f35938a;
                int i29 = this.f493c;
                if (arrayList8.contains(Integer.valueOf(i29))) {
                    uVar.c(i29, tVar5);
                    return;
                }
                return;
            case 21:
                xyz.stream.api.live.g gVar2 = (xyz.stream.api.live.g) this.f492b;
                xyz.stream.api.live.f fVar3 = (xyz.stream.api.live.f) this.f494d;
                int i30 = this.f493c;
                gVar2.getClass();
                try {
                    ArrayList arrayListC = xyz.stream.api.live.g.c(gVar2.f35898a);
                    if (arrayListC.isEmpty()) {
                        gVar2.q(fVar3, null);
                    } else {
                        Object obj2 = t4.f.x(arrayListC).e(new xyz.netfly.mobile.player.c(i30, 11)).g().f32947a;
                        if (obj2 == null) {
                            obj2 = null;
                        }
                        ArrayList arrayListK = xyz.stream.api.live.g.k((LiveCategoryEntity) obj2);
                        if (arrayListK.isEmpty()) {
                            gVar2.q(fVar3, null);
                        } else {
                            gVar2.q(fVar3, arrayListK);
                        }
                    }
                    return;
                } catch (Exception e10) {
                    xyz.stream.utils.h.c("Error in getChannel: " + e10.getMessage());
                    gVar2.q(fVar3, null);
                    return;
                }
            case 22:
                k0 k0Var = (k0) this.f492b;
                File file = (File) this.f494d;
                k0Var.getClass();
                StringBuilder sb = new StringBuilder();
                sb.append(xyz.stream.utils.e.d().f36112a.getCacheDir().getAbsolutePath());
                int i31 = this.f493c;
                sb.append(i31 == 0 ? "/logs/sdk.zip" : "/logs/video.zip");
                File file2 = new File(sb.toString());
                if (file2.exists()) {
                    file2.delete();
                }
                try {
                    fileOutputStream = new FileOutputStream(file2);
                    try {
                        zipOutputStream = new ZipOutputStream(fileOutputStream);
                        try {
                            fileInputStream = new FileInputStream(file);
                            try {
                                zipOutputStream.putNextEntry(new ZipEntry(file.getName()));
                                bArr = new byte[4096];
                            } finally {
                            }
                        } finally {
                        }
                    } finally {
                    }
                } catch (IOException e11) {
                    xyz.stream.utils.h.c("compressFile failed: " + e11.getMessage());
                    file2 = null;
                }
                while (true) {
                    int i32 = fileInputStream.read(bArr);
                    if (i32 == -1) {
                        zipOutputStream.closeEntry();
                        fileInputStream.close();
                        zipOutputStream.close();
                        fileOutputStream.close();
                        if (file2 != null) {
                            StringBuilder sb2 = new StringBuilder();
                            sb2.append(i31 == 0 ? "sdk_" : "video_");
                            sb2.append(xyz.stream.utils.e.d().b());
                            sb2.append("_");
                            SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss", Locale.US);
                            simpleDateFormat2.setTimeZone(TimeZone.getTimeZone("UTC"));
                            sb2.append(simpleDateFormat2.format(Long.valueOf(System.currentTimeMillis())));
                            sb2.append(".");
                            sb2.append(xyz.stream.utils.e.d().f36113b.replaceAll("\\.", "_"));
                            sb2.append(".zip");
                            String string = sb2.toString();
                            String str7 = (String) k0Var.f36157a;
                            if (str7 == null || str7.isEmpty()) {
                                xyz.stream.utils.h.c("Upload URL is not set.");
                                xyz.stream.utils.a0 a0Var = (xyz.stream.utils.a0) k0Var.f36160d;
                                if (a0Var != null) {
                                    UiUtils.dismissProgressDialog();
                                    StringBuilder sb3 = ((LogActivity) a0Var.f36098a).f35501b;
                                    sb3.append("Failed to upload log file: ");
                                    sb3.append("Upload URL is not set.");
                                    sb3.append("\n");
                                    LogActivity logActivity = (LogActivity) a0Var.f36098a;
                                    logActivity.getClass();
                                    logActivity.runOnUiThread(new ye.d(logActivity, i10));
                                    return;
                                }
                                return;
                            }
                            String strO = defpackage.e.o(new StringBuilder(), (String) k0Var.f36157a, string);
                            HashMap map2 = new HashMap();
                            map2.put("file", file2);
                            fe.h hVar = new fe.h(k0Var, string, 25, i11);
                            xyz.stream.utils.z zVarE = xyz.stream.utils.z.e();
                            zVarE.getClass();
                            try {
                                MultipartBody.Builder builder = new MultipartBody.Builder();
                                builder.setType(MultipartBody.FORM);
                                for (String str8 : map2.keySet()) {
                                    Object obj3 = map2.get(str8);
                                    if (obj3 instanceof File) {
                                        File file3 = (File) obj3;
                                        builder.addFormDataPart(str8, file3.getName(), RequestBody.create(file3, (MediaType) null));
                                    } else {
                                        builder.addFormDataPart(str8, obj3 != null ? obj3.toString() : "");
                                    }
                                }
                                Request requestBuild = new Request.Builder().url(strO).post(builder.build()).build();
                                xyz.stream.utils.z.f36195b.newBuilder().writeTimeout(50L, TimeUnit.SECONDS).build().newCall(requestBuild).enqueue(new xyz.stream.utils.w(zVarE, strO, requestBuild, hVar));
                                return;
                            } catch (Exception e12) {
                                xyz.stream.utils.h.c(e12.toString());
                                return;
                            }
                        }
                        return;
                    }
                    zipOutputStream.write(bArr, 0, i32);
                }
            default:
                e.m mVar2 = (e.m) this.f492b;
                View view2 = (View) this.f494d;
                if (mVar2 == null || view2 == null || mVar2.getWindow() == null) {
                    return;
                }
                int width = view2.getWidth();
                int i33 = this.f493c;
                view2.measure(View.MeasureSpec.makeMeasureSpec(width > 0 ? view2.getWidth() : i33, 1073741824), View.MeasureSpec.makeMeasureSpec(0, 0));
                int measuredHeight = view2.getMeasuredHeight();
                if (measuredHeight > 0) {
                    mVar2.getWindow().setLayout(i33, ((int) TypedValue.applyDimension(1, 2.0f, view2.getResources().getDisplayMetrics())) + measuredHeight);
                    return;
                }
                return;
        }
    }

    public /* synthetic */ n(Object obj, Object obj2, int i10, int i11) {
        this.f491a = i11;
        this.f492b = obj;
        this.f494d = obj2;
        this.f493c = i10;
    }
}
