我怎么能编程方式禁用Android的USB调试 [英] How can I disable Android USB debugging programmatically
问题描述
有自动开启,如果USB插在一些三星Android手机造成USB调试的错误。这显然是一个安全问题。我想编写一个程序,将禁用,这样我就可以开始它时,USB插头插入USB调试。 如何做到这一点任何想法?
There is a bug on some Samsung Android Phones causing USB-debugging to automatically be turned on if the USB is plugged in. This is obviously a security issue. I want to write a program which will disable USB debugging so that I can start it whenever usb-plug is inserted. Any ideas on how to do this?
推荐答案
这似乎是不可能的。我想我必须使用 Settings.System ,提供的 ADB_ENABLED ,但是的 ADB_ENABLED 是一个安全-系统设置不能由一个普通的应用程序来改变。 : - (
It seems to be impossible. I think I must use Settings.System with ADB_ENABLED, but ADB_ENABLED is a Secure-System-Setting which cannot be changed by a normal application. :-(
在另一方面,有权限 android.permission.WRITE_SECURE_SETTINGS
,所以它看起来像我可以改变它。我能得到它有根电话?
On the other hand, there is the permission android.permission.WRITE_SECURE_SETTINGS
, so it looks like I can alter it. Can I get it on a rooted phone?
如果有人对如何解决这个安全问题的想法,这将是巨大的。
If someone has an idea on how to fix this security issue, it would be great.
这篇关于我怎么能编程方式禁用Android的USB调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!