what-the-bank/sources/io/flutter/plugins/webviewflutter/JavaScriptChannel.java

79 lines
3.4 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package io.flutter.plugins.webviewflutter;
import android.os.Handler;
import android.os.Looper;
import android.webkit.JavascriptInterface;
import io.flutter.plugins.webviewflutter.GeneratedAndroidWebView;
/* loaded from: classes6.dex */
public class JavaScriptChannel implements Releasable {
private JavaScriptChannelFlutterApiImpl flutterApi;
final String javaScriptChannelName;
private final Handler platformThreadHandler;
/* JADX INFO: Access modifiers changed from: package-private */
public static /* synthetic */ void lambda$postMessage$0(Void r0) {
}
/* JADX INFO: Access modifiers changed from: package-private */
public static /* synthetic */ void lambda$release$2(Void r0) {
}
public JavaScriptChannel(JavaScriptChannelFlutterApiImpl javaScriptChannelFlutterApiImpl, String str, Handler handler) {
this.flutterApi = javaScriptChannelFlutterApiImpl;
this.javaScriptChannelName = str;
this.platformThreadHandler = handler;
}
@JavascriptInterface
public void postMessage(final String str) {
Runnable runnable = new Runnable(this, str) { // from class: io.flutter.plugins.webviewflutter.JavaScriptChannel$$ExternalSyntheticLambda2
public final JavaScriptChannel f$0;
public final String f$1;
@Override // java.lang.Runnable
public final void run() {
this.f$0.m349x6cafa204(this.f$1);
}
{
this.f$0 = this;
this.f$1 = str;
}
};
if (this.platformThreadHandler.getLooper() == Looper.myLooper()) {
runnable.run();
} else {
this.platformThreadHandler.post(runnable);
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: lambda$postMessage$1$io-flutter-plugins-webviewflutter-JavaScriptChannel, reason: not valid java name */
public /* synthetic */ void m349x6cafa204(String str) {
JavaScriptChannelFlutterApiImpl javaScriptChannelFlutterApiImpl = this.flutterApi;
if (javaScriptChannelFlutterApiImpl != null) {
javaScriptChannelFlutterApiImpl.postMessage(this, str, new GeneratedAndroidWebView.JavaScriptChannelFlutterApi.Reply() { // from class: io.flutter.plugins.webviewflutter.JavaScriptChannel$$ExternalSyntheticLambda0
@Override // io.flutter.plugins.webviewflutter.GeneratedAndroidWebView.JavaScriptChannelFlutterApi.Reply
public final void reply(Object obj) {
JavaScriptChannel.lambda$postMessage$0((Void) obj);
}
});
}
}
@Override // io.flutter.plugins.webviewflutter.Releasable
public void release() {
JavaScriptChannelFlutterApiImpl javaScriptChannelFlutterApiImpl = this.flutterApi;
if (javaScriptChannelFlutterApiImpl != null) {
javaScriptChannelFlutterApiImpl.dispose(this, new GeneratedAndroidWebView.JavaScriptChannelFlutterApi.Reply() { // from class: io.flutter.plugins.webviewflutter.JavaScriptChannel$$ExternalSyntheticLambda1
@Override // io.flutter.plugins.webviewflutter.GeneratedAndroidWebView.JavaScriptChannelFlutterApi.Reply
public final void reply(Object obj) {
JavaScriptChannel.lambda$release$2((Void) obj);
}
});
}
this.flutterApi = null;
}
}