secure-if
secure-if copied to clipboard
Fail to block when replugging
App should re-execute these command when they find usb connected. OS: ColorOS R9sk_11_A.18_170112
Try setprop sys.usb.config none
to disable the poped up usb list.
To block data delivery, I think two commands below is just enough for all.
setprop sys.usb.config none
setprop sys.usb.configfs 1
So I made it a Magisk Module.
@simonsmh No it turns back to mtp,adb
automatically when I replug it
@simonsmh I know setprop
this function, But I am in the test when the Disabled function is normal but the Enabled function does not work.
https://android.googlesource.com/platform/system/core/+/master/rootdir/init.usb.rc
hmmm... just a reboot to reset all of them is fine 🤣
@znhocn Hmm... not having that problem on 6.0.1
The ColorOS do reset USB settings upon recharge, I think.
@znhocn setprop sys.usb.configfs 0 setprop sys.usb.config mtp This is just working. I'm testing them on my oneplus 3 although all the method working without any problem. One of the users is using Sony z4 and he said setprop working but virtual/android_usb not. @wfjsw Have you tried disabling adb first?
@simonsmh Sure.
ColorOS makes Charge Only
=> sys.usb.state=mass_storage
which mount a Driver ISO on USB.