正在查看: Housing v14.7.8 应用的 CustomTabMainActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Housing v14.7.8 应用的 CustomTabMainActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.facebook;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.Bundle;
import androidx.activity.result.LoginTargetApp;
import com.facebook.gamingservices.cloudgaming.internal.SDKConstants;
import com.facebook.internal.CustomTab;
import com.facebook.internal.InstagramCustomTab;
import com.facebook.internal.NativeProtocol;
import com.facebook.internal.Utility;
import com.newrelic.agent.android.api.v2.TraceFieldInterface;
import com.newrelic.agent.android.background.ApplicationStateMonitor;
import com.newrelic.agent.android.instrumentation.Instrumented;
import com.newrelic.agent.android.tracing.Trace;
import com.newrelic.agent.android.tracing.TraceMachine;
import java.util.ArrayList;
import kotlin.Metadata;
import kotlin.jvm.JvmField;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.r;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@Metadata(d1 = {"\u00008\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u0000 \u00192\u00020\u0001:\u0001\u0019B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J!\u0010\t\u001a\u00020\b2\u0006\u0010\u0005\u001a\u00020\u00042\b\u0010\u0007\u001a\u0004\u0018\u00010\u0006H\u0002¢\u0006\u0004\b\t\u0010\nJ\u0019\u0010\r\u001a\u00020\b2\b\u0010\f\u001a\u0004\u0018\u00010\u000bH\u0014¢\u0006\u0004\b\r\u0010\u000eJ\u0017\u0010\u0010\u001a\u00020\b2\u0006\u0010\u000f\u001a\u00020\u0006H\u0014¢\u0006\u0004\b\u0010\u0010\u0011J\u000f\u0010\u0012\u001a\u00020\bH\u0014¢\u0006\u0004\b\u0012\u0010\u0003R\u0016\u0010\u0014\u001a\u00020\u00138\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u0014\u0010\u0015R\u0018\u0010\u0017\u001a\u0004\u0018\u00010\u00168\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u0017\u0010\u0018¨\u0006\u001a"}, d2 = {"Lcom/facebook/CustomTabMainActivity;", "Landroid/app/Activity;", "<init>", "()V", "", "resultCode", "Landroid/content/Intent;", "resultIntent", "Lzp/j0;", "sendResult", "(ILandroid/content/Intent;)V", "Landroid/os/Bundle;", "savedInstanceState", "onCreate", "(Landroid/os/Bundle;)V", SDKConstants.PARAM_INTENT, "onNewIntent", "(Landroid/content/Intent;)V", "onResume", "", "shouldCloseCustomTab", "Z", "Landroid/content/BroadcastReceiver;", "redirectReceiver", "Landroid/content/BroadcastReceiver;", "Companion", "facebook-common_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
@Instrumented
public final class CustomTabMainActivity extends Activity implements TraceFieldInterface {
public Trace _nr_trace;
@Nullable
private BroadcastReceiver redirectReceiver;
private boolean shouldCloseCustomTab = true;
@NotNull
public static final Companion INSTANCE = new Companion(null);
@JvmField
@NotNull
public static final String EXTRA_ACTION = "CustomTabMainActivity.extra_action";
@JvmField
@NotNull
public static final String EXTRA_PARAMS = "CustomTabMainActivity.extra_params";
@JvmField
@NotNull
public static final String EXTRA_CHROME_PACKAGE = "CustomTabMainActivity.extra_chromePackage";
@JvmField
@NotNull
public static final String EXTRA_URL = "CustomTabMainActivity.extra_url";
@JvmField
@NotNull
public static final String EXTRA_TARGET_APP = "CustomTabMainActivity.extra_targetApp";
@JvmField
@NotNull
public static final String REFRESH_ACTION = "CustomTabMainActivity.action_refresh";
@JvmField
@NotNull
public static final String NO_ACTIVITY_EXCEPTION = "CustomTabMainActivity.no_activity_exception";
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0010\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\u0004H\u0002R\u0010\u0010\u0003\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0005\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0006\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0007\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\b\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\t\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\n\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Lcom/facebook/CustomTabMainActivity$Companion;", "", "()V", "EXTRA_ACTION", "", "EXTRA_CHROME_PACKAGE", "EXTRA_PARAMS", "EXTRA_TARGET_APP", "EXTRA_URL", "NO_ACTIVITY_EXCEPTION", "REFRESH_ACTION", "parseResponseUri", "Landroid/os/Bundle;", "urlString", "facebook-common_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final Bundle parseResponseUri(String urlString) {
Uri parse = Uri.parse(urlString);
Bundle parseUrlQueryString = Utility.parseUrlQueryString(parse.getQuery());
parseUrlQueryString.putAll(Utility.parseUrlQueryString(parse.getFragment()));
return parseUrlQueryString;
}
private Companion() {
}
}
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public class WhenMappings {
public static final int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[LoginTargetApp.values().length];
try {
iArr[LoginTargetApp.INSTAGRAM.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
$EnumSwitchMapping$0 = iArr;
}
}
private final void sendResult(int resultCode, Intent resultIntent) {
BroadcastReceiver broadcastReceiver = this.redirectReceiver;
if (broadcastReceiver != null) {
androidx.localbroadcastmanager.content.b.b(this).e(broadcastReceiver);
}
if (resultIntent != null) {
String stringExtra = resultIntent.getStringExtra(EXTRA_URL);
Bundle parseResponseUri = stringExtra != null ? INSTANCE.parseResponseUri(stringExtra) : new Bundle();
Intent intent = getIntent();
r.j(intent, SDKConstants.PARAM_INTENT);
Intent createProtocolResultIntent = NativeProtocol.createProtocolResultIntent(intent, parseResponseUri, null);
if (createProtocolResultIntent != null) {
resultIntent = createProtocolResultIntent;
}
setResult(resultCode, resultIntent);
} else {
Intent intent2 = getIntent();
r.j(intent2, SDKConstants.PARAM_INTENT);
setResult(resultCode, NativeProtocol.createProtocolResultIntent(intent2, null, null));
}
finish();
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
TraceMachine.startTracing("CustomTabMainActivity");
try {
TraceMachine.enterMethod(this._nr_trace, "CustomTabMainActivity#onCreate", (ArrayList) null);
} catch (NoSuchFieldError unused) {
TraceMachine.enterMethod((Trace) null, "CustomTabMainActivity#onCreate", (ArrayList) null);
}
super.onCreate(savedInstanceState);
String str = CustomTabActivity.CUSTOM_TAB_REDIRECT_ACTION;
if (r.f(str, getIntent().getAction())) {
setResult(0);
finish();
TraceMachine.exitMethod();
return;
}
if (savedInstanceState == null) {
String stringExtra = getIntent().getStringExtra(EXTRA_ACTION);
if (stringExtra == null) {
TraceMachine.exitMethod();
return;
}
Bundle bundleExtra = getIntent().getBundleExtra(EXTRA_PARAMS);
boolean openCustomTab = (WhenMappings.$EnumSwitchMapping$0[LoginTargetApp.INSTANCE.fromString(getIntent().getStringExtra(EXTRA_TARGET_APP)).ordinal()] == 1 ? new InstagramCustomTab(stringExtra, bundleExtra) : new CustomTab(stringExtra, bundleExtra)).openCustomTab(this, getIntent().getStringExtra(EXTRA_CHROME_PACKAGE));
this.shouldCloseCustomTab = false;
if (!openCustomTab) {
setResult(0, getIntent().putExtra(NO_ACTIVITY_EXCEPTION, true));
finish();
TraceMachine.exitMethod();
return;
} else {
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(@NotNull Context context, @NotNull Intent intent) {
r.k(context, "context");
r.k(intent, SDKConstants.PARAM_INTENT);
Intent intent2 = new Intent(CustomTabMainActivity.this, (Class<?>) CustomTabMainActivity.class);
intent2.setAction(CustomTabMainActivity.REFRESH_ACTION);
String str2 = CustomTabMainActivity.EXTRA_URL;
intent2.putExtra(str2, intent.getStringExtra(str2));
intent2.addFlags(603979776);
CustomTabMainActivity.this.startActivity(intent2);
}
};
this.redirectReceiver = broadcastReceiver;
androidx.localbroadcastmanager.content.b.b(this).c(broadcastReceiver, new IntentFilter(str));
}
}
TraceMachine.exitMethod();
}
@Override
public void onNewIntent(@NotNull Intent intent) {
r.k(intent, SDKConstants.PARAM_INTENT);
super.onNewIntent(intent);
if (r.f(REFRESH_ACTION, intent.getAction())) {
androidx.localbroadcastmanager.content.b.b(this).d(new Intent(CustomTabActivity.DESTROY_ACTION));
sendResult(-1, intent);
} else if (r.f(CustomTabActivity.CUSTOM_TAB_REDIRECT_ACTION, intent.getAction())) {
sendResult(-1, intent);
}
}
@Override
public void onResume() {
super.onResume();
if (this.shouldCloseCustomTab) {
sendResult(0, null);
}
this.shouldCloseCustomTab = true;
}
@Override
public void onStart() {
super.onStart();
ApplicationStateMonitor.getInstance().activityStarted();
}
@Override
public void onStop() {
super.onStop();
ApplicationStateMonitor.getInstance().activityStopped();
}
}