package com.ss.android.ugc.aweme.account.login.recover;

import X.8gF;
import X.C4376BiW;
import X.S6n;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.bytedance.apm.agent.v2.instrumentation.ActivityAgent;
import com.bytedance.covode.number.Covode;
import com.bytedance.router.SmartRoute;
import com.bytedance.router.SmartRouter;
import com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer;
import java.net.URLDecoder;
import java.util.HashMap;
import kotlin.h.b.n;

public final class RecoverAccountActivity extends S6n {
    public HashMap LJIIIIZZ;

    static {
        Covode.recordClassIndex(51130);
    }

    public final void _$_clearFindViewByIdCache() {
        HashMap hashMap = this.LJIIIIZZ;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

    public final View _$_findCachedViewById(int i) {
        if (this.LJIIIIZZ == null) {
            this.LJIIIIZZ = new HashMap();
        }
        View view = (View) this.LJIIIIZZ.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        this.LJIIIIZZ.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

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

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

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

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

    public final void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.account.login.recover.RecoverAccountActivity", "onWindowFocusChanged", true);
        RecoverAccountActivity.super.onWindowFocusChanged(z);
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [X.SNU, com.ss.android.ugc.aweme.account.login.recover.RecoverAccountActivity, android.app.Activity] */
    public final void onStop() {
        8gF.LIZLLL(this);
        RecoverAccountActivity.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: r7v0, types: [X.SNU, com.ss.android.ugc.aweme.account.login.recover.RecoverAccountActivity, X.S6n, android.app.Activity] */
    public final void onCreate(Bundle bundle) {
        8gF.LIZ(this, bundle);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.account.login.recover.RecoverAccountActivity", "onCreate", true);
        RecoverAccountActivity.super.onCreate(bundle);
        String str = C4376BiW.LIZ.LIZ().LIZLLL;
        if (str == null || str.length() == 0) {
            str = "sslocal://webview?url=https%3A%2F%2Fwww.tiktok.com%2Fucenter_web%2Faccount_recover%3Fappend_common_params%3D1%26hide_nav_bar%3D1%26container_color_auto_dark%3D1";
        }
        String LIZ = LIZ(getIntent(), "enter_from");
        if (LIZ == null) {
            LIZ = "";
        }
        n.LIZIZ(LIZ, "");
        SmartRoute buildRoute = SmartRouter.buildRoute(this, str + URLDecoder.decode("&enter_from=".concat(String.valueOf(LIZ)), "UTF-8"));
        Bundle LIZ2 = LIZ(getIntent());
        if (LIZ2 == null) {
            LIZ2 = new Bundle();
        }
        buildRoute.withParam(LIZ2);
        buildRoute.withAnimation(2130772157, 2130771995);
        buildRoute.open();
        finish();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.account.login.recover.RecoverAccountActivity", "onCreate", false);
    }

    public static String LIZ(Intent intent, String str) {
        try {
            return intent.getStringExtra(str);
        } catch (Exception unused) {
            return null;
        }
    }
}
