Removing Android app permissions

First go to:

C:\Program Files (x86)\Epic Games\4.xx\Engine\Source\Programs\UnrealBuildTool

right click on the “UnrealBuildTool” - Visual C# Project file, go to properties and remove the write protection.

Then open the “UnrealBuildTool” - Visual C# Project file with Visual Studio and look at the right site for the “Android” folder. Open it and click on the “UEDeployAndroid.cs” file.

Now you have to search for something like this:

In my Case it was at line 1544.

You can remove the permissions or just comment them out.
But leave the first two lines as they are!

Note that the Engine needs some permissions to work.
Here is a list i found in the forum:

Minimum required:
android.permission.WRITE_EXTERNAL_STORAGE

Required for AdMob:
android.permission.INTERNET
android.permission.ACCESS_NETWORK_STATE

OBB download from Google Play Store (working on for 4.8):
com.android.vending.CHECK_LICENSE
android.permission.INTERNET
android.permission.WAKE_LOCK
android.permission.ACCESS_NETWORK_STATE
android.permission.ACCESS_WIFI_STATE

Force Feedback:
android.permission.VIBRATE

InApp purchase:
com.android.vending.CHECK_LICENSE
com.android.vending.BILLING

GearVR:
android.permission.CAMERA

These are also currently included, but I think they can be dropped:
android.permission.READ_PHONE_STATE
android.permission.GET_ACCOUNTS
android.permission.MODIFY_AUDIO_SETTINGS

You can easily leave the minimum requirements in the “UEDeployAndroid.cs” – file and activate the other permissions later in the Project Settings. So you can have different permissions for each project.

In my case it looks like this now:

You only have to rebuild the “UnrealBuildTool”. I suggest to build it new.

Note: If the Engine is updated, you have to repeat all the steps.

For anyone still struggling with this, I couldn’t get ManifestRequirementsOverride.txt working b/c I accidentally named it ManifestRequirementsOverride.txt.txt (the file extension was hidden)

Make sure it is only ManifestRequirementsOverride.txt

This approach is better because it preserves the dynamic portions such as IAP, permissions defined in the DefaultEngine.ini or ManifestRequirementsAdditions.txt, and supported texture formats.

Side note:
If it complains about ‘Path’, put using System.IO; on top of your Build.cs file.

I think this doesn’t work anymore. I can’t find any Android permissions in UnrealBuildTools.cs, while using UE4 4.26.

The UPL method seems to work. The unwanted permissions are gone from the Manifest, but when I launch from the editor to be sent to my headset, Unreal is still trying to grant access for the unwanted permissions:

Running: C:\Users\Work\AppData\Local\Android\Sdk\platform-tools\adb.exe -s 1WMHH5472874 shell pm grant com.Bacon.BananaGame android.permission.READ_EXTERNAL_STORAGE

Its doing that for both read and write. Anyway to get around this?

So how to check all of these permissions before the game on game instance?
How to integrate to the game?