feat: add magisk module

This commit is contained in:
2025-10-15 20:38:16 -04:00
parent 2f1f11d1bb
commit a2c013b14f
12 changed files with 84 additions and 36 deletions

6
magisk/module.prop Normal file
View File

@@ -0,0 +1,6 @@
id=samsung_kbd_override
name=Samsung Keyboard Override
version=1.0
versionCode=1
author=EvanReichard
description=Fixes Samsung keyboard driver binding issues

32
magisk/service.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/system/bin/sh
VENDOR_ID=04E8
DEVICE_ID=7021
DEV_DIR=/sys/bus/hid/devices/*:$VENDOR_ID:$DEVICE_ID*/
IGNORE_PARAM=/sys/module/hid/parameters/ignore_special_drivers
LOG="[samsung_kbd_override]"
# Wait Boot
while [ "$(getprop sys.boot_completed)" != "1" ]; do
sleep 1
done
# Loop Service
while sleep 1; do
if [ ! -d $DEV_DIR ]; then
continue
fi
if [ ! -d $DEV_DIR/driver ]; then
if [ "$(cat $IGNORE_PARAM)" = "0" ]; then
echo "$LOG driver unbound -> ignoring special drivers"
echo "1" > $IGNORE_PARAM
fi
else
if [ "$(cat $IGNORE_PARAM)" = "1" ]; then
echo "$LOG driver bound -> restoring special drivers"
echo "0" > $IGNORE_PARAM
fi
fi
done