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

Patch apq8084 #143

Closed mkgrage closed 5 years ago

mkgrage commented 5 years ago

Device: Samsung S5 G906S-lentislte

OS version (KitKat/Lollipop/Marshmallow/Nougat): I have Android 8.1 Oreo LOS 15.1

Built from repo (date and build command) or downloaded from website (links): I downloaded my image https://github.com/github-cygwin/android_kernel_samsung_apq8084/tree/lineage-15.1

Output of cat /proc/version in adb shell or NetHunter Terminal: Linux version 3.10.108 gcc version 4.9.x 20150123

Issue:

I just try patching Lineage OS 15.1 kernel (taken from LOS15.1 kernel source) using android keyboard HID patch (https://github.com/pelya/android-key...nel_3.10.patch), using toolchain 4.9. (My device lentislte-G906S and using kernel 3.10.108, proc apq8084)

Patching process itself resulting success. When i try compile, everything going smooth except one file (f_hid.c) which showing error:

drivers/usb/gadget/f_hid.c: In function 'f_hidg_read': drivers/usb/gadget/f_hid.c:269:4: error: implicit declaration of function 'free_ep_req' [-Werror=implicit-function-declaration] free_ep_req(hidg->out_ep, req); ^ cc1: some warnings being treated as errors scripts/Makefile.build:308: recipe for target 'drivers/usb/gadget/f_hid.o' failed make[3]: [drivers/usb/gadget/f_hid.o] Error 1 scripts/Makefile.build:455: recipe for target 'drivers/usb/gadget' failed make[2]: [drivers/usb/gadget] Error 2 scripts/Makefile.build:455: recipe for target 'drivers/usb' failed make[1]: [drivers/usb] Error 2 Makefile:818: recipe for target 'drivers' failed make: [drivers] Error 2

I know it show improper declaration of one function inside f.hid.c file after patching process, but I cant configure how to change to proper way. Do you have any suggestion regarding above matters? (like edit f_hid.c file itself or edit patch file)

Darklife0420 commented 5 years ago

Have to tried renaming the file more specifically change the extension type f_hid.com or so I or ext or e or config or bin or shll try those if not get back to me and I'll go through my database and find the working answer

Sent from Yahoo Mail on Android

On Thu, Jul 19, 2018 at 10:58 PM, KiraRyunotifications@github.com wrote:
Hi pelya,

I just try patching Lineage OS 15.1 kernel (taken from LOS15.1 kernel source) using android keyboard HID patch (https://github.com/pelya/android-key...nel_3.10.patch), using toolchain 4.9. (My device lentislte-G906S and using kernel 3.10.108, proc apq8084)

Patching process itself resulting success. When i try compile, everything going smooth except one file (f_hid.c) which showing error:

drivers/usb/gadget/f_hid.c: In function 'f_hidg_read': drivers/usb/gadget/f_hid.c:269:4: error: implicit declaration of function 'free_ep_req' [-Werror=implicit-function-declaration] free_ep_req(hidg->out_ep, req); ^ cc1: some warnings being treated as errors scripts/Makefile.build:308: recipe for target 'drivers/usb/gadget/f_hid.o' failed make[3]: [drivers/usb/gadget/f_hid.o] Error 1 scripts/Makefile.build:455: recipe for target 'drivers/usb/gadget' failed make[2]: [drivers/usb/gadget] Error 2 scripts/Makefile.build:455: recipe for target 'drivers/usb' failed make[1]: [drivers/usb] Error 2 Makefile:818: recipe for target 'drivers' failed make: [drivers] Error 2

I know it show improper declaration of one function inside f.hid.c file after patching process, but I cant configure how to change to proper way. Do you have any suggestion regarding above matters? (like edit f_hid.c file itself or edit patch file)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

mkgrage commented 5 years ago

So, do you mean (CMIIW) I have to change f_hid.c to any exrension file like f_hid.com or f_hid.so? Then recompile it?

Darklife0420 commented 5 years ago

Yeah sorry I thought my text speech thing got all that  But yeah rename the extension name and then recompile it  When I looked itup on my history that's what I did and it worked for me I renamed it to f_hid.Bin 

Your trying I g to get the USB keyboard thingy to work, right? Double checking Sent from Yahoo Mail on Android

On Fri, Jul 20, 2018 at 2:16 PM, KiraRyunotifications@github.com wrote:
So, do you mean (CMIIW) I have to change f_hid.c to any exrension file like f_hid.com or f_hid.so? Then recompile it?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub, or mute the thread.

mkgrage commented 5 years ago

Okay I would try it then. I'll update it...

mkgrage commented 5 years ago

It still show an error:

LD drivers/usb/dwc3/built-in.o CC drivers/usb/gadget/udc-core.o CC drivers/usb/gadget/android.o make[3]: No rule to make target 'drivers/usb/gadget/f_hid.o', needed by 'drivers/usb/gadget/libcomposite.o'. Stop. scripts/Makefile.build:455: recipe for target 'drivers/usb/gadget' failed make[2]: [drivers/usb/gadget] Error 2 scripts/Makefile.build:455: recipe for target 'drivers/usb' failed make[1]: [drivers/usb] Error 2 Makefile:818: recipe for target 'drivers' failed make: [drivers] Error 2

mkgrage commented 5 years ago

@Darklife0420 @0E800 I just found the solutuon. Its because a patch for f_hid.c kernel regarding prevent access releasing memory patch. I need to remove those patch from the kernel to make HID patch works well, though I didnt realize what is the future effect by removing prevent access memory patch. Have a nice day...:D

ObSo6 commented 4 years ago

@mkgrage Hello, I'm sorry to disturb you. I have the same problem as you, but I can't solve it. Maybe I'm not a programmer. Would you like to give specific solutions? Anyway, thank you. Have a good life。