导航菜单

页面标题

页面副标题

FileWipe Pro v3.0.0 - z1.java 源代码

正在查看: FileWipe Pro v3.0.0 应用的 z1.java JAVA 源代码文件

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


package com.applovin.impl;

import android.os.Build;
import android.text.TextUtils;
import com.applovin.impl.sdk.SessionTracker;
import com.applovin.impl.sdk.utils.CollectionUtils;
import com.applovin.impl.sdk.utils.JsonUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.y1;
import com.applovin.sdk.AppLovinEventTypes;
import com.applovin.sdk.AppLovinSdk;
import com.applovin.sdk.AppLovinSdkUtils;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.io.OutputStream;
import java.lang.Thread;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import org.json.JSONArray;
import org.json.JSONObject;

public abstract class z1 {

    private static volatile ExecutorService f4779g;

    protected final com.applovin.impl.sdk.k f4781a;

    protected final com.applovin.impl.sdk.o f4782b;

    private final y1.b f4783c;

    private final Map f4784d = Collections.synchronizedMap(new HashMap());

    private final Set f4785e = Collections.synchronizedSet(new HashSet());

    private static final int f4778f = (int) TimeUnit.SECONDS.toMillis(30);

    private static final Object f4780h = new Object();

    public class a implements ThreadFactory {

        public class C0021a implements Thread.UncaughtExceptionHandler {
            public C0021a() {
            }

            @Override
            public void uncaughtException(Thread thread, Throwable th) {
                z1.this.f4781a.O();
                if (com.applovin.impl.sdk.o.a()) {
                    z1.this.f4781a.O().a("HealthEventsReporter", "Caught unhandled exception", th);
                }
            }
        }

        public a() {
        }

        @Override
        public Thread newThread(Runnable runnable) {
            Thread thread = new Thread(runnable, "AppLovinSdk:health_events_reporter");
            thread.setDaemon(true);
            thread.setPriority(((Integer) z1.this.f4781a.a(l4.Q)).intValue());
            thread.setUncaughtExceptionHandler(new C0021a());
            return thread;
        }
    }

    public z1(com.applovin.impl.sdk.k kVar, y1.b bVar) {
        this.f4781a = kVar;
        this.f4782b = kVar.O();
        this.f4783c = bVar;
        a();
    }

    private void c(y1 y1Var, List list) {
        HttpURLConnection httpURLConnection;
        Throwable th;
        if (y1Var.a() == y1.b.AD || y1Var.a() == y1.b.MEDIATED_AD || y1Var.a() == y1.b.USER_SESSION || !a7.a(((Integer) this.f4781a.a(l4.f3036z)).intValue())) {
            return;
        }
        Iterator it = list.iterator();
        while (it.hasNext()) {
            Map map = (Map) it.next();
            try {
                httpURLConnection = (HttpURLConnection) a(y1Var, map).openConnection();
                try {
                    int i10 = f4778f;
                    httpURLConnection.setConnectTimeout(i10);
                    httpURLConnection.setReadTimeout(i10);
                    httpURLConnection.setDefaultUseCaches(false);
                    httpURLConnection.setAllowUserInteraction(false);
                    httpURLConnection.setUseCaches(false);
                    httpURLConnection.setInstanceFollowRedirects(true);
                    httpURLConnection.setDoOutput(false);
                    httpURLConnection.setRequestMethod("POST");
                    httpURLConnection.setRequestProperty("AppLovin-Event-Type", y1Var.b());
                    int responseCode = httpURLConnection.getResponseCode();
                    if (com.applovin.impl.sdk.o.a()) {
                        this.f4782b.a("HealthEventsReporter", y1Var.b() + " reported with code " + responseCode + " and extra parameters " + map);
                    }
                    this.f4784d.put(y1Var, Long.valueOf(System.currentTimeMillis()));
                } catch (Throwable th2) {
                    th = th2;
                    try {
                        if (com.applovin.impl.sdk.o.a()) {
                            this.f4782b.d("HealthEventsReporter", "Failed to report " + y1Var.b() + " with extra parameters " + map, th);
                        }
                        a7.a(httpURLConnection, this.f4781a);
                    } finally {
                        a7.a(httpURLConnection, this.f4781a);
                    }
                }
            } catch (Throwable th3) {
                httpURLConnection = null;
                th = th3;
            }
        }
    }

    public void d(y1 y1Var, Map map) {
        a(y1Var, map, 0L);
    }

    private void a() {
        if (f4779g != null) {
            return;
        }
        synchronized (f4780h) {
            try {
                if (f4779g != null) {
                    return;
                }
                f4779g = Executors.newFixedThreadPool(1, new a());
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    private void d(y1 y1Var, List list) {
        String str = (String) this.f4781a.a(l4.A);
        if (TextUtils.isEmpty(str)) {
            return;
        }
        double a10 = y1Var.a(this.f4781a);
        if (a7.a(a10)) {
            if (((Boolean) this.f4781a.a(l4.G)).booleanValue()) {
                a(str, y1Var, a(y1Var, a10, list));
                return;
            }
            Iterator it = list.iterator();
            while (it.hasNext()) {
                f4779g.execute(new f8(9, str, this, y1Var, a(y1Var, a10, Collections.singletonList((Map) it.next()))));
            }
        }
    }

    public void a(String str, y1 y1Var, JSONObject jSONObject) {
        byte[] bytes;
        HttpURLConnection httpURLConnection;
        HttpURLConnection httpURLConnection2 = null;
        try {
            URL url = new URL(str);
            bytes = jSONObject.toString().getBytes(C.UTF8_NAME);
            httpURLConnection = (HttpURLConnection) url.openConnection();
        } catch (Throwable th) {
            th = th;
        }
        try {
            int i10 = f4778f;
            httpURLConnection.setConnectTimeout(i10);
            httpURLConnection.setReadTimeout(i10);
            httpURLConnection.setRequestProperty("Content-Type", "application/json; charset=utf-8");
            httpURLConnection.setDefaultUseCaches(false);
            httpURLConnection.setAllowUserInteraction(false);
            httpURLConnection.setUseCaches(false);
            httpURLConnection.setInstanceFollowRedirects(true);
            httpURLConnection.setDoOutput(true);
            httpURLConnection.setFixedLengthStreamingMode(bytes.length);
            httpURLConnection.setRequestMethod("POST");
            httpURLConnection.setRequestProperty("AppLovin-Event-Type", y1Var.b());
            OutputStream outputStream = httpURLConnection.getOutputStream();
            outputStream.write(bytes);
            outputStream.close();
            int responseCode = httpURLConnection.getResponseCode();
            if (com.applovin.impl.sdk.o.a()) {
                this.f4782b.a("HealthEventsReporter", y1Var.b() + " reported with code " + responseCode);
            }
            this.f4784d.put(y1Var, Long.valueOf(System.currentTimeMillis()));
            a7.a(httpURLConnection, this.f4781a);
        } catch (Throwable th2) {
            th = th2;
            httpURLConnection2 = httpURLConnection;
            try {
                if (com.applovin.impl.sdk.o.a()) {
                    this.f4782b.d("HealthEventsReporter", "Failed to report " + y1Var.b(), th);
                }
            } finally {
                a7.a(httpURLConnection2, this.f4781a);
            }
        }
    }

    public void a(y1 y1Var, String str) {
        a(y1Var, str, new HashMap());
    }

    public void a(y1 y1Var, String str, Map map) {
        map.put("source", str);
        d(y1Var, map);
    }

    public void a(y1 y1Var, String str, Map map, String str2) {
        if (!StringUtils.isValidString(str2) || this.f4785e.add(str2)) {
            map.put("source", str);
            a(y1Var, str, map);
        }
    }

    public void a(y1 y1Var, Map map, long j5) {
        ArrayList arrayList = new ArrayList();
        arrayList.add(map);
        a(y1Var, arrayList, j5);
    }

    public void a(y1 y1Var, List list, long j5) {
        if (a(y1Var, j5)) {
            return;
        }
        try {
            if (a7.h()) {
                f4779g.execute(new e8(this, y1Var, list, 16));
            } else {
                b(y1Var, list);
            }
        } catch (Throwable th) {
            if (com.applovin.impl.sdk.o.a()) {
                this.f4782b.d("HealthEventsReporter", "Failed to report " + y1Var.b() + " with extra parameters collection " + list, th);
            }
        }
    }

    public void b(y1 y1Var, List list) {
        if (AppLovinSdkUtils.isEmulator()) {
            return;
        }
        if (com.applovin.impl.sdk.o.a()) {
            this.f4782b.a("HealthEventsReporter", "Reporting " + y1Var.b() + " with extra parameters collection " + list);
        }
        if (this.f4783c != y1Var.a()) {
            g1.a("Health event " + y1Var.b() + " category: " + y1Var.a() + " does not match the reporter category: " + this.f4783c, new Object[0]);
        }
        c(y1Var, list);
        d(y1Var, list);
    }

    private Map c(y1 y1Var, Map map) {
        HashMap hashMap = new HashMap(map);
        if (y1Var == y1.f4716u0) {
            hashMap.remove("details");
        }
        return hashMap;
    }

    private Map b(y1 y1Var, Map map) {
        HashMap hashMap = new HashMap();
        hashMap.put("type", y1Var.b());
        if (y1Var == y1.f4708q0 || y1Var == y1.F0 || y1Var == y1.D0) {
            if (((Boolean) this.f4781a.a(l4.d4)).booleanValue()) {
                CollectionUtils.putStringIfValid("wvvc", String.valueOf(a8.d()), hashMap);
                CollectionUtils.putStringIfValid("wvv", a8.c(), hashMap);
                CollectionUtils.putStringIfValid("wvpn", a8.b(), hashMap);
            }
            CollectionUtils.putStringIfValid("oglv", this.f4781a.B().I(), hashMap);
        }
        Map L = this.f4781a.B().L();
        hashMap.put("platform", String.valueOf(L.get("platform")));
        hashMap.put("country_code", String.valueOf(L.get("country_code")));
        hashMap.put("cc", this.f4781a.w().getCountryCode());
        hashMap.put("applovin_random_token", this.f4781a.h0());
        hashMap.put("compass_random_token", this.f4781a.v());
        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));
        CollectionUtils.putStringIfValid("ad_review_sdk_version", i.b(), hashMap);
        hashMap.put("md", (String) this.f4781a.a(l4.f2993t));
        b(hashMap);
        a(hashMap);
        if (map != null) {
            hashMap.putAll(c(y1Var, map));
        }
        return hashMap;
    }

    private URL a(y1 y1Var, Map map) {
        StringBuilder sb2 = new StringBuilder("https://ms.applovin.com/1.0/sdk/error?");
        Iterator it = b(y1Var, map).entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry entry = (Map.Entry) it.next();
            String encode = URLEncoder.encode((String) entry.getKey(), C.UTF8_NAME);
            String encode2 = URLEncoder.encode((String) entry.getValue(), C.UTF8_NAME);
            sb2.append(encode);
            sb2.append("=");
            sb2.append(encode2);
            if (it.hasNext()) {
                sb2.append("&");
            }
        }
        return new URL(sb2.toString());
    }

    private JSONObject a(y1 y1Var, double d4, List list) {
        JSONObject jSONObject = new JSONObject();
        JsonUtils.putLong(jSONObject, "ts_ms", System.currentTimeMillis());
        if (y1Var == y1.f4708q0 || y1Var == y1.F0 || y1Var == y1.D0) {
            if (((Boolean) this.f4781a.a(l4.d4)).booleanValue()) {
                JsonUtils.putStringIfValid(jSONObject, "wvvc", String.valueOf(a8.d()));
                JsonUtils.putStringIfValid(jSONObject, "wvv", a8.c());
                JsonUtils.putStringIfValid(jSONObject, "wvpn", a8.b());
            }
            JsonUtils.putStringIfValid(jSONObject, "oglv", this.f4781a.B().I());
        }
        JSONObject jSONObject2 = new JSONObject();
        Map L = this.f4781a.B().L();
        JsonUtils.putObject(jSONObject2, "platform", L.get("platform"));
        JsonUtils.putObject(jSONObject2, "os", L.get("os"));
        JsonUtils.putObject(jSONObject2, "brand", L.get("brand"));
        JsonUtils.putObject(jSONObject2, "model", L.get("model"));
        JsonUtils.putObject(jSONObject2, "revision", L.get("revision"));
        JsonUtils.putObject(jSONObject2, "country_code", L.get("country_code"));
        JsonUtils.putObject(jSONObject2, "cc", this.f4781a.w().getCountryCode());
        JsonUtils.putObject(jSONObject2, "applovin_random_token", this.f4781a.h0());
        JsonUtils.putObject(jSONObject2, "ad_review_sdk_version", StringUtils.emptyIfNull(i.b()));
        Map D = this.f4781a.B().D();
        JsonUtils.putObject(jSONObject2, "sdk_version", D.get("sdk_version"));
        JsonUtils.putObject(jSONObject2, "plugin_version", this.f4781a.a(l4.B3));
        JsonUtils.putObject(jSONObject2, "app_version", D.get("app_version"));
        JsonUtils.putObject(jSONObject2, CampaignEx.JSON_KEY_PACKAGE_NAME, D.get(CampaignEx.JSON_KEY_PACKAGE_NAME));
        JsonUtils.putObject(jSONObject2, "first_install", Boolean.toString(Boolean.TRUE.equals((Boolean) D.get("first_install_v2"))));
        JsonUtils.putObject(jSONObject2, "md", this.f4781a.a(l4.f2993t));
        JsonUtils.putObject(jSONObject2, "mediation_provider", this.f4781a.V());
        SessionTracker m02 = this.f4781a.m0();
        JsonUtils.putObject(jSONObject2, "app_state", m02.getCurrentApplicationState().b());
        JsonUtils.putObject(jSONObject2, "app_state_duration_ms", Long.valueOf(m02.getCurrentApplicationStateDurationMillis()));
        JsonUtils.putObject(jSONObject2, "session_id", m02.getSessionId());
        JsonUtils.putObject(jSONObject2, "session_duration_ms", Long.valueOf(System.currentTimeMillis() - com.applovin.impl.sdk.k.n()));
        JsonUtils.putObject(jSONObject, "shared_fields", jSONObject2);
        JSONArray jSONArray = new JSONArray();
        Iterator it = list.iterator();
        while (it.hasNext()) {
            Map map = (Map) it.next();
            JSONObject jSONObject3 = new JSONObject();
            JsonUtils.putDouble(jSONObject3, "ts_ms", System.currentTimeMillis());
            JsonUtils.putString(jSONObject3, "type", y1Var.b());
            JsonUtils.putDouble(jSONObject3, "weight", d4);
            JsonUtils.putString(jSONObject3, AppLovinEventTypes.USER_COMPLETED_LEVEL, "DEBUG");
            a(map);
            JsonUtils.putAll(jSONObject3, (Map<String, ?>) map);
            jSONArray.put(jSONObject3);
        }
        JsonUtils.putObject(jSONObject, "events", jSONArray);
        return jSONObject;
    }

    private void b(java.util.Map r6) {
        throw new UnsupportedOperationException("Method not decompiled: com.applovin.impl.z1.b(java.util.Map):void");
    }

    private void a(Map map) {
        if (map == null) {
            return;
        }
        Object a10 = this.f4781a.I().a();
        if (a10 instanceof com.applovin.impl.sdk.ad.b) {
            map.put("fs_ad_network", "AppLovin");
            map.put("fs_ad_creative_id", Long.toString(((com.applovin.impl.sdk.ad.b) a10).getAdIdNumber()));
        } else if (a10 instanceof q2) {
            q2 q2Var = (q2) a10;
            map.put("fs_ad_network", q2Var.getNetworkName());
            map.put("fs_ad_creative_id", q2Var.getCreativeId());
        } else {
            map.put("fs_ad_network", "None");
            map.put("fs_ad_creative_id", "None");
        }
    }

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