mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-16 10:57:17 +01:00
46 lines
2.4 KiB
Java
46 lines
2.4 KiB
Java
package androidx.webkit.internal;
|
|
|
|
import androidx.webkit.JavaScriptReplyProxy;
|
|
import java.lang.reflect.InvocationHandler;
|
|
import java.util.Objects;
|
|
import org.apache.commons.lang3.Functions$$ExternalSyntheticLambda19;
|
|
import org.chromium.support_lib_boundary.JsReplyProxyBoundaryInterface;
|
|
import org.chromium.support_lib_boundary.util.BoundaryInterfaceReflectionUtil;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes14.dex */
|
|
public class JavaScriptReplyProxyImpl extends JavaScriptReplyProxy {
|
|
private final JsReplyProxyBoundaryInterface mBoundaryInterface;
|
|
|
|
public JavaScriptReplyProxyImpl(JsReplyProxyBoundaryInterface jsReplyProxyBoundaryInterface) {
|
|
this.mBoundaryInterface = jsReplyProxyBoundaryInterface;
|
|
}
|
|
|
|
public static JavaScriptReplyProxyImpl forInvocationHandler(InvocationHandler invocationHandler) {
|
|
JsReplyProxyBoundaryInterface jsReplyProxyBoundaryInterface = (JsReplyProxyBoundaryInterface) BoundaryInterfaceReflectionUtil.castToSuppLibClass(JsReplyProxyBoundaryInterface.class, invocationHandler);
|
|
return (JavaScriptReplyProxyImpl) jsReplyProxyBoundaryInterface.getOrCreatePeer(new Functions$$ExternalSyntheticLambda19(jsReplyProxyBoundaryInterface, 1));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ Object lambda$forInvocationHandler$0(JsReplyProxyBoundaryInterface jsReplyProxyBoundaryInterface) throws Exception {
|
|
return new JavaScriptReplyProxyImpl(jsReplyProxyBoundaryInterface);
|
|
}
|
|
|
|
@Override // androidx.webkit.JavaScriptReplyProxy
|
|
public void postMessage(byte[] bArr) {
|
|
Objects.requireNonNull(bArr, "ArrayBuffer must be non-null");
|
|
if (!WebViewFeatureInternal.WEB_MESSAGE_ARRAY_BUFFER.isSupportedByWebView()) {
|
|
throw WebViewFeatureInternal.getUnsupportedOperationException();
|
|
}
|
|
this.mBoundaryInterface.postMessageWithPayload(BoundaryInterfaceReflectionUtil.createInvocationHandlerFor(new WebMessagePayloadAdapter(bArr)));
|
|
}
|
|
|
|
@Override // androidx.webkit.JavaScriptReplyProxy
|
|
public void postMessage(String str) {
|
|
if (WebViewFeatureInternal.WEB_MESSAGE_LISTENER.isSupportedByWebView()) {
|
|
this.mBoundaryInterface.postMessage(str);
|
|
return;
|
|
}
|
|
throw WebViewFeatureInternal.getUnsupportedOperationException();
|
|
}
|
|
}
|