rils / ARP

Android Record and Play. A Java application to record android touch screen , hard key events and playback.
31 stars 5 forks source link

Can't send events #1

Open DerekJarvis opened 6 years ago

DerekJarvis commented 6 years ago

This looks interesting, but I can't get it to send events. Recording works fine, but replay fails:

C:\Users\docsa\Downloads\20180302105814_events.mel convertpushPlayC:\Users\docsa\Downloads\20180302105814_events.mel Matching device-qpnp_pon Matching device-gpio Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 Non matching device,Skip-/dev/input/event1 adb push: C:\Users\docsa\Downloads\20180302105814_events.mesto /data/local/tmp/myTesterEventScript.mes adb shell sh /data/local/tmp/myTesterEventScript.mes wait: 0 seconds before next play

rils commented 6 years ago

Hi @DerekJarvis , Thanks for trying out. I understood your problem. Output of getevent will contains events from all devices includin sensors, gpio etc. But our interest is recreate the touch events. So we have to extract only touch events from full output of getevent. For this touch driver file's name registered in your kernel(ussually same in all devices unless manufacturer/someone changes it) is needed. Looks like your device name is different. from common names. To fix this- 1 Can you post details of your device -brand/manufacturer?

  1. Open adb shell and enter getevent
  2. Do some touch /swipe. Note down the lines printing shell, exactly when you do touch/swipe. There might be events from your light sensor/accelorometer/ etc. so keep device in some stable place and do touch to recognise easily.

Thanks Rilwan.

DerekJarvis commented 6 years ago

For my device: Model Number: MI 5X Android Version: 7.1.2 Kernel version: 3.18.31-perf-gf29baab Version Number: N2G47H

See attached for the events. There's no other events except for event1. But I do notice there's an fts_ts(event2) and ft5435_ts (event1) device. Maybe this is the cause?

On Sat, Mar 3, 2018 at 1:27 AM, rilwan notifications@github.com wrote:

Hi @DerekJarvis https://github.com/derekjarvis , Thanks for trying out. I understood your problem. Output of getevent will contains events from all devices includin sensors, gpio etc. But our interest is recreate the touch events. So we have to extract only touch events from full output of getevent. For this touch driver file's name registered in your kernel(ussually same in all devices unless manufacturer/someone changes it) is needed. Looks like your device name is different. To fix this- 1 Can you post details of your device -brand/manufacturer?

  1. Open adb shell and enter getevent
  2. Do some touch /swipe. Note down the lines printing shell, exactly when you do touch/swipe. There might be events from your light sensor/accelorometer. so keep device in some stable place and do touch to recognise easily.

Thanks Rilwan.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rils/ARP/issues/1#issuecomment-369991382, or mute the thread https://github.com/notifications/unsubscribe-auth/AGgwSfl304HtjfMc8sTrbhLVGT1shvl7ks5taYEJgaJpZM4SaA93 .

C:\Users\docsa>adb shell tiffany:/ $ getevent add device 1: /dev/input/event8 name: "msm8953-snd-card-mtp Button Jack" add device 2: /dev/input/event7 name: "msm8953-snd-card-mtp Headset Jack" could not get driver version for /dev/input/mouse0, Not a typewriter add device 3: /dev/input/event5 name: "hbtp_vm" add device 4: /dev/input/event4 name: "uinput-goodix" add device 5: /dev/input/event3 name: "vitural-sar" add device 6: /dev/input/event0 name: "qpnp_pon" could not get driver version for /dev/input/mice, Not a typewriter add device 7: /dev/input/event6 name: "gpio-keys" add device 8: /dev/input/event2 name: "fts_ts" add device 9: /dev/input/event1 name: "ft5435_ts" /dev/input/event1: 0003 0039 00000563 /dev/input/event1: 0003 0035 0000040e /dev/input/event1: 0003 0036 00000230 /dev/input/event1: 0001 014a 00000001 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 000003f3 /dev/input/event1: 0003 0036 00000245 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 000003df /dev/input/event1: 0003 0036 00000254 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 000003d4 /dev/input/event1: 0003 0036 0000025c /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 000003be /dev/input/event1: 0003 0036 00000265 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000039f /dev/input/event1: 0003 0036 00000270 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 00000357 /dev/input/event1: 0003 0036 00000285 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000033e /dev/input/event1: 0003 0036 0000028a /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000030e /dev/input/event1: 0003 0036 00000292 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 000002fa /dev/input/event1: 0003 0036 00000294 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 000002ce /dev/input/event1: 0003 0036 0000029a /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 000002ab /dev/input/event1: 0003 0036 0000029b /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000029d /dev/input/event1: 0003 0036 0000029c /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 00000293 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000027b /dev/input/event1: 0003 0036 0000029d /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 00000268 /dev/input/event1: 0003 0036 0000029f /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000025b /dev/input/event1: 0003 0036 000002a0 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 00000253 /dev/input/event1: 0003 0036 000002a2 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000024e /dev/input/event1: 0003 0036 000002a4 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000024b /dev/input/event1: 0003 0036 000002a6 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0036 000002a9 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000024d /dev/input/event1: 0003 0036 000002aa /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000024e /dev/input/event1: 0003 0036 000002ab /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 00000252 /dev/input/event1: 0003 0036 000002ae /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 00000257 /dev/input/event1: 0003 0036 000002b1 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000025e /dev/input/event1: 0003 0036 000002b7 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 00000264 /dev/input/event1: 0003 0036 000002bc /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000026b /dev/input/event1: 0003 0036 000002c2 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 00000272 /dev/input/event1: 0003 0036 000002c8 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000027d /dev/input/event1: 0003 0036 000002d4 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 00000285 /dev/input/event1: 0003 0036 000002dc /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000028a /dev/input/event1: 0003 0036 000002e3 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000028e /dev/input/event1: 0003 0036 000002e8 /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0035 0000028f /dev/input/event1: 0003 0036 000002ea /dev/input/event1: 0000 0000 00000000 /dev/input/event1: 0003 0039 ffffffff /dev/input/event1: 0001 014a 00000000 /dev/input/event1: 0000 0000 00000000

rils commented 6 years ago

Hi @DerekJarvis OK Got it. if event1 is touchscreen name is ft5435_ts

I have list of common names I added in the utils.java https://github.com/rils/ARP/blob/e3c21645bf869e99b2572206a9fda8e965d545e4/src/com/ours/tester/Utils.java#L21 Just want to add "ft5435_ts" to above line. and compile it. Do you have java build environment ? Its been long time I had this. May be i can set it up. Meanwhile if you can compile java, You can make the change and build the application. You can push the change too. :)

Regarding event2- I cant see the event2 in the log you send ? May i know at when event2 comes, what exactly was happening in the phone ?

DerekJarvis commented 6 years ago

Ah I see. Thanks for the update! I don't have a Java build environment :(. But I did use the zip file trick :) Since the only change required is a string change I just extracted the JAR, replaced the "synaptic" string in the .class file, then re-zipped. It worked perfectly! Thanks for the help!

On Mar 6, 2018 6:12 PM, "rilwan" notifications@github.com wrote:

Hi @DerekJarvis https://github.com/derekjarvis OK Got it. if event1 is touchscreen name is ft5435_ts

I have list of common names I added in the utils.java https://github.com/rils/ARP/blob/e3c21645bf869e99b2572206a9fda8 e965d545e4/src/com/ours/tester/Utils.java#L21 Just want to add "ft5435_ts" to above line. and compile it. Do you have java build environment ? Its been long time I had this. May be i can set it up. Meanwhile if you can compile java, You can make the change and build the application. You can push the change too. :)

Regarding event2- I cant see the event2 in the log you send ? May i know at when event2 comes, what exactly was happening in the phone ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rils/ARP/issues/1#issuecomment-370731638, or mute the thread https://github.com/notifications/unsubscribe-auth/AGgwSYW9W4zqivf8q77QEw4TNFEPUZkDks5tbmEbgaJpZM4SaA93 .

DerekJarvis commented 6 years ago

Now that I've tested further I notice there are issues in sending events. It misses a few, and sometimes gets stuck with a key pressed down. Is this a known issue?

rils commented 6 years ago

Actually not. I havent tested this for long time , especially on newer devices. There was no stuck issues.. So u compiled by adding " ft5435_ts" ?

On Tue, Mar 6, 2018 at 6:35 PM, DerekJarvis notifications@github.com wrote:

Now that I've tested further I notice there are issues in sending events. It misses a few, and sometimes gets stuck with a key pressed down. Is this a known issue?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rils/ARP/issues/1#issuecomment-370774939, or mute the thread https://github.com/notifications/unsubscribe-auth/APzct2xdy2mHxMRikClZMzTibOgVGA5Lks5tbomRgaJpZM4SaA93 .

adamsuelo commented 3 years ago

Ah I see. Thanks for the update! I don't have a Java build environment :(. But I did use the zip file trick :) Since the only change required is a string change I just extracted the JAR, replaced the "synaptic" string in the .class file, then re-zipped. It worked perfectly! Thanks for the help! On Mar 6, 2018 6:12 PM, "rilwan" @.***> wrote: Hi @DerekJarvis https://github.com/derekjarvis OK Got it. if event1 is touchscreen name is ft5435_ts I have list of common names I added in the utils.java https://github.com/rils/ARP/blob/e3c21645bf869e99b2572206a9fda8 e965d545e4/src/com/ours/tester/Utils.java#L21 Just want to add "ft5435_ts" to above line. and compile it. Do you have java build environment ? Its been long time I had this. May be i can set it up. Meanwhile if you can compile java, You can make the change and build the application. You can push the change too. :) Regarding event2- I cant see the event2 in the log you send ? May i know at when event2 comes, what exactly was happening in the phone ? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AGgwSYW9W4zqivf8q77QEw4TNFEPUZkDks5tbmEbgaJpZM4SaA93 .

What JAR did you extract and modify? I have the same problem as you had and I'm trying to change the string without having to decompile and build the whole application.

Thanks in advance, have a nice day.