csdcorp / speech_to_text

A Flutter plugin that exposes device specific text to speech recognition capability.
BSD 3-Clause "New" or "Revised" License
348 stars 217 forks source link

Android Permission android.permission.BLUETOOTH_CONNECT should be optional #469

Closed adscooli closed 4 months ago

adscooli commented 4 months ago

Consider removing the BLUETOOTH_CONNECT permission from the libs Manifest file, as it's flagged as critical or dangerous by various app checkers.

The permission should be optinal and added manually as mentioned in the Docs.

The permission was introduced in this commit

sowens-csd commented 4 months ago

So you're suggesting making Bluetooth support optional and only enable it if requested by the developer?

adscooli commented 4 months ago

Yes in a sense. While Bluetooth is currently optional since it can be disabled using the provided flags, the BLUETOOTH_CONNECT permission will be added automatically through manifest merge, even if it is not explicitly required.

The permissions mentioned in the doc are:

// these permission must be added by the developer:
android.permission.RECORD_AUDIO
android.permission.INTERNET 
android.permission.BLUETOOTH 
android.permission.BLUETOOTH_ADMIN 

// only this is automatically added by manifest merge (which seems unintentional)
android.permission.BLUETOOTH_CONNECT

Here is the part of the doc: grafik

The flags to disable bluetooth are (if anyone else is interested)

SpeechToText.androidNoBluetooth
SpeechToText.iosNoBluetooth.
sowens-csd commented 4 months ago

Makes sense, thanks. I think what happened is that Android Studio tends to complain about those flags and I sometimes get the example and plugin manifests confused when I'm not paying sufficient attention. I'll make the change.

sowens-csd commented 4 months ago

6.5.1 is out now with this change. If you have a chance to try it let me know.

adscooli commented 4 months ago

Great. Thanks. I tested it with the bluetooth NoBluetooth flags and without the bluetooth permissions. Works as expected an no permission is added to the app anymore.