导航菜单

页面标题

页面副标题

St.John's v1.0.9 - CurrentTaskBrowserTabActivity.java 源代码

正在查看: St.John's v1.0.9 应用的 CurrentTaskBrowserTabActivity.java JAVA 源代码文件

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


package com.microsoft.identity.client;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.widget.Toast;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.microsoft.identity.common.adal.internal.AuthenticationConstants;
import com.microsoft.identity.common.internal.providers.oauth2.CurrentTaskBrowserAuthorizationFragment;
import com.microsoft.identity.common.internal.util.StringUtil;

public final class CurrentTaskBrowserTabActivity extends Activity {
    private static final int REDIRECT_RECEIVED_CODE = 2;
    private static final String TAG = "CurrentTaskBrowserTabActivity";
    private BroadcastReceiver mCloseBroadcastReceiver;

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        String str = TAG + ":onCreate";
        String dataString = getIntent().getDataString();
        if (bundle != null || getIntent() == null || StringUtil.isEmpty(getIntent().getDataString())) {
            return;
        }
        Intent createCustomTabResponseIntent = CurrentTaskBrowserAuthorizationFragment.createCustomTabResponseIntent(this, dataString);
        if (createCustomTabResponseIntent != null) {
            startActivityForResult(createCustomTabResponseIntent, 2);
        } else {
            com.microsoft.identity.common.logging.Logger.warn(str, "Received NULL response intent. Unable to complete authorization.");
            Toast.makeText(getApplicationContext(), "Unable to complete authorization as there is no interactive call in progress. This can be due to closing the app while the authorization was in process.", 1).show();
        }
    }

    @Override
    protected void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        final String str = TAG + ":onActivityResult";
        if (i2 == 0) {
            LocalBroadcastManager.getInstance(this).sendBroadcast(new Intent(AuthenticationConstants.AuthorizationIntentAction.REDIRECT_RETURNED_ACTION));
            this.mCloseBroadcastReceiver = new BroadcastReceiver() {
                @Override
                public void onReceive(android.content.Context r4, android.content.Intent r5) {
                    throw new UnsupportedOperationException("Method not decompiled: com.microsoft.identity.client.CurrentTaskBrowserTabActivity.AnonymousClass1.onReceive(android.content.Context, android.content.Intent):void");
                }
            };
            LocalBroadcastManager.getInstance(this).registerReceiver(this.mCloseBroadcastReceiver, new IntentFilter(AuthenticationConstants.AuthorizationIntentAction.DESTROY_REDIRECT_RECEIVING_ACTIVITY_ACTION));
        }
    }

    @Override
    protected void onDestroy() {
        LocalBroadcastManager.getInstance(this).unregisterReceiver(this.mCloseBroadcastReceiver);
        super.onDestroy();
    }
}