Android Question Permissions listed in Play Store but not declared in code

Alessandro71

Well-Known Member
Licensed User
Longtime User
These are the permissions of my app as shown in the Play Console app bundle detail:

android.permission.FOREGROUND_SERVICE
android.permission.INTERNET
android.permission.READ_EXTERNAL_STORAGE
android.permission.RECEIVE_BOOT_COMPLETED
android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
android.permission.SCHEDULE_EXACT_ALARM
android.permission.VIBRATE
android.permission.WAKE_LOCK
android.permission.WRITE_EXTERNAL_STORAGE

while the "List Permissions" in the IDE only shows these:

1669475695594.png


Where do the EXTERNAL_STORAGE permissions come from?
I'm only using File.DirInternal and File.DirAssets in my code.
 

JohnC

Expert
Licensed User
Longtime User
One of the libraries you are using seems to have a function that might use that permission and google is detecting that.

If you know for sure that you don't need it, then you could add this to the manifest:
B4X:
RemovePermission(android.permission.WRITE_EXTERNAL_STORAGE)
 
Upvote 0

Alessandro71

Well-Known Member
Licensed User
Longtime User
Can you post the complete manifest editor code?
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@mipmap/ic_launcher")
CreateResource(mipmap-anydpi-v26, ic_launcher.xml,
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@mipmap/background"/>
    <foreground android:drawable="@mipmap/foreground"/>
</adaptive-icon>
)
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.

'**** Preferences
SetActivityAttribute(Main, android:windowSoftInputMode, adjustResize|stateHidden)
'****

'sdk24 - theme
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values-v20, theme.xml,
<resources>
    <style
        name="LightTheme" parent="@android:style/Theme.Material.Light">
    </style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
    <style
        name="LightTheme" parent="@android:style/Theme.Holo.Light">
    </style>
</resources>
)

'sdk 26 - FileProvider
AddManifestText(<uses-permission
   android:name="android.permission.WRITE_EXTERNAL_STORAGE"
   android:maxSdkVersion="18" />
)
AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
   <files-path name="name" path="shared" />
)

'http
SetApplicationAttribute(android:usesCleartextTraffic, "true")

'do not kill if in background
AddPermission(android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS)

'sdk 31
AddPermission(android.permission.SCHEDULE_EXACT_ALARM)
 
Upvote 0

Alessandro71

Well-Known Member
Licensed User
Longtime User
It comes from this:
B4X:
AddManifestText(<uses-permission
   android:name="android.permission.WRITE_EXTERNAL_STORAGE"
   android:maxSdkVersion="18" />
)
You can remove it as its max version is lower than your app's min version.
I was asking myself about it.
It's a leftover from the SDK 30 transition
 
Upvote 0
Top