Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to block when replugging #3

Open
wfjsw opened this issue Jul 23, 2017 · 9 comments
Open

Fail to block when replugging #3

wfjsw opened this issue Jul 23, 2017 · 9 comments

Comments

@wfjsw
Copy link

wfjsw commented Jul 23, 2017

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

@simonsmh
Copy link

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

@simonsmh
Copy link

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.

@wfjsw
Copy link
Author

wfjsw commented Jul 24, 2017

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

@znhocn
Copy link
Contributor

znhocn commented Jul 24, 2017

@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

@simonsmh
Copy link

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

@wfjsw
Copy link
Author

wfjsw commented Jul 24, 2017

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

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

@simonsmh
Copy link

@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?

@wfjsw
Copy link
Author

wfjsw commented Jul 24, 2017

@simonsmh Sure.

@wfjsw
Copy link
Author

wfjsw commented Jul 24, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants