Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove uses-permission from AndroidManifest.xml #34

Closed
ghost opened this issue Apr 2, 2019 · 4 comments
Closed

Remove uses-permission from AndroidManifest.xml #34

ghost opened this issue Apr 2, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 2, 2019

Problem Statement:

I am using react-native-get-sms-android for reading sms only. Still my app asks permission for WRITE_SMS and SEND_SMS, even though I have not asked for that permission.

Cause:

The permission specified in the AndroidManifest.xml of this plugin.

Solution:

Remove the permissions from this plugin's AndroidManifest.xml and let developers add it to their app's Manifest so that there are no permissions required that the developer is not aware of.

Workaround:

Add this to your app's android/app/src/main/AndroidManifest.xml and it will remove unnecessary permission.

<uses-permission android:name="android.permission.WRITE_SMS" tools:node="remove" />
<uses-permission android:name="android.permission.SEND_SMS" tools:node="remove" />

Also add xmlns:tools to your manifest tag to work:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example">
@ghost
Copy link
Author

ghost commented Apr 2, 2019

Also change the README accordingly. As it guides to add permissions manually to AndroidManifest.xml, which is not actually required. It should be changed to add the specific permission that a specific function requires.

@mikehardy
Copy link
Collaborator

Seems like a reasonable idea. Why not propose a PR to match?

@ghost
Copy link
Author

ghost commented Apr 2, 2019

Sure thing. I am new to react-native, so was just going through on some blog posts on how to develop plugins for react-native so that I don't accidentally break any other things. I will create a PR as soon as I am ready with the change. Maybe within 24 hours.

@briankabiro
Copy link
Owner

Thanks @sulaysumaria. We'd both be happy to offer advice on this.

briankabiro added a commit that referenced this issue Aug 15, 2019
- remove the user permissions for the app from the manifest
- update the README with the new changes

[Finishes #34]
briankabiro added a commit that referenced this issue Aug 21, 2019
- remove the user permissions for the app from the manifest
- update the README with the new changes

[Finishes #34]
briankabiro added a commit that referenced this issue Aug 21, 2019
- remove the user permissions for the app from the manifest
- update the README with the new changes

[Finishes #34]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants