openstf / minitouch

Minimal multitouch event producer for Android.
Other
633 stars 233 forks source link

Added STDIN and File Input #20

Closed mumblepins closed 6 years ago

mumblepins commented 7 years ago

I wanted the ability to be able to run minitouch as a standalone program, so I added the ability to accept from STDIN or a separate file. I also modified the socket handling itself to wrap the fd in a FILE* stream, so I was able to use standardized functions for all input modes.

Compile worked for all platforms, tested on armeabi-v7a/no-pie without problems

Example usage

adb shell "echo -e 'd 0 10 10 50\nc\nw 2500\nu 0\nc' | /data/local/tmp/minitouch -i -v"  # STDIN pipe

adb shell "/data/local/tmp/minitouch -i -v"                                              # Terminal input

adb shell "echo -e 'd 0 10 10 50\nc\nw 2500\nu 0\nc' > /data/local/tmp/file.in"
adb shell "/data/local/tmp/minitouch -f /data/local/tmp/file.in -v"                      # File input
sorccu commented 7 years ago

Overall this looks good to me, but I need to test it out first just in case - but I won't have time for a few days. Meanwhile, it would be helpful if others let me know whether this patch works for them (and importantly, whether it still functions the same as before).

sorccu commented 7 years ago

Please ping me if I haven't responded again by next week, sometimes I forget.

sorccu commented 6 years ago

This was a totally awesome PR, merged. Sorry it took so long.