导航菜单

页面标题

页面副标题

Cantique de Louanges v12 - r.java 源代码

正在查看: Cantique de Louanges v12 应用的 r.java JAVA 源代码文件

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


package com.applovin.impl.sdk;

import android.os.Build;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.sdk.AppLovinSdk;
import java.io.UnsupportedEncodingException;
import java.lang.Thread;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;

public class r {
    private static final int aEA = (int) TimeUnit.SECONDS.toMillis(30);
    private final ExecutorService aEB;
    private final Map<a, Long> aEC = Collections.synchronizedMap(new HashMap());
    protected final x logger;
    protected final n sdk;

    public enum a {
        ANR("anr"),
        BLACK_VIEW("black_view"),
        CRASH("crash"),
        TASK_EXCEPTION("task_exception"),
        CAUGHT_EXCEPTION("caught_exception"),
        WEB_VIEW_ERROR("web_view_error"),
        INTEGRATION_ERROR("integration_error"),
        TEMPLATE_ERROR("template_error"),
        FILE_ERROR("file_error"),
        NETWORK_ERROR("network_error");

        private final String Jn;

        a(String str) {
            this.Jn = str;
        }

        public String tU() {
            return this.Jn;
        }
    }

    public r(final n nVar) {
        this.sdk = nVar;
        this.logger = nVar.BN();
        this.aEB = Executors.newFixedThreadPool(1, new ThreadFactory() {
            @Override
            public Thread newThread(Runnable runnable) {
                Thread thread = new Thread(runnable, "AppLovinSdk:error_reporter");
                thread.setDaemon(true);
                thread.setPriority(((Integer) nVar.a(com.applovin.impl.sdk.c.b.aQK)).intValue());
                thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
                    @Override
                    public void uncaughtException(@NonNull Thread thread2, @NonNull Throwable th) {
                        nVar.BN();
                        if (x.Fn()) {
                            nVar.BN().c("ErrorReporter", "Caught unhandled exception", th);
                        }
                    }
                });
                return thread;
            }
        });
    }

    private URL c(a aVar, @Nullable Map<String, String> map) throws MalformedURLException, UnsupportedEncodingException {
        StringBuilder sb = new StringBuilder("https://ms.applovin.com/1.0/sdk/error");
        sb.append("?");
        Iterator<Map.Entry<String, String>> it = d(aVar.tU(), map).entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry<String, String> next = it.next();
            String encode = URLEncoder.encode(next.getKey(), "UTF-8");
            String encode2 = URLEncoder.encode(next.getValue(), "UTF-8");
            sb.append(encode);
            sb.append("=");
            sb.append(encode2);
            if (it.hasNext()) {
                sb.append("&");
            }
        }
        return new URL(sb.toString());
    }

    private void i(java.util.Map<java.lang.String, java.lang.String> r6) {
        throw new UnsupportedOperationException("Method not decompiled: com.applovin.impl.sdk.r.i(java.util.Map):void");
    }

    private void j(Map<String, String> map) {
        Object Fd = this.sdk.Cf().Fd();
        if (Fd instanceof com.applovin.impl.sdk.ad.e) {
            map.put("fs_ad_network", "AppLovin");
            map.put("fs_ad_creative_id", Long.toString(((com.applovin.impl.sdk.ad.e) Fd).getAdIdNumber()));
        } else if (!(Fd instanceof com.applovin.impl.mediation.b.a)) {
            map.put("fs_ad_network", "None");
            map.put("fs_ad_creative_id", "None");
        } else {
            com.applovin.impl.mediation.b.a aVar = (com.applovin.impl.mediation.b.a) Fd;
            map.put("fs_ad_network", aVar.getNetworkName());
            map.put("fs_ad_creative_id", aVar.getCreativeId());
        }
    }

    public void b(String str, String str2, int i5) {
        if (i5 < 400) {
            return;
        }
        HashMap hashMap = new HashMap(3);
        hashMap.put("source", str2);
        hashMap.put("details", StringUtils.emptyIfNull(str));
        hashMap.put("top_main_method", String.valueOf(i5));
        a(a.NETWORK_ERROR, hashMap);
    }

    public void d(String str, @Nullable String str2, Throwable th) {
        HashMap hashMap = new HashMap(3);
        hashMap.put("source", str);
        hashMap.put("details", StringUtils.emptyIfNull(str2));
        hashMap.put("top_main_method", th.toString());
        a(a.CAUGHT_EXCEPTION, hashMap);
    }

    public void g(String str, Throwable th) {
        d(str, null, th);
    }

    public void a(a aVar, String str, @Nullable String str2) {
        HashMap hashMap = new HashMap(2);
        hashMap.put("source", str);
        hashMap.put("details", StringUtils.emptyIfNull(str2));
        a(aVar, hashMap);
    }

    public void d(a aVar, @Nullable Map<String, String> map) {
        if (x.Fn()) {
            this.logger.f("ErrorReporter", "Reporting " + aVar.tU() + " error...");
        }
        try {
            HttpURLConnection httpURLConnection = (HttpURLConnection) c(aVar, map).openConnection();
            int i5 = aEA;
            httpURLConnection.setConnectTimeout(i5);
            httpURLConnection.setReadTimeout(i5);
            httpURLConnection.setDefaultUseCaches(false);
            httpURLConnection.setAllowUserInteraction(false);
            httpURLConnection.setUseCaches(false);
            httpURLConnection.setInstanceFollowRedirects(true);
            httpURLConnection.setDoOutput(false);
            httpURLConnection.setRequestMethod("POST");
            int responseCode = httpURLConnection.getResponseCode();
            if (x.Fn()) {
                this.logger.f("ErrorReporter", aVar.tU() + " reported with code " + responseCode);
            }
            this.aEC.put(aVar, Long.valueOf(System.currentTimeMillis()));
        } catch (Throwable th) {
            if (x.Fn()) {
                this.logger.b("ErrorReporter", "Failed to report " + aVar.tU(), th);
            }
        }
    }

    public void a(a aVar, @Nullable Map<String, String> map) {
        a(aVar, map, 0L);
    }

    private Map<String, String> d(String str, @Nullable Map<String, String> map) {
        HashMap hashMap = new HashMap();
        hashMap.put("type", str);
        if (this.sdk.BV() != null) {
            hashMap.put("platform", this.sdk.BU().Ed());
        } else {
            hashMap.put("platform", this.sdk.BS().CX());
        }
        hashMap.put("applovin_random_token", this.sdk.BB());
        hashMap.put("compass_random_token", this.sdk.BA());
        hashMap.put("model", Build.MODEL);
        hashMap.put("brand", Build.MANUFACTURER);
        hashMap.put("brand_name", Build.BRAND);
        hashMap.put("hardware", Build.HARDWARE);
        hashMap.put("revision", Build.DEVICE);
        hashMap.put("os", Build.VERSION.RELEASE);
        hashMap.put("api_level", String.valueOf(Build.VERSION.SDK_INT));
        hashMap.put("sdk_version", String.valueOf(AppLovinSdk.VERSION));
        hashMap.put("aei", String.valueOf(this.sdk.a(com.applovin.impl.sdk.c.b.aKC)));
        hashMap.put("mei", String.valueOf(this.sdk.a(com.applovin.impl.sdk.c.b.aKD)));
        i(hashMap);
        j(hashMap);
        if (map != null) {
            hashMap.putAll(map);
        }
        return hashMap;
    }

    public void a(final a aVar, @Nullable final Map<String, String> map, long j5) {
        if (a(aVar, j5)) {
            return;
        }
        try {
            if (com.applovin.impl.sdk.utils.u.Lx()) {
                this.aEB.execute(new Runnable() {
                    @Override
                    public final void run() {
                        r.this.d(aVar, map);
                    }
                });
            } else {
                d(aVar, map);
            }
        } catch (Throwable th) {
            if (x.Fn()) {
                this.logger.b("ErrorReporter", "Failed to report " + aVar.tU(), th);
            }
        }
    }

    private boolean a(a aVar, long j5) {
        Long l5 = this.aEC.get(aVar);
        return System.currentTimeMillis() - (l5 != null ? l5.longValue() : -1L) < j5;
    }
}