导航菜单

页面标题

页面副标题

Perplexity v2.48.1 - AbstractC5312l.java 源代码

正在查看: Perplexity v2.48.1 应用的 AbstractC5312l.java JAVA 源代码文件

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


package nh;

import android.app.Application;
import android.content.SharedPreferences;
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
import h9.C3901i;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.InvalidPropertiesFormatException;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
import javax.net.ssl.HttpsURLConnection;
import org.json.JSONException;
import org.json.JSONObject;
import u2.AbstractC6698a;

public abstract class AbstractC5312l extends I implements InterfaceC5302b {
    static {
        new C3901i(AbstractC5312l.class.getSimpleName());
    }

    public AbstractC5312l(String str, long j10) {
        put("__TYPE__", str);
        put("__TIMESTAMP__", String.valueOf(j10));
    }

    public static AbstractC5312l e(String str) {
        if (str == null) {
            throw new NullPointerException("api string cannot be null");
        }
        try {
            JSONObject jSONObject = new JSONObject(str);
            HashMap hashMap = new HashMap();
            Iterator<String> keys = jSONObject.keys();
            while (keys.hasNext()) {
                String next = keys.next();
                hashMap.put(next, (String) jSONObject.get(next));
            }
            String str2 = (String) hashMap.get("__TYPE__");
            String str3 = (String) hashMap.get("__TIMESTAMP__");
            long parseLong = !M.h(str3) ? Long.parseLong(str3) : -1L;
            Application application = G.f58881p.f58882a;
            int i10 = application.getSharedPreferences("pref_retry_count", 0).getInt("rc-" + str3, 0);
            int i11 = i10 + 1;
            try {
                SharedPreferences.Editor edit = application.getSharedPreferences("pref_retry_count", 0).edit();
                edit.putInt("rc-" + str3, i11);
                edit.commit();
            } catch (Throwable th2) {
                int i12 = M.f58902b;
                M.b(th2);
            }
            if (i10 > 3) {
                hashMap.put("rc", String.valueOf(i10));
            }
            if ("CONFIG".equalsIgnoreCase(str2)) {
                C5305e c5305e = new C5305e(parseLong);
                c5305e.putAll(hashMap);
                return c5305e;
            }
            if ("EVENT".equalsIgnoreCase(str2)) {
                C5311k c5311k = new C5311k(parseLong);
                c5311k.putAll(hashMap);
                return c5311k;
            }
            if ("SESSION_START".equalsIgnoreCase(str2)) {
                C5310j c5310j = new C5310j(parseLong);
                c5310j.putAll(hashMap);
                return c5310j;
            }
            if ("GDPR_CONSENT".equalsIgnoreCase(str2)) {
                C5307g c5307g = new C5307g("GDPR_CONSENT", parseLong);
                c5307g.putAll(hashMap);
                return c5307g;
            }
            if ("GDPR_UNDER_13".equalsIgnoreCase(str2)) {
                C5308h c5308h = new C5308h("GDPR_UNDER_13", parseLong);
                c5308h.putAll(hashMap);
                return c5308h;
            }
            if (!"CUSTOM_USER_ID".equalsIgnoreCase(str2)) {
                throw new InvalidPropertiesFormatException(e.q.k("Unknown type = ", str2));
            }
            C5306f c5306f = new C5306f("CUSTOM_USER_ID", parseLong);
            c5306f.putAll(hashMap);
            return c5306f;
        } catch (JSONException e10) {
            throw new IOException(e10);
        }
    }

    public final HashMap g() {
        HashMap hashMap = new HashMap(this);
        hashMap.remove("__TYPE__");
        hashMap.remove("__TIMESTAMP__");
        return hashMap;
    }

    public final long h() {
        String str = (String) get("__TIMESTAMP__");
        if (M.h(str)) {
            return -1L;
        }
        return Long.parseLong(str);
    }

    public final boolean j() {
        try {
            String str = (String) get("e");
            if (str != null) {
                return new JSONObject(str).getBoolean("is_admon_revenue");
            }
            return false;
        } catch (Throwable th2) {
            th2.getMessage();
            return false;
        }
    }

    public final boolean k(G g10) {
        AbstractC5312l abstractC5312l;
        HashMap hashMap;
        int i10;
        StringBuilder sb2;
        TreeMap treeMap;
        Iterator it;
        String str;
        String sb3;
        HttpURLConnection httpURLConnection;
        try {
            try {
                if (g().containsKey("s")) {
                    long parseLong = Long.parseLong((String) g().get("s"));
                    F f4 = g10.f58886e;
                    if (parseLong >= (f4 == null ? -1L : f4.f58876d) && !((String) g().get("k")).equalsIgnoreCase("sdid") && t.b().a(r.a(), g10.f58882a) != null) {
                        J j10 = new J();
                        j10.g(g10);
                        abstractC5312l = this;
                        try {
                            abstractC5312l.putAll(j10);
                        } catch (Throwable unused) {
                        }
                        String concat = "https://sdk-api-v1.singular.net/api/v1".concat(abstractC5312l.b());
                        HashMap g11 = abstractC5312l.g();
                        long h10 = abstractC5312l.h();
                        InterfaceC5301a c10 = abstractC5312l.c();
                        int i11 = K.f58898a;
                        int i12 = M.f58902b;
                        long currentTimeMillis = System.currentTimeMillis();
                        int i13 = K.f58898a + 1;
                        K.f58898a = i13;
                        int i14 = K.f58898a;
                        hashMap = new HashMap();
                        String[] strArr = K.f58899b;
                        for (i10 = 0; i10 < 3; i10++) {
                            String str2 = strArr[i10];
                            if (g11.containsKey(str2)) {
                                hashMap.put(str2, g11.get(str2));
                                g11.remove(str2);
                            }
                        }
                        sb2 = new StringBuilder();
                        treeMap = new TreeMap(g11);
                        treeMap.put("rt", "json");
                        treeMap.put("lag", String.valueOf(M.k(h10)));
                        treeMap.put("c", M.c(g10.f58882a));
                        if (treeMap.containsKey("u") || M.h((String) treeMap.get("u"))) {
                            g10.f58887f.getClass();
                            if (!M.h(null)) {
                                g10.f58887f.getClass();
                                treeMap.put("u", null);
                                treeMap.put("k", "OAID");
                            }
                        }
                        it = treeMap.entrySet().iterator();
                        while (true) {
                            str = "";
                            if (it.hasNext()) {
                                break;
                            }
                            Map.Entry entry = (Map.Entry) it.next();
                            String encode = URLEncoder.encode((String) entry.getKey(), "UTF-8");
                            String str3 = (String) entry.getValue();
                            str = str3 != null ? URLEncoder.encode(str3, "UTF-8") : "";
                            if (sb2.length() > 0) {
                                sb2.append("&");
                            }
                            sb2.append(encode);
                            sb2.append("=");
                            sb2.append(str);
                        }
                        sb3 = sb2.toString();
                        String str4 = g10.f58885d.f57833b;
                        if (sb3 != null) {
                            String l4 = M.l("?".concat(sb3), str4);
                            str = M.h(l4) ? sb3 : AbstractC6698a.g(sb3, "&h=", l4);
                        }
                        URL url = new URL(AbstractC6698a.g(concat, "?", str));
                        httpURLConnection = !url.getProtocol().equalsIgnoreCase("https") ? (HttpsURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(url.openConnection())) : (HttpURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(url.openConnection()));
                        httpURLConnection.setConnectTimeout(10000);
                        httpURLConnection.setReadTimeout(10000);
                        httpURLConnection.setRequestMethod("POST");
                        httpURLConnection.setDoInput(true);
                        httpURLConnection.setUseCaches(false);
                        httpURLConnection.setRequestProperty("User-Agent", s.f58940b);
                        httpURLConnection.setRequestProperty("Content-Type", "application/json");
                        String str5 = g10.f58885d.f57833b;
                        JSONObject jSONObject = new JSONObject();
                        if (hashMap.size() > 0) {
                            String jSONObject2 = new JSONObject(hashMap).toString();
                            String l5 = M.l(jSONObject2, str5);
                            jSONObject.put("payload", jSONObject2);
                            jSONObject.put("signature", l5);
                        }
                        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(httpURLConnection.getOutputStream(), "UTF-8");
                        outputStreamWriter.write(jSONObject.toString());
                        outputStreamWriter.close();
                        httpURLConnection.getRequestMethod();
                        return K.a(g10, c10, currentTimeMillis, i13, httpURLConnection);
                    }
                }
                return K.a(g10, c10, currentTimeMillis, i13, httpURLConnection);
            } catch (IOException e10) {
                throw e10;
            }
        } finally {
            httpURLConnection.disconnect();
        }
        abstractC5312l = this;
        String concat2 = "https://sdk-api-v1.singular.net/api/v1".concat(abstractC5312l.b());
        HashMap g112 = abstractC5312l.g();
        long h102 = abstractC5312l.h();
        InterfaceC5301a c102 = abstractC5312l.c();
        int i112 = K.f58898a;
        int i122 = M.f58902b;
        long currentTimeMillis2 = System.currentTimeMillis();
        int i132 = K.f58898a + 1;
        K.f58898a = i132;
        int i142 = K.f58898a;
        hashMap = new HashMap();
        String[] strArr2 = K.f58899b;
        while (i10 < 3) {
        }
        sb2 = new StringBuilder();
        treeMap = new TreeMap(g112);
        treeMap.put("rt", "json");
        treeMap.put("lag", String.valueOf(M.k(h102)));
        treeMap.put("c", M.c(g10.f58882a));
        if (treeMap.containsKey("u")) {
        }
        g10.f58887f.getClass();
        if (!M.h(null)) {
        }
        it = treeMap.entrySet().iterator();
        while (true) {
            str = "";
            if (it.hasNext()) {
            }
            sb2.append(encode);
            sb2.append("=");
            sb2.append(str);
        }
        sb3 = sb2.toString();
        String str42 = g10.f58885d.f57833b;
        if (sb3 != null) {
        }
        URL url2 = new URL(AbstractC6698a.g(concat2, "?", str));
        httpURLConnection = !url2.getProtocol().equalsIgnoreCase("https") ? (HttpsURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(url2.openConnection())) : (HttpURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(url2.openConnection()));
        httpURLConnection.setConnectTimeout(10000);
        httpURLConnection.setReadTimeout(10000);
        httpURLConnection.setRequestMethod("POST");
        httpURLConnection.setDoInput(true);
        httpURLConnection.setUseCaches(false);
        httpURLConnection.setRequestProperty("User-Agent", s.f58940b);
        httpURLConnection.setRequestProperty("Content-Type", "application/json");
        String str52 = g10.f58885d.f57833b;
        JSONObject jSONObject3 = new JSONObject();
        if (hashMap.size() > 0) {
        }
        OutputStreamWriter outputStreamWriter2 = new OutputStreamWriter(httpURLConnection.getOutputStream(), "UTF-8");
        outputStreamWriter2.write(jSONObject3.toString());
        outputStreamWriter2.close();
        httpURLConnection.getRequestMethod();
    }

    public final String l() {
        return new JSONObject(this).toString();
    }
}