Announcement

Collapse
No announcement yet.

Modify AndroidManifest.xml?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Modify AndroidManifest.xml?

    Hello, I was looking at the appication and I noticed that it wants to have a lot of permissions. I was wondering if there is a way to remove the permisisons from the application? Now if I remove them manually from intermediate/android/apk, the building recreates the manifest. If I make the file read-only, the building stops.

    I would prefer to remove pretty much every single permission required by the manifest, because to be honest if I see random application requiring a lot permissions that is most likely instant delete for me for an application or I my self would not even install it to begin with, so I assume there are other people who think the same way as me.

    #2
    on 4.7git you can modify the source file located at ..\Engine\Source\Programs\UnrealBuildTool\Android\UEDeployAndroid.cs the XML should be around line 650 - making changes here is a little project dependent cause it require to build the UnrealBuildTool at any changes.. on previus version you could manually edit the AndroidManifest.xml on [PROJECT]\Build\Android

    Please notice, binary dependency in "Engine\Binaries\Android" seems also tied with this configuration file (UEDeployAndroid.cs).
    Last edited by CloVeCaT; 03-09-2015, 07:43 PM.

    Comment


      #3
      Thank you. I managed to compile the unrealbuildtool and I added few lines of code to just read the permissions from a text file. At least it looks like it can run by removing everything except the write to external storage-permission.

      Comment


        #4
        "Automating" the AndroidManifest.xml has been the bane of me recently :/

        Is there anyway that anyone knows of that we can have a project specific UEDeployAndroid.cs ?

        Perhaps then we can compile the UnrealBuildTool binary specific to projects?
        Last edited by JamesMugford; 03-28-2015, 01:25 PM.

        Comment


          #5
          Originally posted by Minxies View Post
          "Automating" the AndroidManifest.xml has been the bane of me recently :/

          Is there anyway that anyone knows of that we can have a project specific UEDeployAndroid.cs ?

          Perhaps then we can compile the UnrealBuildTool binary specific to projects?
          I don't think this is possible. I recently had to add my custom stuff to the UEDeployAndroid.cs GenerateManifest functions, too, to get what I wanted. A lot of guys are having this issue and complaining about it. Let's hope 4.8 will have some changes...

          Comment


            #6
            Basically what I did was just make the UEDeployAndroid.cs to load the permissions from a text-file at a certain location, so it wasn't exactly a project specific, but at least I can change the file according to project that I am using. I guess with some simple programming it would be possibly to make the cs-file to read from project specific folder, which permissions to give by reading the text-file then generating the manifest from that. Maybe it is not a best way to go, but at least that should be one way to deal with the auto-generation. Of course the problem comes from having to constantly build your own building tool on every update...

            Comment


              #7
              I'm looking at ways to improve the AndroidManifest.xml generation. In particular, which permissions are you most concerned about removing?

              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

              Comment


                #8
                I guess the way you've categorized there would be nice. Like if there would be tickable checkboxes from the unreal editor for example I would do something of minimum requirements, where no extra stuff would be included, then I would untick everything. Then if I would want to use force feedback and admob, I could clheck those or something along the lines of that.

                If for example something that doesn't use any of the following permissions, but still shows them: internet, blling and use of external storage, it might scare away some people from even wanting to download the game. If I could remove the permissions for example billing and internet, the game looks a bit safer to download.

                Comment


                  #9
                  I suppose exposing more fields to the Android configuration is 1 solution.

                  Though there will always be that odd use case where someone wants to modify something that's not exposed there (like myself, I want to be able to change the android application label)

                  Would it not be nice to have a: "Use Static AndroidManifest.xml" checkbox that allows us to build from an AndroidManifest.xml file on a project specific basis? (Like in 4.6.1 and prior)

                  Comment


                    #10
                    I'm currently working on Google Cloud Messaging, which requires a quite big chunk of xml inside the Manifest:

                    Code:
                    <receiver android:name="com.epicgames.ue4.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
                    	<intent-filter>
                    		<action android:name="com.google.android.c2dm.intent.RECEIVE" />
                    		<category android:name="com.epicgames.ue4" />
                    	</intent-filter>
                    </receiver>
                    
                    <receiver
                    	android:name="com.epicgames.ue4.GcmTimeAlarm"
                    	android:process=":remote"
                    	android:permission="com.google.android.c2dm.permission.SEND" >
                    	<intent-filter>
                    		<action android:name="com.google.android.c2dm.intent.RECEIVE" />
                    		<category android:name="com.epicgames.ue4" />
                    	</intent-filter>
                    </receiver>
                    <service android:name="com.epicgames.ue4.GcmIntentService" />
                    It would be rather painful for adding it via Editor or UEDeployAndroid.cs. For now I disabled generation and I'm simply copying the Manifest.xml from Game/Build/Android. There should be such an option for users that prefers modifying Manifest by themselves rather than using generator.

                    By the way, iOS is suffering from the same problem with generating plist files.

                    Comment


                      #11
                      I know I'm bumping an old thread but I have some information to assist.

                      If you have UE4 write to the data folder on external sd or main storage instead of the UE4Engine folder read/write permission won't be required.

                      Unpopular Minion on the Play Store (Released: January 31, 2016)

                      Comment


                        #12
                        Originally posted by Distul View Post
                        I know I'm bumping an old thread but I have some information to assist.

                        If you have UE4 write to the data folder on external sd or main storage instead of the UE4Engine folder read/write permission won't be required.
                        Again bumping an old thread, but how exactly do you do that? I'd like to remove the need to for the external read/write permissions.

                        Comment


                          #13
                          Originally posted by jeevcat View Post
                          Again bumping an old thread, but how exactly do you do that? I'd like to remove the need to for the external read/write permissions.
                          Don't think it's possible without modifying the engine code.

                          Unpopular Minion on the Play Store (Released: January 31, 2016)

                          Comment


                            #14
                            After peeking through the source code for the manifest generation, it looks like there is an undocumented way to append things to your AndroidManifest.xml file.

                            You need to create another file called "ManifestRequirementsAdditions.txt" in your projects target build folder. For example, in my Build/Android/ManifestRequirementsAdditions.txt:

                            Code:
                            <supports-gl-texture android:name="GL_AMD_compressed_ATC_texture" />
                            Side note: this is great if you are like me and want to package out a bunch of different APKs in order to have smaller file sizes (instead of one huge APK + OBB with all of the texture compression formats). For more info on that:
                            https://developer.android.com/guide/...e-element.html
                            https://developer.android.com/google...iple-apks.html

                            Comment


                              #15
                              Android manifest is automatically generated as stated above. You can just use append in order to add stuff
                              Github - YouTube - Unreal Slackers - KITATUS

                              Comment

                              Working...
                              X