Everything works
Removed setting the UDC for now as the service runs before the other init scripts selinux is a complete pain, but I need to figure out a way to make it so that you can use hidg devices without root; preferably with a way for an android app to request access.
This commit is contained in:
parent
458b033a0a
commit
da7b8c476c
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
chmod 755 $MODPATH/bin/ghid.sh
|
||||
sed "s@\[MODDIR\]@$MODPATH@g" "$MODPATH/overlay.d/ghid.rc" | sed 's/modules_update/modules/g' >"$TMPDIR/ghid.rc"
|
||||
cp "$TMPDIR/ghid.rc" "$MODPATH/overlay.d/ghid.rc"
|
||||
chmod 755 "$MODPATH/system/bin/ghid.sh"
|
||||
sed "s@\[MODDIR\]@$MODPATH@g" "$MODPATH/system/bin/ghid.sh" | sed 's/modules_update/modules/g' >"$TMPDIR/ghid.sh"
|
||||
cp "$TMPDIR/ghid.sh" "$MODPATH/system/bin/ghid.sh"
|
||||
|
||||
rpwd="$PWD"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
id=ghid
|
||||
name=ghid
|
||||
version=0
|
||||
versionCode=20
|
||||
versionCode=23
|
||||
author=lordwelch
|
||||
description=creates ghid device files in /dev
|
||||
|
@ -1,2 +1,8 @@
|
||||
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=* && property:sys.usb.configfs=1
|
||||
exec u:object_r:magisk:s0 root root -- [MODDIR]/bin/ghid.sh setup ${sys.usb.config}
|
||||
start ghid
|
||||
|
||||
service ghid /system/bin/ghid.sh setup ${sys.usb.config}
|
||||
user root
|
||||
seclabel u:r:magisk:s0
|
||||
disabled
|
||||
oneshot
|
||||
|
@ -1,13 +1,12 @@
|
||||
#!/system/bin/sh
|
||||
# $1 setup
|
||||
controller=$(getprop sys.usb.controller)
|
||||
moddir=${0%bin/*}
|
||||
moddir=[MODDIR]
|
||||
selected=standard-keyboard
|
||||
remove_ghid() {
|
||||
echo "disabling ghid" >>$moddir/ghid.log
|
||||
rm /config/usb_gadget/g1/configs/b.1/fhid
|
||||
rmdir /config/usb_gadget/g1/functions/hid.usb0
|
||||
echo "$controller" >/config/usb_gadget/g1/UDC
|
||||
}
|
||||
|
||||
enable_ghid() {
|
||||
@ -43,8 +42,6 @@ enable_ghid() {
|
||||
cp "$moddir/reports/$report_names" /config/usb_gadget/g1/functions/hid.usb0/report_desc
|
||||
cd /config/usb_gadget/g1/configs/b.1/
|
||||
/data/adb/magisk/busybox ln -nsf ../../../../usb_gadget/g1/functions/hid.usb0 ./fhid
|
||||
echo none >/config/usb_gadget/g1/UDC
|
||||
echo "$controller" >/config/usb_gadget/g1/UDC
|
||||
}
|
||||
|
||||
echo success ghid was run >>$moddir/ghid.log
|
Loading…
x
Reference in New Issue
Block a user