package com.ss.android.ugc.aweme.app.host;

import X.AnonymousClass7dQ;
import X.AnonymousClass8GW;
import X.AnonymousClass9DN;
import X.AnonymousClass9DO;
import X.AnonymousClass9I0;
import X.AnonymousClass9I1;
import X.C11547xB;
import X.C12337yS;
import X.C43439Hy;
import X.C43449Hz;
import X.FLI;
import X.SBX;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.sqlite.SQLiteDatabase;
import com.bytedance.apm.agent.v2.instrumentation.AppAgent;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.AwemeAppBuildConfig;

public class AwemeHostApplication extends SBX {
    public C43439Hy LIZIZ;

    static {
        Covode.recordClassIndex(53295);
    }

    public Resources getResources() {
        return this.LIZIZ.LIZ(AwemeHostApplication.super.getResources());
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [android.content.Context, android.app.Application, com.ss.android.ugc.aweme.app.host.AwemeHostApplication, X.SBX] */
    public void onCreate() {
        if (AnonymousClass7dQ.LIZ == null) {
            AnonymousClass8GW.LIZ = this;
            AnonymousClass7dQ.LIZ = this;
        }
        AppAgent.onTrace("onCreate", true);
        this.LIZIZ.LIZ();
        AwemeHostApplication.super.onCreate();
        this.LIZIZ.LIZIZ();
        AppAgent.onTrace("onCreate", false);
    }

    /* JADX WARNING: type inference failed for: r4v0, types: [android.app.Application, com.ss.android.ugc.aweme.app.host.AwemeHostApplication] */
    public AwemeHostApplication() {
        AppAgent.onTrace("<init>", true);
        if (C12337yS.LIZLLL.LIZJ()) {
            this.LIZIZ = new AnonymousClass9DN(this, new AwemeAppBuildConfig(), new AnonymousClass9I0());
        } else {
            this.LIZIZ = new AnonymousClass9DO(this, new AwemeAppBuildConfig(), new AnonymousClass9I0());
        }
        AppAgent.onTrace("<init>", false);
    }

    public void onConfigurationChanged(Configuration configuration) {
        if (!this.LIZIZ.LIZLLL()) {
            AwemeHostApplication.super.onConfigurationChanged(configuration);
            this.LIZIZ.LIZ(configuration);
        }
    }

    public void onTrimMemory(int i) {
        if (!this.LIZIZ.LIZJ()) {
            AwemeHostApplication.super.onTrimMemory(i);
            this.LIZIZ.LIZ(i);
        }
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [android.content.Context, com.ss.android.ugc.aweme.app.host.AwemeHostApplication, X.SBX] */
    public void attachBaseContext(Context context) {
        AppAgent.onTrace("attachBaseContext", true);
        FLI.LIZ = new C43449Hz(this);
        Context LIZ = AnonymousClass9I1.LIZ.LIZ(context);
        this.LIZIZ.LIZ(LIZ);
        AwemeHostApplication.super.attachBaseContext(LIZ);
        C11547xB.LIZ(this);
        this.LIZIZ.LIZIZ(LIZ);
        AppAgent.onTrace("attachBaseContext", false);
    }

    public SQLiteDatabase openOrCreateDatabase(String str, int i, SQLiteDatabase.CursorFactory cursorFactory) {
        return AwemeHostApplication.super.openOrCreateDatabase(this.LIZIZ.LIZ(str), i, cursorFactory);
    }
}
