-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can no copy text from Magic5Pro to Windows #3885
Comments
The vendor modified the method so iy is different from AOSP. Please retrieve the framework library:
and post it. |
|
Sorry, wrong path:
|
FYI. |
They added a parameter public ClipData getPrimaryClip(String pkg, int userId, String stackTraceMsg) diffdiff --git a/server/src/main/java/com/genymobile/scrcpy/wrappers/ClipboardManager.java b/server/src/main/java/com/genymobile/scrcpy/wrappers/ClipboardManager.java
index cb176cc3a..7b7509755 100644
--- a/server/src/main/java/com/genymobile/scrcpy/wrappers/ClipboardManager.java
+++ b/server/src/main/java/com/genymobile/scrcpy/wrappers/ClipboardManager.java
@@ -37,8 +37,13 @@ public class ClipboardManager {
getPrimaryClipMethod = manager.getClass().getMethod("getPrimaryClip", String.class, String.class, int.class);
getMethodVersion = 1;
} catch (NoSuchMethodException e2) {
- getPrimaryClipMethod = manager.getClass().getMethod("getPrimaryClip", String.class, String.class, int.class, int.class);
- getMethodVersion = 2;
+ try {
+ getPrimaryClipMethod = manager.getClass().getMethod("getPrimaryClip", String.class, String.class, int.class, int.class);
+ getMethodVersion = 2;
+ } catch (NoSuchMethodException e3) {
+ getPrimaryClipMethod = manager.getClass().getMethod("getPrimaryClip", String.class, int.class, String.class);
+ getMethodVersion = 3;
+ }
}
}
}
@@ -80,8 +85,10 @@ public class ClipboardManager {
return (ClipData) method.invoke(manager, FakeContext.PACKAGE_NAME, FakeContext.ROOT_UID);
case 1:
return (ClipData) method.invoke(manager, FakeContext.PACKAGE_NAME, null, FakeContext.ROOT_UID);
- default:
+ case 2:
return (ClipData) method.invoke(manager, FakeContext.PACKAGE_NAME, null, FakeContext.ROOT_UID, 0);
+ default:
+ return (ClipData) method.invoke(manager, FakeContext.PACKAGE_NAME, FakeContext.ROOT_UID, null);
}
}
Please test this binary:
|
it works.Thank you so much! |
Merged into It will be fixed in the next release. |
Environment
Describe the bug
Terminal output when I press CTRL-C in scrcpy window:
The text was updated successfully, but these errors were encountered: