导航菜单

页面标题

页面副标题

Uptodown App Store v6.80 - C2456a.java 源代码

正在查看: Uptodown App Store v6.80 应用的 C2456a.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package v2;

import androidx.browser.trusted.sharing.ShareTarget;
import g2.C1756J;
import h2.AbstractResultReceiverC1793d;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.Charset;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLHandshakeException;
import kotlin.jvm.internal.m;
import m3.C2102d;
import org.json.JSONObject;
import u2.I;
import u2.w;

public final class C2456a {

    private HttpsURLConnection f23933a;

    private OutputStream f23934b;

    private final String f23935c = "--";

    private final String f23936d = "SwA" + System.currentTimeMillis() + "SwA";

    private long f23937e;

    public C2456a(AbstractResultReceiverC1793d abstractResultReceiverC1793d) {
    }

    private final C1756J g(Exception exc, C1756J c1756j, String str) {
        c1756j.h(str);
        if (exc.getMessage() != null) {
            c1756j.i(exc.getMessage());
            return c1756j;
        }
        c1756j.i(exc.toString());
        return c1756j;
    }

    private final void l(String str, String str2) {
        OutputStream outputStream = this.f23934b;
        m.b(outputStream);
        String str3 = this.f23935c + this.f23936d + "\r\n";
        Charset charset = C2102d.f22118b;
        byte[] bytes = str3.getBytes(charset);
        m.d(bytes, "getBytes(...)");
        outputStream.write(bytes);
        OutputStream outputStream2 = this.f23934b;
        m.b(outputStream2);
        byte[] bytes2 = "Content-Type: text/plain\r\n".getBytes(charset);
        m.d(bytes2, "getBytes(...)");
        outputStream2.write(bytes2);
        OutputStream outputStream3 = this.f23934b;
        m.b(outputStream3);
        byte[] bytes3 = ("Content-Disposition: form-data; name=\"" + str + "\"\r\n").getBytes(charset);
        m.d(bytes3, "getBytes(...)");
        outputStream3.write(bytes3);
        OutputStream outputStream4 = this.f23934b;
        m.b(outputStream4);
        byte[] bytes4 = ("\r\n" + str2 + "\r\n").getBytes(charset);
        m.d(bytes4, "getBytes(...)");
        outputStream4.write(bytes4);
    }

    public final void a(String paramName, String fileName, byte[] bytes, JSONObject jSONObject) {
        m.e(paramName, "paramName");
        m.e(fileName, "fileName");
        m.e(bytes, "bytes");
        try {
            OutputStream outputStream = this.f23934b;
            m.b(outputStream);
            String str = this.f23935c + this.f23936d + "\r\n";
            Charset charset = C2102d.f22118b;
            byte[] bytes2 = str.getBytes(charset);
            m.d(bytes2, "getBytes(...)");
            outputStream.write(bytes2);
            OutputStream outputStream2 = this.f23934b;
            m.b(outputStream2);
            byte[] bytes3 = ("Content-Disposition: form-data; name=\"" + paramName + "\"; filename=\"" + fileName + "\"\r\n").getBytes(charset);
            m.d(bytes3, "getBytes(...)");
            outputStream2.write(bytes3);
            OutputStream outputStream3 = this.f23934b;
            m.b(outputStream3);
            byte[] bytes4 = "Content-Type: application/octet-stream\r\n".getBytes(charset);
            m.d(bytes4, "getBytes(...)");
            outputStream3.write(bytes4);
            OutputStream outputStream4 = this.f23934b;
            m.b(outputStream4);
            byte[] bytes5 = "Content-Transfer-Encoding: binary\r\n".getBytes(charset);
            m.d(bytes5, "getBytes(...)");
            outputStream4.write(bytes5);
            OutputStream outputStream5 = this.f23934b;
            m.b(outputStream5);
            byte[] bytes6 = "\r\n".getBytes(charset);
            m.d(bytes6, "getBytes(...)");
            outputStream5.write(bytes6);
            OutputStream outputStream6 = this.f23934b;
            m.b(outputStream6);
            outputStream6.write(bytes, 0, bytes.length);
            OutputStream outputStream7 = this.f23934b;
            m.b(outputStream7);
            byte[] bytes7 = "\r\n".getBytes(charset);
            m.d(bytes7, "getBytes(...)");
            outputStream7.write(bytes7);
        } catch (IOException unused) {
            OutputStream outputStream8 = this.f23934b;
            m.b(outputStream8);
            outputStream8.close();
        } catch (Exception unused2) {
            OutputStream outputStream9 = this.f23934b;
            m.b(outputStream9);
            outputStream9.close();
        } catch (OutOfMemoryError unused3) {
            OutputStream outputStream10 = this.f23934b;
            m.b(outputStream10);
            outputStream10.close();
        }
    }

    public final long b(String paramName, String fileName, String str) {
        m.e(paramName, "paramName");
        m.e(fileName, "fileName");
        long j4 = 0;
        try {
            OutputStream outputStream = this.f23934b;
            m.b(outputStream);
            String str2 = this.f23935c + this.f23936d + "\r\n";
            Charset charset = C2102d.f22118b;
            byte[] bytes = str2.getBytes(charset);
            m.d(bytes, "getBytes(...)");
            outputStream.write(bytes);
            OutputStream outputStream2 = this.f23934b;
            m.b(outputStream2);
            byte[] bytes2 = ("Content-Disposition: form-data; name=\"" + paramName + "\"; filename=\"" + fileName + "\"\r\n").getBytes(charset);
            m.d(bytes2, "getBytes(...)");
            outputStream2.write(bytes2);
            OutputStream outputStream3 = this.f23934b;
            m.b(outputStream3);
            byte[] bytes3 = "Content-Type: application/octet-stream\r\n".getBytes(charset);
            m.d(bytes3, "getBytes(...)");
            outputStream3.write(bytes3);
            OutputStream outputStream4 = this.f23934b;
            m.b(outputStream4);
            byte[] bytes4 = "Content-Transfer-Encoding: binary\r\n".getBytes(charset);
            m.d(bytes4, "getBytes(...)");
            outputStream4.write(bytes4);
            OutputStream outputStream5 = this.f23934b;
            m.b(outputStream5);
            byte[] bytes5 = "\r\n".getBytes(charset);
            m.d(bytes5, "getBytes(...)");
            outputStream5.write(bytes5);
            FileInputStream fileInputStream = new FileInputStream(str);
            byte[] bArr = new byte[8192];
            while (true) {
                int read = fileInputStream.read(bArr);
                if (read <= 0) {
                    fileInputStream.close();
                    OutputStream outputStream6 = this.f23934b;
                    m.b(outputStream6);
                    byte[] bytes6 = "\r\n".getBytes(C2102d.f22118b);
                    m.d(bytes6, "getBytes(...)");
                    outputStream6.write(bytes6);
                    return j4;
                }
                OutputStream outputStream7 = this.f23934b;
                m.b(outputStream7);
                outputStream7.write(bArr, 0, read);
                j4 += read;
            }
        } catch (IOException unused) {
            OutputStream outputStream8 = this.f23934b;
            if (outputStream8 != null) {
                outputStream8.close();
            }
            return j4;
        } catch (Exception unused2) {
            OutputStream outputStream9 = this.f23934b;
            if (outputStream9 != null) {
                outputStream9.close();
            }
            return j4;
        } catch (OutOfMemoryError unused3) {
            OutputStream outputStream10 = this.f23934b;
            if (outputStream10 != null) {
                outputStream10.close();
            }
            return j4;
        }
    }

    public final void c(String paramName, String value) {
        m.e(paramName, "paramName");
        m.e(value, "value");
        l(paramName, value);
    }

    public final void d(URL url, String str) {
        m.e(url, "url");
        URLConnection openConnection = url.openConnection();
        m.c(openConnection, "null cannot be cast to non-null type javax.net.ssl.HttpsURLConnection");
        HttpsURLConnection httpsURLConnection = (HttpsURLConnection) openConnection;
        this.f23933a = httpsURLConnection;
        m.b(httpsURLConnection);
        httpsURLConnection.setRequestMethod(ShareTarget.METHOD_POST);
        HttpsURLConnection httpsURLConnection2 = this.f23933a;
        m.b(httpsURLConnection2);
        httpsURLConnection2.setReadTimeout(30000);
        HttpsURLConnection httpsURLConnection3 = this.f23933a;
        m.b(httpsURLConnection3);
        httpsURLConnection3.setConnectTimeout(30000);
        HttpsURLConnection httpsURLConnection4 = this.f23933a;
        m.b(httpsURLConnection4);
        httpsURLConnection4.setDoInput(true);
        HttpsURLConnection httpsURLConnection5 = this.f23933a;
        m.b(httpsURLConnection5);
        httpsURLConnection5.setDoOutput(true);
        HttpsURLConnection httpsURLConnection6 = this.f23933a;
        m.b(httpsURLConnection6);
        httpsURLConnection6.setRequestProperty("Connection", "Keep-Alive");
        HttpsURLConnection httpsURLConnection7 = this.f23933a;
        m.b(httpsURLConnection7);
        httpsURLConnection7.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + this.f23936d);
        HttpsURLConnection httpsURLConnection8 = this.f23933a;
        m.b(httpsURLConnection8);
        httpsURLConnection8.setRequestProperty("Accept-Charset", "utf-8");
        HttpsURLConnection httpsURLConnection9 = this.f23933a;
        m.b(httpsURLConnection9);
        httpsURLConnection9.setRequestProperty("Accept", "application/json");
        HttpsURLConnection httpsURLConnection10 = this.f23933a;
        m.b(httpsURLConnection10);
        httpsURLConnection10.setRequestProperty("Identificador", "Uptodown_Android");
        HttpsURLConnection httpsURLConnection11 = this.f23933a;
        m.b(httpsURLConnection11);
        httpsURLConnection11.setRequestProperty("apk_file", str);
        HttpsURLConnection httpsURLConnection12 = this.f23933a;
        m.b(httpsURLConnection12);
        httpsURLConnection12.setRequestProperty("Identificador-Version", "680");
        HttpsURLConnection httpsURLConnection13 = this.f23933a;
        m.b(httpsURLConnection13);
        httpsURLConnection13.setRequestProperty("APIKEY", I.f23820a.e());
        w wVar = w.f23890a;
        HttpsURLConnection httpsURLConnection14 = this.f23933a;
        m.b(httpsURLConnection14);
        wVar.a(httpsURLConnection14);
        HttpsURLConnection httpsURLConnection15 = this.f23933a;
        m.b(httpsURLConnection15);
        httpsURLConnection15.setFixedLengthStreamingMode((int) this.f23937e);
        HttpsURLConnection httpsURLConnection16 = this.f23933a;
        m.b(httpsURLConnection16);
        httpsURLConnection16.connect();
        HttpsURLConnection httpsURLConnection17 = this.f23933a;
        m.b(httpsURLConnection17);
        this.f23934b = httpsURLConnection17.getOutputStream();
    }

    public final void e() {
        OutputStream outputStream = this.f23934b;
        m.b(outputStream);
        byte[] bytes = (this.f23935c + this.f23936d + this.f23935c + "\r\n").getBytes(C2102d.f22118b);
        m.d(bytes, "getBytes(...)");
        outputStream.write(bytes);
        OutputStream outputStream2 = this.f23934b;
        m.b(outputStream2);
        outputStream2.close();
    }

    public final C1756J f(boolean z4) {
        InputStream errorStream;
        boolean z5;
        C1756J c1756j = new C1756J();
        try {
            HttpsURLConnection httpsURLConnection = this.f23933a;
            m.b(httpsURLConnection);
            int responseCode = httpsURLConnection.getResponseCode();
            c1756j.k(responseCode);
            if (responseCode < 200 || responseCode >= 300) {
                HttpsURLConnection httpsURLConnection2 = this.f23933a;
                m.b(httpsURLConnection2);
                errorStream = httpsURLConnection2.getErrorStream();
                if (errorStream == null) {
                    HttpsURLConnection httpsURLConnection3 = this.f23933a;
                    m.b(httpsURLConnection3);
                    errorStream = httpsURLConnection3.getInputStream();
                }
                z5 = false;
            } else {
                HttpsURLConnection httpsURLConnection4 = this.f23933a;
                m.b(httpsURLConnection4);
                errorStream = httpsURLConnection4.getInputStream();
                if (errorStream == null) {
                    HttpsURLConnection httpsURLConnection5 = this.f23933a;
                    m.b(httpsURLConnection5);
                    errorStream = httpsURLConnection5.getErrorStream();
                }
                z5 = true;
            }
            StringBuilder sb = new StringBuilder();
            byte[] bArr = new byte[1024];
            if (z5 && z4) {
                InflaterInputStream inflaterInputStream = new InflaterInputStream(errorStream, new Inflater(true));
                while (true) {
                    int read = inflaterInputStream.read(bArr);
                    if (read == -1) {
                        break;
                    }
                    sb.append(new String(bArr, 0, read, C2102d.f22118b));
                }
                c1756j.i(sb.toString());
                inflaterInputStream.close();
            } else {
                while (true) {
                    int read2 = errorStream.read(bArr);
                    if (read2 == -1) {
                        break;
                    }
                    sb.append(new String(bArr, 0, read2, C2102d.f22118b));
                }
                c1756j.i(sb.toString());
            }
            errorStream.close();
            HttpsURLConnection httpsURLConnection6 = this.f23933a;
            m.b(httpsURLConnection6);
            httpsURLConnection6.disconnect();
            return c1756j;
        } catch (IllegalArgumentException e5) {
            return g(e5, c1756j, "IllegalArgumentException");
        } catch (IllegalStateException e6) {
            return g(e6, c1756j, "IllegalStateException");
        } catch (NullPointerException e7) {
            return g(e7, c1756j, "NullPointerException");
        } catch (SecurityException e8) {
            return g(e8, c1756j, "SecurityException");
        } catch (MalformedURLException e9) {
            return g(e9, c1756j, "MalformedURLException");
        } catch (ProtocolException e10) {
            return g(e10, c1756j, "ProtocolException");
        } catch (SocketTimeoutException e11) {
            return g(e11, c1756j, "SocketTimeoutException");
        } catch (SSLHandshakeException e12) {
            return g(e12, c1756j, "SSLHandshakeException");
        } catch (IOException e13) {
            return g(e13, c1756j, "IOException");
        }
    }

    public final void h(String paramName, String fileName, byte[] bytes) {
        m.e(paramName, "paramName");
        m.e(fileName, "fileName");
        m.e(bytes, "bytes");
        long length = this.f23937e + (this.f23935c + this.f23936d + "\r\n").length();
        this.f23937e = length;
        long j4 = 2;
        long length2 = length + ("Content-Disposition: form-data; name=\"" + paramName + "\"; filename=\"" + fileName + "\"\r\n").length() + 40 + 35 + j4;
        this.f23937e = length2;
        this.f23937e = length2 + ((long) bytes.length) + j4;
    }

    public final void i(String paramName, String fileName, long j4) {
        m.e(paramName, "paramName");
        m.e(fileName, "fileName");
        long length = this.f23937e + (this.f23935c + this.f23936d + "\r\n").length();
        this.f23937e = length;
        long j5 = 2;
        this.f23937e = length + ("Content-Disposition: form-data; name=\"" + paramName + "\"; filename=\"" + fileName + "\"\r\n").length() + 40 + 35 + j5 + j4 + j5;
    }

    public final void j() {
        this.f23937e = this.f23937e + (this.f23935c + this.f23936d + this.f23935c + "\r\n").length();
    }

    public final void k(String paramName, String value) {
        m.e(paramName, "paramName");
        m.e(value, "value");
        long length = this.f23937e + (this.f23935c + this.f23936d + "\r\n").length() + 26;
        this.f23937e = length;
        long length2 = length + ("Content-Disposition: form-data; name=\"" + paramName + "\"\r\n").length();
        this.f23937e = length2;
        this.f23937e = length2 + ("\r\n" + value + "\r\n").length();
    }
}