We have a beta version of the BLE extension that incorporates the new Bluetooth permissions introduced in Android 12. Please make a backup of your projects before upgrading the extension. Because this is a work in progress, there may be issues that still need to be addressed. If you try it out, please leave feedback in this thread.
I checked it on an Android 13 device. It seems that the Location sensor must be enabled (also on Android 12+) to get BLE devices (BLE.DeviceList) - Companion & APK.
In addition, the BLUETOOTH_CONNECT permission is still not declared in the Manifest. So the BluetoothClient component has to be added again (as a dummy) to get this permission in the Manifest.
Did you include a block that actually tries to scan or connect? The dangerous permissions are included conditionally. This way, for example, your app doesn't get the BLUETOOTH_ADVERTISE permission if the app never uses the StartAdvertising block. For example, here is a copy of our healthy plant IOT tutorial with the beta version added and when I compile it to APK I get the location and Bluetooth permissions.
My test app (aia), which I used from one of my old BLE posts, only lists the available devices. The BLUETOOTH_CONNECT permission is also required for this. However, the new BLE extension only declares this permission if at least one (empty) BLE.Connect... block is added.
According to my tests, BLUETOOTH_CONNECT (+ BLUETOOTH_SCAN) is always required on Android 12+ (even for just scanning).
If you'd like to add that flag, you should be able to check the new design property "NoLocationNeeded". However, due to limitations in the App Inventor build system this won't result in the removal of the ACCESS_FINE_LOCATION permission in the Manifest, but it should stop the extension from asking for the permission at runtime.
Well, since I have to edit the manifest anyway, I might as well remove ACCESS_FINE_LOCATION there. At the moment, however, I also have the problem with my current work notebook that the "neverForLocation" flag is unknown in my APK Editor Studio version. It was probably added later by Google.
Unfortunately, the current APK Studio version cannot be installed on my ancient Win7 notebook. I'll have to try it on another Win10 PC or on my MacMini, later ..
Correct. The flags feature was something added for SDK 31 and needs a newer version of the build tools even for us to compile with it, so I expect many other tools will need to be updated to take it into account.
Save the AndroidManifest.xml file with above changes.
Rebuild the APK file.
NOTE:
How to view the AndroidManifest.xml?
------ Download APK Studio Editor from the link Download APK Editor for PC and Mac – APK Editor Studio
------ Open APK Studio Editor and Open the APK file.
------ Click on the "Open Contents" tab
------ Folder will be opened and "AndroidManifest.xml" file can be seen.
How to Edit AndroidManifest.xml file?
------ Open the AndroidManifest.xml using any of the text editor.
------ Delete the lines related to Bluetooth related permissions.
------ Paste the below lines and save the changes.