• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1on init
2    write /sys/class/android_usb/android0/f_rndis/vendorID 18D1
3    write /sys/class/android_usb/android0/f_rndis/wceis 1
4
5on boot
6    write /sys/class/android_usb/android0/iSerial ${ro.serialno}
7    write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
8    write /sys/class/android_usb/android0/iProduct ${ro.product.model}
9
10    write /sys/class/android_usb/f_mass_storage/lun/nofua 1
11
12    write /sys/class/android_usb/android0/f_rndis_qc/rndis_transports BAM2BAM_IPA
13    setprop sys.usb.mtp.device_type 3
14    setprop sys.usb.rps_mask 0
15
16on post-fs
17    write /sys/class/android_usb/android0/f_ffs/aliases adb,mtp,ptp
18    mkdir /dev/usb-ffs 0775 shell shell
19    mkdir /dev/usb-ffs/adb 0770 shell shell
20    mount functionfs adb /dev/usb-ffs/adb noatime uid=2000,gid=2000,no_disconnect=1
21    mkdir /dev/usb-ffs/mtp 0770 mtp mtp
22    mkdir /dev/usb-ffs/ptp 0770 mtp mtp
23    mount functionfs mtp /dev/usb-ffs/mtp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1
24    mount functionfs ptp /dev/usb-ffs/ptp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1
25
26on property:sys.usb.config=mtp
27    stop adbd
28    write /sys/class/android_usb/android0/enable 0
29    write /sys/class/android_usb/android0/idVendor 18D1
30    write /sys/class/android_usb/android0/idProduct 4EE1
31    write /sys/class/android_usb/android0/bDeviceClass 0
32    write /sys/class/android_usb/android0/bDeviceSubClass 0
33    write /sys/class/android_usb/android0/bDeviceProtocol 0
34    write /sys/class/android_usb/android0/functions ${sys.usb.config}
35    write /sys/class/android_usb/android0/enable 1
36    setprop sys.usb.state ${sys.usb.config}
37
38on property:sys.usb.config=mtp,adb
39    write /sys/class/android_usb/android0/enable 0
40    write /sys/class/android_usb/android0/idVendor 18D1
41    write /sys/class/android_usb/android0/idProduct 4EE2
42    write /sys/class/android_usb/android0/bDeviceClass 0
43    write /sys/class/android_usb/android0/bDeviceSubClass 0
44    write /sys/class/android_usb/android0/bDeviceProtocol 0
45    write /sys/class/android_usb/android0/functions ${sys.usb.config}
46    write /sys/class/android_usb/android0/enable 1
47    start adbd
48    setprop sys.usb.state ${sys.usb.config}
49
50on property:sys.usb.config=rndis
51    stop adbd
52    write /sys/class/android_usb/android0/enable 0
53    write /sys/class/android_usb/android0/idVendor 18D1
54    write /sys/class/android_usb/android0/idProduct 4EE3
55    write /sys/class/android_usb/android0/bDeviceClass 239
56    write /sys/class/android_usb/android0/bDeviceSubClass 2
57    write /sys/class/android_usb/android0/bDeviceProtocol 1
58    write /sys/class/android_usb/android0/functions ${sys.usb.config}
59    write /sys/class/android_usb/android0/enable 1
60    setprop sys.usb.state ${sys.usb.config}
61
62on property:sys.usb.config=rndis,adb
63    write /sys/class/android_usb/android0/enable 0
64    write /sys/class/android_usb/android0/idVendor 18D1
65    write /sys/class/android_usb/android0/idProduct 4EE4
66    write /sys/class/android_usb/android0/bDeviceClass 239
67    write /sys/class/android_usb/android0/bDeviceSubClass 2
68    write /sys/class/android_usb/android0/bDeviceProtocol 1
69    write /sys/class/android_usb/android0/functions ${sys.usb.config}
70    write /sys/class/android_usb/android0/enable 1
71    start adbd
72    setprop sys.usb.state ${sys.usb.config}
73
74on property:sys.usb.config=ptp
75    stop adbd
76    write /sys/class/android_usb/android0/enable 0
77    write /sys/class/android_usb/android0/idVendor 18D1
78    write /sys/class/android_usb/android0/idProduct 4EE5
79    write /sys/class/android_usb/android0/bDeviceClass 0
80    write /sys/class/android_usb/android0/bDeviceSubClass 0
81    write /sys/class/android_usb/android0/bDeviceProtocol 0
82    write /sys/class/android_usb/android0/functions ptp
83    write /sys/class/android_usb/android0/enable 1
84    setprop sys.usb.state ${sys.usb.config}
85
86on property:sys.usb.config=ptp,adb
87    write /sys/class/android_usb/android0/enable 0
88    write /sys/class/android_usb/android0/idVendor 18D1
89    write /sys/class/android_usb/android0/idProduct 4EE6
90    write /sys/class/android_usb/android0/bDeviceClass 0
91    write /sys/class/android_usb/android0/bDeviceSubClass 0
92    write /sys/class/android_usb/android0/bDeviceProtocol 0
93    write /sys/class/android_usb/android0/functions ptp,adb
94    write /sys/class/android_usb/android0/enable 1
95    start adbd
96    setprop sys.usb.state ${sys.usb.config}
97
98on property:sys.usb.config=midi
99    stop adbd
100    write /sys/class/android_usb/android0/enable 0
101    write /sys/class/android_usb/android0/idVendor 18D1
102    write /sys/class/android_usb/android0/idProduct 4EE8
103    write /sys/class/android_usb/android0/bDeviceClass 0
104    write /sys/class/android_usb/android0/bDeviceSubClass 0
105    write /sys/class/android_usb/android0/bDeviceProtocol 0
106    write /sys/class/android_usb/android0/functions ${sys.usb.config}
107    write /sys/class/android_usb/android0/enable 1
108    setprop sys.usb.state ${sys.usb.config}
109
110on property:sys.usb.config=midi,adb
111    write /sys/class/android_usb/android0/enable 0
112    write /sys/class/android_usb/android0/idVendor 18D1
113    write /sys/class/android_usb/android0/idProduct 4EE9
114    write /sys/class/android_usb/android0/bDeviceClass 0
115    write /sys/class/android_usb/android0/bDeviceSubClass 0
116    write /sys/class/android_usb/android0/bDeviceProtocol 0
117    write /sys/class/android_usb/android0/functions ${sys.usb.config}
118    write /sys/class/android_usb/android0/enable 1
119    start adbd
120    setprop sys.usb.state ${sys.usb.config}
121