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

./mysendevent: not executable: 64-bit ELF file on Pixel7 and Samsung S20 #35

Open
allesschonweg opened this issue May 30, 2024 · 4 comments

Comments

@allesschonweg
Copy link

user@linuxlaptop ~/android-touch-record-replay $ ./record_touch_events.sh
Looking for touchscreen device...
/dev/input/event4
/dev/input/event3
Touchscreen device found! -> /dev/input/event3
SDK version: 34

Recording will START as soon as you put your finger in the touchscreen.
Press ctrl+c to STOP recording...
^C
user@linuxlaptop ~/android-touch-record-replay $ ./replay_touch_events.sh
Looking for touchscreen device...
/dev/input/event4
/dev/input/event3
Touchscreen device found! -> /dev/input/event3
---ls: /data/local/tmp/mysendevent: No such file or directory---
mysendevent: 1 file pushed. 0.4 MB/s (13608 bytes in 0.030s)
recorded_touch_events.txt: 1 file pushed. 0.1 MB/s (15059 bytes in 0.101s)
/system/bin/sh: /data/local/tmp/mysendevent: not executable: 64-bit ELF file
user@linuxlaptop ~/android-touch-record-replay $ adb shell
x1s:/ $ cd /data/local/temp
/system/bin/sh: cd: /data/local/temp: No such file or directory
2|x1s:/ $ cd /data/local/tmp
x1s:/data/local/tmp $ ls -l
total 16
-rwxrwxrwx 1 shell shell 13608 2024-05-30 15:09 mysendevent
x1s:/data/local/tmp $ ./mysendevent
/system/bin/sh: ./mysendevent: not executable: 64-bit ELF file

@sodaws
Copy link

sodaws commented Jun 4, 2024

Did you use mysendevent-arm64? If not, modify replay_touch_events.sh (line 12) to use that one.

@allesschonweg
Copy link
Author

Ok, yes, then it works, but the script should then somehow query for the architecture and push the correct binary.
But even this way, I just end up in a denied Permission in both, a stock Pixel 7a and a rooted Android 14 device:
android-touch-record-replay $ ./replay_touch_events.sh
Looking for touchscreen device...
/dev/input/event6
/dev/input/event8
/dev/input/event0
/dev/input/event7
/dev/input/event3
Touchscreen device found! -> /dev/input/event3
---/data/local/tmp/mysendevent---
recorded_touch_events.txt: 1 file pushed.
could not open /dev/input/event3, Permission denied

@sodaws
Copy link

sodaws commented Jun 6, 2024

iirc root is required since Android 10. I've never used it with newer versions.

hmm...but I just remembered something. I think when the replay_touch_events.sh calls adb shell the command is executed with the shell user. This user probably doesn't execute stuff with root by default. Instead of using:

adb shell /data/local/tmp/mysendevent "${TOUCH_DEVICE#*-> }" /sdcard/recorded_touch_events.txt

maybe using:

adb shell su -c '/data/local/tmp/mysendevent "${TOUCH_DEVICE#*-> }" /sdcard/recorded_touch_events.txt'

will do the trick.

@finnmglas
Copy link

What worked for me was to edit the file replay_touch_events.sh, adding "-arm64" to every occurrence of the mysendevent thing, so the right binary was pushed

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