Skip to content
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

raise errror after touch click display screen on pc #2250

Closed
2 tasks done
zhoushuoqi opened this issue Apr 13, 2021 · 3 comments
Closed
2 tasks done

raise errror after touch click display screen on pc #2250

zhoushuoqi opened this issue Apr 13, 2021 · 3 comments

Comments

@zhoushuoqi
Copy link

zhoushuoqi commented Apr 13, 2021

  • I have read the FAQ.
  • I have searched in existing issues.

Android 8.1.0

display screen is ok, but trying to control device from pc raise an error:

INFO: Renderer: direct3d
INFO: Initial texture: 2608x720
[server] ERROR: Could not invoke method
java.lang.NoSuchMethodException: injectInputEvent [class android.view.InputEvent, int]
at java.lang.Class.getMethod(Class.java:2068)
at java.lang.Class.getMethod(Class.java:1690)
at com.genymobile.scrcpy.wrappers.InputManager.getInjectInputEventMethod(InputManager.java:28)
at com.genymobile.scrcpy.wrappers.InputManager.injectInputEvent(InputManager.java:35)
at com.genymobile.scrcpy.Device.injectEvent(Device.java:169)
at com.genymobile.scrcpy.Device.injectEvent(Device.java:173)
at com.genymobile.scrcpy.Controller.injectTouch(Controller.java:215)
at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:94)
at com.genymobile.scrcpy.Controller.control(Controller.java:71)
at com.genymobile.scrcpy.Server$2.run(Server.java:100)
at java.lang.Thread.run(Thread.java:764)
[server] ERROR: Could not invoke method
java.lang.NoSuchMethodException: injectInputEvent [class android.view.InputEvent, int]
at java.lang.Class.getMethod(Class.java:2068)
at java.lang.Class.getMethod(Class.java:1690)
at com.genymobile.scrcpy.wrappers.InputManager.getInjectInputEventMethod(InputManager.java:28)
at com.genymobile.scrcpy.wrappers.InputManager.injectInputEvent(InputManager.java:35)
at com.genymobile.scrcpy.Device.injectEvent(Device.java:169)
at com.genymobile.scrcpy.Device.injectEvent(Device.java:173)
at com.genymobile.scrcpy.Controller.injectTouch(Controller.java:215)
at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:94)
at com.genymobile.scrcpy.Controller.control(Controller.java:71)
at com.genymobile.scrcpy.Server$2.run(Server.java:100)
at java.lang.Thread.run(Thread.java:764)

@zhoushuoqi zhoushuoqi changed the title raise errror after touch click display screen on raise errror after touch click display screen on pc Apr 13, 2021
@rom1v
Copy link
Collaborator

rom1v commented Apr 13, 2021

java.lang.NoSuchMethodException: injectInputEvent [class android.view.InputEvent, int]

Which device/system? The ROM changed this function so it differs from "standard" Android (AOSP).

@thomasrebele
Copy link
Contributor

thomasrebele commented Jan 15, 2022

I had the same problem with a Yotaphone 2 (YD201). It seems that the method has an additional parameter:

public boolean android.hardware.input.IInputManager$Stub$Proxy.injectInputEvent(android.view.InputEvent,int,int) throws android.os.RemoteException, 

I couldn't find the meaning of the additional parameter. Passing 0 seems to work fine. Pull-request: #2946

Great project, it helps a lot to gain access to the phone after breaking the screen (replacing the "spider app" with a permanent black screen).

rom1v pushed a commit that referenced this issue Jan 16, 2022
Some devices with modified ROMs expose a different signature for
injectInputEvent().

Fixes #2250 <#2250>
PR #2946 <#2946>

Signed-off-by: Romain Vimont <[email protected]>
@rom1v rom1v closed this as completed in b7a0627 Jan 29, 2022
@rom1v
Copy link
Collaborator

rom1v commented Apr 16, 2022

Please test #3190 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants