路径:
android6.0\frameworks\base\packages\SystemUI\src\com\android\systemui\usb\UsbDebuggingActivity.java
在onCreate最后,添加:
//setupAlert();
doConfirm();
doConfirm模拟了onClick的流程:
public void doConfirm(){
try {
IBinder b = ServiceManager.getService(USB_SERVICE);
IUsbManager service = IUsbManager.Stub.asInterface(b);
service.allowUsbDebugging(true, mKey);
} catch (Exception e) {
Log.e(TAG, "Unable to notify Usb service", e);
}
finish();
}
本文详细介绍了如何在Android 6.0系统中通过修改SystemUI源代码,绕过USB调试权限提示,直接允许USB调试的方法。通过在UsbDebuggingActivity的onCreate方法中调用doConfirm(),模拟用户点击确认流程,实现自动开启USB调试。
2089

被折叠的 条评论
为什么被折叠?



