Permission changed for API startLocalOnlyHotspot but is neither declared nor checked
DSOTM-pf opened this issue · 2 comments
Hi, there, I've found an issue in version 1.4.2, which is downloaded from F-Droid.
Describe the bug
I found the usage of startLocalOnlyHotspot
may cause compatibility bugs. It is related to the call chain:
com.genonbeta.TrebleShot.service.CommunicationService.onStartCommand(android.content.Intent,int,int)int
com.genonbeta.TrebleShot.service.CommunicationService.setupHotspot()void
com.genonbeta.TrebleShot.util.HotspotUtils$OreoAPI.enableConfigured(java.lang.String,java.lang.String)boolean
com.genonbeta.TrebleShot.util.HotspotUtils$OreoAPI.enable()boolean
android.net.wifi.WifiManager.startLocalOnlyHotspot(android.net.wifi.WifiManager$LocalOnlyHotspotCallback,android.os.Handler)void
This API needs ACCESS_COARSE_LOCATION
permission at API-level 28 and below, but is changed to ACCESS_FINE_LOCATION
in 29. The app only uses coarse location in the manifest.
It can be fixed by adding fine location to the manifest, and request for the fine location at somewhere in the program (maybe before calling that API, and also check SDK_INT>28
).
I found only the coarse location permission is there when I start a hotspot (through ADB).
Can you help me review this issue? @velitasali
Thanks !!!
Thanks for the thorough description.
The changes you are suggesting are already there in the latest revision.
android/app/src/main/AndroidManifest.xml
Line 24 in b62716f
Thanks for the thorough description.
The changes you are suggesting are already there in the latest revision.
android/app/src/main/AndroidManifest.xml
Line 24 in b62716f
Awesome! Very thanks!