导航菜单

页面标题

页面副标题

Dostt v1.0.89 - C1826a.java 源代码

正在查看: Dostt v1.0.89 应用的 C1826a.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 com.razorpay.rn.RazorpayModule;
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 C1826a implements Q1.E {

    private static long f11740t;

    private static long f11741u;

    private static long f11742v;

    private static long f11743w;

    private static long f11744x;

    private S1.f f11745a;

    private Q1.H f11746b;

    private C1854d f11747c;

    private Q1.G f11748d;

    private S1.i f11749e;

    private S1.j f11750f;

    private S1.j f11751g;

    private b0 f11752h;

    private Q1.B f11753i;

    private C1858h f11754j;

    private C1857g f11755k;

    private Q1.F f11756l;

    private Q1.K f11757m;

    private Q1.I f11758n;

    private o0 f11759o;

    private Q1.L f11760p;

    private Q1.M f11761q;

    private Q1.N f11762r;

    private Q1.T f11763s;

    class A implements Runnable {
        A() {
        }

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

    class B implements Runnable {

        final C1865o f11765a;

        final Q1.Y f11766b;

        B(C1865o c1865o, Q1.Y y10) {
            this.f11765a = c1865o;
            this.f11766b = y10;
        }

        @Override
        public void run() {
            C1826a.this.v2(this.f11765a, this.f11766b);
        }
    }

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

        @Override
        public void a(C1826a c1826a) {
            c1826a.S1(C1826a.this.f11754j.f12060z.booleanValue());
        }
    }

    class D implements Runnable {
        D() {
        }

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

    class E implements Runnable {
        E() {
        }

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

    class F implements Runnable {
        F() {
        }

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

    class G implements Runnable {
        G() {
        }

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

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

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

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

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

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

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

    class K implements Runnable {
        K() {
        }

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

    class L implements Runnable {
        L() {
        }

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

    class M implements Runnable {
        M() {
        }

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

    class N implements Runnable {

        final Q1.C f11779a;

        N(Q1.C c10) {
            this.f11779a = c10;
        }

        @Override
        public void run() {
            if (C1826a.this.f11754j == null || C1826a.this.f11754j.f12049o == null) {
                return;
            }
            C1826a.this.f11754j.f12049o.onFinishedEventTrackingSucceeded(this.f11779a.c());
        }
    }

    class O implements Runnable {

        final Q1.C f11781a;

        O(Q1.C c10) {
            this.f11781a = c10;
        }

        @Override
        public void run() {
            if (C1826a.this.f11754j == null || C1826a.this.f11754j.f12050p == null) {
                return;
            }
            C1826a.this.f11754j.f12050p.onFinishedEventTrackingFailed(this.f11781a.b());
        }
    }

    class P implements Runnable {

        final n0 f11783a;

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

        @Override
        public void run() {
            C1826a.this.f11763s.a(this.f11783a.f12139o);
            C1826a.this.f11763s = null;
        }
    }

    class Q implements Runnable {

        final C1859i f11785a;

        Q(C1859i c1859i) {
            this.f11785a = c1859i;
        }

        @Override
        public void run() {
            if (C1826a.this.f11752h.a()) {
                C1826a.this.f11748d.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]);
                C1826a.this.Z1();
            }
            C1826a.this.j2(this.f11785a);
        }
    }

    class R implements Runnable {

        final p0 f11787a;

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

        @Override
        public void run() {
            if (C1826a.this.f11754j == null || C1826a.this.f11754j.f12051q == null) {
                return;
            }
            C1826a.this.f11754j.f12051q.onFinishedSessionTrackingSucceeded(this.f11787a.c());
        }
    }

    class S implements Runnable {

        final p0 f11789a;

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

        @Override
        public void run() {
            if (C1826a.this.f11754j == null || C1826a.this.f11754j.f12052r == null) {
                return;
            }
            C1826a.this.f11754j.f12052r.onFinishedSessionTrackingFailed(this.f11789a.b());
        }
    }

    class T implements Runnable {
        T() {
        }

        @Override
        public void run() {
            if (C1826a.this.f11754j == null || C1826a.this.f11754j.f12046l == null) {
                return;
            }
            C1826a.this.f11754j.f12046l.onAttributionChanged(C1826a.this.f11755k);
        }
    }

    class U implements Runnable {

        final i0 f11792a;

        final C1866p f11793b;

        U(i0 i0Var, C1866p c1866p) {
            this.f11792a = i0Var;
            this.f11793b = c1866p;
        }

        @Override
        public void run() {
            this.f11792a.f12137m.q().a(this.f11793b);
        }
    }

    class V implements Runnable {

        final Uri f11795a;

        final Intent f11796b;

        V(Uri uri, Intent intent) {
            this.f11795a = uri;
            this.f11796b = intent;
        }

        @Override
        public void run() {
            if (C1826a.this.f11754j == null) {
                return;
            }
            if (C1826a.this.f11754j.f12053s != null ? C1826a.this.f11754j.f12053s.launchReceivedDeeplink(this.f11795a) : true) {
                C1826a.this.i1(this.f11796b, this.f11795a);
            }
        }
    }

    class W implements Runnable {

        final boolean f11798a;

        W(boolean z10) {
            this.f11798a = z10;
        }

        @Override
        public void run() {
            C1826a.this.S1(this.f11798a);
        }
    }

    class X implements Runnable {

        final boolean f11800a;

        X(boolean z10) {
            this.f11800a = z10;
        }

        @Override
        public void run() {
            C1826a.this.T1(this.f11800a);
        }
    }

    class Y implements Runnable {

        final Uri f11802a;

        final long f11803b;

        Y(Uri uri, long j10) {
            this.f11802a = uri;
            this.f11803b = j10;
        }

        @Override
        public void run() {
            C1826a.this.D1(this.f11802a, this.f11803b);
        }
    }

    class Z implements Runnable {

        final Uri f11805a;

        final long f11806b;

        Z(Uri uri, long j10) {
            this.f11805a = uri;
            this.f11806b = j10;
        }

        @Override
        public void run() {
            C1826a.this.D1(this.f11805a, this.f11806b);
        }
    }

    class RunnableC0220a implements Runnable {
        RunnableC0220a() {
        }

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

    class a0 implements Runnable {

        final boolean f11809a;

        a0(boolean z10) {
            this.f11809a = z10;
        }

        @Override
        public void run() {
            C1826a.this.R1(this.f11809a);
        }
    }

    class RunnableC1827b implements Runnable {

        final j0 f11811a;

        final String f11812b;

        RunnableC1827b(j0 j0Var, String str) {
            this.f11811a = j0Var;
            this.f11812b = str;
        }

        @Override
        public void run() {
            C1826a.this.O1(this.f11811a, this.f11812b);
        }
    }

    public class b0 {

        boolean f11814a;

        boolean f11815b;

        boolean f11816c;

        boolean f11817d;

        boolean f11818e;

        boolean f11819f;

        boolean f11820g;

        boolean f11821h;

        boolean f11822i;

        public b0() {
        }

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

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

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

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

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

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

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

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

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

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

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

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

    class RunnableC1828c implements Runnable {

        final Q1.C f11824a;

        RunnableC1828c(Q1.C c10) {
            this.f11824a = c10;
        }

        @Override
        public void run() {
            C1826a.this.k1(this.f11824a);
        }
    }

    class RunnableC1829d implements Runnable {

        final n0 f11826a;

        RunnableC1829d(n0 n0Var) {
            this.f11826a = n0Var;
        }

        @Override
        public void run() {
            C1826a.this.n1(this.f11826a);
        }
    }

    class RunnableC1830e implements Runnable {

        final p0 f11828a;

        RunnableC1830e(p0 p0Var) {
            this.f11828a = p0Var;
        }

        @Override
        public void run() {
            C1826a.this.p1(this.f11828a);
        }
    }

    class RunnableC1831f implements Runnable {

        final C1873x f11830a;

        RunnableC1831f(C1873x c1873x) {
            this.f11830a = c1873x;
        }

        @Override
        public void run() {
            C1826a.this.h1(this.f11830a);
        }
    }

    class RunnableC1832g implements Runnable {

        final i0 f11832a;

        RunnableC1832g(i0 i0Var) {
            this.f11832a = i0Var;
        }

        @Override
        public void run() {
            C1826a.this.m1(this.f11832a);
        }
    }

    class RunnableC1833h implements Runnable {
        RunnableC1833h() {
        }

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

    class RunnableC1834i implements Runnable {

        final String f11835a;

        final String f11836b;

        RunnableC1834i(String str, String str2) {
            this.f11835a = str;
            this.f11836b = str2;
        }

        @Override
        public void run() {
            C1826a.this.z0(this.f11835a, this.f11836b);
        }
    }

    class RunnableC1835j implements Runnable {
        RunnableC1835j() {
        }

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

    class RunnableC1836k implements Runnable {

        final String f11839a;

        final String f11840b;

        RunnableC1836k(String str, String str2) {
            this.f11839a = str;
            this.f11840b = str2;
        }

        @Override
        public void run() {
            C1826a.this.A0(this.f11839a, this.f11840b);
        }
    }

    class RunnableC1837l implements Runnable {

        final String f11842a;

        RunnableC1837l(String str) {
            this.f11842a = str;
        }

        @Override
        public void run() {
            C1826a.this.G1(this.f11842a);
        }
    }

    class RunnableC1838m implements Runnable {

        final String f11844a;

        RunnableC1838m(String str) {
            this.f11844a = str;
        }

        @Override
        public void run() {
            C1826a.this.H1(this.f11844a);
        }
    }

    class RunnableC1839n implements Runnable {
        RunnableC1839n() {
        }

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

    class RunnableC1840o implements Runnable {
        RunnableC1840o() {
        }

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

    class RunnableC1841p implements Runnable {

        final boolean f11848a;

        final String f11849b;

        RunnableC1841p(boolean z10, String str) {
            this.f11848a = z10;
            this.f11849b = str;
        }

        @Override
        public void run() {
            if (!this.f11848a) {
                q0.e(C1826a.this.getContext()).A(this.f11849b);
            }
            if (C1826a.this.f11752h.a()) {
                return;
            }
            C1826a.this.U1(this.f11849b);
        }
    }

    class RunnableC1842q implements Runnable {
        RunnableC1842q() {
        }

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

    class RunnableC1843r implements Runnable {
        RunnableC1843r() {
        }

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

    class RunnableC1844s implements Runnable {

        final C1870u f11853a;

        RunnableC1844s(C1870u c1870u) {
            this.f11853a = c1870u;
        }

        @Override
        public void run() {
            C1826a.this.n2(this.f11853a);
        }
    }

    class RunnableC1845t implements Runnable {

        final boolean f11855a;

        RunnableC1845t(boolean z10) {
            this.f11855a = z10;
        }

        @Override
        public void run() {
            C1826a.this.k2(this.f11855a);
        }
    }

    class RunnableC1846u implements Runnable {
        RunnableC1846u() {
        }

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

    class RunnableC1847v implements Runnable {

        final String f11858a;

        final JSONObject f11859b;

        RunnableC1847v(String str, JSONObject jSONObject) {
            this.f11858a = str;
            this.f11859b = jSONObject;
        }

        @Override
        public void run() {
            C1826a.this.i2(this.f11858a, this.f11859b);
        }
    }

    class RunnableC1848w implements Runnable {

        final C1856f f11861a;

        RunnableC1848w(C1856f c1856f) {
            this.f11861a = c1856f;
        }

        @Override
        public void run() {
            C1826a.this.h2(this.f11861a);
        }
    }

    class RunnableC1849x implements Runnable {

        final C1864n f11863a;

        RunnableC1849x(C1864n c1864n) {
            this.f11863a = c1864n;
        }

        @Override
        public void run() {
            C1826a.this.m2(this.f11863a);
        }
    }

    class RunnableC1850y implements Runnable {
        RunnableC1850y() {
        }

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

    class RunnableC1851z implements Runnable {
        RunnableC1851z() {
        }

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

    private C1826a(C1858h c1858h) {
        m(c1858h);
        Q1.G j10 = AbstractC1862l.j();
        this.f11748d = j10;
        j10.d();
        this.f11745a = new S1.d("ActivityHandler");
        b0 b0Var = new b0();
        this.f11752h = b0Var;
        Boolean bool = c1858h.f12060z;
        b0Var.f11814a = bool != null ? bool.booleanValue() : true;
        b0 b0Var2 = this.f11752h;
        b0Var2.f11815b = c1858h.f12021A;
        b0Var2.f11816c = true;
        b0Var2.f11817d = false;
        b0Var2.f11818e = false;
        b0Var2.f11820g = false;
        b0Var2.f11821h = false;
        b0Var2.f11822i = false;
        this.f11745a.submit(new RunnableC1835j());
    }

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

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

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

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

    private boolean D0(C1854d c1854d) {
        if (!this.f11752h.a()) {
            return true;
        }
        this.f11748d.b("Sdk did not yet start", new Object[0]);
        return false;
    }

    public void D1(Uri uri, long j10) {
        if (d1()) {
            if (!s0.V(uri)) {
                C1853c a10 = c0.a(uri, j10, this.f11747c, this.f11754j, this.f11753i, this.f11759o);
                if (a10 == null) {
                    return;
                }
                this.f11757m.e(a10);
                return;
            }
            this.f11748d.c("Deeplink (" + uri.toString() + ") processing skipped", new Object[0]);
        }
    }

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

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

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

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

    private void G0(q0 q0Var) {
        String l10 = q0Var.l();
        if (l10 != null && !l10.equals(this.f11747c.f11977y)) {
            l(l10, true);
        }
        if (q0Var.n() != null) {
            H();
        }
        K0();
        this.f11760p.s();
        this.f11761q.c();
        this.f11762r.b();
        A1();
        C1();
        B1();
    }

    private void H0() {
        if (D0(this.f11747c)) {
            if (this.f11752h.f() && this.f11752h.d()) {
                return;
            }
            if (this.f11755k == null || this.f11747c.f11967o) {
                this.f11756l.e();
            }
        }
    }

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

    private void J0(n0 n0Var) {
        if (n0Var.f12193p) {
            String str = n0Var.f12202y;
            if (str != null && str.equalsIgnoreCase("huawei_ads")) {
                C1854d c1854d = this.f11747c;
                c1854d.f11941H = n0Var.f12194q;
                c1854d.f11942I = n0Var.f12195r;
                c1854d.f11943J = n0Var.f12196s;
                w2();
                return;
            }
            String str2 = n0Var.f12202y;
            if (str2 != null && str2.equalsIgnoreCase("huawei_app_gallery")) {
                C1854d c1854d2 = this.f11747c;
                c1854d2.f11941H = n0Var.f12194q;
                c1854d2.f11942I = n0Var.f12195r;
                c1854d2.f11944K = n0Var.f12196s;
                w2();
                return;
            }
            String str3 = n0Var.f12202y;
            if (str3 != null && str3.equalsIgnoreCase("meta")) {
                C1854d c1854d3 = this.f11747c;
                c1854d3.f11959Z = n0Var.f12194q;
                c1854d3.f11958Y = n0Var.f12196s;
                c1854d3.f11961a0 = n0Var.f12201x;
                w2();
                return;
            }
            String str4 = n0Var.f12202y;
            if (str4 != null && str4.equalsIgnoreCase("samsung")) {
                C1854d c1854d4 = this.f11747c;
                c1854d4.f11951R = n0Var.f12194q;
                c1854d4.f11952S = n0Var.f12195r;
                c1854d4.f11953T = n0Var.f12196s;
                w2();
                return;
            }
            String str5 = n0Var.f12202y;
            if (str5 != null && str5.equalsIgnoreCase("xiaomi")) {
                C1854d c1854d5 = this.f11747c;
                c1854d5.f11945L = n0Var.f12194q;
                c1854d5.f11946M = n0Var.f12195r;
                c1854d5.f11947N = n0Var.f12196s;
                c1854d5.f11948O = n0Var.f12197t;
                c1854d5.f11949P = n0Var.f12198u;
                c1854d5.f11950Q = n0Var.f12199v;
                w2();
                return;
            }
            String str6 = n0Var.f12202y;
            if (str6 != null && str6.equalsIgnoreCase("vivo")) {
                C1854d c1854d6 = this.f11747c;
                c1854d6.f11954U = n0Var.f12194q;
                c1854d6.f11955V = n0Var.f12195r;
                c1854d6.f11956W = n0Var.f12196s;
                c1854d6.f11957X = n0Var.f12199v;
                w2();
                return;
            }
            C1854d c1854d7 = this.f11747c;
            c1854d7.f11934A = n0Var.f12194q;
            c1854d7.f11935B = n0Var.f12195r;
            c1854d7.f11936C = n0Var.f12196s;
            c1854d7.f11938E = n0Var.f12197t;
            c1854d7.f11939F = n0Var.f12198u;
            c1854d7.f11940G = n0Var.f12199v;
            c1854d7.f11937D = n0Var.f12200w;
            w2();
        }
    }

    private void K0() {
        C1854d c1854d = this.f11747c;
        if (c1854d == null || !c1854d.f11963c || c1854d.f11964d) {
            return;
        }
        P1();
        if (this.f11754j.f12025E && !this.f11752h.c()) {
            String str = this.f11753i.f11678k;
            if (str == null || str.isEmpty()) {
                this.f11748d.c("Can't read preinstall payload, invalid package name", new Object[0]);
                return;
            }
            q0 e10 = q0.e(getContext());
            long j10 = e10.j();
            if (g0.i(j10)) {
                this.f11752h.f11822i = true;
                return;
            }
            if (g0.j("system_properties", j10)) {
                String c10 = g0.c(this.f11753i.f11678k, this.f11748d);
                if (c10 == null || c10.isEmpty()) {
                    j10 = g0.k("system_properties", j10);
                } else {
                    this.f11757m.g(c10, "system_properties");
                }
            }
            if (g0.j("system_properties_reflection", j10)) {
                String f10 = g0.f(this.f11753i.f11678k, this.f11748d);
                if (f10 == null || f10.isEmpty()) {
                    j10 = g0.k("system_properties_reflection", j10);
                } else {
                    this.f11757m.g(f10, "system_properties_reflection");
                }
            }
            if (g0.j("system_properties_path", j10)) {
                String d10 = g0.d(this.f11753i.f11678k, this.f11748d);
                if (d10 == null || d10.isEmpty()) {
                    j10 = g0.k("system_properties_path", j10);
                } else {
                    this.f11757m.g(d10, "system_properties_path");
                }
            }
            if (g0.j("system_properties_path_reflection", j10)) {
                String e11 = g0.e(this.f11753i.f11678k, this.f11748d);
                if (e11 == null || e11.isEmpty()) {
                    j10 = g0.k("system_properties_path_reflection", j10);
                } else {
                    this.f11757m.g(e11, "system_properties_path_reflection");
                }
            }
            if (g0.j("content_provider", j10)) {
                String a10 = g0.a(this.f11754j.f12039e, this.f11753i.f11678k, this.f11748d);
                if (a10 == null || a10.isEmpty()) {
                    j10 = g0.k("content_provider", j10);
                } else {
                    this.f11757m.g(a10, "content_provider");
                }
            }
            if (g0.j("content_provider_intent_action", j10)) {
                List g10 = g0.g(this.f11754j.f12039e, this.f11753i.f11678k, this.f11748d);
                if (g10 == null || g10.isEmpty()) {
                    j10 = g0.k("content_provider_intent_action", j10);
                } else {
                    Iterator it = g10.iterator();
                    while (it.hasNext()) {
                        this.f11757m.g((String) it.next(), "content_provider_intent_action");
                    }
                }
            }
            if (g0.j("content_provider_no_permission", j10)) {
                List h10 = g0.h(this.f11754j.f12039e, this.f11753i.f11678k, this.f11748d);
                if (h10 == null || h10.isEmpty()) {
                    j10 = g0.k("content_provider_no_permission", j10);
                } else {
                    Iterator it2 = h10.iterator();
                    while (it2.hasNext()) {
                        this.f11757m.g((String) it2.next(), "content_provider_no_permission");
                    }
                }
            }
            if (g0.j("file_system", j10)) {
                String b10 = g0.b(this.f11753i.f11678k, this.f11754j.f12028H, this.f11748d);
                if (b10 == null || b10.isEmpty()) {
                    j10 = g0.k("file_system", j10);
                } else {
                    this.f11757m.g(b10, "file_system");
                }
            }
            e10.H(j10);
            this.f11752h.f11822i = true;
        }
    }

    private void K1() {
        C1854d c1854d = this.f11747c;
        if (c1854d != null && c1854d.f11966f) {
            c1854d.f11966f = false;
            w2();
        }
    }

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

    private void L1() {
        this.f11756l.c();
        this.f11746b.c();
        this.f11757m.c();
        this.f11758n.c();
    }

    private Intent M0(Uri uri) {
        Intent intent;
        if (this.f11754j.f12048n == null) {
            intent = new Intent("android.intent.action.VIEW", uri);
        } else {
            C1858h c1858h = this.f11754j;
            intent = new Intent("android.intent.action.VIEW", uri, c1858h.f12039e, c1858h.f12048n);
        }
        intent.setFlags(268435456);
        intent.setPackage(this.f11754j.f12039e.getPackageName());
        return intent;
    }

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

    public void N0() {
        if (this.f11752h.j() || e1()) {
            return;
        }
        Double d10 = this.f11754j.f12055u;
        double doubleValue = d10 != null ? d10.doubleValue() : 0.0d;
        long k10 = AbstractC1862l.k();
        long j10 = (long) (1000.0d * doubleValue);
        if (j10 > k10) {
            double d11 = k10 / 1000;
            DecimalFormat decimalFormat = s0.f12227a;
            this.f11748d.a("Delay start of %s seconds bigger than max allowed value of %s seconds", decimalFormat.format(doubleValue), decimalFormat.format(d11));
            doubleValue = d11;
        } else {
            k10 = j10;
        }
        this.f11748d.h("Waiting %s seconds before starting first session", s0.f12227a.format(doubleValue));
        this.f11751g.h(k10);
        this.f11752h.f11818e = true;
        C1854d c1854d = this.f11747c;
        if (c1854d != null) {
            c1854d.f11975w = 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.f11747c)) {
            this.f11757m.e(c0.b(j0Var, str, this.f11747c, this.f11754j, this.f11753i, this.f11759o));
        }
    }

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

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

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

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

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

    public void R1(boolean z10) {
        this.f11747c.f11967o = z10;
        w2();
    }

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

    public void S1(boolean z10) {
        C1854d c1854d;
        if (b1(d1(), z10, "Adjust already enabled", "Adjust already disabled")) {
            if (z10 && (c1854d = this.f11747c) != null && c1854d.f11964d) {
                this.f11748d.b("Re-enabling SDK not possible for forgotten user", new Object[0]);
                return;
            }
            b0 b0Var = this.f11752h;
            b0Var.f11814a = z10;
            if (b0Var.a()) {
                u2(!z10, "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.f11747c.f11963c = z10;
            w2();
            if (z10) {
                q0 e10 = q0.e(getContext());
                if (e10.g()) {
                    Y0();
                } else {
                    v1();
                    if (e10.f()) {
                        U0();
                    }
                    Iterator it = this.f11754j.f12056v.f12164b.iterator();
                    while (it.hasNext()) {
                        n2((C1870u) it.next());
                    }
                    Boolean bool = this.f11754j.f12056v.f12165c;
                    if (bool != null) {
                        k2(bool.booleanValue());
                    }
                    this.f11754j.f12056v.f12164b = new ArrayList();
                    this.f11754j.f12056v.f12165c = null;
                }
                if (!e10.h()) {
                    this.f11748d.c("Detected that install was not tracked at enable time", new Object[0]);
                    l2(System.currentTimeMillis());
                }
                G0(e10);
            }
            u2(!z10, "Pausing handlers due to SDK being disabled", "Handlers remain paused", "Resuming handlers due to SDK being enabled");
        }
    }

    private void T0() {
        if (V1()) {
            this.f11747c.f11966f = true;
            w2();
            C1853c x10 = new Q1.b0(this.f11754j, this.f11753i, this.f11747c, this.f11759o, System.currentTimeMillis()).x(new C1870u(Boolean.FALSE));
            this.f11746b.h(x10);
            if (this.f11754j.f12044j) {
                this.f11748d.h("Buffered event %s", x10.s());
            } else {
                this.f11746b.e();
            }
        }
    }

    public void T1(boolean z10) {
        if (b1(this.f11752h.k(), z10, "Adjust already in offline mode", "Adjust already in online mode")) {
            b0 b0Var = this.f11752h;
            b0Var.f11815b = z10;
            if (b0Var.a()) {
                u2(z10, "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(z10, "Pausing handlers to put SDK offline mode", "Handlers remain paused", "Resuming handlers to put SDK in online mode");
            }
        }
    }

    public void U0() {
        q0 e10 = q0.e(getContext());
        e10.E();
        if (D0(this.f11747c) && d1()) {
            C1854d c1854d = this.f11747c;
            if (c1854d.f11964d || c1854d.f11965e) {
                return;
            }
            if (this.f11754j.f12030J) {
                this.f11748d.a("Call to disable third party sharing API ignored, already done when COPPA enabled", new Object[0]);
                return;
            }
            c1854d.f11965e = true;
            w2();
            C1853c q10 = new Q1.b0(this.f11754j, this.f11753i, this.f11747c, this.f11759o, System.currentTimeMillis()).q();
            this.f11746b.h(q10);
            e10.s();
            if (this.f11754j.f12044j) {
                this.f11748d.h("Buffered event %s", q10.s());
            } else {
                this.f11746b.e();
            }
        }
    }

    public void U1(String str) {
        if (D0(this.f11747c) && d1()) {
            C1854d c1854d = this.f11747c;
            if (c1854d.f11964d || str == null || str.equals(c1854d.f11977y)) {
                return;
            }
            this.f11747c.f11977y = str;
            w2();
            C1853c t10 = new Q1.b0(this.f11754j, this.f11753i, this.f11747c, this.f11759o, System.currentTimeMillis()).t("push");
            this.f11746b.h(t10);
            q0.e(getContext()).v();
            if (this.f11754j.f12044j) {
                this.f11748d.h("Buffered event %s", t10.s());
            } else {
                this.f11746b.e();
            }
        }
    }

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

    private boolean V1() {
        if (this.f11747c == null || !d1()) {
            return false;
        }
        if (this.f11747c.f11964d) {
            return false;
        }
        return !r0.f11966f;
    }

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

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

    private void X1() {
        this.f11747c = new C1854d();
        this.f11752h.f11821h = true;
        s2();
        long currentTimeMillis = System.currentTimeMillis();
        q0 e10 = q0.e(getContext());
        this.f11747c.f11977y = e10.l();
        if (this.f11752h.e()) {
            if (e10.g()) {
                Y0();
            } else {
                v1();
                if (e10.f()) {
                    U0();
                }
                Iterator it = this.f11754j.f12056v.f12164b.iterator();
                while (it.hasNext()) {
                    n2((C1870u) it.next());
                }
                Boolean bool = this.f11754j.f12056v.f12165c;
                if (bool != null) {
                    k2(bool.booleanValue());
                }
                this.f11754j.f12056v.f12164b = new ArrayList();
                this.f11754j.f12056v.f12165c = null;
                this.f11747c.f11969q = 1;
                o2(currentTimeMillis);
                G0(e10);
            }
        }
        this.f11747c.d(currentTimeMillis);
        this.f11747c.f11963c = this.f11752h.e();
        this.f11747c.f11975w = this.f11752h.l();
        w2();
        e10.v();
        e10.t();
        e10.s();
        u1();
    }

    public void Y0() {
        if (D0(this.f11747c) && d1()) {
            C1854d c1854d = this.f11747c;
            if (c1854d.f11964d) {
                return;
            }
            c1854d.f11964d = true;
            w2();
            C1853c s10 = new Q1.b0(this.f11754j, this.f11753i, this.f11747c, this.f11759o, System.currentTimeMillis()).s();
            this.f11746b.h(s10);
            q0.e(getContext()).t();
            if (this.f11754j.f12044j) {
                this.f11748d.h("Buffered event %s", s10.s());
            } else {
                this.f11746b.e();
            }
        }
    }

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

    public static C1826a Z0(C1858h c1858h) {
        List<ActivityManager.RunningAppProcessInfo> runningAppProcesses;
        if (c1858h == null) {
            AbstractC1862l.j().b("AdjustConfig missing", new Object[0]);
            return null;
        }
        if (!c1858h.e()) {
            AbstractC1862l.j().b("AdjustConfig not initialized correctly", new Object[0]);
            return null;
        }
        if (c1858h.f12042h != null) {
            int myPid = Process.myPid();
            ActivityManager activityManager = (ActivityManager) c1858h.f12039e.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(c1858h.f12042h)) {
                            AbstractC1862l.j().h("Skipping initialization in background process (%s)", next.processName);
                            return null;
                        }
                    }
                }
            } else {
                return null;
            }
        }
        return new C1826a(c1858h);
    }

    public void Z1() {
        if (this.f11752h.a()) {
            AbstractC1868s.d(this.f11754j.f12057w);
            X1();
            return;
        }
        if (q0.e(getContext()).f()) {
            U0();
        }
        Iterator it = this.f11754j.f12056v.f12164b.iterator();
        while (it.hasNext()) {
            n2((C1870u) it.next());
        }
        Boolean bool = this.f11754j.f12056v.f12165c;
        if (bool != null) {
            k2(bool.booleanValue());
        }
        this.f11754j.f12056v.f12164b = new ArrayList();
        C1858h c1858h = this.f11754j;
        c1858h.f12056v.f12165c = null;
        if (this.f11747c.f11963c) {
            AbstractC1868s.d(c1858h.f12057w);
            s2();
            v1();
            w1();
            H0();
            u1();
        }
    }

    public void a1() {
        this.f11747c.f11964d = true;
        w2();
        this.f11746b.flush();
        S1(false);
    }

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

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

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

    public void c1() {
        String l10;
        Double d10;
        f11743w = AbstractC1862l.r();
        f11744x = AbstractC1862l.t();
        f11740t = AbstractC1862l.u();
        f11741u = AbstractC1862l.v();
        f11742v = AbstractC1862l.u();
        y1(this.f11754j.f12039e);
        x1(this.f11754j.f12039e);
        this.f11759o = new o0();
        E1(this.f11754j.f12039e);
        F1(this.f11754j.f12039e);
        C1858h c1858h = this.f11754j;
        if (c1858h.f12060z != null) {
            c1858h.f12056v.f12163a.add(new C());
        }
        if (this.f11752h.b()) {
            b0 b0Var = this.f11752h;
            C1854d c1854d = this.f11747c;
            b0Var.f11814a = c1854d.f11963c;
            b0Var.f11818e = c1854d.f11975w;
            b0Var.f11819f = false;
        } else {
            this.f11752h.f11819f = true;
        }
        z1(this.f11754j.f12039e);
        this.f11753i = new Q1.B(this.f11754j);
        if (this.f11754j.f12044j) {
            this.f11748d.h("Event buffering is enabled", new Object[0]);
        }
        this.f11753i.B(this.f11754j);
        if (this.f11753i.f11668a == null) {
            if (s0.c(this.f11754j)) {
                this.f11748d.a("Unable to get Google Play Services Advertising ID at start time", new Object[0]);
            } else {
                if (this.f11754j.f12030J) {
                    this.f11748d.h("Cannot read Google Play Services Advertising ID with COPPA enabled", new Object[0]);
                }
                if (this.f11754j.f12029I) {
                    this.f11748d.h("Cannot read Google Play Services Advertising ID with play store kids app enabled", new Object[0]);
                }
            }
            if (this.f11753i.f11675h == null) {
                if (s0.b(this.f11754j)) {
                    this.f11748d.b("Unable to get any Device IDs. Please check if Proguard is correctly set with Adjust SDK", new Object[0]);
                } else {
                    if (this.f11754j.f12030J) {
                        this.f11748d.h("Cannot read non Play IDs with COPPA enabled", new Object[0]);
                    }
                    if (this.f11754j.f12029I) {
                        this.f11748d.h("Cannot read non Play IDs with play store kids app enabled", new Object[0]);
                    }
                }
            }
        } else {
            this.f11748d.h("Google Play Services Advertising ID read correctly at start time", new Object[0]);
        }
        String str = this.f11754j.f12045k;
        if (str != null) {
            this.f11748d.h("Default tracker: '%s'", str);
        }
        String str2 = this.f11754j.f12059y;
        if (str2 != null) {
            this.f11748d.h("Push token: '%s'", str2);
            if (this.f11752h.b()) {
                l(this.f11754j.f12059y, false);
            } else {
                q0.e(getContext()).A(this.f11754j.f12059y);
            }
        } else if (this.f11752h.b() && (l10 = q0.e(getContext()).l()) != null) {
            l(l10, true);
        }
        if (this.f11763s == null) {
            this.f11763s = this.f11754j.f12034N;
        }
        if (this.f11752h.b() && q0.e(getContext()).g()) {
            A();
        }
        this.f11749e = new S1.i(new D(), f11741u, f11740t, "Foreground timer");
        if (this.f11754j.f12054t) {
            this.f11748d.h("Send in background configured", new Object[0]);
            this.f11750f = new S1.j(new E(), "Background timer");
        }
        if (this.f11752h.a() && (d10 = this.f11754j.f12055u) != null && d10.doubleValue() > 0.0d) {
            this.f11748d.h("Delay start configured", new Object[0]);
            this.f11752h.f11817d = true;
            this.f11751g = new S1.j(new G(), "Delay Start timer");
        }
        R1.d.g(this.f11754j.f12058x);
        C1858h c1858h2 = this.f11754j;
        this.f11746b = AbstractC1862l.l(this, this.f11754j.f12039e, g2(false), new R1.a(c1858h2.f12027G, c1858h2.f12035a, c1858h2.f12036b, c1858h2.f12037c, c1858h2.f12038d, this.f11753i.f11677j, c1858h2.f12039e));
        C1858h c1858h3 = this.f11754j;
        this.f11756l = AbstractC1862l.d(this, g2(false), new R1.a(c1858h3.f12027G, c1858h3.f12035a, c1858h3.f12036b, c1858h3.f12037c, c1858h3.f12038d, this.f11753i.f11677j, c1858h3.f12039e));
        C1858h c1858h4 = this.f11754j;
        this.f11757m = AbstractC1862l.q(this, g2(true), new R1.a(c1858h4.f12027G, c1858h4.f12035a, c1858h4.f12036b, c1858h4.f12037c, c1858h4.f12038d, this.f11753i.f11677j, c1858h4.f12039e));
        C1858h c1858h5 = this.f11754j;
        this.f11758n = AbstractC1862l.n(this, g2(true), new R1.a(c1858h5.f12027G, c1858h5.f12035a, c1858h5.f12036b, c1858h5.f12037c, c1858h5.f12038d, this.f11753i.f11677j, c1858h5.f12039e));
        if (e1()) {
            t2();
        }
        this.f11760p = new Q1.L(this.f11754j.f12039e, new H());
        this.f11761q = new Q1.M(this.f11754j.f12039e, new I());
        C1858h c1858h6 = this.f11754j;
        this.f11762r = new Q1.N(c1858h6.f12039e, c1858h6.f12032L, new J());
        s1(this.f11754j.f12056v.f12163a);
        Q1();
    }

    private void c2() {
        synchronized (C1854d.class) {
            try {
                if (this.f11747c == null) {
                    return;
                }
                this.f11747c = null;
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }

    private boolean d1() {
        C1854d c1854d = this.f11747c;
        return c1854d != null ? c1854d.f11963c : this.f11752h.e();
    }

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

    private boolean e1() {
        C1854d c1854d = this.f11747c;
        return c1854d != null ? c1854d.f11975w : this.f11752h.l();
    }

    private void e2() {
        synchronized (C1857g.class) {
            try {
                if (this.f11755k == null) {
                    return;
                }
                this.f11755k = null;
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }

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

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

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

    private boolean g2(boolean z10) {
        if (r1(z10)) {
            return false;
        }
        if (this.f11754j.f12054t) {
            return true;
        }
        return this.f11752h.i();
    }

    public void h1(C1873x c1873x) {
        q2(c1873x.f12127c);
        Handler handler = new Handler(this.f11754j.f12039e.getMainLooper());
        if (r2(c1873x.f12133i)) {
            g1(handler);
        }
        t1(c1873x.f12273p, handler);
    }

    public void h2(C1856f c1856f) {
        if (D0(this.f11747c) && d1() && E0(c1856f) && !this.f11747c.f11964d) {
            this.f11746b.h(new Q1.b0(this.f11754j, this.f11753i, this.f11747c, this.f11759o, System.currentTimeMillis()).m(c1856f, this.f11752h.h()));
            this.f11746b.e();
        }
    }

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

    public void i2(String str, JSONObject jSONObject) {
        if (D0(this.f11747c) && d1() && !this.f11747c.f11964d) {
            this.f11746b.h(new Q1.b0(this.f11754j, this.f11753i, this.f11747c, this.f11759o, System.currentTimeMillis()).n(str, jSONObject));
            this.f11746b.e();
        }
    }

    public void j2(C1859i c1859i) {
        if (D0(this.f11747c) && d1() && I0(c1859i) && L0(c1859i.f12079f) && !this.f11747c.f11964d) {
            long currentTimeMillis = System.currentTimeMillis();
            this.f11747c.f11968p++;
            p2(currentTimeMillis);
            C1853c r10 = new Q1.b0(this.f11754j, this.f11753i, this.f11747c, this.f11759o, currentTimeMillis).r(c1859i, this.f11752h.h());
            this.f11746b.h(r10);
            if (this.f11754j.f12044j) {
                this.f11748d.h("Buffered event %s", r10.s());
            } else {
                this.f11746b.e();
            }
            if (this.f11754j.f12054t && this.f11752h.g()) {
                W1();
            }
            w2();
        }
    }

    public void k1(Q1.C c10) {
        q2(c10.f12127c);
        Handler handler = new Handler(this.f11754j.f12039e.getMainLooper());
        boolean z10 = c10.f12125a;
        if (z10 && this.f11754j.f12049o != null) {
            this.f11748d.c("Launching success event tracking listener", new Object[0]);
            handler.post(new N(c10));
        } else {
            if (z10 || this.f11754j.f12050p == null) {
                return;
            }
            this.f11748d.c("Launching failed event tracking listener", new Object[0]);
            handler.post(new O(c10));
        }
    }

    public void k2(boolean z10) {
        if (!D0(this.f11747c)) {
            this.f11754j.f12056v.f12165c = Boolean.valueOf(z10);
        } else if (d1() && !this.f11747c.f11964d) {
            C1853c u10 = new Q1.b0(this.f11754j, this.f11753i, this.f11747c, this.f11759o, System.currentTimeMillis()).u(z10);
            this.f11746b.h(u10);
            if (this.f11754j.f12044j) {
                this.f11748d.h("Buffered event %s", u10.s());
            } else {
                this.f11746b.e();
            }
        }
    }

    private void l2(long j10) {
        C1854d c1854d = this.f11747c;
        long j11 = j10 - c1854d.f11973u;
        c1854d.f11969q++;
        c1854d.f11974v = j11;
        o2(j10);
        this.f11747c.d(j10);
        w2();
    }

    public void m1(i0 i0Var) {
        Handler handler = new Handler(this.f11754j.f12039e.getMainLooper());
        JSONObject jSONObject = i0Var.f12130f;
        handler.post(new U(i0Var, jSONObject == null ? new C1866p("not_verified", 101, i0Var.f12128d) : new C1866p(R1.d.f(jSONObject, "verification_status"), R1.d.d(jSONObject, RazorpayModule.MAP_KEY_ERROR_CODE), R1.d.f(jSONObject, "message"))));
    }

    public void m2(C1864n c1864n) {
        if (D0(this.f11747c) && d1() && !this.f11747c.f11964d) {
            this.f11746b.h(new Q1.b0(this.f11754j, this.f11753i, this.f11747c, this.f11759o, System.currentTimeMillis()).w(c1864n, this.f11752h.h()));
            this.f11746b.e();
        }
    }

    public void n1(n0 n0Var) {
        q2(n0Var.f12127c);
        Handler handler = new Handler(this.f11754j.f12039e.getMainLooper());
        if (r2(n0Var.f12133i)) {
            g1(handler);
        }
        if (TextUtils.isEmpty(n0Var.f12139o) || this.f11763s == null) {
            return;
        }
        handler.post(new P(n0Var));
    }

    public void n2(C1870u c1870u) {
        if (!D0(this.f11747c)) {
            this.f11754j.f12056v.f12164b.add(c1870u);
            return;
        }
        if (d1() && !this.f11747c.f11964d) {
            if (this.f11754j.f12030J) {
                this.f11748d.a("Calling third party sharing API not allowed when COPPA enabled", new Object[0]);
                return;
            }
            C1853c x10 = new Q1.b0(this.f11754j, this.f11753i, this.f11747c, this.f11759o, System.currentTimeMillis()).x(c1870u);
            this.f11746b.h(x10);
            if (this.f11754j.f12044j) {
                this.f11748d.h("Buffered event %s", x10.s());
            } else {
                this.f11746b.e();
            }
        }
    }

    private void o1(p0 p0Var, Handler handler) {
        boolean z10 = p0Var.f12125a;
        if (z10 && this.f11754j.f12051q != null) {
            this.f11748d.c("Launching success session tracking listener", new Object[0]);
            handler.post(new R(p0Var));
        } else {
            if (z10 || this.f11754j.f12052r == null) {
                return;
            }
            this.f11748d.c("Launching failed session tracking listener", new Object[0]);
            handler.post(new S(p0Var));
        }
    }

    private void o2(long j10) {
        this.f11746b.h(new Q1.b0(this.f11754j, this.f11753i, this.f11747c, this.f11759o, j10).v(this.f11752h.h()));
        this.f11746b.e();
    }

    public void p1(p0 p0Var) {
        this.f11748d.c("Launching SessionResponse tasks", new Object[0]);
        q2(p0Var.f12127c);
        Handler handler = new Handler(this.f11754j.f12039e.getMainLooper());
        if (r2(p0Var.f12133i)) {
            g1(handler);
        }
        if (this.f11755k == null && !this.f11747c.f11967o) {
            this.f11756l.e();
        }
        if (p0Var.f12125a) {
            q0.e(getContext()).G();
        }
        o1(p0Var, handler);
        this.f11752h.f11820g = true;
    }

    private boolean p2(long j10) {
        if (!D0(this.f11747c)) {
            return false;
        }
        C1854d c1854d = this.f11747c;
        long j11 = j10 - c1854d.f11973u;
        if (j11 > f11743w) {
            return false;
        }
        c1854d.f11973u = j10;
        if (j11 < 0) {
            this.f11748d.b("Time travel!", new Object[0]);
            return true;
        }
        c1854d.f11971s += j11;
        c1854d.f11972t += j11;
        return true;
    }

    private void q1() {
        this.f11756l.b();
        this.f11746b.b();
        if (g2(true)) {
            this.f11757m.c();
            this.f11758n.c();
        } else {
            this.f11757m.b();
            this.f11758n.b();
        }
    }

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

    private boolean r1(boolean z10) {
        return z10 ? this.f11752h.k() || !d1() : this.f11752h.k() || !d1() || this.f11752h.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.f11754j.f12044j || (this.f11752h.f() && this.f11752h.d())) {
            this.f11746b.e();
        }
    }

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

    private void t2() {
        this.f11746b.f(this.f11759o);
        this.f11752h.f11818e = false;
        C1854d c1854d = this.f11747c;
        if (c1854d != null) {
            c1854d.f11975w = false;
            w2();
        }
    }

    private void u1() {
        if (D0(this.f11747c)) {
            q0 e10 = q0.e(getContext());
            String d10 = e10.d();
            long c10 = e10.c();
            if (d10 == null || c10 == -1) {
                return;
            }
            v(Uri.parse(d10), c10);
            e10.r();
        }
    }

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

    private void v1() {
        if (this.f11754j.f12030J) {
            T0();
        } else {
            K1();
        }
    }

    public void v2(C1865o c1865o, Q1.Y y10) {
        if (y10 == null) {
            this.f11748d.a("Purchase verification aborted because verification callback is null", new Object[0]);
            return;
        }
        String str = this.f11754j.f12027G;
        if (str != null && (str.equals("data_residency_eu") || this.f11754j.f12027G.equals("data_residency_us") || this.f11754j.f12027G.equals("data_residency_tr"))) {
            this.f11748d.a("Purchase verification not available for data residency users right now", new Object[0]);
            return;
        }
        if (!D0(this.f11747c)) {
            y10.a(new C1866p("not_verified", 102, "Purchase verification aborted because SDK is still not initialized"));
            this.f11748d.a("Purchase verification aborted because SDK is still not initialized", new Object[0]);
            return;
        }
        if (!d1()) {
            y10.a(new C1866p("not_verified", 103, "Purchase verification aborted because SDK is disabled"));
            this.f11748d.a("Purchase verification aborted because SDK is disabled", new Object[0]);
            return;
        }
        if (this.f11747c.f11964d) {
            y10.a(new C1866p("not_verified", 104, "Purchase verification aborted because user is GDPR forgotten"));
            this.f11748d.a("Purchase verification aborted because user is GDPR forgotten", new Object[0]);
            return;
        }
        if (c1865o == null) {
            this.f11748d.a("Purchase verification aborted because purchase instance is null", new Object[0]);
            y10.a(new C1866p("not_verified", 105, "Purchase verification aborted because purchase instance is null"));
            return;
        }
        C1853c y11 = new Q1.b0(this.f11754j, this.f11753i, this.f11747c, this.f11759o, System.currentTimeMillis()).y(c1865o, y10);
        if (y11 != null) {
            this.f11758n.e(y11);
        } else {
            this.f11748d.a("Purchase verification aborted because verification package is null", new Object[0]);
            y10.a(new C1866p("not_verified", 106, "Purchase verification aborted because verification package is null"));
        }
    }

    private void w1() {
        if (this.f11747c.f11964d) {
            return;
        }
        long currentTimeMillis = System.currentTimeMillis();
        C1854d c1854d = this.f11747c;
        long j10 = currentTimeMillis - c1854d.f11973u;
        if (j10 < 0) {
            this.f11748d.b("Time travel!", new Object[0]);
            this.f11747c.f11973u = currentTimeMillis;
            w2();
            return;
        }
        if (j10 > f11743w) {
            l2(currentTimeMillis);
            F0();
            return;
        }
        if (j10 <= f11744x) {
            this.f11748d.g("Time span since last activity too short for a new subsession", new Object[0]);
            return;
        }
        int i10 = c1854d.f11970r + 1;
        c1854d.f11970r = i10;
        c1854d.f11971s += j10;
        c1854d.f11973u = currentTimeMillis;
        this.f11748d.g("Started subsession %d of session %d", Integer.valueOf(i10), Integer.valueOf(this.f11747c.f11969q));
        w2();
        K0();
        this.f11760p.s();
        this.f11761q.c();
        this.f11762r.b();
        A1();
        C1();
        B1();
    }

    private void w2() {
        synchronized (C1854d.class) {
            try {
                C1854d c1854d = this.f11747c;
                if (c1854d == null) {
                    return;
                }
                s0.j0(c1854d, this.f11754j.f12039e, "AdjustIoActivityState", "Activity state");
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }

    private void x1(Context context) {
        try {
            this.f11747c = (C1854d) s0.d0(context, "AdjustIoActivityState", "Activity state", C1854d.class);
        } catch (Exception e10) {
            this.f11748d.b("Failed to read %s file (%s)", "Activity state", e10.getMessage());
            this.f11747c = null;
        }
        if (this.f11747c != null) {
            this.f11752h.f11821h = true;
        }
    }

    private void x2() {
        synchronized (C1857g.class) {
            try {
                C1857g c1857g = this.f11755k;
                if (c1857g == null) {
                    return;
                }
                s0.j0(c1857g, this.f11754j.f12039e, "AdjustAttribution", "Attribution");
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }

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

    private void y2() {
        synchronized (o0.class) {
            try {
                o0 o0Var = this.f11759o;
                if (o0Var == null) {
                    return;
                }
                s0.j0(o0Var.f12205a, this.f11754j.f12039e, "AdjustSessionCallbackParameters", "Session Callback parameters");
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }

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

    private void z2() {
        synchronized (o0.class) {
            try {
                o0 o0Var = this.f11759o;
                if (o0Var == null) {
                    return;
                }
                s0.j0(o0Var.f12206b, this.f11754j.f12039e, "AdjustSessionPartnerParameters", "Session Partner parameters");
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }

    @Override
    public void A() {
        this.f11745a.submit(new RunnableC1842q());
    }

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

    @Override
    public C1854d B() {
        return this.f11747c;
    }

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

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

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

    @Override
    public C1858h E() {
        return this.f11754j;
    }

    @Override
    public void F(C1859i c1859i) {
        this.f11745a.submit(new Q(c1859i));
    }

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

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

    @Override
    public void H() {
        this.f11745a.submit(new RunnableC0220a());
    }

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

    @Override
    public void I() {
        this.f11745a.submit(new RunnableC1839n());
    }

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

    @Override
    public void J(C1865o c1865o, Q1.Y y10) {
        this.f11745a.submit(new B(c1865o, y10));
    }

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

    @Override
    public void K(C1864n c1864n) {
        this.f11745a.submit(new RunnableC1849x(c1864n));
    }

    @Override
    public void L() {
        this.f11745a.submit(new RunnableC1850y());
    }

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

    public void W0() {
        this.f11745a.submit(new RunnableC1851z());
    }

    @Override
    public void a() {
        S1.j jVar = this.f11750f;
        if (jVar != null) {
            jVar.i();
        }
        S1.i iVar = this.f11749e;
        if (iVar != null) {
            iVar.g();
        }
        S1.j jVar2 = this.f11751g;
        if (jVar2 != null) {
            jVar2.i();
        }
        S1.f fVar = this.f11745a;
        if (fVar != null) {
            fVar.a();
        }
        Q1.H h10 = this.f11746b;
        if (h10 != null) {
            h10.a();
        }
        Q1.F f10 = this.f11756l;
        if (f10 != null) {
            f10.a();
        }
        Q1.K k10 = this.f11757m;
        if (k10 != null) {
            k10.a();
        }
        Q1.I i10 = this.f11758n;
        if (i10 != null) {
            i10.a();
        }
        o0 o0Var = this.f11759o;
        if (o0Var != null) {
            Map map = o0Var.f12205a;
            if (map != null) {
                map.clear();
            }
            Map map2 = this.f11759o.f12206b;
            if (map2 != null) {
                map2.clear();
            }
        }
        c2();
        e2();
        d2();
        this.f11746b = null;
        this.f11748d = null;
        this.f11749e = null;
        this.f11745a = null;
        this.f11750f = null;
        this.f11751g = null;
        this.f11752h = null;
        this.f11753i = null;
        this.f11754j = null;
        this.f11756l = null;
        this.f11757m = null;
        this.f11758n = null;
        this.f11759o = null;
    }

    @Override
    public void b() {
        this.f11752h.f11816c = false;
        this.f11745a.submit(new RunnableC1846u());
    }

    @Override
    public void d() {
        this.f11752h.f11816c = true;
        this.f11745a.submit(new F());
    }

    @Override
    public C1857g e() {
        return this.f11755k;
    }

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

    @Override
    public void g(boolean z10) {
        this.f11745a.submit(new RunnableC1845t(z10));
    }

    @Override
    public Context getContext() {
        return this.f11754j.f12039e;
    }

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

    @Override
    public void i() {
        this.f11745a.submit(new RunnableC1840o());
    }

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

    @Override
    public void j(C1873x c1873x) {
        this.f11745a.submit(new RunnableC1831f(c1873x));
    }

    public void j1(Q1.C c10) {
        this.f11745a.submit(new RunnableC1828c(c10));
    }

    @Override
    public String k() {
        C1854d c1854d = this.f11747c;
        if (c1854d == null) {
            return null;
        }
        return c1854d.f11978z;
    }

    @Override
    public void l(String str, boolean z10) {
        this.f11745a.submit(new RunnableC1841p(z10, str));
    }

    public void l1(i0 i0Var) {
        this.f11745a.submit(new RunnableC1832g(i0Var));
    }

    @Override
    public void m(C1858h c1858h) {
        this.f11754j = c1858h;
    }

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

    @Override
    public void o(C1870u c1870u) {
        this.f11745a.submit(new RunnableC1844s(c1870u));
    }

    @Override
    public void p(C1856f c1856f) {
        this.f11745a.submit(new RunnableC1848w(c1856f));
    }

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

    @Override
    public void r() {
        this.f11745a.submit(new RunnableC1833h());
    }

    public boolean r2(C1857g c1857g) {
        if (c1857g == null) {
            return false;
        }
        if (this.f11754j.f12031K && this.f11747c.f11967o) {
            this.f11748d.h("Not updating intermediate attribution", new Object[0]);
            return false;
        }
        if (c1857g.equals(this.f11755k)) {
            return false;
        }
        this.f11755k = c1857g;
        x2();
        return true;
    }

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

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

    @Override
    public void t(Uri uri, long j10, Q1.T t10) {
        this.f11763s = t10;
        this.f11745a.submit(new Z(uri, j10));
    }

    @Override
    public void u() {
        this.f11745a.submit(new RunnableC1843r());
    }

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

    @Override
    public void w(l0 l0Var) {
        if (l0Var instanceof p0) {
            this.f11748d.c("Finished tracking session", new Object[0]);
            this.f11756l.f((p0) l0Var);
            return;
        }
        if (l0Var instanceof n0) {
            n0 n0Var = (n0) l0Var;
            J0(n0Var);
            this.f11756l.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.f11745a.submit(new RunnableC1837l(str));
    }

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

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

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