正在查看: MX Player v1.97.8 应用的 BrokerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: MX Player v1.97.8 应用的 BrokerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.microsoft.identity.common.internal.broker;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import com.microsoft.identity.common.PropertyBagUtil;
import com.microsoft.identity.common.internal.result.BrokerResultAdapterFactory;
import com.microsoft.identity.common.java.AuthenticationConstants;
import com.microsoft.identity.common.java.exception.ClientException;
import com.microsoft.identity.common.java.exception.ErrorStrings;
import com.microsoft.identity.common.java.request.SdkType;
import com.microsoft.identity.common.java.util.ported.LocalBroadcaster;
import com.microsoft.identity.common.java.util.ported.PropertyBag;
import com.microsoft.identity.common.logging.Logger;
import defpackage.tya;
public final class BrokerActivity extends Activity {
public static final String BROKER_INTENT = "broker_intent";
static final int BROKER_INTENT_REQUEST_CODE = 1001;
static final String BROKER_INTENT_STARTED = "broker_intent_started";
private static final String TAG = "BrokerActivity";
private Boolean mBrokerIntentStarted;
private Intent mBrokerInteractiveRequestIntent;
private Boolean mBrokerResultReceived;
public BrokerActivity() {
Boolean bool = Boolean.FALSE;
this.mBrokerIntentStarted = bool;
this.mBrokerResultReceived = bool;
}
private void returnsExceptionOnActivityUnexpectedlyKilled() {
PropertyBag fromBundle = PropertyBagUtil.fromBundle(BrokerResultAdapterFactory.getBrokerResultAdapter(SdkType.MSAL).bundleFromBaseException(new ClientException(ErrorStrings.BROKER_REQUEST_CANCELLED, "The activity is killed unexpectedly."), null));
fromBundle.put(AuthenticationConstants.LocalBroadcasterFields.REQUEST_CODE, Integer.valueOf(AuthenticationConstants.UIRequest.BROKER_FLOW));
fromBundle.put(AuthenticationConstants.LocalBroadcasterFields.RESULT_CODE, Integer.valueOf(AuthenticationConstants.BrokerResponse.BROKER_OPERATION_CANCELLED));
LocalBroadcaster.INSTANCE.broadcast(AuthenticationConstants.LocalBroadcasterAliases.RETURN_BROKER_INTERACTIVE_ACQUIRE_TOKEN_RESULT, fromBundle);
}
@Override
public SharedPreferences getSharedPreferences(String str, int i) {
return tya.m.getSharedPreferences(str, i);
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
String h = z31.h(new StringBuilder(), TAG, ":onActivityResult");
Logger.info(h, "Result received from Broker Request code: " + i + " Result code: " + i);
this.mBrokerResultReceived = Boolean.TRUE;
if (i2 == 2004 || i2 == 2001 || i2 == 2002) {
Logger.verbose(h, "Completing interactive request ");
PropertyBag fromBundle = PropertyBagUtil.fromBundle(intent.getExtras());
fromBundle.put(AuthenticationConstants.LocalBroadcasterFields.REQUEST_CODE, Integer.valueOf(AuthenticationConstants.UIRequest.BROKER_FLOW));
fromBundle.put(AuthenticationConstants.LocalBroadcasterFields.RESULT_CODE, Integer.valueOf(i2));
LocalBroadcaster.INSTANCE.broadcast(AuthenticationConstants.LocalBroadcasterAliases.RETURN_BROKER_INTERACTIVE_ACQUIRE_TOKEN_RESULT, fromBundle);
} else {
returnsExceptionOnActivityUnexpectedlyKilled();
}
finish();
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
String h = z31.h(new StringBuilder(), TAG, ":onCreate");
if (bundle != null) {
this.mBrokerInteractiveRequestIntent = (Intent) bundle.getParcelable(BROKER_INTENT);
this.mBrokerIntentStarted = Boolean.valueOf(bundle.getBoolean(BROKER_INTENT_STARTED));
return;
}
Bundle extras = getIntent().getExtras();
if (extras != null) {
this.mBrokerInteractiveRequestIntent = (Intent) extras.getParcelable(BROKER_INTENT);
} else {
Logger.warn(h, "Extras is null.");
}
}
@Override
public void onDestroy() {
if (!this.mBrokerResultReceived.booleanValue()) {
returnsExceptionOnActivityUnexpectedlyKilled();
}
super.onDestroy();
}
@Override
public void onResume() {
super.onResume();
if (this.mBrokerIntentStarted.booleanValue()) {
return;
}
this.mBrokerIntentStarted = Boolean.TRUE;
startActivityForResult(this.mBrokerInteractiveRequestIntent, 1001);
}
@Override
public void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
bundle.putParcelable(BROKER_INTENT, this.mBrokerInteractiveRequestIntent);
bundle.putBoolean(BROKER_INTENT_STARTED, this.mBrokerIntentStarted.booleanValue());
}
@Override
public void onStop() {
super.onStop();
}
}