导航菜单

页面标题

页面副标题

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

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

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


package m2;

import android.content.Context;
import android.provider.Settings;
import android.util.Base64;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import com.mbridge.msdk.playercommon.exoplayer2.DefaultLoadControl;
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import javax.net.ssl.HttpsURLConnection;
import k2.C1002a;
import k2.b;
import kotlin.jvm.internal.AbstractC1009g;
import kotlin.jvm.internal.m;
import l2.C1027a;
import l2.C1030d;
import m3.d;

public final class C1061a {
    public static final C0221a b = new C0221a(null);
    public final Context a;

    public static final class C0221a {
        public C0221a(AbstractC1009g abstractC1009g) {
        }
    }

    public C1061a(Context context) {
        m.e(context, "context");
        this.a = context;
    }

    public static String a(HashMap hashMap) {
        StringBuilder sb = new StringBuilder();
        boolean z = true;
        for (Map.Entry entry : hashMap.entrySet()) {
            String str = (String) entry.getKey();
            String str2 = (String) entry.getValue();
            if (z) {
                z = false;
            } else {
                sb.append("&");
            }
            sb.append(URLEncoder.encode(str, C.UTF8_NAME));
            sb.append("=");
            sb.append(URLEncoder.encode(str2, C.UTF8_NAME));
        }
        String sb2 = sb.toString();
        m.d(sb2, "result.toString()");
        return sb2;
    }

    public final C1030d b(String token) {
        BufferedReader bufferedReader;
        OutputStream outputStream;
        m.e(token, "token");
        String str = "/eapi/sdk-installation/" + Settings.Secure.getString(this.a.getContentResolver(), "android_id");
        HashMap hashMap = new HashMap();
        String jSONObject = new C1002a(this.a, token).a(this.a).toString();
        m.d(jSONObject, "jsonObjectContext.toString()");
        hashMap.put("context", jSONObject);
        String jSONObject2 = new b(this.a).a().toString();
        m.d(jSONObject2, "jsonObjectFile.toString()");
        hashMap.put("file", jSONObject2);
        StringBuilder sb = new StringBuilder();
        C1027a c1027a = C1027a.a;
        sb.append(c1027a.b());
        sb.append(str);
        String sb2 = sb.toString();
        C1030d c1030d = new C1030d();
        try {
            if (m3.m.p("POST", "GET", true)) {
                sb2 = sb2 + '?' + a(hashMap);
            }
            URLConnection openConnection = new URL(sb2).openConnection();
            m.c(openConnection, "null cannot be cast to non-null type javax.net.ssl.HttpsURLConnection");
            HttpsURLConnection httpsURLConnection = (HttpsURLConnection) openConnection;
            httpsURLConnection.setReadTimeout(DefaultLoadControl.DEFAULT_MIN_BUFFER_MS);
            httpsURLConnection.setConnectTimeout(DefaultLoadControl.DEFAULT_MIN_BUFFER_MS);
            httpsURLConnection.setRequestMethod("POST");
            httpsURLConnection.setDoInput(true);
            if (m3.m.p("POST", "POST", true)) {
                httpsURLConnection.setDoOutput(true);
            }
            if (m3.m.D("https://secure.uptodown.com", "www.xxxyyyxxx.com", false, 2, null)) {
                Charset charset = d.b;
                byte[] bytes = TtmlNode.ANONYMOUS_REGION_ID.getBytes(charset);
                m.d(bytes, "getBytes(...)");
                byte[] encode = Base64.encode(bytes, 0);
                m.d(encode, "encode(devValue.toByteArray(), Base64.DEFAULT)");
                httpsURLConnection.setRequestProperty(TtmlNode.ANONYMOUS_REGION_ID, new String(encode, charset));
            }
            httpsURLConnection.setRequestProperty("Identificador", "Uptodown_Android");
            httpsURLConnection.setRequestProperty("Identificador-Version", "999");
            httpsURLConnection.setRequestProperty("APIKEY", c1027a.a());
            if (m3.m.p("POST", "POST", true) && (outputStream = httpsURLConnection.getOutputStream()) != null) {
                BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(outputStream, C.UTF8_NAME));
                bufferedWriter.write(a(hashMap));
                bufferedWriter.flush();
                bufferedWriter.close();
                outputStream.close();
            }
            int responseCode = httpsURLConnection.getResponseCode();
            c1030d.e(responseCode);
            if (responseCode == 200) {
                bufferedReader = new BufferedReader(new InputStreamReader(httpsURLConnection.getInputStream()));
            } else {
                bufferedReader = new BufferedReader(new InputStreamReader(httpsURLConnection.getErrorStream()));
                c1030d.c(true);
            }
            StringBuilder sb3 = new StringBuilder();
            while (true) {
                String readLine = bufferedReader.readLine();
                if (readLine == null) {
                    c1030d.d(sb3.toString());
                    return c1030d;
                }
                sb3.append(readLine);
            }
        } catch (Exception e) {
            e.printStackTrace();
            c1030d.c(true);
            c1030d.d(e.getMessage());
            return c1030d;
        }
    }
}