导航菜单

页面标题

页面副标题

Dostt v1.0.89 - C0504a.java 源代码

正在查看: Dostt v1.0.89 应用的 C0504a.java JAVA 源代码文件

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


package Q1;

import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.os.Process;
import android.text.TextUtils;
import java.io.InputStream;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.json.JSONObject;

public class C0504a implements Q1.E {

    private static long f3978t;

    private static long f3979u;

    private static long f3980v;

    private static long f3981w;

    private static long f3982x;

    private S1.f f3983a;

    private Q1.H f3984b;

    private C0532d f3985c;

    private Q1.G f3986d;

    private S1.i f3987e;

    private S1.j f3988f;

    private S1.j f3989g;

    private b0 f3990h;

    private Q1.B f3991i;

    private C0536h f3992j;

    private C0535g f3993k;

    private Q1.F f3994l;

    private Q1.K f3995m;

    private Q1.I f3996n;

    private o0 f3997o;

    private Q1.L f3998p;

    private Q1.M f3999q;

    private Q1.N f4000r;

    private Q1.T f4001s;

    class A implements Runnable {
        A() {
        }

        @Override
        public void run() {
            C0504a.this.C0();
        }
    }

    class B implements Runnable {

        final C0543o f4003a;

        final Q1.Y f4004b;

        B(C0543o c0543o, Q1.Y y6) {
            this.f4003a = c0543o;
            this.f4004b = y6;
        }

        @Override
        public void run() {
            C0504a.this.v2(this.f4003a, this.f4004b);
        }
    }

    class C implements Q1.J {
        C() {
        }

        @Override
        public void a(C0504a c0504a) {
            c0504a.S1(C0504a.this.f3992j.f4298z.booleanValue());
        }
    }

    class D implements Runnable {
        D() {
        }

        @Override
        public void run() {
            C0504a.this.W0();
        }
    }

    class E implements Runnable {
        E() {
        }

        @Override
        public void run() {
            C0504a.this.B0();
        }
    }

    class F implements Runnable {
        F() {
        }

        @Override
        public void run() {
            C0504a.this.b2();
            C0504a.this.W1();
            C0504a.this.f3986d.g("Subsession end", new Object[0]);
            C0504a.this.V0();
        }
    }

    class G implements Runnable {
        G() {
        }

        @Override
        public void run() {
            C0504a.this.r();
        }
    }

    class H implements Q1.O {
        H() {
        }

        @Override
        public void a(j0 j0Var, String str) {
            C0504a.this.N1(j0Var, str);
        }
    }

    class I implements Q1.O {
        I() {
        }

        @Override
        public void a(j0 j0Var, String str) {
            C0504a.this.N1(j0Var, str);
        }
    }

    class J implements Q1.O {
        J() {
        }

        @Override
        public void a(j0 j0Var, String str) {
            C0504a.this.N1(j0Var, str);
        }
    }

    class K implements Runnable {
        K() {
        }

        @Override
        public void run() {
            j0 k7 = k0.k(C0504a.this.getContext(), C0504a.this.f3986d);
            if (k7 != null) {
                C0504a.this.N1(k7, "samsung");
            }
        }
    }

    class L implements Runnable {
        L() {
        }

        @Override
        public void run() {
            j0 m7 = k0.m(C0504a.this.getContext(), C0504a.this.f3986d);
            if (m7 != null) {
                C0504a.this.N1(m7, "xiaomi");
            }
        }
    }

    class M implements Runnable {
        M() {
        }

        @Override
        public void run() {
            j0 l7 = k0.l(C0504a.this.getContext(), C0504a.this.f3986d);
            if (l7 != null) {
                C0504a.this.N1(l7, "vivo");
            }
        }
    }

    class N implements Runnable {

        final Q1.C f4017a;

        N(Q1.C c7) {
            this.f4017a = c7;
        }

        @Override
        public void run() {
            if (C0504a.this.f3992j == null || C0504a.this.f3992j.f4287o == null) {
                return;
            }
            C0504a.this.f3992j.f4287o.onFinishedEventTrackingSucceeded(this.f4017a.c());
        }
    }

    class O implements Runnable {

        final Q1.C f4019a;

        O(Q1.C c7) {
            this.f4019a = c7;
        }

        @Override
        public void run() {
            if (C0504a.this.f3992j == null || C0504a.this.f3992j.f4288p == null) {
                return;
            }
            C0504a.this.f3992j.f4288p.onFinishedEventTrackingFailed(this.f4019a.b());
        }
    }

    class P implements Runnable {

        final n0 f4021a;

        P(n0 n0Var) {
            this.f4021a = n0Var;
        }

        @Override
        public void run() {
            C0504a.this.f4001s.a(this.f4021a.f4377o);
            C0504a.this.f4001s = null;
        }
    }

    class Q implements Runnable {

        final C0537i f4023a;

        Q(C0537i c0537i) {
            this.f4023a = c0537i;
        }

        @Override
        public void run() {
            if (C0504a.this.f3990h.a()) {
                C0504a.this.f3986d.a("Event tracked before first activity resumed.\nIf it was triggered in the Application class, it might timestamp or even send an install long before the user opens the app.\nPlease check https://github.com/adjust/android_sdk#can-i-trigger-an-event-at-application-launch for more information.", new Object[0]);
                C0504a.this.Z1();
            }
            C0504a.this.j2(this.f4023a);
        }
    }

    class R implements Runnable {

        final p0 f4025a;

        R(p0 p0Var) {
            this.f4025a = p0Var;
        }

        @Override
        public void run() {
            if (C0504a.this.f3992j == null || C0504a.this.f3992j.f4289q == null) {
                return;
            }
            C0504a.this.f3992j.f4289q.onFinishedSessionTrackingSucceeded(this.f4025a.c());
        }
    }

    class S implements Runnable {

        final p0 f4027a;

        S(p0 p0Var) {
            this.f4027a = p0Var;
        }

        @Override
        public void run() {
            if (C0504a.this.f3992j == null || C0504a.this.f3992j.f4290r == null) {
                return;
            }
            C0504a.this.f3992j.f4290r.onFinishedSessionTrackingFailed(this.f4027a.b());
        }
    }

    class T implements Runnable {
        T() {
        }

        @Override
        public void run() {
            if (C0504a.this.f3992j == null || C0504a.this.f3992j.f4284l == null) {
                return;
            }
            C0504a.this.f3992j.f4284l.onAttributionChanged(C0504a.this.f3993k);
        }
    }

    class U implements Runnable {

        final i0 f4030a;

        final C0544p f4031b;

        U(i0 i0Var, C0544p c0544p) {
            this.f4030a = i0Var;
            this.f4031b = c0544p;
        }

        @Override
        public void run() {
            this.f4030a.f4375m.q().a(this.f4031b);
        }
    }

    class V implements Runnable {

        final Uri f4033a;

        final Intent f4034b;

        V(Uri uri, Intent intent) {
            this.f4033a = uri;
            this.f4034b = intent;
        }

        @Override
        public void run() {
            if (C0504a.this.f3992j == null) {
                return;
            }
            if (C0504a.this.f3992j.f4291s != null ? C0504a.this.f3992j.f4291s.launchReceivedDeeplink(this.f4033a) : true) {
                C0504a.this.i1(this.f4034b, this.f4033a);
            }
        }
    }

    class W implements Runnable {

        final boolean f4036a;

        W(boolean z6) {
            this.f4036a = z6;
        }

        @Override
        public void run() {
            C0504a.this.S1(this.f4036a);
        }
    }

    class X implements Runnable {

        final boolean f4038a;

        X(boolean z6) {
            this.f4038a = z6;
        }

        @Override
        public void run() {
            C0504a.this.T1(this.f4038a);
        }
    }

    class Y implements Runnable {

        final Uri f4040a;

        final long f4041b;

        Y(Uri uri, long j7) {
            this.f4040a = uri;
            this.f4041b = j7;
        }

        @Override
        public void run() {
            C0504a.this.D1(this.f4040a, this.f4041b);
        }
    }

    class Z implements Runnable {

        final Uri f4043a;

        final long f4044b;

        Z(Uri uri, long j7) {
            this.f4043a = uri;
            this.f4044b = j7;
        }

        @Override
        public void run() {
            C0504a.this.D1(this.f4043a, this.f4044b);
        }
    }

    class RunnableC0070a implements Runnable {
        RunnableC0070a() {
        }

        @Override
        public void run() {
            C0504a.this.Q1();
        }
    }

    class a0 implements Runnable {

        final boolean f4047a;

        a0(boolean z6) {
            this.f4047a = z6;
        }

        @Override
        public void run() {
            C0504a.this.R1(this.f4047a);
        }
    }

    class RunnableC0505b implements Runnable {

        final j0 f4049a;

        final String f4050b;

        RunnableC0505b(j0 j0Var, String str) {
            this.f4049a = j0Var;
            this.f4050b = str;
        }

        @Override
        public void run() {
            C0504a.this.O1(this.f4049a, this.f4050b);
        }
    }

    public class b0 {

        boolean f4052a;

        boolean f4053b;

        boolean f4054c;

        boolean f4055d;

        boolean f4056e;

        boolean f4057f;

        boolean f4058g;

        boolean f4059h;

        boolean f4060i;

        public b0() {
        }

        public boolean a() {
            return !this.f4059h;
        }

        public boolean b() {
            return this.f4059h;
        }

        public boolean c() {
            return this.f4060i;
        }

        public boolean d() {
            return !this.f4058g;
        }

        public boolean e() {
            return this.f4052a;
        }

        public boolean f() {
            return this.f4057f;
        }

        public boolean g() {
            return this.f4054c;
        }

        public boolean h() {
            return this.f4055d;
        }

        public boolean i() {
            return !this.f4054c;
        }

        public boolean j() {
            return !this.f4055d;
        }

        public boolean k() {
            return this.f4053b;
        }

        public boolean l() {
            return this.f4056e;
        }
    }

    class RunnableC0506c implements Runnable {

        final Q1.C f4062a;

        RunnableC0506c(Q1.C c7) {
            this.f4062a = c7;
        }

        @Override
        public void run() {
            C0504a.this.k1(this.f4062a);
        }
    }

    class RunnableC0507d implements Runnable {

        final n0 f4064a;

        RunnableC0507d(n0 n0Var) {
            this.f4064a = n0Var;
        }

        @Override
        public void run() {
            C0504a.this.n1(this.f4064a);
        }
    }

    class RunnableC0508e implements Runnable {

        final p0 f4066a;

        RunnableC0508e(p0 p0Var) {
            this.f4066a = p0Var;
        }

        @Override
        public void run() {
            C0504a.this.p1(this.f4066a);
        }
    }

    class RunnableC0509f implements Runnable {

        final C0551x f4068a;

        RunnableC0509f(C0551x c0551x) {
            this.f4068a = c0551x;
        }

        @Override
        public void run() {
            C0504a.this.h1(this.f4068a);
        }
    }

    class RunnableC0510g implements Runnable {

        final i0 f4070a;

        RunnableC0510g(i0 i0Var) {
            this.f4070a = i0Var;
        }

        @Override
        public void run() {
            C0504a.this.m1(this.f4070a);
        }
    }

    class RunnableC0511h implements Runnable {
        RunnableC0511h() {
        }

        @Override
        public void run() {
            C0504a.this.M1();
        }
    }

    class RunnableC0512i implements Runnable {

        final String f4073a;

        final String f4074b;

        RunnableC0512i(String str, String str2) {
            this.f4073a = str;
            this.f4074b = str2;
        }

        @Override
        public void run() {
            C0504a.this.z0(this.f4073a, this.f4074b);
        }
    }

    class RunnableC0513j implements Runnable {
        RunnableC0513j() {
        }

        @Override
        public void run() {
            C0504a.this.c1();
        }
    }

    class RunnableC0514k implements Runnable {

        final String f4077a;

        final String f4078b;

        RunnableC0514k(String str, String str2) {
            this.f4077a = str;
            this.f4078b = str2;
        }

        @Override
        public void run() {
            C0504a.this.A0(this.f4077a, this.f4078b);
        }
    }

    class RunnableC0515l implements Runnable {

        final String f4080a;

        RunnableC0515l(String str) {
            this.f4080a = str;
        }

        @Override
        public void run() {
            C0504a.this.G1(this.f4080a);
        }
    }

    class RunnableC0516m implements Runnable {

        final String f4082a;

        RunnableC0516m(String str) {
            this.f4082a = str;
        }

        @Override
        public void run() {
            C0504a.this.H1(this.f4082a);
        }
    }

    class RunnableC0517n implements Runnable {
        RunnableC0517n() {
        }

        @Override
        public void run() {
            C0504a.this.I1();
        }
    }

    class RunnableC0518o implements Runnable {
        RunnableC0518o() {
        }

        @Override
        public void run() {
            C0504a.this.J1();
        }
    }

    class RunnableC0519p implements Runnable {

        final boolean f4086a;

        final String f4087b;

        RunnableC0519p(boolean z6, String str) {
            this.f4086a = z6;
            this.f4087b = str;
        }

        @Override
        public void run() {
            if (!this.f4086a) {
                q0.e(C0504a.this.getContext()).A(this.f4087b);
            }
            if (C0504a.this.f3990h.a()) {
                return;
            }
            C0504a.this.U1(this.f4087b);
        }
    }

    class RunnableC0520q implements Runnable {
        RunnableC0520q() {
        }

        @Override
        public void run() {
            C0504a.this.Y0();
        }
    }

    class RunnableC0521r implements Runnable {
        RunnableC0521r() {
        }

        @Override
        public void run() {
            C0504a.this.U0();
        }
    }

    class RunnableC0522s implements Runnable {

        final C0548u f4091a;

        RunnableC0522s(C0548u c0548u) {
            this.f4091a = c0548u;
        }

        @Override
        public void run() {
            C0504a.this.n2(this.f4091a);
        }
    }

    class RunnableC0523t implements Runnable {

        final boolean f4093a;

        RunnableC0523t(boolean z6) {
            this.f4093a = z6;
        }

        @Override
        public void run() {
            C0504a.this.k2(this.f4093a);
        }
    }

    class RunnableC0524u implements Runnable {
        RunnableC0524u() {
        }

        @Override
        public void run() {
            C0504a.this.N0();
            C0504a.this.a2();
            C0504a.this.Y1();
            C0504a.this.f3986d.g("Subsession start", new Object[0]);
            C0504a.this.Z1();
        }
    }

    class RunnableC0525v implements Runnable {

        final String f4096a;

        final JSONObject f4097b;

        RunnableC0525v(String str, JSONObject jSONObject) {
            this.f4096a = str;
            this.f4097b = jSONObject;
        }

        @Override
        public void run() {
            C0504a.this.i2(this.f4096a, this.f4097b);
        }
    }

    class RunnableC0526w implements Runnable {

        final C0534f f4099a;

        RunnableC0526w(C0534f c0534f) {
            this.f4099a = c0534f;
        }

        @Override
        public void run() {
            C0504a.this.h2(this.f4099a);
        }
    }

    class RunnableC0527x implements Runnable {

        final C0542n f4101a;

        RunnableC0527x(C0542n c0542n) {
            this.f4101a = c0542n;
        }

        @Override
        public void run() {
            C0504a.this.m2(this.f4101a);
        }
    }

    class RunnableC0528y implements Runnable {
        RunnableC0528y() {
        }

        @Override
        public void run() {
            C0504a.this.a1();
        }
    }

    class RunnableC0529z implements Runnable {
        RunnableC0529z() {
        }

        @Override
        public void run() {
            C0504a.this.X0();
        }
    }

    private C0504a(C0536h c0536h) {
        m(c0536h);
        Q1.G j7 = AbstractC0540l.j();
        this.f3986d = j7;
        j7.d();
        this.f3983a = new S1.d("ActivityHandler");
        b0 b0Var = new b0();
        this.f3990h = b0Var;
        Boolean bool = c0536h.f4298z;
        b0Var.f4052a = bool != null ? bool.booleanValue() : true;
        b0 b0Var2 = this.f3990h;
        b0Var2.f4053b = c0536h.f4259A;
        b0Var2.f4054c = true;
        b0Var2.f4055d = false;
        b0Var2.f4056e = false;
        b0Var2.f4058g = false;
        b0Var2.f4059h = false;
        b0Var2.f4060i = false;
        this.f3983a.submit(new RunnableC0513j());
    }

    private void A1() {
        this.f3983a.submit(new K());
    }

    private void B1() {
        this.f3983a.submit(new M());
    }

    public void C0() {
        if (f2()) {
            this.f3984b.e();
        }
    }

    private void C1() {
        this.f3983a.submit(new L());
    }

    private boolean D0(C0532d c0532d) {
        if (!this.f3990h.a()) {
            return true;
        }
        this.f3986d.b("Sdk did not yet start", new Object[0]);
        return false;
    }

    public void D1(Uri uri, long j7) {
        if (d1()) {
            if (!s0.V(uri)) {
                C0531c a7 = c0.a(uri, j7, this.f3985c, this.f3992j, this.f3991i, this.f3997o);
                if (a7 == null) {
                    return;
                }
                this.f3995m.e(a7);
                return;
            }
            this.f3986d.c("Deeplink (" + uri.toString() + ") processing skipped", new Object[0]);
        }
    }

    private boolean E0(C0534f c0534f) {
        if (c0534f == null) {
            this.f3986d.b("Ad revenue object missing", new Object[0]);
            return false;
        }
        if (c0534f.c()) {
            return true;
        }
        this.f3986d.b("Ad revenue object not initialized correctly", new Object[0]);
        return false;
    }

    private void E1(Context context) {
        try {
            this.f3997o.f4443a = (Map) s0.d0(context, "AdjustSessionCallbackParameters", "Session Callback parameters", Map.class);
        } catch (Exception e7) {
            this.f3986d.b("Failed to read %s file (%s)", "Session Callback parameters", e7.getMessage());
            this.f3997o.f4443a = null;
        }
    }

    private void F0() {
        G0(q0.e(getContext()));
    }

    private void F1(Context context) {
        try {
            this.f3997o.f4444b = (Map) s0.d0(context, "AdjustSessionPartnerParameters", "Session Partner parameters", Map.class);
        } catch (Exception e7) {
            this.f3986d.b("Failed to read %s file (%s)", "Session Partner parameters", e7.getMessage());
            this.f3997o.f4444b = null;
        }
    }

    private void G0(q0 q0Var) {
        String l7 = q0Var.l();
        if (l7 != null && !l7.equals(this.f3985c.f4215y)) {
            l(l7, true);
        }
        if (q0Var.n() != null) {
            H();
        }
        K0();
        this.f3998p.s();
        this.f3999q.c();
        this.f4000r.b();
        A1();
        C1();
        B1();
    }

    private void H0() {
        if (D0(this.f3985c)) {
            if (this.f3990h.f() && this.f3990h.d()) {
                return;
            }
            if (this.f3993k == null || this.f3985c.f4205o) {
                this.f3994l.e();
            }
        }
    }

    private boolean I0(C0537i c0537i) {
        if (c0537i == null) {
            this.f3986d.b("Event missing", new Object[0]);
            return false;
        }
        if (c0537i.e()) {
            return true;
        }
        this.f3986d.b("Event not initialized correctly", new Object[0]);
        return false;
    }

    private void J0(n0 n0Var) {
        if (n0Var.f4431p) {
            String str = n0Var.f4440y;
            if (str != null && str.equalsIgnoreCase("huawei_ads")) {
                C0532d c0532d = this.f3985c;
                c0532d.f4179H = n0Var.f4432q;
                c0532d.f4180I = n0Var.f4433r;
                c0532d.f4181J = n0Var.f4434s;
                w2();
                return;
            }
            String str2 = n0Var.f4440y;
            if (str2 != null && str2.equalsIgnoreCase("huawei_app_gallery")) {
                C0532d c0532d2 = this.f3985c;
                c0532d2.f4179H = n0Var.f4432q;
                c0532d2.f4180I = n0Var.f4433r;
                c0532d2.f4182K = n0Var.f4434s;
                w2();
                return;
            }
            String str3 = n0Var.f4440y;
            if (str3 != null && str3.equalsIgnoreCase("meta")) {
                C0532d c0532d3 = this.f3985c;
                c0532d3.f4197Z = n0Var.f4432q;
                c0532d3.f4196Y = n0Var.f4434s;
                c0532d3.f4199a0 = n0Var.f4439x;
                w2();
                return;
            }
            String str4 = n0Var.f4440y;
            if (str4 != null && str4.equalsIgnoreCase("samsung")) {
                C0532d c0532d4 = this.f3985c;
                c0532d4.f4189R = n0Var.f4432q;
                c0532d4.f4190S = n0Var.f4433r;
                c0532d4.f4191T = n0Var.f4434s;
                w2();
                return;
            }
            String str5 = n0Var.f4440y;
            if (str5 != null && str5.equalsIgnoreCase("xiaomi")) {
                C0532d c0532d5 = this.f3985c;
                c0532d5.f4183L = n0Var.f4432q;
                c0532d5.f4184M = n0Var.f4433r;
                c0532d5.f4185N = n0Var.f4434s;
                c0532d5.f4186O = n0Var.f4435t;
                c0532d5.f4187P = n0Var.f4436u;
                c0532d5.f4188Q = n0Var.f4437v;
                w2();
                return;
            }
            String str6 = n0Var.f4440y;
            if (str6 != null && str6.equalsIgnoreCase("vivo")) {
                C0532d c0532d6 = this.f3985c;
                c0532d6.f4192U = n0Var.f4432q;
                c0532d6.f4193V = n0Var.f4433r;
                c0532d6.f4194W = n0Var.f4434s;
                c0532d6.f4195X = n0Var.f4437v;
                w2();
                return;
            }
            C0532d c0532d7 = this.f3985c;
            c0532d7.f4172A = n0Var.f4432q;
            c0532d7.f4173B = n0Var.f4433r;
            c0532d7.f4174C = n0Var.f4434s;
            c0532d7.f4176E = n0Var.f4435t;
            c0532d7.f4177F = n0Var.f4436u;
            c0532d7.f4178G = n0Var.f4437v;
            c0532d7.f4175D = n0Var.f4438w;
            w2();
        }
    }

    private void K0() {
        C0532d c0532d = this.f3985c;
        if (c0532d == null || !c0532d.f4201c || c0532d.f4202d) {
            return;
        }
        P1();
        if (this.f3992j.f4263E && !this.f3990h.c()) {
            String str = this.f3991i.f3916k;
            if (str == null || str.isEmpty()) {
                this.f3986d.c("Can't read preinstall payload, invalid package name", new Object[0]);
                return;
            }
            q0 e7 = q0.e(getContext());
            long j7 = e7.j();
            if (g0.i(j7)) {
                this.f3990h.f4060i = true;
                return;
            }
            if (g0.j("system_properties", j7)) {
                String c7 = g0.c(this.f3991i.f3916k, this.f3986d);
                if (c7 == null || c7.isEmpty()) {
                    j7 = g0.k("system_properties", j7);
                } else {
                    this.f3995m.g(c7, "system_properties");
                }
            }
            if (g0.j("system_properties_reflection", j7)) {
                String f7 = g0.f(this.f3991i.f3916k, this.f3986d);
                if (f7 == null || f7.isEmpty()) {
                    j7 = g0.k("system_properties_reflection", j7);
                } else {
                    this.f3995m.g(f7, "system_properties_reflection");
                }
            }
            if (g0.j("system_properties_path", j7)) {
                String d7 = g0.d(this.f3991i.f3916k, this.f3986d);
                if (d7 == null || d7.isEmpty()) {
                    j7 = g0.k("system_properties_path", j7);
                } else {
                    this.f3995m.g(d7, "system_properties_path");
                }
            }
            if (g0.j("system_properties_path_reflection", j7)) {
                String e8 = g0.e(this.f3991i.f3916k, this.f3986d);
                if (e8 == null || e8.isEmpty()) {
                    j7 = g0.k("system_properties_path_reflection", j7);
                } else {
                    this.f3995m.g(e8, "system_properties_path_reflection");
                }
            }
            if (g0.j("content_provider", j7)) {
                String a7 = g0.a(this.f3992j.f4277e, this.f3991i.f3916k, this.f3986d);
                if (a7 == null || a7.isEmpty()) {
                    j7 = g0.k("content_provider", j7);
                } else {
                    this.f3995m.g(a7, "content_provider");
                }
            }
            if (g0.j("content_provider_intent_action", j7)) {
                List g7 = g0.g(this.f3992j.f4277e, this.f3991i.f3916k, this.f3986d);
                if (g7 == null || g7.isEmpty()) {
                    j7 = g0.k("content_provider_intent_action", j7);
                } else {
                    Iterator it = g7.iterator();
                    while (it.hasNext()) {
                        this.f3995m.g((String) it.next(), "content_provider_intent_action");
                    }
                }
            }
            if (g0.j("content_provider_no_permission", j7)) {
                List h7 = g0.h(this.f3992j.f4277e, this.f3991i.f3916k, this.f3986d);
                if (h7 == null || h7.isEmpty()) {
                    j7 = g0.k("content_provider_no_permission", j7);
                } else {
                    Iterator it2 = h7.iterator();
                    while (it2.hasNext()) {
                        this.f3995m.g((String) it2.next(), "content_provider_no_permission");
                    }
                }
            }
            if (g0.j("file_system", j7)) {
                String b7 = g0.b(this.f3991i.f3916k, this.f3992j.f4266H, this.f3986d);
                if (b7 == null || b7.isEmpty()) {
                    j7 = g0.k("file_system", j7);
                } else {
                    this.f3995m.g(b7, "file_system");
                }
            }
            e7.H(j7);
            this.f3990h.f4060i = true;
        }
    }

    private void K1() {
        C0532d c0532d = this.f3985c;
        if (c0532d != null && c0532d.f4204f) {
            c0532d.f4204f = false;
            w2();
        }
    }

    private boolean L0(String str) {
        if (str != null && !str.isEmpty()) {
            if (this.f3985c.c(str)) {
                this.f3986d.h("Skipping duplicated order ID '%s'", str);
                return false;
            }
            this.f3985c.b(str);
            this.f3986d.g("Added order ID '%s'", str);
        }
        return true;
    }

    private void L1() {
        this.f3994l.c();
        this.f3984b.c();
        this.f3995m.c();
        this.f3996n.c();
    }

    private Intent M0(Uri uri) {
        Intent intent;
        if (this.f3992j.f4286n == null) {
            intent = new Intent("android.intent.action.VIEW", uri);
        } else {
            C0536h c0536h = this.f3992j;
            intent = new Intent("android.intent.action.VIEW", uri, c0536h.f4277e, c0536h.f4286n);
        }
        intent.setFlags(268435456);
        intent.setPackage(this.f3992j.f4277e.getPackageName());
        return intent;
    }

    public void M1() {
        if (this.f3990h.j()) {
            this.f3986d.h("Start delay expired or never configured", new Object[0]);
            return;
        }
        t2();
        this.f3990h.f4055d = false;
        this.f3989g.e();
        this.f3989g = null;
        s2();
    }

    public void N0() {
        if (this.f3990h.j() || e1()) {
            return;
        }
        Double d7 = this.f3992j.f4293u;
        double doubleValue = d7 != null ? d7.doubleValue() : 0.0d;
        long k7 = AbstractC0540l.k();
        long j7 = (long) (1000.0d * doubleValue);
        if (j7 > k7) {
            double d8 = k7 / 1000;
            DecimalFormat decimalFormat = s0.f4465a;
            this.f3986d.a("Delay start of %s seconds bigger than max allowed value of %s seconds", decimalFormat.format(doubleValue), decimalFormat.format(d8));
            doubleValue = d8;
        } else {
            k7 = j7;
        }
        this.f3986d.h("Waiting %s seconds before starting first session", s0.f4465a.format(doubleValue));
        this.f3989g.h(k7);
        this.f3990h.f4056e = true;
        C0532d c0532d = this.f3985c;
        if (c0532d != null) {
            c0532d.f4213w = true;
            w2();
        }
    }

    public static boolean O0(Context context) {
        return context.deleteFile("AdjustIoActivityState");
    }

    public void O1(j0 j0Var, String str) {
        if (d1() && f1(j0Var) && !s0.P(j0Var, str, this.f3985c)) {
            this.f3995m.e(c0.b(j0Var, str, this.f3985c, this.f3992j, this.f3991i, this.f3997o));
        }
    }

    public static boolean P0(Context context) {
        return context.deleteFile("AdjustAttribution");
    }

    private void P1() {
        String k7;
        if (!d1() || this.f3990h.a() || (k7 = q0.e(getContext()).k()) == null || k7.isEmpty()) {
            return;
        }
        this.f3995m.g(k7, "system_installer_referrer");
    }

    public static boolean Q0(Context context) {
        return context.deleteFile("AdjustSessionCallbackParameters");
    }

    public void Q1() {
        if (d1() && !this.f3990h.a()) {
            this.f3995m.f();
        }
    }

    public static boolean R0(Context context) {
        return context.deleteFile("AdjustSessionPartnerParameters");
    }

    public void R1(boolean z6) {
        this.f3985c.f4205o = z6;
        w2();
    }

    static void S0(Context context) {
        O0(context);
        P0(context);
        Q0(context);
        R0(context);
        q0.e(context).a();
    }

    public void S1(boolean z6) {
        C0532d c0532d;
        if (b1(d1(), z6, "Adjust already enabled", "Adjust already disabled")) {
            if (z6 && (c0532d = this.f3985c) != null && c0532d.f4202d) {
                this.f3986d.b("Re-enabling SDK not possible for forgotten user", new Object[0]);
                return;
            }
            b0 b0Var = this.f3990h;
            b0Var.f4052a = z6;
            if (b0Var.a()) {
                u2(!z6, "Handlers will start as paused due to the SDK being disabled", "Handlers will still start as paused", "Handlers will start as active due to the SDK being enabled");
                return;
            }
            this.f3985c.f4201c = z6;
            w2();
            if (z6) {
                q0 e7 = q0.e(getContext());
                if (e7.g()) {
                    Y0();
                } else {
                    v1();
                    if (e7.f()) {
                        U0();
                    }
                    Iterator it = this.f3992j.f4294v.f4402b.iterator();
                    while (it.hasNext()) {
                        n2((C0548u) it.next());
                    }
                    Boolean bool = this.f3992j.f4294v.f4403c;
                    if (bool != null) {
                        k2(bool.booleanValue());
                    }
                    this.f3992j.f4294v.f4402b = new ArrayList();
                    this.f3992j.f4294v.f4403c = null;
                }
                if (!e7.h()) {
                    this.f3986d.c("Detected that install was not tracked at enable time", new Object[0]);
                    l2(System.currentTimeMillis());
                }
                G0(e7);
            }
            u2(!z6, "Pausing handlers due to SDK being disabled", "Handlers remain paused", "Resuming handlers due to SDK being enabled");
        }
    }

    private void T0() {
        if (V1()) {
            this.f3985c.f4204f = true;
            w2();
            C0531c x6 = new Q1.b0(this.f3992j, this.f3991i, this.f3985c, this.f3997o, System.currentTimeMillis()).x(new C0548u(Boolean.FALSE));
            this.f3984b.h(x6);
            if (this.f3992j.f4282j) {
                this.f3986d.h("Buffered event %s", x6.s());
            } else {
                this.f3984b.e();
            }
        }
    }

    public void T1(boolean z6) {
        if (b1(this.f3990h.k(), z6, "Adjust already in offline mode", "Adjust already in online mode")) {
            b0 b0Var = this.f3990h;
            b0Var.f4053b = z6;
            if (b0Var.a()) {
                u2(z6, "Handlers will start paused due to SDK being offline", "Handlers will still start as paused", "Handlers will start as active due to SDK being online");
            } else {
                u2(z6, "Pausing handlers to put SDK offline mode", "Handlers remain paused", "Resuming handlers to put SDK in online mode");
            }
        }
    }

    public void U0() {
        q0 e7 = q0.e(getContext());
        e7.E();
        if (D0(this.f3985c) && d1()) {
            C0532d c0532d = this.f3985c;
            if (c0532d.f4202d || c0532d.f4203e) {
                return;
            }
            if (this.f3992j.f4268J) {
                this.f3986d.a("Call to disable third party sharing API ignored, already done when COPPA enabled", new Object[0]);
                return;
            }
            c0532d.f4203e = true;
            w2();
            C0531c q6 = new Q1.b0(this.f3992j, this.f3991i, this.f3985c, this.f3997o, System.currentTimeMillis()).q();
            this.f3984b.h(q6);
            e7.s();
            if (this.f3992j.f4282j) {
                this.f3986d.h("Buffered event %s", q6.s());
            } else {
                this.f3984b.e();
            }
        }
    }

    public void U1(String str) {
        if (D0(this.f3985c) && d1()) {
            C0532d c0532d = this.f3985c;
            if (c0532d.f4202d || str == null || str.equals(c0532d.f4215y)) {
                return;
            }
            this.f3985c.f4215y = str;
            w2();
            C0531c t6 = new Q1.b0(this.f3992j, this.f3991i, this.f3985c, this.f3997o, System.currentTimeMillis()).t("push");
            this.f3984b.h(t6);
            q0.e(getContext()).v();
            if (this.f3992j.f4282j) {
                this.f3986d.h("Buffered event %s", t6.s());
            } else {
                this.f3984b.e();
            }
        }
    }

    public void V0() {
        if (!f2()) {
            q1();
        }
        if (p2(System.currentTimeMillis())) {
            w2();
        }
    }

    private boolean V1() {
        if (this.f3985c == null || !d1()) {
            return false;
        }
        if (this.f3985c.f4202d) {
            return false;
        }
        return !r0.f4204f;
    }

    public void W1() {
        if (this.f3988f != null && f2() && this.f3988f.g() <= 0) {
            this.f3988f.h(f3980v);
        }
    }

    public void X0() {
        if (!d1()) {
            b2();
            return;
        }
        if (f2()) {
            this.f3984b.e();
        }
        if (p2(System.currentTimeMillis())) {
            w2();
        }
    }

    private void X1() {
        this.f3985c = new C0532d();
        this.f3990h.f4059h = true;
        s2();
        long currentTimeMillis = System.currentTimeMillis();
        q0 e7 = q0.e(getContext());
        this.f3985c.f4215y = e7.l();
        if (this.f3990h.e()) {
            if (e7.g()) {
                Y0();
            } else {
                v1();
                if (e7.f()) {
                    U0();
                }
                Iterator it = this.f3992j.f4294v.f4402b.iterator();
                while (it.hasNext()) {
                    n2((C0548u) it.next());
                }
                Boolean bool = this.f3992j.f4294v.f4403c;
                if (bool != null) {
                    k2(bool.booleanValue());
                }
                this.f3992j.f4294v.f4402b = new ArrayList();
                this.f3992j.f4294v.f4403c = null;
                this.f3985c.f4207q = 1;
                o2(currentTimeMillis);
                G0(e7);
            }
        }
        this.f3985c.d(currentTimeMillis);
        this.f3985c.f4201c = this.f3990h.e();
        this.f3985c.f4213w = this.f3990h.l();
        w2();
        e7.v();
        e7.t();
        e7.s();
        u1();
    }

    public void Y0() {
        if (D0(this.f3985c) && d1()) {
            C0532d c0532d = this.f3985c;
            if (c0532d.f4202d) {
                return;
            }
            c0532d.f4202d = true;
            w2();
            C0531c s6 = new Q1.b0(this.f3992j, this.f3991i, this.f3985c, this.f3997o, System.currentTimeMillis()).s();
            this.f3984b.h(s6);
            q0.e(getContext()).t();
            if (this.f3992j.f4282j) {
                this.f3986d.h("Buffered event %s", s6.s());
            } else {
                this.f3984b.e();
            }
        }
    }

    public void Y1() {
        if (d1()) {
            this.f3987e.e();
        }
    }

    public static C0504a Z0(C0536h c0536h) {
        List<ActivityManager.RunningAppProcessInfo> runningAppProcesses;
        if (c0536h == null) {
            AbstractC0540l.j().b("AdjustConfig missing", new Object[0]);
            return null;
        }
        if (!c0536h.e()) {
            AbstractC0540l.j().b("AdjustConfig not initialized correctly", new Object[0]);
            return null;
        }
        if (c0536h.f4280h != null) {
            int myPid = Process.myPid();
            ActivityManager activityManager = (ActivityManager) c0536h.f4277e.getSystemService("activity");
            if (activityManager != null && (runningAppProcesses = activityManager.getRunningAppProcesses()) != null) {
                Iterator<ActivityManager.RunningAppProcessInfo> it = runningAppProcesses.iterator();
                while (true) {
                    if (!it.hasNext()) {
                        break;
                    }
                    ActivityManager.RunningAppProcessInfo next = it.next();
                    if (next.pid == myPid) {
                        if (!next.processName.equalsIgnoreCase(c0536h.f4280h)) {
                            AbstractC0540l.j().h("Skipping initialization in background process (%s)", next.processName);
                            return null;
                        }
                    }
                }
            } else {
                return null;
            }
        }
        return new C0504a(c0536h);
    }

    public void Z1() {
        if (this.f3990h.a()) {
            AbstractC0546s.d(this.f3992j.f4295w);
            X1();
            return;
        }
        if (q0.e(getContext()).f()) {
            U0();
        }
        Iterator it = this.f3992j.f4294v.f4402b.iterator();
        while (it.hasNext()) {
            n2((C0548u) it.next());
        }
        Boolean bool = this.f3992j.f4294v.f4403c;
        if (bool != null) {
            k2(bool.booleanValue());
        }
        this.f3992j.f4294v.f4402b = new ArrayList();
        C0536h c0536h = this.f3992j;
        c0536h.f4294v.f4403c = null;
        if (this.f3985c.f4201c) {
            AbstractC0546s.d(c0536h.f4295w);
            s2();
            v1();
            w1();
            H0();
            u1();
        }
    }

    public void a1() {
        this.f3985c.f4202d = true;
        w2();
        this.f3984b.flush();
        S1(false);
    }

    public void a2() {
        S1.j jVar = this.f3988f;
        if (jVar == null) {
            return;
        }
        jVar.e();
    }

    private boolean b1(boolean z6, boolean z7, String str, String str2) {
        if (z6 != z7) {
            return true;
        }
        if (z6) {
            this.f3986d.c(str, new Object[0]);
        } else {
            this.f3986d.c(str2, new Object[0]);
        }
        return false;
    }

    public void b2() {
        this.f3987e.f();
    }

    public void c1() {
        String l7;
        Double d7;
        f3981w = AbstractC0540l.r();
        f3982x = AbstractC0540l.t();
        f3978t = AbstractC0540l.u();
        f3979u = AbstractC0540l.v();
        f3980v = AbstractC0540l.u();
        y1(this.f3992j.f4277e);
        x1(this.f3992j.f4277e);
        this.f3997o = new o0();
        E1(this.f3992j.f4277e);
        F1(this.f3992j.f4277e);
        C0536h c0536h = this.f3992j;
        if (c0536h.f4298z != null) {
            c0536h.f4294v.f4401a.add(new C());
        }
        if (this.f3990h.b()) {
            b0 b0Var = this.f3990h;
            C0532d c0532d = this.f3985c;
            b0Var.f4052a = c0532d.f4201c;
            b0Var.f4056e = c0532d.f4213w;
            b0Var.f4057f = false;
        } else {
            this.f3990h.f4057f = true;
        }
        z1(this.f3992j.f4277e);
        this.f3991i = new Q1.B(this.f3992j);
        if (this.f3992j.f4282j) {
            this.f3986d.h("Event buffering is enabled", new Object[0]);
        }
        this.f3991i.B(this.f3992j);
        if (this.f3991i.f3906a == null) {
            if (s0.c(this.f3992j)) {
                this.f3986d.a("Unable to get Google Play Services Advertising ID at start time", new Object[0]);
            } else {
                if (this.f3992j.f4268J) {
                    this.f3986d.h("Cannot read Google Play Services Advertising ID with COPPA enabled", new Object[0]);
                }
                if (this.f3992j.f4267I) {
                    this.f3986d.h("Cannot read Google Play Services Advertising ID with play store kids app enabled", new Object[0]);
                }
            }
            if (this.f3991i.f3913h == null) {
                if (s0.b(this.f3992j)) {
                    this.f3986d.b("Unable to get any Device IDs. Please check if Proguard is correctly set with Adjust SDK", new Object[0]);
                } else {
                    if (this.f3992j.f4268J) {
                        this.f3986d.h("Cannot read non Play IDs with COPPA enabled", new Object[0]);
                    }
                    if (this.f3992j.f4267I) {
                        this.f3986d.h("Cannot read non Play IDs with play store kids app enabled", new Object[0]);
                    }
                }
            }
        } else {
            this.f3986d.h("Google Play Services Advertising ID read correctly at start time", new Object[0]);
        }
        String str = this.f3992j.f4283k;
        if (str != null) {
            this.f3986d.h("Default tracker: '%s'", str);
        }
        String str2 = this.f3992j.f4297y;
        if (str2 != null) {
            this.f3986d.h("Push token: '%s'", str2);
            if (this.f3990h.b()) {
                l(this.f3992j.f4297y, false);
            } else {
                q0.e(getContext()).A(this.f3992j.f4297y);
            }
        } else if (this.f3990h.b() && (l7 = q0.e(getContext()).l()) != null) {
            l(l7, true);
        }
        if (this.f4001s == null) {
            this.f4001s = this.f3992j.f4272N;
        }
        if (this.f3990h.b() && q0.e(getContext()).g()) {
            A();
        }
        this.f3987e = new S1.i(new D(), f3979u, f3978t, "Foreground timer");
        if (this.f3992j.f4292t) {
            this.f3986d.h("Send in background configured", new Object[0]);
            this.f3988f = new S1.j(new E(), "Background timer");
        }
        if (this.f3990h.a() && (d7 = this.f3992j.f4293u) != null && d7.doubleValue() > 0.0d) {
            this.f3986d.h("Delay start configured", new Object[0]);
            this.f3990h.f4055d = true;
            this.f3989g = new S1.j(new G(), "Delay Start timer");
        }
        R1.d.g(this.f3992j.f4296x);
        C0536h c0536h2 = this.f3992j;
        this.f3984b = AbstractC0540l.l(this, this.f3992j.f4277e, g2(false), new R1.a(c0536h2.f4265G, c0536h2.f4273a, c0536h2.f4274b, c0536h2.f4275c, c0536h2.f4276d, this.f3991i.f3915j, c0536h2.f4277e));
        C0536h c0536h3 = this.f3992j;
        this.f3994l = AbstractC0540l.d(this, g2(false), new R1.a(c0536h3.f4265G, c0536h3.f4273a, c0536h3.f4274b, c0536h3.f4275c, c0536h3.f4276d, this.f3991i.f3915j, c0536h3.f4277e));
        C0536h c0536h4 = this.f3992j;
        this.f3995m = AbstractC0540l.q(this, g2(true), new R1.a(c0536h4.f4265G, c0536h4.f4273a, c0536h4.f4274b, c0536h4.f4275c, c0536h4.f4276d, this.f3991i.f3915j, c0536h4.f4277e));
        C0536h c0536h5 = this.f3992j;
        this.f3996n = AbstractC0540l.n(this, g2(true), new R1.a(c0536h5.f4265G, c0536h5.f4273a, c0536h5.f4274b, c0536h5.f4275c, c0536h5.f4276d, this.f3991i.f3915j, c0536h5.f4277e));
        if (e1()) {
            t2();
        }
        this.f3998p = new Q1.L(this.f3992j.f4277e, new H());
        this.f3999q = new Q1.M(this.f3992j.f4277e, new I());
        C0536h c0536h6 = this.f3992j;
        this.f4000r = new Q1.N(c0536h6.f4277e, c0536h6.f4270L, new J());
        s1(this.f3992j.f4294v.f4401a);
        Q1();
    }

    private void c2() {
        synchronized (C0532d.class) {
            try {
                if (this.f3985c == null) {
                    return;
                }
                this.f3985c = null;
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    private boolean d1() {
        C0532d c0532d = this.f3985c;
        return c0532d != null ? c0532d.f4201c : this.f3990h.e();
    }

    private void d2() {
        synchronized (o0.class) {
            try {
                if (this.f3997o == null) {
                    return;
                }
                this.f3997o = null;
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    private boolean e1() {
        C0532d c0532d = this.f3985c;
        return c0532d != null ? c0532d.f4213w : this.f3990h.l();
    }

    private void e2() {
        synchronized (C0535g.class) {
            try {
                if (this.f3993k == null) {
                    return;
                }
                this.f3993k = null;
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    private boolean f1(j0 j0Var) {
        String str;
        return (j0Var == null || (str = j0Var.f4328a) == null || str.length() == 0) ? false : true;
    }

    private boolean f2() {
        return g2(false);
    }

    private void g1(Handler handler) {
        if (this.f3992j.f4284l == null) {
            return;
        }
        handler.post(new T());
    }

    private boolean g2(boolean z6) {
        if (r1(z6)) {
            return false;
        }
        if (this.f3992j.f4292t) {
            return true;
        }
        return this.f3990h.i();
    }

    public void h1(C0551x c0551x) {
        q2(c0551x.f4365c);
        Handler handler = new Handler(this.f3992j.f4277e.getMainLooper());
        if (r2(c0551x.f4371i)) {
            g1(handler);
        }
        t1(c0551x.f4511p, handler);
    }

    public void h2(C0534f c0534f) {
        if (D0(this.f3985c) && d1() && E0(c0534f) && !this.f3985c.f4202d) {
            this.f3984b.h(new Q1.b0(this.f3992j, this.f3991i, this.f3985c, this.f3997o, System.currentTimeMillis()).m(c0534f, this.f3990h.h()));
            this.f3984b.e();
        }
    }

    public void i1(Intent intent, Uri uri) {
        if (this.f3992j.f4277e.getPackageManager().queryIntentActivities(intent, 0).size() <= 0) {
            this.f3986d.b("Unable to open deferred deep link (%s)", uri);
        } else {
            this.f3986d.h("Open deferred deep link (%s)", uri);
            this.f3992j.f4277e.startActivity(intent);
        }
    }

    public void i2(String str, JSONObject jSONObject) {
        if (D0(this.f3985c) && d1() && !this.f3985c.f4202d) {
            this.f3984b.h(new Q1.b0(this.f3992j, this.f3991i, this.f3985c, this.f3997o, System.currentTimeMillis()).n(str, jSONObject));
            this.f3984b.e();
        }
    }

    public void j2(C0537i c0537i) {
        if (D0(this.f3985c) && d1() && I0(c0537i) && L0(c0537i.f4317f) && !this.f3985c.f4202d) {
            long currentTimeMillis = System.currentTimeMillis();
            this.f3985c.f4206p++;
            p2(currentTimeMillis);
            C0531c r6 = new Q1.b0(this.f3992j, this.f3991i, this.f3985c, this.f3997o, currentTimeMillis).r(c0537i, this.f3990h.h());
            this.f3984b.h(r6);
            if (this.f3992j.f4282j) {
                this.f3986d.h("Buffered event %s", r6.s());
            } else {
                this.f3984b.e();
            }
            if (this.f3992j.f4292t && this.f3990h.g()) {
                W1();
            }
            w2();
        }
    }

    public void k1(Q1.C c7) {
        q2(c7.f4365c);
        Handler handler = new Handler(this.f3992j.f4277e.getMainLooper());
        boolean z6 = c7.f4363a;
        if (z6 && this.f3992j.f4287o != null) {
            this.f3986d.c("Launching success event tracking listener", new Object[0]);
            handler.post(new N(c7));
        } else {
            if (z6 || this.f3992j.f4288p == null) {
                return;
            }
            this.f3986d.c("Launching failed event tracking listener", new Object[0]);
            handler.post(new O(c7));
        }
    }

    public void k2(boolean z6) {
        if (!D0(this.f3985c)) {
            this.f3992j.f4294v.f4403c = Boolean.valueOf(z6);
        } else if (d1() && !this.f3985c.f4202d) {
            C0531c u6 = new Q1.b0(this.f3992j, this.f3991i, this.f3985c, this.f3997o, System.currentTimeMillis()).u(z6);
            this.f3984b.h(u6);
            if (this.f3992j.f4282j) {
                this.f3986d.h("Buffered event %s", u6.s());
            } else {
                this.f3984b.e();
            }
        }
    }

    private void l2(long j7) {
        C0532d c0532d = this.f3985c;
        long j8 = j7 - c0532d.f4211u;
        c0532d.f4207q++;
        c0532d.f4212v = j8;
        o2(j7);
        this.f3985c.d(j7);
        w2();
    }

    public void m1(i0 i0Var) {
        Handler handler = new Handler(this.f3992j.f4277e.getMainLooper());
        JSONObject jSONObject = i0Var.f4368f;
        handler.post(new U(i0Var, jSONObject == null ? new C0544p("not_verified", 101, i0Var.f4366d) : new C0544p(R1.d.f(jSONObject, "verification_status"), R1.d.d(jSONObject, "code"), R1.d.f(jSONObject, "message"))));
    }

    public void m2(C0542n c0542n) {
        if (D0(this.f3985c) && d1() && !this.f3985c.f4202d) {
            this.f3984b.h(new Q1.b0(this.f3992j, this.f3991i, this.f3985c, this.f3997o, System.currentTimeMillis()).w(c0542n, this.f3990h.h()));
            this.f3984b.e();
        }
    }

    public void n1(n0 n0Var) {
        q2(n0Var.f4365c);
        Handler handler = new Handler(this.f3992j.f4277e.getMainLooper());
        if (r2(n0Var.f4371i)) {
            g1(handler);
        }
        if (TextUtils.isEmpty(n0Var.f4377o) || this.f4001s == null) {
            return;
        }
        handler.post(new P(n0Var));
    }

    public void n2(C0548u c0548u) {
        if (!D0(this.f3985c)) {
            this.f3992j.f4294v.f4402b.add(c0548u);
            return;
        }
        if (d1() && !this.f3985c.f4202d) {
            if (this.f3992j.f4268J) {
                this.f3986d.a("Calling third party sharing API not allowed when COPPA enabled", new Object[0]);
                return;
            }
            C0531c x6 = new Q1.b0(this.f3992j, this.f3991i, this.f3985c, this.f3997o, System.currentTimeMillis()).x(c0548u);
            this.f3984b.h(x6);
            if (this.f3992j.f4282j) {
                this.f3986d.h("Buffered event %s", x6.s());
            } else {
                this.f3984b.e();
            }
        }
    }

    private void o1(p0 p0Var, Handler handler) {
        boolean z6 = p0Var.f4363a;
        if (z6 && this.f3992j.f4289q != null) {
            this.f3986d.c("Launching success session tracking listener", new Object[0]);
            handler.post(new R(p0Var));
        } else {
            if (z6 || this.f3992j.f4290r == null) {
                return;
            }
            this.f3986d.c("Launching failed session tracking listener", new Object[0]);
            handler.post(new S(p0Var));
        }
    }

    private void o2(long j7) {
        this.f3984b.h(new Q1.b0(this.f3992j, this.f3991i, this.f3985c, this.f3997o, j7).v(this.f3990h.h()));
        this.f3984b.e();
    }

    public void p1(p0 p0Var) {
        this.f3986d.c("Launching SessionResponse tasks", new Object[0]);
        q2(p0Var.f4365c);
        Handler handler = new Handler(this.f3992j.f4277e.getMainLooper());
        if (r2(p0Var.f4371i)) {
            g1(handler);
        }
        if (this.f3993k == null && !this.f3985c.f4205o) {
            this.f3994l.e();
        }
        if (p0Var.f4363a) {
            q0.e(getContext()).G();
        }
        o1(p0Var, handler);
        this.f3990h.f4058g = true;
    }

    private boolean p2(long j7) {
        if (!D0(this.f3985c)) {
            return false;
        }
        C0532d c0532d = this.f3985c;
        long j8 = j7 - c0532d.f4211u;
        if (j8 > f3981w) {
            return false;
        }
        c0532d.f4211u = j7;
        if (j8 < 0) {
            this.f3986d.b("Time travel!", new Object[0]);
            return true;
        }
        c0532d.f4209s += j8;
        c0532d.f4210t += j8;
        return true;
    }

    private void q1() {
        this.f3994l.b();
        this.f3984b.b();
        if (g2(true)) {
            this.f3995m.c();
            this.f3996n.c();
        } else {
            this.f3995m.b();
            this.f3996n.b();
        }
    }

    private void q2(String str) {
        if (str == null || str.equals(this.f3985c.f4216z)) {
            return;
        }
        this.f3985c.f4216z = str;
        w2();
    }

    private boolean r1(boolean z6) {
        return z6 ? this.f3990h.k() || !d1() : this.f3990h.k() || !d1() || this.f3990h.h();
    }

    private void s1(List list) {
        if (list == null) {
            return;
        }
        Iterator it = list.iterator();
        while (it.hasNext()) {
            ((Q1.J) it.next()).a(this);
        }
    }

    private void s2() {
        if (!f2()) {
            q1();
            return;
        }
        L1();
        if (!this.f3992j.f4282j || (this.f3990h.f() && this.f3990h.d())) {
            this.f3984b.e();
        }
    }

    private void t1(Uri uri, Handler handler) {
        if (uri == null) {
            return;
        }
        this.f3986d.h("Deferred deeplink received (%s)", uri);
        handler.post(new V(uri, M0(uri)));
    }

    private void t2() {
        this.f3984b.f(this.f3997o);
        this.f3990h.f4056e = false;
        C0532d c0532d = this.f3985c;
        if (c0532d != null) {
            c0532d.f4213w = false;
            w2();
        }
    }

    private void u1() {
        if (D0(this.f3985c)) {
            q0 e7 = q0.e(getContext());
            String d7 = e7.d();
            long c7 = e7.c();
            if (d7 == null || c7 == -1) {
                return;
            }
            v(Uri.parse(d7), c7);
            e7.r();
        }
    }

    private void u2(boolean z6, String str, String str2, String str3) {
        if (z6) {
            this.f3986d.h(str, new Object[0]);
        } else if (!r1(false)) {
            this.f3986d.h(str3, new Object[0]);
        } else if (r1(true)) {
            this.f3986d.h(str2, new Object[0]);
        } else {
            this.f3986d.h(str2 + ", except the Sdk Click Handler", new Object[0]);
        }
        s2();
    }

    private void v1() {
        if (this.f3992j.f4268J) {
            T0();
        } else {
            K1();
        }
    }

    public void v2(C0543o c0543o, Q1.Y y6) {
        if (y6 == null) {
            this.f3986d.a("Purchase verification aborted because verification callback is null", new Object[0]);
            return;
        }
        String str = this.f3992j.f4265G;
        if (str != null && (str.equals("data_residency_eu") || this.f3992j.f4265G.equals("data_residency_us") || this.f3992j.f4265G.equals("data_residency_tr"))) {
            this.f3986d.a("Purchase verification not available for data residency users right now", new Object[0]);
            return;
        }
        if (!D0(this.f3985c)) {
            y6.a(new C0544p("not_verified", 102, "Purchase verification aborted because SDK is still not initialized"));
            this.f3986d.a("Purchase verification aborted because SDK is still not initialized", new Object[0]);
            return;
        }
        if (!d1()) {
            y6.a(new C0544p("not_verified", 103, "Purchase verification aborted because SDK is disabled"));
            this.f3986d.a("Purchase verification aborted because SDK is disabled", new Object[0]);
            return;
        }
        if (this.f3985c.f4202d) {
            y6.a(new C0544p("not_verified", 104, "Purchase verification aborted because user is GDPR forgotten"));
            this.f3986d.a("Purchase verification aborted because user is GDPR forgotten", new Object[0]);
            return;
        }
        if (c0543o == null) {
            this.f3986d.a("Purchase verification aborted because purchase instance is null", new Object[0]);
            y6.a(new C0544p("not_verified", 105, "Purchase verification aborted because purchase instance is null"));
            return;
        }
        C0531c y7 = new Q1.b0(this.f3992j, this.f3991i, this.f3985c, this.f3997o, System.currentTimeMillis()).y(c0543o, y6);
        if (y7 != null) {
            this.f3996n.e(y7);
        } else {
            this.f3986d.a("Purchase verification aborted because verification package is null", new Object[0]);
            y6.a(new C0544p("not_verified", 106, "Purchase verification aborted because verification package is null"));
        }
    }

    private void w1() {
        if (this.f3985c.f4202d) {
            return;
        }
        long currentTimeMillis = System.currentTimeMillis();
        C0532d c0532d = this.f3985c;
        long j7 = currentTimeMillis - c0532d.f4211u;
        if (j7 < 0) {
            this.f3986d.b("Time travel!", new Object[0]);
            this.f3985c.f4211u = currentTimeMillis;
            w2();
            return;
        }
        if (j7 > f3981w) {
            l2(currentTimeMillis);
            F0();
            return;
        }
        if (j7 <= f3982x) {
            this.f3986d.g("Time span since last activity too short for a new subsession", new Object[0]);
            return;
        }
        int i7 = c0532d.f4208r + 1;
        c0532d.f4208r = i7;
        c0532d.f4209s += j7;
        c0532d.f4211u = currentTimeMillis;
        this.f3986d.g("Started subsession %d of session %d", Integer.valueOf(i7), Integer.valueOf(this.f3985c.f4207q));
        w2();
        K0();
        this.f3998p.s();
        this.f3999q.c();
        this.f4000r.b();
        A1();
        C1();
        B1();
    }

    private void w2() {
        synchronized (C0532d.class) {
            try {
                C0532d c0532d = this.f3985c;
                if (c0532d == null) {
                    return;
                }
                s0.j0(c0532d, this.f3992j.f4277e, "AdjustIoActivityState", "Activity state");
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    private void x1(Context context) {
        try {
            this.f3985c = (C0532d) s0.d0(context, "AdjustIoActivityState", "Activity state", C0532d.class);
        } catch (Exception e7) {
            this.f3986d.b("Failed to read %s file (%s)", "Activity state", e7.getMessage());
            this.f3985c = null;
        }
        if (this.f3985c != null) {
            this.f3990h.f4059h = true;
        }
    }

    private void x2() {
        synchronized (C0535g.class) {
            try {
                C0535g c0535g = this.f3993k;
                if (c0535g == null) {
                    return;
                }
                s0.j0(c0535g, this.f3992j.f4277e, "AdjustAttribution", "Attribution");
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    private void y1(Context context) {
        try {
            this.f3993k = (C0535g) s0.d0(context, "AdjustAttribution", "Attribution", C0535g.class);
        } catch (Exception e7) {
            this.f3986d.b("Failed to read %s file (%s)", "Attribution", e7.getMessage());
            this.f3993k = null;
        }
    }

    private void y2() {
        synchronized (o0.class) {
            try {
                o0 o0Var = this.f3997o;
                if (o0Var == null) {
                    return;
                }
                s0.j0(o0Var.f4443a, this.f3992j.f4277e, "AdjustSessionCallbackParameters", "Session Callback parameters");
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    private void z1(Context context) {
        try {
            InputStream open = context.getAssets().open("adjust_config.properties");
            Properties properties = new Properties();
            properties.load(open);
            this.f3986d.g("adjust_config.properties file read and loaded", new Object[0]);
            String property = properties.getProperty("defaultTracker");
            if (property != null) {
                this.f3992j.f4283k = property;
            }
        } catch (Exception e7) {
            this.f3986d.c("%s file not found in this app", e7.getMessage());
        }
    }

    private void z2() {
        synchronized (o0.class) {
            try {
                o0 o0Var = this.f3997o;
                if (o0Var == null) {
                    return;
                }
                s0.j0(o0Var.f4444b, this.f3992j.f4277e, "AdjustSessionPartnerParameters", "Session Partner parameters");
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @Override
    public void A() {
        this.f3983a.submit(new RunnableC0520q());
    }

    public void A0(String str, String str2) {
        if (s0.W(str, "key", "Session Partner") && s0.W(str2, "value", "Session Partner")) {
            o0 o0Var = this.f3997o;
            if (o0Var.f4444b == null) {
                o0Var.f4444b = new LinkedHashMap();
            }
            String str3 = (String) this.f3997o.f4444b.get(str);
            if (str2.equals(str3)) {
                this.f3986d.g("Key %s already present with the same value", str);
                return;
            }
            if (str3 != null) {
                this.f3986d.a("Key %s will be overwritten", str);
            }
            this.f3997o.f4444b.put(str, str2);
            z2();
        }
    }

    @Override
    public C0532d B() {
        return this.f3985c;
    }

    public void B0() {
        this.f3983a.submit(new A());
    }

    @Override
    public void C(n0 n0Var) {
        this.f3983a.submit(new RunnableC0507d(n0Var));
    }

    @Override
    public void D(String str, String str2) {
        this.f3983a.submit(new RunnableC0514k(str, str2));
    }

    @Override
    public C0536h E() {
        return this.f3992j;
    }

    @Override
    public void F(C0537i c0537i) {
        this.f3983a.submit(new Q(c0537i));
    }

    @Override
    public void G(p0 p0Var) {
        this.f3983a.submit(new RunnableC0508e(p0Var));
    }

    public void G1(String str) {
        if (s0.W(str, "key", "Session Callback")) {
            Map map = this.f3997o.f4443a;
            if (map == null) {
                this.f3986d.a("Session Callback parameters are not set", new Object[0]);
            } else if (((String) map.remove(str)) == null) {
                this.f3986d.a("Key %s does not exist", str);
            } else {
                this.f3986d.c("Key %s will be removed", str);
                y2();
            }
        }
    }

    @Override
    public void H() {
        this.f3983a.submit(new RunnableC0070a());
    }

    public void H1(String str) {
        if (s0.W(str, "key", "Session Partner")) {
            Map map = this.f3997o.f4444b;
            if (map == null) {
                this.f3986d.a("Session Partner parameters are not set", new Object[0]);
            } else if (((String) map.remove(str)) == null) {
                this.f3986d.a("Key %s does not exist", str);
            } else {
                this.f3986d.c("Key %s will be removed", str);
                z2();
            }
        }
    }

    @Override
    public void I() {
        this.f3983a.submit(new RunnableC0517n());
    }

    public void I1() {
        if (this.f3997o.f4443a == null) {
            this.f3986d.a("Session Callback parameters are not set", new Object[0]);
        }
        this.f3997o.f4443a = null;
        y2();
    }

    @Override
    public void J(C0543o c0543o, Q1.Y y6) {
        this.f3983a.submit(new B(c0543o, y6));
    }

    public void J1() {
        if (this.f3997o.f4444b == null) {
            this.f3986d.a("Session Partner parameters are not set", new Object[0]);
        }
        this.f3997o.f4444b = null;
        z2();
    }

    @Override
    public void K(C0542n c0542n) {
        this.f3983a.submit(new RunnableC0527x(c0542n));
    }

    @Override
    public void L() {
        this.f3983a.submit(new RunnableC0528y());
    }

    public void N1(j0 j0Var, String str) {
        this.f3983a.submit(new RunnableC0505b(j0Var, str));
    }

    public void W0() {
        this.f3983a.submit(new RunnableC0529z());
    }

    @Override
    public void a() {
        S1.j jVar = this.f3988f;
        if (jVar != null) {
            jVar.i();
        }
        S1.i iVar = this.f3987e;
        if (iVar != null) {
            iVar.g();
        }
        S1.j jVar2 = this.f3989g;
        if (jVar2 != null) {
            jVar2.i();
        }
        S1.f fVar = this.f3983a;
        if (fVar != null) {
            fVar.a();
        }
        Q1.H h7 = this.f3984b;
        if (h7 != null) {
            h7.a();
        }
        Q1.F f7 = this.f3994l;
        if (f7 != null) {
            f7.a();
        }
        Q1.K k7 = this.f3995m;
        if (k7 != null) {
            k7.a();
        }
        Q1.I i7 = this.f3996n;
        if (i7 != null) {
            i7.a();
        }
        o0 o0Var = this.f3997o;
        if (o0Var != null) {
            Map map = o0Var.f4443a;
            if (map != null) {
                map.clear();
            }
            Map map2 = this.f3997o.f4444b;
            if (map2 != null) {
                map2.clear();
            }
        }
        c2();
        e2();
        d2();
        this.f3984b = null;
        this.f3986d = null;
        this.f3987e = null;
        this.f3983a = null;
        this.f3988f = null;
        this.f3989g = null;
        this.f3990h = null;
        this.f3991i = null;
        this.f3992j = null;
        this.f3994l = null;
        this.f3995m = null;
        this.f3996n = null;
        this.f3997o = null;
    }

    @Override
    public void b() {
        this.f3990h.f4054c = false;
        this.f3983a.submit(new RunnableC0524u());
    }

    @Override
    public void d() {
        this.f3990h.f4054c = true;
        this.f3983a.submit(new F());
    }

    @Override
    public C0535g e() {
        return this.f3993k;
    }

    @Override
    public o0 f() {
        return this.f3997o;
    }

    @Override
    public void g(boolean z6) {
        this.f3983a.submit(new RunnableC0523t(z6));
    }

    @Override
    public Context getContext() {
        return this.f3992j.f4277e;
    }

    @Override
    public void h(String str) {
        this.f3983a.submit(new RunnableC0516m(str));
    }

    @Override
    public void i() {
        this.f3983a.submit(new RunnableC0518o());
    }

    @Override
    public boolean isEnabled() {
        return d1();
    }

    @Override
    public void j(C0551x c0551x) {
        this.f3983a.submit(new RunnableC0509f(c0551x));
    }

    public void j1(Q1.C c7) {
        this.f3983a.submit(new RunnableC0506c(c7));
    }

    @Override
    public String k() {
        C0532d c0532d = this.f3985c;
        if (c0532d == null) {
            return null;
        }
        return c0532d.f4216z;
    }

    @Override
    public void l(String str, boolean z6) {
        this.f3983a.submit(new RunnableC0519p(z6, str));
    }

    public void l1(i0 i0Var) {
        this.f3983a.submit(new RunnableC0510g(i0Var));
    }

    @Override
    public void m(C0536h c0536h) {
        this.f3992j = c0536h;
    }

    @Override
    public void n(String str, JSONObject jSONObject) {
        this.f3983a.submit(new RunnableC0525v(str, jSONObject));
    }

    @Override
    public void o(C0548u c0548u) {
        this.f3983a.submit(new RunnableC0522s(c0548u));
    }

    @Override
    public void p(C0534f c0534f) {
        this.f3983a.submit(new RunnableC0526w(c0534f));
    }

    @Override
    public void q(boolean z6) {
        this.f3983a.submit(new a0(z6));
    }

    @Override
    public void r() {
        this.f3983a.submit(new RunnableC0511h());
    }

    public boolean r2(C0535g c0535g) {
        if (c0535g == null) {
            return false;
        }
        if (this.f3992j.f4269K && this.f3985c.f4205o) {
            this.f3986d.h("Not updating intermediate attribution", new Object[0]);
            return false;
        }
        if (c0535g.equals(this.f3993k)) {
            return false;
        }
        this.f3993k = c0535g;
        x2();
        return true;
    }

    @Override
    public void s(String str, String str2) {
        this.f3983a.submit(new RunnableC0512i(str, str2));
    }

    @Override
    public void setEnabled(boolean z6) {
        this.f3983a.submit(new W(z6));
    }

    @Override
    public void t(Uri uri, long j7, Q1.T t6) {
        this.f4001s = t6;
        this.f3983a.submit(new Z(uri, j7));
    }

    @Override
    public void u() {
        this.f3983a.submit(new RunnableC0521r());
    }

    @Override
    public void v(Uri uri, long j7) {
        this.f3983a.submit(new Y(uri, j7));
    }

    @Override
    public void w(l0 l0Var) {
        if (l0Var instanceof p0) {
            this.f3986d.c("Finished tracking session", new Object[0]);
            this.f3994l.f((p0) l0Var);
            return;
        }
        if (l0Var instanceof n0) {
            n0 n0Var = (n0) l0Var;
            J0(n0Var);
            this.f3994l.h(n0Var);
        } else if (l0Var instanceof Q1.C) {
            j1((Q1.C) l0Var);
        } else if (l0Var instanceof i0) {
            l1((i0) l0Var);
        }
    }

    @Override
    public void x(String str) {
        this.f3983a.submit(new RunnableC0515l(str));
    }

    @Override
    public void y(boolean z6) {
        this.f3983a.submit(new X(z6));
    }

    @Override
    public Q1.B z() {
        return this.f3991i;
    }

    public void z0(String str, String str2) {
        if (s0.W(str, "key", "Session Callback") && s0.W(str2, "value", "Session Callback")) {
            o0 o0Var = this.f3997o;
            if (o0Var.f4443a == null) {
                o0Var.f4443a = new LinkedHashMap();
            }
            String str3 = (String) this.f3997o.f4443a.get(str);
            if (str2.equals(str3)) {
                this.f3986d.g("Key %s already present with the same value", str);
                return;
            }
            if (str3 != null) {
                this.f3986d.a("Key %s will be overwritten", str);
            }
            this.f3997o.f4443a.put(str, str2);
            y2();
        }
    }
}