简体   繁体   中英

How remove SYSTEM_ALERT_WINDOW android permission in react native

How remove SYSTEM_ALERT_WINDOW android permission in React Native?

I remove it from AndroidManifest.xml but it don't removed from app.

Add

xmlns:tools="http://schemas.android.com/tools"

to manifest tag in AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.bepaw.esportninja">

and add

tools:node="remove"

to

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW " tools:node="remove" />
  1. Remove android.permission.SYSTEM_ALERT_WINDOW permission from AndroidManifest.xml file
  2. Create additional AndroidManifest.xml file in 'src/debug' directory
  3. Make it look like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
</manifest>

After that your APK will have SYSTEM_ALERT_WINDOW permission only for 'build' variant but not for 'release'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM