oliexdev / openScale

Open-source weight and body metrics tracker, with support for Bluetooth scales
GNU General Public License v3.0
1.66k stars 290 forks source link

openscale sync: specify reciever_export or reciever_not_exported flag. #1043

Open Jackahack opened 3 months ago

Jackahack commented 3 months ago

Is your feature request related to a problem?. connecting with openscale sync on android 14 phones to mqtt brokers will need to specify a certain flag (as per API level 34) The situation right now when you connect is that app keeps crashing resulting in the following error: java.lang.SecurityException: com.health.openscale.sync: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts

what i found on the developer.adroid forum was the following

_"" Apps and services that target Android 14 (API level 34) or higher and use context-registered receivers are required to specify a flag to indicate whether or not the receiver should be exported to all other apps on the device: either RECEIVER_EXPORTED or RECEIVER_NOTEXPORTED, respectively. This requirement helps protect apps from security vulnerabilities by leveraging the features for these receivers introduced in Android 13. Exception for receivers that receive only system broadcasts If your app is registering a receiver only for system broadcasts through Context#registerReceiver methods, such as Context#registerReceiver(), then it shouldn't specify a flag when registering the receiver. ""

see the link below https://developer.android.com/about/versions/14/behavior-changes-14

the solution is to patch the app so it complies again with the api. until then openscale sync is unusable for the latests android phones personally i dont know which flag is needed.

rd4p commented 1 month ago

Hi, same problem here. Mqtt option is not usable in the current state :x