-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
READ_PHONE_STATE permission added when using with expo (bare workflow) #3021
Comments
cc @Kudo |
thanks @andrewjack-cat for the good catch. i am working on a better way for expo integration in reanimated and will address this issue together. |
For people running into this with In {
"plugins": [
[
"./withAndroidRemovedPermissions",
[
"android.permission.READ_PHONE_STATE"
]
],
],
} Then, add a new file in the root of your project, called const {
AndroidConfig,
createRunOncePlugin,
withAndroidManifest,
} = require('@expo/config-plugins');
const withAndroidRemovedPermissions = (config, permissions) => {
return withAndroidManifest(config, (config) => {
AndroidConfig.Permissions.removePermissions(config.modResults, permissions);
const usesPermissions = config.modResults.manifest['uses-permission'] || [];
permissions.forEach((permission) => {
usesPermissions.push({
$: {
'tools:node': 'remove',
'android:name': permission,
},
});
});
config.modResults.manifest['uses-permission'] = usesPermissions;
config.modResults.manifest.$['xmlns:tools'] =
'http://schemas.android.com/tools';
return config;
});
};
module.exports = createRunOncePlugin(
withAndroidRemovedPermissions,
'withAndroidRemovedPermissions'
); You can also use this too, for example, remove {
"plugins": [
[
"./withAndroidRemovedPermissions",
[
"android.permission.RECORD_AUDIO",
"android.permission.READ_PHONE_STATE"
]
],
],
} |
## Description with #3005, we don't need the expo adapter to install JSI bindings. by removing the adapter, this pr will also fix #3084 and fix #3021 ## Changes remove expo adapter ## Test code and steps to reproduce 1. `$ createNPMPackage.sh` 2. create an expo sdk44 project, `yarn add file:/path/to/react-native-reanimated-2.5.0.tgz` and test launching. 2. create an react-native 0.67 project, `yarn add file:/path/to/react-native-reanimated-2.5.0.tgz` and test launching. ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Added TS types tests - [ ] Added unit / integration tests - [ ] Updated documentation - [ ] Ensured that CI passes
I ran expo upgrade This will actually fix a bug where react-reanimated was asking for more permissions on android than wwe are needing software-mansion/react-native-reanimated#3021 So thats a win
Description
react-native-reanimated/android-npm/expo/linking.gradle
Line 26 in d22fc8a
Due to no targetSdkVersion being specified in the expo gradle file. This causes the Android manifest to assume the targetSdkVersion is < 4. This causes the Android manifest merger to add the "dangerous" READ_PHONE_STATE permission.
Expected behavior
READ_PHONE_STATE should not be present in the final Android Manifest.
This can be fixed by adding this to
expo/linking.gradle
:Actual behavior & steps to reproduce
READ_PHONE_STATE is present in the final Android Manifest. & can see reanimated mention in manifest-merger-logs.
Snack or minimal code example
app/build/outputs/logs/manifest-merger-debug-report.txt
for references to READ_PHONE_STATEPackage versions
Affected platforms
The text was updated successfully, but these errors were encountered: