导航菜单

页面标题

页面副标题

MX Player v1.97.8 - CurrentTaskAuthorizationActivity.java 源代码

正在查看: MX Player v1.97.8 应用的 CurrentTaskAuthorizationActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.microsoft.identity.common.internal.providers.oauth2;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import com.microsoft.identity.common.adal.internal.AuthenticationConstants;
import com.microsoft.identity.common.internal.ui.DualScreenActivity;
import com.microsoft.identity.common.logging.Logger;

public class CurrentTaskAuthorizationActivity extends DualScreenActivity {
    private static final String TAG = "CurrentTaskAuthorizationActivity";
    private boolean mCloseCustomTabs = true;
    private CurrentTaskBrowserAuthorizationFragment mFragment;
    private BroadcastReceiver redirectReceiver;

    private void unregisterAndFinish() {
        dia.a(this).d(this.redirectReceiver);
        finish();
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        String h = z31.h(new StringBuilder(), TAG, ":onCreate");
        Fragment authorizationFragmentFromStartIntent = AuthorizationActivityFactory.getAuthorizationFragmentFromStartIntent(getIntent());
        if (!(authorizationFragmentFromStartIntent instanceof CurrentTaskBrowserAuthorizationFragment)) {
            IllegalStateException illegalStateException = new IllegalStateException("Unexpected fragment type");
            Logger.error(h, "Fragment provided was not of type CurrentTaskBrowserAuthorizationFragment", illegalStateException);
            throw illegalStateException;
        }
        CurrentTaskBrowserAuthorizationFragment currentTaskBrowserAuthorizationFragment = (CurrentTaskBrowserAuthorizationFragment) authorizationFragmentFromStartIntent;
        this.mFragment = currentTaskBrowserAuthorizationFragment;
        currentTaskBrowserAuthorizationFragment.setInstanceState(getIntent().getExtras());
        if (!AuthenticationConstants.AuthorizationIntentAction.REDIRECT_RETURNED_ACTION.equals(getIntent().getAction())) {
            setFragment(this.mFragment);
            if (bundle == null) {
                this.mCloseCustomTabs = false;
                this.redirectReceiver = new BroadcastReceiver() {
                    @Override
                    public void onReceive(Context context, Intent intent) {
                        Intent intent2 = new Intent((Context) CurrentTaskAuthorizationActivity.this, (Class<?>) CurrentTaskAuthorizationActivity.class);
                        intent2.setAction(AuthenticationConstants.AuthorizationIntentAction.REFRESH_TO_CLOSE);
                        intent2.addFlags(603979776);
                        CurrentTaskAuthorizationActivity.this.startActivity(intent2);
                    }
                };
                dia.a(this).b(this.redirectReceiver, new IntentFilter(AuthenticationConstants.AuthorizationIntentAction.REDIRECT_RETURNED_ACTION));
                return;
            }
            return;
        }
        if (CurrentTaskBrowserAuthorizationFragment.class.isInstance(this.mFragment)) {
            Bundle bundle2 = new Bundle();
            bundle2.putBoolean("RESPONSE", true);
            this.mFragment.setArguments(bundle2);
            this.mFragment.completeAuthorizationInBrowserFlow(getIntent().getStringExtra("RESPONSE_URI"));
            finish();
        }
    }

    public void onNewIntent(Intent intent) {
        super/*ub3*/.onNewIntent(intent);
        if (AuthenticationConstants.AuthorizationIntentAction.REFRESH_TO_CLOSE.equals(intent.getAction())) {
            dia.a(this).c(new Intent(AuthenticationConstants.AuthorizationIntentAction.DESTROY_REDIRECT_RECEIVING_ACTIVITY_ACTION));
            unregisterAndFinish();
        }
        setIntent(intent);
    }

    public void onResume() {
        super.onResume();
        if (AuthenticationConstants.AuthorizationIntentAction.REDIRECT_RETURNED_ACTION.equals(getIntent().getAction())) {
            Bundle bundle = new Bundle();
            bundle.putBoolean("RESPONSE", true);
            this.mFragment.setArguments(bundle);
            this.mFragment.completeAuthorizationInBrowserFlow(getIntent().getStringExtra("RESPONSE_URI"));
            setResult(-1);
            unregisterAndFinish();
        }
        if (this.mCloseCustomTabs) {
            unregisterAndFinish();
        }
        this.mCloseCustomTabs = true;
    }
}