Introducing a new way to review your PRs.

Read the announcement

slickdaddyy / gamehub-oss

privacy oriented gamehub

View on GitHub

13 documents · Updated Nov 19, 2026

docs / input-mapping-controls

Input Mapping Controls

Overview

This area owns the Lite patch surface for the app's input/key mapping subsystem. The covered files are patch diffs against decompiled Android resources and smali under patches/, so the behavior documented here is the behavior changed by those patches rather than the full upstream implementation.

The mapping runtime has several small global-state entry points. patches/smali_classes5__com__xj__mapping__interaction__KeyboardEditService.smali.diff changes the static boolean KeyboardEditService.q from an explicit false initializer to the VM default. patches/smali_classes5__com__xj__mapping__utils__ConfigUtil.smali.diff does the same for ConfigUtil.k, and patches/smali_classes5__com__xj__mapping__utils__EventConfigUtils.smali.diff does the same for EventConfigUtils.a. Touch and drawing helpers follow the same pattern: patches/smali_classes5__com__xj__mapping__utils__touch__gtouch__GTouchUtils.smali.diff removes explicit false initializers from GTouchUtils.c and GTouchUtils.d, patches/smali_classes5__com__xj__mapping__view__GestureView.smali.diff removes the explicit initializer from GestureView.x, and patches/smali_classes5__com__xj__mapping__view__canvas__ExShape.smali.diff removes it from ExShape.f. These patches do not change the effective initial value for a boolean field, but they do change class metadata/static-field declarations, which matters for bytecode diffing and any tooling that matches exact smali declarations.

The mapping settings/help UI is intentionally de-networked in two places. patches/smali_classes5__com__xj__mapping__keyconfig__setting__view__MapGlobalSettingLayout.smali.diff replaces the advanced/global setting web dialog URL https://www.xiaoji.com/url/obscure-click with http://127.0.0.1 before calling DialogWebView.setUrl. patches/smali_classes5__com__xj__mapping__view__DialogAdvancedSettings$2.smali.diff applies the same localhost replacement in the advanced settings click handler. patches/smali_classes5__com__xj__mapping__view__KeyboardViewNew.smali.diff redirects the keyboard view's help/select-device web content bases from https://doc.xiaoji.com/help.html?lang= and https://doc.xiaoji.com/selectdevice.html?lang= to http://127.0.0.1 before the language suffix is appended. Together these patches keep mapping help, obscure-click guidance, and device-selection documentation from loading remote Xiaoji content.

HID model guidance is handled by the HidModelTipDialog smali patch and the matching XML layouts. patches/smali_classes5__com__xj__mapping__play__dialog__HidModelTipDialog.smali.diff changes dialog argument parsing: instead of using startInfoModel with Android 13+ typed parcelable access, it always reads a StartInfoModel from the bundle key preview_data via Bundle.getParcelable. The same method still reads isDisplayGameBtn, stores the model into field k, returns early when the model is absent, wires btnClose, calls its content setup, darkens the window background, installs a key listener, persists reminder state through SPUtils.g("DeviceTipsManager"), updates tvNoMoreReminders, and either hides touch-play/no-more-reminder tip views or attaches a MenuFloatView item depending on isDisplayGameBtn. patches/res__layout__dialog_hid_model_popup.xml.diff and patches/res__layout__dialog_no_support_model_popup.xml.diff keep the same dialog structure and IDs (layout_dialog, btn_close, desImage, tvNoMoreReminders, tvNoMoreRemindersTips) but change the card background from #ff191a1c to #ff111827 and replace the close icon drawable with @android:color/transparent.

The mapping operation and mode-picking layouts are also themed and stripped of some art. patches/res__layout__map_key_oper_guide_layout.xml.diff preserves the three-card operation guide and its text IDs/strings, but replaces all three guide images (mapping_guide_hold_and_drag, mapping_guide_click, and mapping_guide_double_click) with transparent Android color drawables. patches/res__layout__llauncher_dialog_fragment_button_mapping.xml.diff keeps the button-mapping dialog's rv_mapping list and common_focus_cl container, changes the container color to #ff111827, and makes the closeIv image transparent. patches/res__layout__llauncher_dialog_fragment_mapping_mode.xml.diff keeps the mode dialog title and DpadRecyclerView, changes the background to #ff111827, and also makes closeIv transparent. patches/res__layout__xja_dialog_advanced_features.xml.diff applies the same darker #ff111827 background to the advanced-features dialog while leaving its closeIv drawable and title structure intact.

Path ownership is split by package and resource naming. Smali patches under patches/smali_classes5__com__xj__mapping__*.diff and nested patches/smali_classes5__com__xj__mapping__**.diff are part of this doc when they affect mapping services, mapping config/event utilities, mapping touch utilities, mapping views, or mapping play dialogs. The explicitly listed resource layouts are owned here because they are the visible mapping/HID/advanced-feature dialogs or mapping operation guides used by those smali surfaces.

Coupling

  • If patches/smali_classes5__com__xj__mapping__play__dialog__HidModelTipDialog.smali.diff changes the bundle key or parcelable retrieval path, also verify the caller that creates the HID dialog passes preview_data; this patch no longer reads startInfoModel, so a caller using the old key will produce an early return before DialogHidModelPopupBinding UI setup.
  • If any IDs in patches/res__layout__dialog_hid_model_popup.xml.diff change, check patches/smali_classes5__com__xj__mapping__play__dialog__HidModelTipDialog.smali.diff; the smali directly accesses binding fields for btnClose, btnTouchPlay, tvNoMoreReminders, and tvNoMoreRemindersTips and will silently skip branches when fields are absent or null.
  • If the localhost URL replacements in patches/smali_classes5__com__xj__mapping__keyconfig__setting__view__MapGlobalSettingLayout.smali.diff, patches/smali_classes5__com__xj__mapping__view__DialogAdvancedSettings$2.smali.diff, or patches/smali_classes5__com__xj__mapping__view__KeyboardViewNew.smali.diff are reverted, verify network/privacy expectations for mapping help and obscure-click guidance; these dialogs otherwise resume loading remote xiaoji.com / doc.xiaoji.com content.
  • If guide or close-icon assets are restored in patches/res__layout__map_key_oper_guide_layout.xml.diff, patches/res__layout__dialog_hid_model_popup.xml.diff, patches/res__layout__dialog_no_support_model_popup.xml.diff, patches/res__layout__llauncher_dialog_fragment_button_mapping.xml.diff, or patches/res__layout__llauncher_dialog_fragment_mapping_mode.xml.diff, verify the patched theme still has visible affordances; the current Lite layouts intentionally keep hit targets/IDs while rendering several images transparent.
  • If the static boolean field declarations in KeyboardEditService, ConfigUtil, EventConfigUtils, GTouchUtils, GestureView, or ExShape are edited, check any smali patch tooling that matches field lines exactly. Removing = false is semantically equivalent for runtime initialization, but not equivalent for text-based patch application.

Risks

  • patches/smali_classes5__com__xj__mapping__play__dialog__HidModelTipDialog.smali.diff: the argument migration from startInfoModel to preview_data is brittle because a missing or mismatched key leaves k null and returns before the dialog finishes setup. If upstream callers still send startInfoModel, the HID model tip will not initialize its close button, reminder controls, or menu action.
  • patches/smali_classes5__com__xj__mapping__view__KeyboardViewNew.smali.diff: replacing URL prefixes with http://127.0.0.1 while preserving later string-builder appends means language/query suffixes can still be appended to a localhost URL. If a local handler is not present, mapping help/select-device actions may open a dead page rather than failing at compile time.
  • patches/res__layout__dialog_hid_model_popup.xml.diff, patches/res__layout__dialog_no_support_model_popup.xml.diff, patches/res__layout__llauncher_dialog_fragment_button_mapping.xml.diff, and patches/res__layout__llauncher_dialog_fragment_mapping_mode.xml.diff: close controls keep their view IDs and dimensions but render transparent. If users rely on visual close affordances rather than controller/back handling, these dialogs can appear non-dismissible even though the touch target remains in place.