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 unnecessary permissions, fixes #5886 #12965

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.helloworld"
android:versionCode="1"
android:versionName="1.0">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<!-- These permissions are added implicitly by android-jsc, see https://github.com/facebook/android-jsc/pull/12 -->
<!-- The following lines can be removed after android-jsc is updated in react-native -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should make it clear here that this does not add the permissions and what needs to be done if someone wants to add those to their app (probably just remove tools:node="remove").

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove" />
Copy link
Contributor

@mkonicek mkonicek Mar 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are probably for AsyncStorage so we should keep them? Not sure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think one module that needs read permissions is CameraRoll. I fixed it recently because we didn't request the permission in UIExplorer on Android 23+.

Copy link
Contributor

@ferrannp ferrannp Mar 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried AsyncStorage without this permission and it works fine. I guess under the hood it uses SQLite from Android so it does not really need this permission.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AsyncStorage Uses SQLite which saves to the app's local storage which doesn't require a permission.

However CameraRoll will require READ_EXTERNAL_STORAGE (for getPhotos) & WRITE_EXTERNAL_STORAGE (for saveToCameraRoll)

<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove"/>
Copy link
Contributor

@mkonicek mkonicek Mar 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice trick!


<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
>

<!-- These are added by React Native for debug mode, but aren't needed in release mode -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" tools:node="remove" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice trick!

</manifest>