Android-BLE-library onPairingRequestReceived called with pin does not overtake the system popup with a Samsung device

Hi,

I'm developing an Android app that will be used on Samsung Galaxy Tab devices only in which the user can connect, through BLE, to another device, which is a module added onto a circuit board. I'm using your Android-BLE-library V2.9.0 to do so.

I have the possibility to automatically enter the pincode needed instead of asking the user to enter it manually to pair with a device and I would like to do so in order to improve the usability of my app.

So the behavior I want is: The user click on a BLE module available and discovered, then it automatically pair and connect to it without showing any popup asking for a pincode.

By looking on your library I thought that overriding onPairingRequestReceived and calling device.setPin would be my solution. But it appears that the Samsung system doesn't care and shows the system app that ask the user to enter the pincode.

Did you ever hear about this kind of issue? Is there any workaround?

Thank you very much for your help!

Parents
  • Hi,

    Does this mean that you are using a static passkey and want your app to enter this static passkey? Please be aware that a static passkey can very easily be brute forced, so in this case a passke will not add anything to the security at all, and the security woul be on the sale level as "just works".

    That said, while I have not been able to confirm this, the the popup will (I think) still show up even if you also implement onPairingRequestReceived(), but the device will bond. This is because when a device wants to bond an Intent is sent to all apps. One of the app is the system, which shows the dialog. A different app would be the yours, which would provide the PIN. But that would not hide the already visible popup, so it will not be elegant.

    In sum, this approach (if I have understood it correctly), seem not so good as the visible popup will not be elegant, and you will also not get any benefits from using a passkey if it is static.

  • Hello Einar,

    Thanks a lot for your prompt reply!

    You're totally right about the static passkey. For the moment, I am still developing the app so I try to make it the easiest way, that is why Slight smile

    I'll try to be more understandable: My app is developed to work with a machine that has a BLE module on it. But both BLE or USB connection are available. The process I try to set up is that through the USB connection I can communicate the passkey required to initiate the BLE connection between my Samsung device and my machine, so that this whole procces is automatic regarding the user. But to do so, I have to overtake the system process that asks the passkey to the user on a popup. I tried the onPairingRequestReceived() but it didn't work.

    Regarding your answer, it seems to be more of an Android/Samsung issue than an issue from your library. I hoped that I could fine a workaround with your library, but that's ok, I will look for another way.

    Thank you again Einar!

Reply
  • Hello Einar,

    Thanks a lot for your prompt reply!

    You're totally right about the static passkey. For the moment, I am still developing the app so I try to make it the easiest way, that is why Slight smile

    I'll try to be more understandable: My app is developed to work with a machine that has a BLE module on it. But both BLE or USB connection are available. The process I try to set up is that through the USB connection I can communicate the passkey required to initiate the BLE connection between my Samsung device and my machine, so that this whole procces is automatic regarding the user. But to do so, I have to overtake the system process that asks the passkey to the user on a popup. I tried the onPairingRequestReceived() but it didn't work.

    Regarding your answer, it seems to be more of an Android/Samsung issue than an issue from your library. I hoped that I could fine a workaround with your library, but that's ok, I will look for another way.

    Thank you again Einar!

Children
No Data
Related