package com.mexico.inloancash;

import ai.advance.liveness.lib.Market;
import android.app.Activity;
import android.app.Application;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import com.adjust.sdk.Adjust;
import com.adjust.sdk.AdjustAttribution;
import com.adjust.sdk.AdjustConfig;
import com.adjust.sdk.LogLevel;
import com.adjust.sdk.OnAttributionChangedListener;
import com.adjust.sdk.OnDeviceIdsRead;
import com.appsflyer.AppsFlyerConversionListener;
import com.appsflyer.AppsFlyerLib;
import com.facebook.FacebookSdk;
import com.facebook.appevents.AppEventsLogger;
import com.facebook.places.model.PlaceFields;
import java.util.ArrayList;
import java.util.Map;
import ඓ.ඓ.K.C0667;
import ῲ.ᨨ.㳳.C1841;
import K.K.㸾.K.C2388;

public class MyApplication extends Application {

    /* renamed from: ʬ  reason: contains not printable characters */
    public static MyApplication f2290;

    /* renamed from: ඓ  reason: contains not printable characters */
    public static String f2291 = "mao";

    /* renamed from: ⁱ  reason: contains not printable characters */
    public static String f2292;

    /* renamed from: 㴹  reason: contains not printable characters */
    public static MyApplication f2293;

    /* renamed from: 㸾  reason: contains not printable characters */
    public static ArrayList<Activity> f2294 = new ArrayList<>();

    /* renamed from: ῲ  reason: contains not printable characters */
    public AppsFlyerConversionListener f2295 = new C0344(this);

    /* renamed from: com.mexico.inloancash.MyApplication$ʬ  reason: contains not printable characters */
    public class C0344 implements AppsFlyerConversionListener {
        public C0344(MyApplication myApplication) {
        }

        @Override // com.appsflyer.AppsFlyerConversionListener
        public void onAppOpenAttribution(Map<String, String> map) {
            for (String str : map.keySet()) {
                Log.d("LOG_TAG", "attribute: " + str + " = " + map.get(str));
            }
        }

        @Override // com.appsflyer.AppsFlyerConversionListener
        public void onAttributionFailure(String str) {
            Log.d("LOG_TAG", "error onAttributionFailure : " + str);
        }

        @Override // com.appsflyer.AppsFlyerConversionListener
        public void onConversionDataFail(String str) {
            Log.d("LOG_TAG", "error getting conversion data: " + str);
        }

        @Override // com.appsflyer.AppsFlyerConversionListener
        public void onConversionDataSuccess(Map<String, Object> map) {
            for (String str : map.keySet()) {
                Log.d("LOG_TAG1", "attribute: " + str + " = " + map.get(str));
            }
        }
    }

    /* renamed from: com.mexico.inloancash.MyApplication$ῲ  reason: contains not printable characters */
    public class C0345 implements OnDeviceIdsRead {
        public C0345(MyApplication myApplication) {
        }

        @Override // com.adjust.sdk.OnDeviceIdsRead
        public void onGoogleAdIdRead(String str) {
        }
    }

    /* renamed from: com.mexico.inloancash.MyApplication$K  reason: contains not printable characters */
    public class C0346 implements OnAttributionChangedListener {
        public C0346(MyApplication myApplication) {
        }

        @Override // com.adjust.sdk.OnAttributionChangedListener
        public void onAttributionChanged(AdjustAttribution adjustAttribution) {
            if (adjustAttribution != null && !TextUtils.isEmpty(adjustAttribution.trackerName)) {
                String str = adjustAttribution.trackerName;
                SharedPreferences.Editor edit = C1841.m4812().edit();
                edit.putString("trackerName", str);
                edit.commit();
            }
        }
    }

    /* renamed from: com.mexico.inloancash.MyApplication$㸾  reason: contains not printable characters */
    public static final class C0347 implements Application.ActivityLifecycleCallbacks {
        public /* synthetic */ C0347(C0346 k) {
        }

        public void onActivityCreated(Activity activity, Bundle bundle) {
        }

        public void onActivityDestroyed(Activity activity) {
        }

        public void onActivityPaused(Activity activity) {
            Adjust.onPause();
        }

        public void onActivityResumed(Activity activity) {
            Adjust.onResume();
        }

        public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
        }

        public void onActivityStarted(Activity activity) {
        }

        public void onActivityStopped(Activity activity) {
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static MyApplication m1353() {
        if (f2290 == null) {
            f2290 = new MyApplication();
        }
        return f2290;
    }

    public void onCreate() {
        super.onCreate();
        f2293 = this;
        AppsFlyerLib.getInstance().init("DAYBvfRejUEctWAFYgris9", this.f2295, getApplicationContext());
        AppsFlyerLib.getInstance().startTracking(this);
        AdjustConfig adjustConfig = new AdjustConfig(this, "v62ej8l8lslc", AdjustConfig.ENVIRONMENT_SANDBOX);
        adjustConfig.setLogLevel(LogLevel.VERBOSE);
        FacebookSdk.sdkInitialize(getApplicationContext());
        AppEventsLogger.activateApp((Application) this);
        FacebookSdk.setAutoLogAppEventsEnabled(true);
        FacebookSdk.setAdvertiserIDCollectionEnabled(true);
        adjustConfig.setNeedsCost(true);
        adjustConfig.setOnAttributionChangedListener(new C0346(this));
        Adjust.onCreate(adjustConfig);
        registerActivityLifecycleCallbacks(new C0347(null));
        C1841.f6258 = this;
        if (C1841.f6259 == null) {
            C1841.f6259 = getSharedPreferences("daikuan1", 0);
        }
        C2388.m6425(this, "dcaeb1f41c5ce114", "3c9d4400427aabd6", Market.Mexico);
        Adjust.getGoogleAdId(this, new C0345(this));
        try {
            TelephonyManager telephonyManager = (TelephonyManager) f2293.getBaseContext().getSystemService(PlaceFields.PHONE);
            if (telephonyManager != null) {
                telephonyManager.listen(new C0667(this, telephonyManager), 256);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public void m1354(Activity activity) {
        f2294.remove(activity);
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m1355(Activity activity) {
        f2294.add(activity);
    }
}
