1
0
mirror of https://github.com/devhunter1/android_device_samsung_a15.git synced 2024-11-19 14:47:45 +00:00
Twrp/recovery/root/init.recovery.usb.rc
2024-08-08 15:19:10 +05:30

103 lines
4.7 KiB
Plaintext

on init
setprop sys.usb.configfs 1
setprop sys.usb.ffs.aio_compat 1
setprop vendor.usb.controller ${sys.usb.controller}
setprop vendor.usb.acm_cnt 0
setprop vendor.usb.acm_port0 ""
setprop vendor.usb.acm_port1 ""
setprop vendor.usb.acm_enable 0
on fs
mkdir /config
mkdir /dev/usb-ffs 0770 shell shell
mkdir /dev/usb-ffs/adb 0770 shell shell
mount configfs none /config
mkdir /config/usb_gadget/g1 0770 shell shell
mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell
write /config/usb_gadget/g1/bcdDevice 0x504
write /config/usb_gadget/g1/bcdUSB 0x0200
write /config/usb_gadget/g1/os_desc/use 1
write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
mkdir /config/usb_gadget/g1/functions/mass_storage.usb0
mkdir /config/usb_gadget/g1/functions/ffs.adb
mkdir /config/usb_gadget/g1/functions/mtp.gs0
write /config/usb_gadget/g1/functions/mtp.gs0/os_desc/interface.MTP/compatible_id "MTP"
mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100"
symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
write /sys/class/android_usb/android0/f_ffs/aliases adb
on property:sys.usb.config=none && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
stop fastbootd
setprop sys.usb.ffs.ready 0
setprop sys.usb.ffs.mtp.ready 0
write /config/usb_gadget/g1/bDeviceClass 0
write /config/usb_gadget/g1/bDeviceSubClass 0
write /config/usb_gadget/g1/bDeviceProtocol 0
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
write /sys/devices/platform/mt_usb/saving 0
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb"
write /config/usb_gadget/g1/idVendor 0x04E8
write /config/usb_gadget/g1/idProduct 0x6860
write /config/usb_gadget/g1/os_desc/use 1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=fastboot && property:sys.usb.ffs.ready=1 && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "fastboot"
write /config/usb_gadget/g1/idVendor 0x04E8
write /config/usb_gadget/g1/idProduct 0x6860
write /config/usb_gadget/g1/os_desc/use 1
symlink /config/usb_gadget/g1/functions/ffs.fastboot /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=sideload && property:sys.usb.ffs.ready=1 && property:sys.usb.configfs=1
write /config/usb_gadget/g1/idVendor 0x04E8
on property:sys.usb.config=mtp && property:sys.usb.configfs=1
setprop sys.usb.ffs.mtp.ready 1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/idVendor 0x04E8
write /config/usb_gadget/g1/idProduct 0x6860
write /config/usb_gadget/g1/os_desc/use 1
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mtp,adb
start adbd
on property:sys.usb.config=fastboot
start fastbootd
on property:sys.usb.config=adb
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
setprop sys.usb.ffs.mtp.ready 1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/idVendor 0x04E8
write /config/usb_gadget/g1/idProduct 0x6860
write /config/usb_gadget/g1/os_desc/use 1
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}