|
Hello:
I had the same problem with my "GreenAsia Inc. USB Joystick". First, I created a custom key layout for this device:
/system/usr/keylayout/Vendor_0e8f_Product_0003.kl
key 103 DPAD_UP
key 105 DPAD_LEFT
key 106 DPAD_RIGHT
key 108 DPAD_DOWN
key 288 BUTTON_Y
key 289 BUTTON_B
key 290 BUTTON_A
key 291 BUTTON_X
key 292 BUTTON_L1
key 293 BUTTON_R1
key 294 BUTTON_L2
key 295 BUTTON_R2
key 296 BUTTON_SELECT
key 297 BUTTON_START
key 298 BUTTON_THUMBL
key 299 BUTTON_THUMBR
axis 0x00 X
axis 0x01 Y
axis 0x02 RZ
axis 0x05 Z
But this was not enough. Beelink GT1 Ultimate has inside his "/system/framework/services.jar", some harcoded mappings from scancode 288 (0x120) to 292 (0x124), that launch some apps. I had to copy this jar to my PC, extract the jar content, run "backsmali.bat", and edit the file "classout\com\android\server\policy\PhoneWindowManager.smali".
For example, for skipping the mapping for "BUTTON_A", you must search in the file the hexadecimal code of the scancode 290, thats is, 0x122. Then, change the line:
if-ne v4, v6, :cond_639
with this line:
goto :cond_639
With this change, you jump the code that does the mapping for scancode 290.
Do the same with codes 0x120 (288), 0x121 (289), 0x123 (291) and 0x124 (292). You must respect the cond_XXX number, for doing the proper jump (goto).
Then, you must run "smali.bat" to recompose the file "classes.dex", and then, repackage the file "services.jar" (winzip, 7zip). Overwrite the services.jar in your GT1 and reboot. Test the gamepad with any available android app (gamepad tester, ...) and you'll see that the gamepad buttons don't launch any application.
I hope it helps someone with the same or similar problem. |
|