BLE-HID-Peripheral-for-Android icon indicating copy to clipboard operation
BLE-HID-Peripheral-for-Android copied to clipboard

Root required?

Open gtbX opened this issue 7 years ago • 1 comments

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.

gtbX avatar Jan 29 '18 18:01 gtbX

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

jmichael2497 avatar Mar 09 '19 23:03 jmichael2497