package com.ss.android.ugc.aweme.ecommerce.combinepayment.ordersubmit;

import X.2dc;
import X.3SC;
import X.3T9;
import X.4r1;
import X.8gF;
import X.8pz;
import X.C5195Bvj;
import X.C5364ByS;
import X.CWJ;
import X.DAe;
import X.K41;
import X.OFc;
import X.TSt;
import android.content.Intent;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.View;
import com.bytedance.apm.agent.v2.instrumentation.ActivityAgent;
import com.bytedance.covode.number.Covode;
import com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer;
import java.util.HashMap;
import java.util.UUID;
import kotlin.h.b.n;

public final class TransparentLoadingOSPActivity extends CWJ {
    public OrderSubmitRequestParam LIZ;
    public HashMap<String, Object> LIZIZ;
    public String LIZJ = "";
    public String LIZLLL = "";
    public String LJ = "";
    public String LJFF;
    public SparseArray LJI;

    static {
        Covode.recordClassIndex(68726);
    }

    public final void _$_clearFindViewByIdCache() {
        SparseArray sparseArray = this.LJI;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

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

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

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

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

    public final void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.ecommerce.combinepayment.ordersubmit.TransparentLoadingOSPActivity", "onWindowFocusChanged", true);
        TransparentLoadingOSPActivity.super.onWindowFocusChanged(z);
    }

    public final void onBackPressed() {
        TransparentLoadingOSPActivity.super.onBackPressed();
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [X.4Qh, X.SNU, com.ss.android.ugc.aweme.ecommerce.combinepayment.ordersubmit.TransparentLoadingOSPActivity, android.app.Activity] */
    public final void onStart() {
        8gF.LIZ(this);
        TransparentLoadingOSPActivity.super.onStart();
        OFc _$_findCachedViewById = _$_findCachedViewById(2131371690);
        n.LIZIZ(_$_findCachedViewById, "");
        _$_findCachedViewById.setVisibility(0);
        _$_findCachedViewById(2131371690).LIZIZ();
    }

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

    /* JADX WARNING: type inference failed for: r15v0, types: [X.SNU, com.ss.android.ugc.aweme.ecommerce.combinepayment.ordersubmit.TransparentLoadingOSPActivity, android.app.Activity, X.CWJ] */
    public final void onCreate(Bundle bundle) {
        String string;
        String string2;
        String string3;
        long longExtra;
        Object obj;
        Long keyTimestamp;
        Bundle bundle2 = bundle;
        8gF.LIZ(this, bundle2);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.ecommerce.combinepayment.ordersubmit.TransparentLoadingOSPActivity", "onCreate", true);
        super.onCreate(bundle2);
        setContentView(2131561518);
        String str = "0";
        if (bundle2 == null) {
            string = LIZ(getIntent(), "requestParams");
            string2 = LIZ(getIntent(), "trackParams");
            string3 = LIZ(getIntent(), "repoId");
            String LIZ2 = LIZ(getIntent(), "buy_type");
            if (LIZ2 != null) {
                str = LIZ2;
            }
            this.LJ = str;
            this.LIZLLL = LIZ(getIntent(), "_originalSchema");
            this.LJFF = LIZ(getIntent(), "cart_storage_key");
            longExtra = getIntent().getLongExtra("key_timestamp", Long.MIN_VALUE);
        } else {
            string = bundle2.getString("requestParams");
            string2 = bundle2.getString("trackParams");
            string3 = bundle2.getString("repoId");
            this.LIZLLL = bundle2.getString("_originalSchema");
            String string4 = bundle2.getString("buy_type");
            if (string4 != null) {
                str = string4;
            }
            this.LJ = str;
            this.LJFF = LIZ(getIntent(), "cart_storage_key");
            longExtra = getIntent().getLongExtra("key_timestamp", Long.MIN_VALUE);
        }
        if (string == null) {
            try {
                if (this.LJFF != null) {
                    Object LIZ3 = K41.LIZ(this).LIZ(this.LJFF);
                    if (!(LIZ3 instanceof String)) {
                        LIZ3 = null;
                    }
                    string = (String) LIZ3;
                }
            } catch (Exception e) {
                TSt.LIZ(e.toString());
            }
        }
        if (string3 == null) {
            string3 = "default_repo_id" + UUID.randomUUID();
        }
        this.LIZJ = string3;
        this.LIZ = (OrderSubmitRequestParam) 2dc.LIZ(string, OrderSubmitRequestParam.class);
        if (getIntent().hasExtra("key_timestamp")) {
            OrderSubmitRequestParam orderSubmitRequestParam = this.LIZ;
            if (!(orderSubmitRequestParam == null || (keyTimestamp = orderSubmitRequestParam.getKeyTimestamp()) == null)) {
                if (keyTimestamp.longValue() != longExtra) {
                }
            }
            this.LIZ = null;
        }
        try {
            obj = 3T9.LIZ.LIZ().LIZ(string2, HashMap.class);
        } catch (Exception unused) {
            obj = null;
        }
        HashMap<String, Object> hashMap = (HashMap) obj;
        this.LIZIZ = hashMap;
        if (hashMap != null) {
            C5364ByS.LIZ.put("trackParams", hashMap);
        }
        OrderSubmitRequestParam orderSubmitRequestParam2 = this.LIZ;
        if (orderSubmitRequestParam2 != null) {
            C5364ByS.LIZ.put("requestParams", orderSubmitRequestParam2);
        }
        OrderSubmitRequestParam orderSubmitRequestParam3 = this.LIZ;
        HashMap<String, Object> hashMap2 = this.LIZIZ;
        if (hashMap2 == null) {
            hashMap2 = new HashMap<>();
        }
        if (orderSubmitRequestParam3 != null) {
            DAe.LIZ(3SC.LIZ, 8pz.LIZIZ, new C5195Bvj(orderSubmitRequestParam3, (4r1) null, this, hashMap2), 2);
        }
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.ecommerce.combinepayment.ordersubmit.TransparentLoadingOSPActivity", "onCreate", false);
    }

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