# Removing Android app permissions

**URL:** <https://forums.unrealengine.com/t/removing-android-app-permissions/335454>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [October 16, 2015, 2:14am UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454 "2015-10-16T02:14:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimzorz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dimzorz](https://forums.unrealengine.com/u/dimzorz)\
**Post date:** [October 16, 2015, 2:14am UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/1 "2015-10-16T02:14:02Z")

</div>

What’s the most straightforward way to remove some app permissions?

I noticed that on install my app asks for much more than it will ever use and I don’t want users to think that something shady is going on. I see the Extra Permissions section in the Android Settings, but I’m trying to remove permissions, not add them.

Thanks ahead of time.

---

<div class="post-metadata">

**Author:** ![dimzorz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dimzorz](https://forums.unrealengine.com/u/dimzorz)\
**Post date:** [October 28, 2015, 3:29pm UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/2 "2015-10-28T15:29:55Z")

</div>

Anyone?\_\_\_

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8213bb97](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8213bb97](https://forums.unrealengine.com/u/anonymous_user_8213bb97)\
**Post date:** [January 27, 2016, 1:50pm UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/3 "2016-01-27T13:50:57Z")

</div>

Same problem here…

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_52e7c991](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_52e7c991](https://forums.unrealengine.com/u/anonymous_user_52e7c991)\
**Post date:** [February 2, 2016, 11:15pm UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/4 "2016-02-02T23:15:14Z")

</div>

And here…

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8213bb97](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8213bb97](https://forums.unrealengine.com/u/anonymous_user_8213bb97)\
**Post date:** [February 3, 2016, 7:39am UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/5 "2016-02-03T07:39:11Z")

</div>

Hey guys,

Good news, I got rid of all the permissions 🙂  
In your projectfolder go to GAME\Main\Intermediate\Android\APK.  
You can look at the AndroidManifest.XML, and see all of the permissions.  
You can’t change this file by simply deleting all the permissions, but here is what you do:

1. Copy the important text in between  
‘!–Requirements-- and  
/manifest’, like androidSDKversion etc (only essential stuff, and the permissions you want).
2. Then, make a .txt file named ‘ManifestRequirementsOverride.txt’ in the GAME/Build/Android folder.
3. Every line you will put in this file, will overwrite your AndroidManifest.XML-lines between ‘!–Requirements-- and  
/manifest’.  
So if you leave this file blanc, all permissions will be gone, but you will have some other problems when building…  
Thats why you need to keep in some of the sdk and feature stuff 😉

Maybe you’ll need to adjust some things to make it work for your project, or put in some permissions that you do want to use. For example, I still put in the wake\_lock, because it doesn’t even ask users for permission, and it’s a nice feature 🙂 After building the game, your project’s AndroidManifest.XML will be updated, and will not need any permissions.

Hope this helps! 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8213bb97](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8213bb97](https://forums.unrealengine.com/u/anonymous_user_8213bb97)\
**Post date:** [February 3, 2016, 7:51am UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/6 "2016-02-03T07:51:55Z")

</div>

This is all i put in my ManifestRequirementsOverride.txt:

```
<uses-sdk android:minSdkVersion="9"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_52e7c991](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_52e7c991](https://forums.unrealengine.com/u/anonymous_user_52e7c991)\
**Post date:** [February 3, 2016, 10:42am UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/7 "2016-02-03T10:42:15Z")

</div>

Great thanks! **It’s really work!**

---

<div class="post-metadata">

**Author:** ![dimzorz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dimzorz](https://forums.unrealengine.com/u/dimzorz)\
**Post date:** [March 2, 2016, 6:29pm UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/8 "2016-03-02T18:29:44Z")

</div>

Awesome! Thanks a lot, now people won’t think that some random guy making games in his spare time is trying to harvest metadata

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d868c905](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d868c905](https://forums.unrealengine.com/u/anonymous_user_d868c905)\
**Post date:** [December 12, 2016, 2:45am UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/9 "2016-12-12T02:45:12Z")

</div>

There is an elegant solution using the [UPL mechanism](https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Programs/UnrealBuildTool/System/UnrealPluginLanguage.cs), which allows you to modify android manifest and Activity class.

(1) Create a file `YourProject/Source/YourProject/AndroidSanitizePermissions_UPL.xml` with content:

```
<?xml version="1.0" encoding="utf-8"?>
<root xmlns:android="http://schemas.android.com/apk/res/android">
	<androidManifestUpdates>
		<removePermission android:name="android.permission.ACCESS_NETWORK_STATE" />
		<removePermission android:name="android.permission.ACCESS_WIFI_STATE" />
		<removePermission android:name="android.permission.READ_PHONE_STATE" />
		<removePermission android:name="com.android.vending.CHECK_LICENSE" />
		<removePermission android:name="android.permission.GET_ACCOUNTS" />
	</androidManifestUpdates>
</root>

```

(2) In `YourProject/Source/YourProject.Build.cs` add:

```
var manifest_file = Path.Combine(ModuleDirectory, "AndroidSanitizePermissions_UPL.xml");
AdditionalPropertiesForReceipt.Add(
	new ReceiptProperty("AndroidPlugin", manifest_file)
);

```

Now the unnecessary permissions will be removed from manifest.

---

<div class="post-metadata">

**Author:** ![Crowsfield](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/crowsfield/32/983195_2.png) [@Crowsfield](https://forums.unrealengine.com/u/Crowsfield)\
**Post date:** [December 19, 2016, 7:53pm UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/10 "2016-12-19T19:53:48Z")

</div>

Very usefull, thx. but in my case it does not remove Read\_Phone\_Stat and Get\_Account.  
Do you you maybe know why?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d868c905](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d868c905](https://forums.unrealengine.com/u/anonymous_user_d868c905)\
**Post date:** [December 21, 2016, 10:47pm UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/11 "2016-12-21T22:47:23Z")

</div>

Have you tried [my method using UPL](https://answers.unrealengine.com/questions/318771/removing-android-app-permissions.html#answer-535611)?  
In my project it successfully removed READ\_PHONE\_STATE and GET\_ACCOUNTS.

---

<div class="post-metadata">

**Author:** ![w0lfi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@w0lfi](https://forums.unrealengine.com/u/w0lfi)\
**Post date:** [December 28, 2016, 7:04pm UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/12 "2016-12-28T19:04:28Z")

</div>

I tried it and it doesn’t work for me…  
The Manifest file uses the same permissions as before.

When i look in the Output Log I see this:

UATHelper: Packaging (Android (ETC1)): [proguard] **Warning: can’t write resource** [META-INF/MANIFEST.MF] (Duplicate zip entry [classes.jar:META-INF/MANIFEST.MF])

I don’t know what I should do with that information, but it says it can’t write the Manifest…  
Does anybody know something?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![w0lfi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@w0lfi](https://forums.unrealengine.com/u/w0lfi)\
**Post date:** [December 28, 2016, 7:10pm UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/13 "2016-12-28T19:10:21Z")

</div>

I wanted to try your solution to this problem but i don’t know where to place the files, because i can’t find these 2 path’s in my project folders…

YourProject/ **Source** /YourProject/AndroidSanitizePermissions\_UPL.xml  
YourProject/ **Source** /YourProject.Build.cs

I have no “Source” - folder or anything similar there…  
Could you please help me with this?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d868c905](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d868c905](https://forums.unrealengine.com/u/anonymous_user_d868c905)\
**Post date:** [December 28, 2016, 11:53pm UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/14 "2016-12-28T23:53:26Z")

</div>

I suppose the Source directory only exists for C++ projects. In order to try this method, you could start a C++ project or convert an BP-only project to a C++ one using [existing tutorials](http://allarsblog.com/2015/11/05/Converting-BP-Project-To-CPP/).

(You should not need any C++ code though, just YourProject.Build.cs)

---

<div class="post-metadata">

**Author:** ![w0lfi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@w0lfi](https://forums.unrealengine.com/u/w0lfi)\
**Post date:** [December 29, 2016, 12:32am UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/15 "2016-12-29T00:32:37Z")

</div>

Thank you for that fast reply. 🙂  
I`ll give it a try the next days.

Ohh and btw. your link about the _UPL mechanism_ is broken.

---

<div class="post-metadata">

**Author:** ![w0lfi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@w0lfi](https://forums.unrealengine.com/u/w0lfi)\
**Post date:** [January 13, 2017, 9:57am UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/16 "2017-01-13T09:57:37Z")

</div>

I found my self a solution for removing the permissions when you can’t use the _ManifestRequirementsOverride.txt_.  
It is based on the post of [MarcelBlanck](https://forums.unrealengine.com/showthread.php?76986-Any-way-to-edit-the-AndroidManifest-xml-Manually) (#3) but it works with the **Launcher Version** 4.14.3 and **Blueprint projects**.

You have to do this only once per Engine Version and after that you only have to add your needed permissions in the project settings. So **no** more _ManifestRequirementsOverride.txt_ is needed anymore.

I will post a detailed instruction in february, but if you want to know it faster, you can text me.

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [February 17, 2017, 8:18am UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/17 "2017-02-17T08:18:22Z")

</div>

The link is not broken. You just need to have a GitHub account and associate it with your Unreal one. [Steps are here](https://www.unrealengine.com/ue4-on-github).

---

<div class="post-metadata">

**Author:** ![ronaldk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ronaldk](https://forums.unrealengine.com/u/ronaldk)\
**Post date:** [February 17, 2017, 4:35pm UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/18 "2017-02-17T16:35:56Z")

</div>

So I tried this and it didn’t work. I tried using the override and while the permissions are fixed, the game doesnt launch!! (just crashes on android). Any suggestions?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d868c905](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d868c905](https://forums.unrealengine.com/u/anonymous_user_d868c905)\
**Post date:** [February 17, 2017, 4:43pm UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/19 "2017-02-17T16:43:55Z")

</div>

I have encountered a similar problem when removing the network permission - [my question](https://answers.unrealengine.com/questions/535616/android-application-crashes-without-internet-permi.html).  
They said it will crash if you remove that permission in “Launch from editor”, but should be fine to remove it when you are building an APK.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1786a85d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1786a85d](https://forums.unrealengine.com/u/anonymous_user_1786a85d)\
**Post date:** [February 24, 2017, 9:28am UTC](https://forums.unrealengine.com/t/removing-android-app-permissions/335454/20 "2017-02-24T09:28:50Z")

</div>

I’d like a detailed instruction. I can’t get ManifestRequirementsOverride.txt to work anymore.

[Next page](https://forums.unrealengine.com/t/removing-android-app-permissions/335454.md?page=2)
