- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
191 lines
8.7 KiB
Java
191 lines
8.7 KiB
Java
package com.facebook.internal;
|
|
|
|
import android.app.Dialog;
|
|
import android.content.Intent;
|
|
import android.content.res.Configuration;
|
|
import android.os.Bundle;
|
|
import androidx.annotation.VisibleForTesting;
|
|
import androidx.fragment.app.DialogFragment;
|
|
import androidx.fragment.app.FragmentActivity;
|
|
import com.facebook.FacebookException;
|
|
import com.facebook.FacebookSdk;
|
|
import com.facebook.internal.FacebookWebFallbackDialog;
|
|
import com.facebook.internal.WebDialog;
|
|
import java.util.Arrays;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.jvm.internal.StringCompanionObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class FacebookDialogFragment extends DialogFragment {
|
|
public static final Companion Companion = new Companion(null);
|
|
public static final String TAG = "FacebookDialogFragment";
|
|
private Dialog innerDialog;
|
|
|
|
public final Dialog getInnerDialog() {
|
|
return this.innerDialog;
|
|
}
|
|
|
|
public final void setInnerDialog(Dialog dialog) {
|
|
this.innerDialog = dialog;
|
|
}
|
|
|
|
@Override // androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
|
|
public void onCreate(Bundle bundle) {
|
|
super.onCreate(bundle);
|
|
initDialog$facebook_common_release();
|
|
}
|
|
|
|
@VisibleForTesting
|
|
public final void initDialog$facebook_common_release() {
|
|
FragmentActivity activity;
|
|
WebDialog newInstance;
|
|
if (this.innerDialog == null && (activity = getActivity()) != null) {
|
|
Intent intent = activity.getIntent();
|
|
NativeProtocol nativeProtocol = NativeProtocol.INSTANCE;
|
|
Intrinsics.checkNotNullExpressionValue(intent, "intent");
|
|
Bundle methodArgumentsFromIntent = NativeProtocol.getMethodArgumentsFromIntent(intent);
|
|
if (!(methodArgumentsFromIntent != null ? methodArgumentsFromIntent.getBoolean(NativeProtocol.WEB_DIALOG_IS_FALLBACK, false) : false)) {
|
|
String string = methodArgumentsFromIntent == null ? null : methodArgumentsFromIntent.getString("action");
|
|
Bundle bundle = methodArgumentsFromIntent != null ? methodArgumentsFromIntent.getBundle("params") : null;
|
|
if (Utility.isNullOrEmpty(string)) {
|
|
Utility.logd(TAG, "Cannot start a WebDialog with an empty/missing 'actionName'");
|
|
activity.finish();
|
|
return;
|
|
} else {
|
|
if (string == null) {
|
|
throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
|
|
}
|
|
newInstance = new WebDialog.Builder(activity, string, bundle).setOnCompleteListener(new WebDialog.OnCompleteListener() { // from class: com.facebook.internal.FacebookDialogFragment$$ExternalSyntheticLambda0
|
|
@Override // com.facebook.internal.WebDialog.OnCompleteListener
|
|
public final void onComplete(Bundle bundle2, FacebookException facebookException) {
|
|
FacebookDialogFragment.m558initDialog$lambda0(FacebookDialogFragment.this, bundle2, facebookException);
|
|
}
|
|
}).build();
|
|
}
|
|
} else {
|
|
String string2 = methodArgumentsFromIntent != null ? methodArgumentsFromIntent.getString("url") : null;
|
|
if (Utility.isNullOrEmpty(string2)) {
|
|
Utility.logd(TAG, "Cannot start a fallback WebDialog with an empty/missing 'url'");
|
|
activity.finish();
|
|
return;
|
|
}
|
|
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
|
|
String format = String.format("fb%s://bridge/", Arrays.copyOf(new Object[]{FacebookSdk.getApplicationId()}, 1));
|
|
Intrinsics.checkNotNullExpressionValue(format, "java.lang.String.format(format, *args)");
|
|
FacebookWebFallbackDialog.Companion companion = FacebookWebFallbackDialog.Companion;
|
|
if (string2 == null) {
|
|
throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
|
|
}
|
|
newInstance = companion.newInstance(activity, string2, format);
|
|
newInstance.setOnCompleteListener(new WebDialog.OnCompleteListener() { // from class: com.facebook.internal.FacebookDialogFragment$$ExternalSyntheticLambda1
|
|
@Override // com.facebook.internal.WebDialog.OnCompleteListener
|
|
public final void onComplete(Bundle bundle2, FacebookException facebookException) {
|
|
FacebookDialogFragment.m559initDialog$lambda1(FacebookDialogFragment.this, bundle2, facebookException);
|
|
}
|
|
});
|
|
}
|
|
this.innerDialog = newInstance;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
/* renamed from: initDialog$lambda-0, reason: not valid java name */
|
|
public static final void m558initDialog$lambda0(FacebookDialogFragment this$0, Bundle bundle, FacebookException facebookException) {
|
|
Intrinsics.checkNotNullParameter(this$0, "this$0");
|
|
this$0.onCompleteWebDialog(bundle, facebookException);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
/* renamed from: initDialog$lambda-1, reason: not valid java name */
|
|
public static final void m559initDialog$lambda1(FacebookDialogFragment this$0, Bundle bundle, FacebookException facebookException) {
|
|
Intrinsics.checkNotNullParameter(this$0, "this$0");
|
|
this$0.onCompleteWebFallbackDialog(bundle);
|
|
}
|
|
|
|
@Override // androidx.fragment.app.DialogFragment
|
|
public Dialog onCreateDialog(Bundle bundle) {
|
|
Dialog dialog = this.innerDialog;
|
|
if (dialog != null) {
|
|
if (dialog != null) {
|
|
return dialog;
|
|
}
|
|
throw new NullPointerException("null cannot be cast to non-null type android.app.Dialog");
|
|
}
|
|
onCompleteWebDialog(null, null);
|
|
setShowsDialog(false);
|
|
Dialog onCreateDialog = super.onCreateDialog(bundle);
|
|
Intrinsics.checkNotNullExpressionValue(onCreateDialog, "super.onCreateDialog(savedInstanceState)");
|
|
return onCreateDialog;
|
|
}
|
|
|
|
@Override // androidx.fragment.app.Fragment
|
|
public void onResume() {
|
|
super.onResume();
|
|
Dialog dialog = this.innerDialog;
|
|
if (dialog instanceof WebDialog) {
|
|
if (dialog == null) {
|
|
throw new NullPointerException("null cannot be cast to non-null type com.facebook.internal.WebDialog");
|
|
}
|
|
((WebDialog) dialog).resize();
|
|
}
|
|
}
|
|
|
|
@Override // androidx.fragment.app.Fragment, android.content.ComponentCallbacks
|
|
public void onConfigurationChanged(Configuration newConfig) {
|
|
Intrinsics.checkNotNullParameter(newConfig, "newConfig");
|
|
super.onConfigurationChanged(newConfig);
|
|
if ((this.innerDialog instanceof WebDialog) && isResumed()) {
|
|
Dialog dialog = this.innerDialog;
|
|
if (dialog == null) {
|
|
throw new NullPointerException("null cannot be cast to non-null type com.facebook.internal.WebDialog");
|
|
}
|
|
((WebDialog) dialog).resize();
|
|
}
|
|
}
|
|
|
|
@Override // androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
|
|
public void onDestroyView() {
|
|
Dialog dialog = getDialog();
|
|
if (dialog != null && getRetainInstance()) {
|
|
dialog.setDismissMessage(null);
|
|
}
|
|
super.onDestroyView();
|
|
}
|
|
|
|
private final void onCompleteWebDialog(Bundle bundle, FacebookException facebookException) {
|
|
FragmentActivity activity = getActivity();
|
|
if (activity == null) {
|
|
return;
|
|
}
|
|
NativeProtocol nativeProtocol = NativeProtocol.INSTANCE;
|
|
Intent intent = activity.getIntent();
|
|
Intrinsics.checkNotNullExpressionValue(intent, "fragmentActivity.intent");
|
|
activity.setResult(facebookException == null ? -1 : 0, NativeProtocol.createProtocolResultIntent(intent, bundle, facebookException));
|
|
activity.finish();
|
|
}
|
|
|
|
private final void onCompleteWebFallbackDialog(Bundle bundle) {
|
|
FragmentActivity activity = getActivity();
|
|
if (activity == null) {
|
|
return;
|
|
}
|
|
Intent intent = new Intent();
|
|
if (bundle == null) {
|
|
bundle = new Bundle();
|
|
}
|
|
intent.putExtras(bundle);
|
|
activity.setResult(-1, intent);
|
|
activity.finish();
|
|
}
|
|
|
|
public static final class Companion {
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
}
|
|
}
|