package com.ss.android.ugc.aweme.deeplink;

import X.0HH;
import X.8gF;
import X.9EH;
import X.AnonymousClass3ZQ;
import X.C03012Pr;
import X.C12422nK;
import X.C18182wc;
import X.C18202we;
import X.C18812xd;
import X.C221237c;
import X.C221337d;
import X.C30043ae;
import X.C34683i8;
import X.LnI;
import X.LsC;
import X.M12;
import X.SNU;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.View;
import android.widget.TextView;
import com.bytedance.apm.agent.v2.instrumentation.ActivityAgent;
import com.bytedance.covode.number.Covode;
import com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer;
import com.ss.android.ugc.aweme.services.MainServiceImpl;
import java.util.HashMap;
import java.util.Map;
import kotlin.h.b.n;

public class UpdateTipActivity extends SNU {
    public String LIZ = "";
    public UpdateTipsArgs LIZIZ;

    static {
        Covode.recordClassIndex(63398);
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [com.ss.android.ugc.aweme.deeplink.UpdateTipActivity, X.SNU, android.app.Activity] */
    public void onDestroy() {
        8gF.LJ(this);
        UpdateTipActivity.super.onDestroy();
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [com.ss.android.ugc.aweme.deeplink.UpdateTipActivity, X.SNU, android.app.Activity] */
    public void onPause() {
        8gF.LIZJ(this);
        UpdateTipActivity.super.onPause();
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [com.ss.android.ugc.aweme.deeplink.UpdateTipActivity, X.SNU, android.app.Activity] */
    public void onResume() {
        8gF.LIZIZ(this);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.deeplink.UpdateTipActivity", "onResume", true);
        UpdateTipActivity.super.onResume();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.deeplink.UpdateTipActivity", "onResume", false);
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [com.ss.android.ugc.aweme.deeplink.UpdateTipActivity, X.SNU, android.app.Activity] */
    public void onStart() {
        8gF.LIZ(this);
        UpdateTipActivity.super.onStart();
    }

    public void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.deeplink.UpdateTipActivity", "onWindowFocusChanged", true);
        UpdateTipActivity.super.onWindowFocusChanged(z);
    }

    public void onBackPressed() {
        LIZ();
    }

    private void LIZLLL() {
        HashMap hashMap = new HashMap();
        hashMap.put("schema_url", this.LIZ);
        hashMap.put("click_position", "back");
        C12422nK.LIZ("schema_update_toast_click", (Map<String, String>) hashMap);
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [com.ss.android.ugc.aweme.deeplink.UpdateTipActivity, android.content.Context, X.SNU] */
    public final void LIZ() {
        Intent intent = new Intent(this, MainServiceImpl.createIMainServicebyMonsterPlugin(false).getMainActivityClass());
        intent.addFlags(131072);
        LIZ(this, intent);
        LIZLLL();
        finish();
    }

    private void LIZIZ() {
        if (LIZ(getIntent()) != null) {
            this.LIZ = this.LIZIZ.getUrlToGo();
            if (TextUtils.equals(9EH.LJIJI, "local_test") && !this.LIZ.isEmpty()) {
                TextView textView = (TextView) findViewById(2131363941);
                textView.setText(this.LIZ);
                textView.setVisibility(0);
            }
        }
    }

    private void LIZJ() {
        if (LIZ(getIntent()) != null) {
            String versionRequire = this.LIZIZ.getVersionRequire();
            if (!TextUtils.isEmpty(versionRequire)) {
                ((TextView) findViewById(2131363942)).setText(0HH.LIZ(getResources().getString(2131831846), new Object[]{versionRequire}));
            }
        }
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [com.ss.android.ugc.aweme.deeplink.UpdateTipActivity, X.SNU, android.app.Activity] */
    public void onStop() {
        8gF.LIZLLL(this);
        UpdateTipActivity.super.onStop();
        if (EnterTransitionCrashOptimizer.getContext() != null) {
            try {
                getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
            } catch (Throwable unused) {
            }
        }
        try {
            getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
        } catch (Throwable unused2) {
        }
    }

    public static Bundle LIZ(Intent intent) {
        try {
            return intent.getExtras();
        } catch (Exception unused) {
            return null;
        }
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [com.ss.android.ugc.aweme.deeplink.UpdateTipActivity, X.4Qh] */
    public void onNewIntent(Intent intent) {
        UpdateTipActivity.super.onNewIntent(intent);
        setIntent(intent);
        LIZJ();
        LIZIZ();
    }

    /* JADX WARNING: type inference failed for: r10v0, types: [com.ss.android.ugc.aweme.deeplink.UpdateTipActivity, android.content.Context, X.1oX, X.SNU, java.lang.Object, android.app.Activity] */
    public void onCreate(Bundle bundle) {
        8gF.LIZ(this, bundle);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.deeplink.UpdateTipActivity", "onCreate", true);
        UpdateTipActivity.super.onCreate(bundle);
        setContentView(2131558524);
        this.LIZIZ = UpdateTipsArgs.getOrNew(this);
        View findViewById = findViewById(2131363943);
        M12.LIZ(this);
        findViewById.setBackground(C18812xd.LIZ((LsC<? super AnonymousClass3ZQ, C03012Pr>) new C18202we()).LIZ(this));
        View findViewById2 = findViewById(2131363940);
        findViewById.setOnClickListener(new C221237c(this));
        View findViewById3 = findViewById(2131368081);
        M12.LIZ(this);
        Drawable LIZ2 = C18812xd.LIZ((LsC<? super AnonymousClass3ZQ, C03012Pr>) new C18182wc()).LIZ(this);
        C30043ae r2 = new C30043ae();
        r2.LIZIZ = 2130968605;
        Resources system = Resources.getSystem();
        n.LIZIZ(system, "");
        r2.LIZJ = Float.valueOf(TypedValue.applyDimension(1, 50.0f, system.getDisplayMetrics()));
        Resources system2 = Resources.getSystem();
        n.LIZIZ(system2, "");
        r2.LJII = LnI.LIZ(TypedValue.applyDimension(1, 72.0f, system2.getDisplayMetrics()));
        Resources system3 = Resources.getSystem();
        n.LIZIZ(system3, "");
        r2.LJI = LnI.LIZ(TypedValue.applyDimension(1, 72.0f, system3.getDisplayMetrics()));
        findViewById3.setBackground(new LayerDrawable(new Drawable[]{LIZ2, r2.LIZ(this)}));
        if (TextUtils.equals(9EH.LJIJI, "local_test")) {
            findViewById2.setVisibility(4);
        } else {
            findViewById2.setOnClickListener(new C221337d(this));
        }
        LIZJ();
        LIZIZ();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.deeplink.UpdateTipActivity", "onCreate", false);
    }

    public static void LIZ(UpdateTipActivity updateTipActivity, Intent intent) {
        C34683i8.LIZ(intent, updateTipActivity);
        updateTipActivity.startActivity(intent);
    }
}
