翰林优商.apk(点击下载) / a.java


package com.kwad.components.core.j;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.kwad.components.core.n.j;
import com.kwad.components.core.n.n;
import com.kwad.sdk.KsAdSDKImpl;
import com.kwad.sdk.api.loader.Wrapper;
import com.kwad.sdk.api.proxy.IActivityProxy;

public abstract class a extends IActivityProxy {
    private static final String FRAGMENTS_TAG = "android:fragments";
    public static final String KEY_START_TIME = "key_start_time";
    private boolean enableDestroyer = true;
    private final com.kwad.components.core.j.kwai.a mPageMonitor = new com.kwad.components.core.j.kwai.a();

    /* access modifiers changed from: protected */
    public boolean enableSaveFragmentState() {
        return false;
    }

    @Override // com.kwad.sdk.api.proxy.IActivityProxy
    public Intent getIntent() {
        Intent intent = super.getIntent();
        n.e(intent);
        return intent;
    }

    /* access modifiers changed from: protected */
    public abstract String getPageName();

    public boolean isEnableDestroyer() {
        return this.enableDestroyer;
    }

    @Override // com.kwad.sdk.api.proxy.IActivityProxy
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        getWindow().setFlags(16777216, 16777216);
        Intent intent = getIntent();
        long j = 0;
        if (intent != null) {
            j = intent.getLongExtra("key_start_time", 0);
        }
        this.mPageMonitor.av(getPageName());
        this.mPageMonitor.n(j);
    }

    @Override // com.kwad.sdk.api.proxy.IActivityProxy
    public void onDestroy() {
        super.onDestroy();
        if (this.enableDestroyer) {
            j.destroyActivity(getActivity(), getWindow());
        }
    }

    @Override // com.kwad.sdk.api.proxy.IActivityProxy
    public void onResume() {
        super.onResume();
        com.kwad.components.core.j.kwai.a aVar = this.mPageMonitor;
        getActivity();
        aVar.oa();
    }

    @Override // com.kwad.sdk.api.proxy.IActivityProxy
    public void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        if (KsAdSDKImpl.get().getIsExternal() && !enableSaveFragmentState() && bundle != null && bundle.containsKey(FRAGMENTS_TAG)) {
            bundle.remove(FRAGMENTS_TAG);
        }
    }

    @Override // com.kwad.sdk.api.proxy.IActivityProxy
    public void setContentView(int i) {
        View view;
        Context wrapContextIfNeed = Wrapper.wrapContextIfNeed(getActivity());
        try {
            view = View.inflate(wrapContextIfNeed, i, null);
        } catch (Throwable unused) {
            com.kwad.components.core.b.a.b(new RuntimeException("inflate fail " + wrapContextIfNeed + "--getIsExternal:" + KsAdSDKImpl.get().getIsExternal()));
            view = Wrapper.wrapInflaterIfNeed(LayoutInflater.from(wrapContextIfNeed)).inflate(i, (ViewGroup) null);
        }
        super.setContentView(view);
    }

    public void setEnableDestroyer(boolean z) {
        this.enableDestroyer = z;
    }
}