NetMirror.apk
Download file
package com.facebook.react.modules.clipboard;
import D2.h;
import android.content.ClipData;
import android.content.ClipboardManager;
import com.facebook.fbreact.specs.NativeClipboardSpec;
import com.facebook.react.bridge.BaseJavaModule;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import kotlin.jvm.internal.DefaultConstructorMarker;
import v1.InterfaceC0756a;
/* JADX INFO: loaded from: classes.dex */
@InterfaceC0756a(name = "Clipboard")
public final class ClipboardModule extends NativeClipboardSpec {
public static final a Companion = new a(null);
public static final String NAME = "Clipboard";
public static final class a {
public /* synthetic */ a(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private a() {
}
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ClipboardModule(ReactApplicationContext reactApplicationContext) {
super(reactApplicationContext);
h.f(reactApplicationContext, "context");
}
private final ClipboardManager getClipboardService() {
Object systemService = getReactApplicationContext().getSystemService("clipboard");
h.d(systemService, "null cannot be cast to non-null type android.content.ClipboardManager");
return (ClipboardManager) systemService;
}
@Override // com.facebook.fbreact.specs.NativeClipboardSpec
public void getString(Promise promise) {
h.f(promise, BaseJavaModule.METHOD_TYPE_PROMISE);
try {
ClipData primaryClip = getClipboardService().getPrimaryClip();
if (primaryClip == null || primaryClip.getItemCount() < 1) {
promise.resolve("");
} else {
promise.resolve(String.valueOf(primaryClip.getItemAt(0).getText()));
}
} catch (Exception e4) {
promise.reject(e4);
}
}
@Override // com.facebook.fbreact.specs.NativeClipboardSpec
public void setString(String str) {
ClipData clipDataNewPlainText = ClipData.newPlainText(null, str);
h.e(clipDataNewPlainText, "newPlainText(...)");
getClipboardService().setPrimaryClip(clipDataNewPlainText);
}
}
⚠️ This content was hidden by an advertisement filtering extension in your browser. Please disable it and reload the page to access the decompiled content.
We only display one small text ad to keep this service free. Here's what it looks like:
Read the Docs for Business: You write the docs. We do the rest.
Try it today!Ad by EthicalAds
Download file