Comments (10)
Yes, you just open /dev/hidg0 as a regular file, and write into it. Here's
a piece of code that does this:
https://github.com/pelya/android-keyboard-gadget/blob/master/hid-gadget-test/jni/hid-gadget-test.c#L178
The format of the bytes sent is described in readme:
https://github.com/pelya/android-keyboard-gadget#how-it-works
Because of SELinux, Android app cannot open the file directly, so it
launches su and pipes data through it, something like FILE *pipe =
popen("su"); fprintf(pipe, "cat > /dev/hidg0\n"); then write keycodes to
pipe, and don't forget to fflush().
On Sat, Jul 9, 2016 at 8:47 PM, Tim Wanders [email protected]
wrote:
hello @pelya https://github.com/pelya I have a question:
I am creating a hid app but I don't want to work with the hid-gadget-test
file. Is it possible to build it into my app to send keystrokes from your
hid patch?(I am using xamarin(mono for android/ C# for android)
Regards,
Tim—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#53, or mute the
thread
https://github.com/notifications/unsubscribe/AAJewKd9uhKq0uNx8UQuRH4aRrt07SHDks5qT967gaJpZM4JIqn9
.
from android-keyboard-gadget.
If Selinux is diabled I
can do someting like this right?:
Echo 0x01 | /dev/hidg0
from android-keyboard-gadget.
Yes you can.
On Jul 9, 2016 10:34 PM, "Tim Wanders" [email protected] wrote:
If Selinux is diabled I
can do someting like this right?:
Echo 0x01 | /dev/hidg0—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#53 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAJewNitXA72_Ezd_MBYq1aVjWTivFqnks5qT_e-gaJpZM4JIqn9
.
from android-keyboard-gadget.
can you give me some more details about that " FILE *pipe =
popen("su"); fprintf(pipe, "cat > /dev/hidg0\n"); then write keycodes to
pipe, and don't forget to fflush()."? the command does not seems to work. ANd I am not understanding it.
from android-keyboard-gadget.
It's a piece of C code, I don't know how are you doing file writing in C#.
Open /dev/hidg0 and write into it chunks 8 bytes each, flush the buffer
after each write, that's it.
On Jul 10, 2016 8:56 AM, "Tim Wanders" [email protected] wrote:
can you give me some more details about that " FILE *pipe =
popen("su"); fprintf(pipe, "cat > /dev/hidg0\n"); then write keycodes to
pipe, and don't forget to fflush()."? the command does not seems to work.
ANd I am not understanding it.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#53 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAJewJp2BDllR5dQE8Oc_GF_58OSq6Crks5qUImWgaJpZM4JIqn9
.
from android-keyboard-gadget.
if I create a test file(located on sdcard with: 0x0a in it) if I do a root shell and then: cat /sdcard/test > /dev/hidg0 but then it spams an random key from my keyboard, any idea?
from android-keyboard-gadget.
or can you explain how to do it with the terminal? Because I can easilly send shell commands like cat in su.
from android-keyboard-gadget.
Yes, you can copypaste a text file.
Please read the keyboard protocol description at
https://github.com/pelya/android-keyboard-gadget#how-it-works
You send 8 bytes at once, not 1, and the first byte is special.
On Jul 10, 2016 9:05 PM, "Tim Wanders" [email protected] wrote:
or can you explain how to do it with the terminal? Because I can easilly
send shell commands like cat in su.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#53 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAJewK4cWF6-mt9MO6QF81T0gufEWOHTks5qUTRQgaJpZM4JIqn9
.
from android-keyboard-gadget.
I still don't understand it :-(
from android-keyboard-gadget.
nevermind, I will use the hid-gadget test utillity :-)
from android-keyboard-gadget.
Related Issues (20)
- Some Questions...Pls Help HOT 2
- Stuck on opening HOT 10
- need hid patch for 4.4.117 kernel
- Ji
- Keyboard
- Require patch for samsung grand 2
- nokia 1020 HOT 1
- No f_hid.c found pls help
- pelya/Android_keyword gadget
- Permissions bug HOT 2
- rdp support HOT 1
- could you add support for samsung galaxy j3 (2016)
- Please send the poc_android files
- what is the VNC password?
- Pin
- How to get or Where can i find the hid-keyboard file?
- Add redmi note 4 support
- No 64bit support
- hid-gadget-test behaving strange
- Well
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-keyboard-gadget.