1 on property:sys.usb.config=none && property:sys.usb.configfs=1 2 write /config/usb_gadget/g1/UDC "none" 3 stop adbd 4 write /config/usb_gadget/g1/bDeviceClass 0 5 write /config/usb_gadget/g1/bDeviceSubClass 0 6 write /config/usb_gadget/g1/bDeviceProtocol 0 7 setprop sys.usb.state ${sys.usb.config} 8 9 on property:sys.usb.config=adb && property:sys.usb.configfs=1 10 start adbd 11 12 on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && property:sys.usb.configfs=1 13 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb" 14 rm /config/usb_gadget/g1/configs/b.1/f1 15 rm /config/usb_gadget/g1/configs/b.1/f2 16 rm /config/usb_gadget/g1/configs/b.1/f3 17 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1 18 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 19 setprop sys.usb.state ${sys.usb.config} 20 21 on property:sys.usb.config=mtp && property:sys.usb.configfs=1 22 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp" 23 rm /config/usb_gadget/g1/configs/b.1/f1 24 rm /config/usb_gadget/g1/configs/b.1/f2 25 rm /config/usb_gadget/g1/configs/b.1/f3 26 symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 27 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 28 setprop sys.usb.state ${sys.usb.config} 29 30 on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1 31 start adbd 32 33 on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1 34 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb" 35 rm /config/usb_gadget/g1/configs/b.1/f1 36 rm /config/usb_gadget/g1/configs/b.1/f2 37 rm /config/usb_gadget/g1/configs/b.1/f3 38 symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 39 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 40 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 41 setprop sys.usb.state ${sys.usb.config} 42 43 on property:sys.usb.config=ptp && property:sys.usb.configfs=1 44 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp" 45 rm /config/usb_gadget/g1/configs/b.1/f1 46 rm /config/usb_gadget/g1/configs/b.1/f2 47 rm /config/usb_gadget/g1/configs/b.1/f3 48 symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1 49 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 50 setprop sys.usb.state ${sys.usb.config} 51 52 on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1 53 start adbd 54 55 on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1 56 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp_adb" 57 rm /config/usb_gadget/g1/configs/b.1/f1 58 rm /config/usb_gadget/g1/configs/b.1/f2 59 rm /config/usb_gadget/g1/configs/b.1/f3 60 symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1 61 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 62 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 63 setprop sys.usb.state ${sys.usb.config} 64 65 on property:sys.usb.config=accessory && property:sys.usb.configfs=1 66 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory" 67 rm /config/usb_gadget/g1/configs/b.1/f1 68 rm /config/usb_gadget/g1/configs/b.1/f2 69 rm /config/usb_gadget/g1/configs/b.1/f3 70 symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1 71 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 72 setprop sys.usb.state ${sys.usb.config} 73 74 on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1 75 start adbd 76 77 on property:sys.usb.ffs.ready=1 && property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1 78 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_adb" 79 rm /config/usb_gadget/g1/configs/b.1/f1 80 rm /config/usb_gadget/g1/configs/b.1/f2 81 rm /config/usb_gadget/g1/configs/b.1/f3 82 symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1 83 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 84 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 85 setprop sys.usb.state ${sys.usb.config} 86 87 on property:sys.usb.config=audio_source && property:sys.usb.configfs=1 88 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "audiosource" 89 rm /config/usb_gadget/g1/configs/b.1/f1 90 rm /config/usb_gadget/g1/configs/b.1/f2 91 rm /config/usb_gadget/g1/configs/b.1/f3 92 symlink /config/usb_gadget/g1/functions/audio_source.gs2 /config/usb_gadget/g1/configs/b.1/f1 93 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 94 setprop sys.usb.state ${sys.usb.config} 95 96 on property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1 97 start adbd 98 99 on property:sys.usb.ffs.ready=1 && property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1 100 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "audiosource_adb" 101 rm /config/usb_gadget/g1/configs/b.1/f1 102 rm /config/usb_gadget/g1/configs/b.1/f2 103 rm /config/usb_gadget/g1/configs/b.1/f3 104 symlink /config/usb_gadget/g1/functions/audio_source.gs2 /config/usb_gadget/g1/configs/b.1/f1 105 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 106 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 107 setprop sys.usb.state ${sys.usb.config} 108 109 on property:sys.usb.config=accessory,audio_source && property:sys.usb.configfs=1 110 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_audiosource" 111 rm /config/usb_gadget/g1/configs/b.1/f1 112 rm /config/usb_gadget/g1/configs/b.1/f2 113 rm /config/usb_gadget/g1/configs/b.1/f3 114 symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1 115 symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f2 116 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 117 setprop sys.usb.state ${sys.usb.config} 118 119 on property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1 120 start adbd 121 122 on property:sys.usb.ffs.ready=1 && property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1 123 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_audiosource_adb" 124 rm /config/usb_gadget/g1/configs/b.1/f1 125 rm /config/usb_gadget/g1/configs/b.1/f2 126 rm /config/usb_gadget/g1/configs/b.1/f3 127 symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1 128 symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f2 129 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3 130 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 131 setprop sys.usb.state ${sys.usb.config} 132 133 on property:sys.usb.config=midi && property:sys.usb.configfs=1 134 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "midi" 135 rm /config/usb_gadget/g1/configs/b.1/f1 136 rm /config/usb_gadget/g1/configs/b.1/f2 137 rm /config/usb_gadget/g1/configs/b.1/f3 138 symlink /config/usb_gadget/g1/functions/midi.gs5 /config/usb_gadget/g1/configs/b.1/f1 139 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 140 setprop sys.usb.state ${sys.usb.config} 141 142 on property:sys.usb.config=midi,adb && property:sys.usb.configfs=1 143 start adbd 144 145 on property:sys.usb.ffs.ready=1 && property:sys.usb.config=midi,adb && property:sys.usb.configfs=1 146 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "midi_adb" 147 rm /config/usb_gadget/g1/configs/b.1/f1 148 rm /config/usb_gadget/g1/configs/b.1/f2 149 rm /config/usb_gadget/g1/configs/b.1/f3 150 symlink /config/usb_gadget/g1/functions/midi.gs5 /config/usb_gadget/g1/configs/b.1/f1 151 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 152 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 153 setprop sys.usb.state ${sys.usb.config} 154 155 on property:sys.usb.config=rndis && property:sys.usb.configfs=1 156 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis" 157 rm /config/usb_gadget/g1/configs/b.1/f1 158 rm /config/usb_gadget/g1/configs/b.1/f2 159 rm /config/usb_gadget/g1/configs/b.1/f3 160 symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1 161 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 162 setprop sys.usb.state ${sys.usb.config} 163 164 on property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1 165 start adbd 166 167 on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1 168 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_adb" 169 rm /config/usb_gadget/g1/configs/b.1/f1 170 rm /config/usb_gadget/g1/configs/b.1/f2 171 rm /config/usb_gadget/g1/configs/b.1/f3 172 symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1 173 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 174 write /config/usb_gadget/g1/UDC ${sys.usb.controller} 175 setprop sys.usb.state ${sys.usb.config} 176