csdcorp / speech_to_text

A Flutter plugin that exposes device specific text to speech recognition capability.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android Permission android.permission.BLUETOOTH_CONNECT should be optional

adscooli opened this issue · comments

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

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

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.

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.

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

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.