secure-if icon indicating copy to clipboard operation
secure-if copied to clipboard

Fail to block when replugging

Open wfjsw opened this issue 6 years ago • 9 comments

App should re-execute these command when they find usb connected. OS: ColorOS R9sk_11_A.18_170112

wfjsw avatar Jul 23 '17 04:07 wfjsw

Try setprop sys.usb.config none to disable the poped up usb list.

simonsmh avatar Jul 24 '17 10:07 simonsmh

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 avatar Jul 24 '17 12:07 simonsmh

@simonsmh No it turns back to mtp,adb automatically when I replug it

wfjsw avatar Jul 24 '17 12:07 wfjsw

@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

znhocn avatar Jul 24 '17 12:07 znhocn

hmmm... just a reboot to reset all of them is fine 🤣

simonsmh avatar Jul 24 '17 12:07 simonsmh

@znhocn Hmm... not having that problem on 6.0.1

The ColorOS do reset USB settings upon recharge, I think.

wfjsw avatar Jul 24 '17 12:07 wfjsw

@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 avatar Jul 24 '17 12:07 simonsmh

@simonsmh Sure.

wfjsw avatar Jul 24 '17 12:07 wfjsw

ColorOS makes Charge Only => sys.usb.state=mass_storage which mount a Driver ISO on USB.

wfjsw avatar Jul 24 '17 12:07 wfjsw