- 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
108 lines
4.9 KiB
Java
108 lines
4.9 KiB
Java
package com.facebook.internal;
|
|
|
|
import android.content.Context;
|
|
import android.net.Uri;
|
|
import android.os.Bundle;
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import android.webkit.WebView;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class FacebookWebFallbackDialog extends WebDialog {
|
|
private static final int OS_BACK_BUTTON_RESPONSE_TIMEOUT_MILLISECONDS = 1500;
|
|
private boolean waitingForDialogToClose;
|
|
public static final Companion Companion = new Companion(null);
|
|
private static final String TAG = FacebookWebFallbackDialog.class.getName();
|
|
|
|
public /* synthetic */ FacebookWebFallbackDialog(Context context, String str, String str2, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(context, str, str2);
|
|
}
|
|
|
|
public static final FacebookWebFallbackDialog newInstance(Context context, String str, String str2) {
|
|
return Companion.newInstance(context, str, str2);
|
|
}
|
|
|
|
private FacebookWebFallbackDialog(Context context, String str, String str2) {
|
|
super(context, str);
|
|
setExpectedRedirectUrl(str2);
|
|
}
|
|
|
|
@Override // com.facebook.internal.WebDialog
|
|
public Bundle parseResponseUri(String str) {
|
|
Uri parse = Uri.parse(str);
|
|
Utility utility = Utility.INSTANCE;
|
|
Bundle parseUrlQueryString = Utility.parseUrlQueryString(parse.getQuery());
|
|
String string = parseUrlQueryString.getString(ServerProtocol.FALLBACK_DIALOG_PARAM_BRIDGE_ARGS);
|
|
parseUrlQueryString.remove(ServerProtocol.FALLBACK_DIALOG_PARAM_BRIDGE_ARGS);
|
|
if (!Utility.isNullOrEmpty(string)) {
|
|
try {
|
|
parseUrlQueryString.putBundle(NativeProtocol.EXTRA_PROTOCOL_BRIDGE_ARGS, BundleJSONConverter.convertToBundle(new JSONObject(string)));
|
|
} catch (JSONException e) {
|
|
Utility utility2 = Utility.INSTANCE;
|
|
Utility.logd(TAG, "Unable to parse bridge_args JSON", e);
|
|
}
|
|
}
|
|
String string2 = parseUrlQueryString.getString(ServerProtocol.FALLBACK_DIALOG_PARAM_METHOD_RESULTS);
|
|
parseUrlQueryString.remove(ServerProtocol.FALLBACK_DIALOG_PARAM_METHOD_RESULTS);
|
|
if (!Utility.isNullOrEmpty(string2)) {
|
|
try {
|
|
parseUrlQueryString.putBundle(NativeProtocol.EXTRA_PROTOCOL_METHOD_RESULTS, BundleJSONConverter.convertToBundle(new JSONObject(string2)));
|
|
} catch (JSONException e2) {
|
|
Utility utility3 = Utility.INSTANCE;
|
|
Utility.logd(TAG, "Unable to parse bridge_args JSON", e2);
|
|
}
|
|
}
|
|
parseUrlQueryString.remove("version");
|
|
parseUrlQueryString.putInt(NativeProtocol.EXTRA_PROTOCOL_VERSION, NativeProtocol.getLatestKnownVersion());
|
|
return parseUrlQueryString;
|
|
}
|
|
|
|
@Override // com.facebook.internal.WebDialog, android.app.Dialog, android.content.DialogInterface
|
|
public void cancel() {
|
|
WebView webView = getWebView();
|
|
if (!isPageFinished() || isListenerCalled() || webView == null || !webView.isShown()) {
|
|
super.cancel();
|
|
} else {
|
|
if (this.waitingForDialogToClose) {
|
|
return;
|
|
}
|
|
this.waitingForDialogToClose = true;
|
|
webView.loadUrl(Intrinsics.stringPlus("javascript:", "(function() { var event = document.createEvent('Event'); event.initEvent('fbPlatformDialogMustClose',true,true); document.dispatchEvent(event);})();"));
|
|
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() { // from class: com.facebook.internal.FacebookWebFallbackDialog$$ExternalSyntheticLambda0
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
FacebookWebFallbackDialog.m560cancel$lambda0(FacebookWebFallbackDialog.this);
|
|
}
|
|
}, 1500L);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
/* renamed from: cancel$lambda-0, reason: not valid java name */
|
|
public static final void m560cancel$lambda0(FacebookWebFallbackDialog this$0) {
|
|
Intrinsics.checkNotNullParameter(this$0, "this$0");
|
|
super.cancel();
|
|
}
|
|
|
|
public static final class Companion {
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
|
|
public final FacebookWebFallbackDialog newInstance(Context context, String url, String expectedRedirectUrl) {
|
|
Intrinsics.checkNotNullParameter(context, "context");
|
|
Intrinsics.checkNotNullParameter(url, "url");
|
|
Intrinsics.checkNotNullParameter(expectedRedirectUrl, "expectedRedirectUrl");
|
|
WebDialog.initDefaultTheme(context);
|
|
return new FacebookWebFallbackDialog(context, url, expectedRedirectUrl, null);
|
|
}
|
|
}
|
|
}
|