BLE-HID-Peripheral-for-Android
BLE-HID-Peripheral-for-Android copied to clipboard
Root required?
Trying to run this on unrooted Nexus 6, but doesn't seem to work. I see this error in logcat after pairing:
D/HidPeripheral: Need BLUETOOTH PRIVILEGED permission: Neither user 10102 nor current process has android.permission.BLUETOOTH_PRIVILEGED.
java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission: Neither user 10102 nor current process has android.permission.BLUETOOTH_PRIVILEGED.
at android.os.Parcel.readException(Parcel.java:1942)
at android.os.Parcel.readException(Parcel.java:1888)
at android.bluetooth.IBluetooth$Stub$Proxy.setPairingConfirmation(IBluetooth.java:1677)
at android.bluetooth.BluetoothDevice.setPairingConfirmation(BluetoothDevice.java:1235)
at jp.kshoji.blehid.HidPeripheral$4.onConnectionStateChange(HidPeripheral.java:581)
at android.bluetooth.BluetoothGattServer$1.onServerConnectionState(BluetoothGattServer.java:93)
at android.bluetooth.IBluetoothGattServerCallback$Stub.onTransact(IBluetoothGattServerCallback.java:70)
at android.os.Binder.execTransact(Binder.java:674)
According to docs, BLUETOOTH_PRIVILEGED is not allowed for 3rd party apps.
seems like the sort of thing that needs to be manually added via adb or automatically via su (root).
should take a peek at open source apps with similar special permission needs like this logcat reader:
https://github.com/plusCubed/matlog/blob/master/app/src/main/java/com/pluscubed/logcat/helper/SuperUserHelper.java