Hello!
-
What language is this for?
Android -
Which rule?
xml:S5604 -
Why do you believe it’s a false-positive/false-negative?
This is a false-positive.
We are integrating an Android SDK that adds sensitive permissions. We however do not use the feature that needs this permission, and do not want this permission to appear in our manifest.
To prevent having this permission, we add a removal rule in our app’s manifest:
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32"
tools:node="remove" />
Notice the tools:node="remove"
.
It seems that Sonar does not care about the removal, and treats this instruction as “You are adding a dangerous permission, be careful”. This is actually the other way around. We know about it, and actively remove it from our manifest.
-
Are you using
SonarCloud -
How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)
-
Create a simple project that contains the Zendesk SDK:
com.zendesk:support:5.2.0
-
Add a removal rule in your manifest:
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32"
tools:node="remove" />
- Scan with Sonar.