导航菜单

页面标题

页面副标题

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

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

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


package m2;

import android.content.Context;
import android.provider.Settings;
import android.util.Base64;
import androidx.browser.trusted.sharing.ShareTarget;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import com.mbridge.msdk.playercommon.exoplayer2.DefaultLoadControl;
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.C2017a;
import k2.b;
import kotlin.jvm.internal.AbstractC2025g;
import kotlin.jvm.internal.m;
import l2.C2057a;
import l2.C2060d;
import m3.C2102d;

public final class C2098a {

    public static final C0281a f22115b = new C0281a(null);

    public final Context f22116a;

    public static final class C0281a {
        public C0281a(AbstractC2025g abstractC2025g) {
        }
    }

    public C2098a(Context context) {
        m.e(context, "context");
        this.f22116a = context;
    }

    public static String a(HashMap hashMap) {
        StringBuilder sb = new StringBuilder();
        boolean z4 = true;
        for (Map.Entry entry : hashMap.entrySet()) {
            String str = (String) entry.getKey();
            String str2 = (String) entry.getValue();
            if (z4) {
                z4 = 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 C2060d b(String token) {
        BufferedReader bufferedReader;
        OutputStream outputStream;
        m.e(token, "token");
        String str = "/eapi/sdk-installation/" + Settings.Secure.getString(this.f22116a.getContentResolver(), "android_id");
        HashMap hashMap = new HashMap();
        String jSONObject = new C2017a(this.f22116a, token).a(this.f22116a).toString();
        m.d(jSONObject, "jsonObjectContext.toString()");
        hashMap.put("context", jSONObject);
        String jSONObject2 = new b(this.f22116a).a().toString();
        m.d(jSONObject2, "jsonObjectFile.toString()");
        hashMap.put("file", jSONObject2);
        StringBuilder sb = new StringBuilder();
        C2057a c2057a = C2057a.f21969a;
        sb.append(c2057a.b());
        sb.append(str);
        String sb2 = sb.toString();
        C2060d c2060d = new C2060d();
        try {
            if (m3.m.p(ShareTarget.METHOD_POST, ShareTarget.METHOD_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(ShareTarget.METHOD_POST);
            httpsURLConnection.setDoInput(true);
            if (m3.m.p(ShareTarget.METHOD_POST, ShareTarget.METHOD_POST, true)) {
                httpsURLConnection.setDoOutput(true);
            }
            if (m3.m.D("https://secure.uptodown.com", "www.xxxyyyxxx.com", false, 2, null)) {
                Charset charset = C2102d.f22118b;
                byte[] bytes = "".getBytes(charset);
                m.d(bytes, "getBytes(...)");
                byte[] encode = Base64.encode(bytes, 0);
                m.d(encode, "encode(devValue.toByteArray(), Base64.DEFAULT)");
                httpsURLConnection.setRequestProperty("", new String(encode, charset));
            }
            httpsURLConnection.setRequestProperty("Identificador", "Uptodown_Android");
            httpsURLConnection.setRequestProperty("Identificador-Version", "999");
            httpsURLConnection.setRequestProperty("APIKEY", c2057a.a());
            if (m3.m.p(ShareTarget.METHOD_POST, ShareTarget.METHOD_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();
            c2060d.e(responseCode);
            if (responseCode == 200) {
                bufferedReader = new BufferedReader(new InputStreamReader(httpsURLConnection.getInputStream()));
            } else {
                bufferedReader = new BufferedReader(new InputStreamReader(httpsURLConnection.getErrorStream()));
                c2060d.c(true);
            }
            StringBuilder sb3 = new StringBuilder();
            while (true) {
                String readLine = bufferedReader.readLine();
                if (readLine == null) {
                    c2060d.d(sb3.toString());
                    return c2060d;
                }
                sb3.append(readLine);
            }
        } catch (Exception e5) {
            e5.printStackTrace();
            c2060d.c(true);
            c2060d.d(e5.getMessage());
            return c2060d;
        }
    }
}