pelya / android-keyboard-gadget

Convert your Android device into USB keyboard/mouse, control your PC from your Android device remotely, including BIOS/bootloader.
Apache License 2.0
1.22k stars 308 forks source link

Building for Samsung Galaxy S3 #11

Closed the-st0rm closed 6 years ago

the-st0rm commented 9 years ago

I am trying to build it for Samsung S3. I checked the patch file and I edited/created the required files manually and I did patch the kernel manually. I flashed my kernel using heimdall but I am not sure if it is working. I have Cyangonmod on my device installed actually. I am not sure what is wrong.

Any suggestions??

the-st0rm commented 9 years ago

copy of the patched files are here https://github.com/the-st0rm/android-keyboard-gadget/tree/master/Samsung_S3

pelya commented 9 years ago

Hi. What kernel did you use, could you please give me the link? When you plug your phone into PC, there should be devices /dev/hidg0 and /dev/hidg1 created in filesystem, if you don't have them - the patch doesn't work.

On Sun, Oct 26, 2014 at 5:40 PM, the-st0rm notifications@github.com wrote:

copy of the patched files are here https://github.com/the-st0rm/android-keyboard-gadget/tree/master/Samsung_S3

— Reply to this email directly or view it on GitHub https://github.com/pelya/android-keyboard-gadget/issues/11#issuecomment-60521189 .

the-st0rm commented 9 years ago

I can see the /dev/hidg0 and /dev/hidg1 created .. the kernel I am using is https://github.com/CyanogenMod/android_kernel_samsung_smdk4412

pelya commented 9 years ago

Then it should work. Install this app to perform keyboard input:

https://play.google.com/store/apps/details?id=remote.hid.keyboard.client

It needs root to open these devices. If your phone is not rooted, you can do 'chmod 666 /dev/hidg0 /dev/hidg1' from ADB shell, and then launch the app. On Oct 28, 2014 12:28 AM, "the-st0rm" notifications@github.com wrote:

I can see the /dev/hidg0 and /dev/hidg1 created .. the kernel I am using is https://github.com/CyanogenMod/android_kernel_samsung_smdk4412

— Reply to this email directly or view it on GitHub https://github.com/pelya/android-keyboard-gadget/issues/11#issuecomment-60680802 .

the-st0rm commented 9 years ago

the permissions are ok but it is not working. I think the problem in this file android.c in this function specifically android_enable_function

in the kernel you built the device for it the android_enable_function takes three arguments in the Samasung S3 kernel the function takes only 2 arguments !! This is the definition of the function static int android_enable_function(struct android_dev dev, char name)

I think this is the problem

On a side note I built it for Nexus 4 and it worked perfectly so thank you so much but I was trying to send the three combination alt+ctrl+t but it didn't work !! I did this echo --left-ctrl --left-alt t | hid-test.bin /dev/hidg0 keyboard

any suggestions??

pelya commented 9 years ago

You may try the patch for kernel 3.1, that's what I'm using for Nexus 7 2012 kernel: https://github.com/pelya/android-keyboard-gadget/blob/master/kernel-3.1.patch android_enable_function() in that patch has 2 parameters instead of 3.

I've checked your hid-gadget-test command, and discovered that I broke this functionality, so I've fixed it and updated it, please re-download the file: https://github.com/pelya/android-keyboard-gadget/tree/master/hid-gadget-test

On Wed, Oct 29, 2014 at 2:45 PM, the-st0rm notifications@github.com wrote:

the permissions are ok but it is not working. I think the problem in this file android.c in this function specifically android_enable_function

in the kernel you built the device for it the android_enable_function takes three arguments in the Samasung S3 kernel the function takes only 2 arguments !! This is the definition of the function static int android_enable_function(struct android_dev dev, char name)

I think this is the problem

On a side note I built it for Nexus 4 and it worked perfectly so thank you so much but I was trying to send the three combination alt+ctrl+t but it didn't work !! I did this echo --left-ctrl --left-alt t | hid-test.bin /dev/hidg0 keyboard

any suggestions??

— Reply to this email directly or view it on GitHub https://github.com/pelya/android-keyboard-gadget/issues/11#issuecomment-60917364 .

the-st0rm commented 9 years ago

@pelya did you fix the c code ??

the-st0rm commented 9 years ago

@pelya I would like to thank you so much for your effort dude. Great work and I really appreciate it :+1:

pelya commented 9 years ago

Yes, I've both fixed C code and updated binaries.

On Wed, Oct 29, 2014 at 3:38 PM, the-st0rm notifications@github.com wrote:

@pelya https://github.com/pelya I would like to thank you so much for your effort dude. Great work and I really appreciate it [image: :+1:]

— Reply to this email directly or view it on GitHub https://github.com/pelya/android-keyboard-gadget/issues/11#issuecomment-60924489 .

horllste commented 7 years ago

Hello, can you please help me with the installation guide or point me to one, i dont understand this, am using samsunt s3 at&t, cynogenmod 13.0, android 601.

thanks

conrad-heimbold commented 6 years ago

@horllste : Here is a guide on how to build lineageos for Samsung Galaxy S3 International (i9300): https://wiki.lineageos.org/devices/i9300/build . The step of patching for HID support has to be done before "brunch i9300".

The problem seems to have been fixed, therefore closing.