-
Notifications
You must be signed in to change notification settings - Fork 25
/
usb.rc
executable file
·30 lines (23 loc) · 924 Bytes
/
usb.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
on property:sys.usb.config=none
write /sys/devices/virtual/usb_composite/rndis/enable 0
on property:sys.usb.config=mass_storage
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=mass_storage,adb
start adbd
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=rndis
exec /system/bin/netcfg usb0 up
write /sys/devices/virtual/usb_composite/rndis/enable 1
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=rndis,adb
exec /system/bin/netcfg usb0 up
write /sys/devices/virtual/usb_composite/rndis/enable 1
start adbd
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=mtp
write /sys/devices/virtual/usb_composite/mtp/enable 1
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=mtp,adb
write /sys/devices/virtual/usb_composite/mtp/enable 0
start adbd
setprop sys.usb.state $sys.usb.config