How can I disable Android USB debugging programmatically

后端 未结 2 1481
囚心锁ツ
囚心锁ツ 2020-12-21 01:32

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 wri

相关标签:
2条回答
  • 2020-12-21 02:05

    I don't think it is a security issue.

    First, it is the responsibility of a developer to only make debug messages available that do not compromise his application in the later.

    Secondly, debug messages that are used for development should probably have another debug level than for production.

    Third, if your application exposes data via adb that compromisses your application, maybe there's something wrong in the app design in the beginning?

    Fourth: It is not recommended to toggle settings that the user should be able to configure. I would hate to see manything I configured go on and off by starting an app. Of course, you mentioned the Bug with Samsung. But I think they should be able to fix this.

    Regards, Chris

    0 讨论(0)
  • 2020-12-21 02:14

    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. :-(

    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.

    0 讨论(0)
提交回复
热议问题