playMaker

Author Topic: Android Permissions Guide  (Read 10974 times)

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 219
Android Permissions Guide
« on: August 04, 2015, 11:04:02 PM »
This post is edited to contain only useful information:

Manual identification and removal of scripts that trigger specific permissions.

Please be aware that having "Android Development" checked, enables Full Network Access and Modify/Delete the contents of your USB storage"

-"Control Vibration" - Remove:
-DeviceVibrate.cs

-"Precise Location (GPS and Network-Based)" - Remove:
-GetLocationInfo.cs
-ProjectLocationToMap.cs
-StartLocationServicesUpdate.cs
-StopLocationServicesUpdate.cs

-"Network Access" - Thanks to Alex for his help in identification with this.

In the project tab of Unity, locate:  Plugins\PlayMaker\WebGL\PlayMaker.dll and ensure that WebGL and Android both have checkmarks (nothing else should have checkmarks).  Then click Apply.

In the project tab of Unity, locate:  Plugins\PlayMaker\PlayMaker.dll and remove the checkmark from Android.  Then click Apply.

Click File, Build Settings, click Player settings, Other settings, In Scripting Define Symbols enter "UNITY_WEBGL", press enter.  File, Save Project.  Then build your unity project

Please note the following caveats with Networking: 
1) Due to a bug in Unity 5.1, you cannot remove permissions at all, unless you edit the android manifest.xml post Unity3d. Downgrading to 5.0.4 works.
2) Downgrading is easy, download 5.0.4 here:  http://unity3d.com/get-unity/download/archive, backup your project, open it with 5.0.4 and it will "recompile" but it will work.


-"Prevent Phone from Sleeping" - I haven't located the offending scripts, but its somewhere in the actions folder.  Deleted all scripts in actions folder and it went away.  I originally thought it was GetiPhoneSetting.cs and  ApplicationRunInBackground.cs but apparently there is more.  This permission doenst bother me enough spend tons of time identifying it, but I did narrow it down to the following actions:  Remove all actions that start with A and B, Sleep, flicker, usegravity, remove actions that start with Get, Remove all action that starts with Set, is kinematic, is sleeping, mouselook2, removemixing, rewind animation, stop animation, wakeup, setanimationFOV and everything itween.
« Last Edit: August 10, 2015, 11:02:16 AM by PlaymakerNOOB »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Android Permissions
« Reply #1 on: August 05, 2015, 04:53:50 AM »
Hi,
i think the best way for this is to leave those actions out and set them as "add-ons"
in the welcome screen, or make an option menu for android to disable/remove them.

btw does ios or other platforms have permissions or something similar?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Android Permissions
« Reply #2 on: August 05, 2015, 09:15:04 AM »
The default PlayMaker.dll includes Unity networking calls. To remove these use the WebGL PlayMaker.dll (Plugins\PlayMaker\WebGL\PlayMaker.dll). This version removes Unity networking calls.

Use the Plugin Importer Settings to use this dll on Android:

- Uncheck Android in Plugins\PlayMaker\PlayMaker.dll
- Check Android in Plugins\PlayMaker\WebGL\PlayMaker.dll

Also in Player Settings > Other Settings > Scripting Define Symbols add this:
UNITY_WEBGL

This will compile networking calls out of actions.

I plan to make this easier to manage in the 1.8.x cycle with some tools and/or scripting defines...



clandestine

  • Sr. Member
  • ****
  • Posts: 255
    • ЯKD.ZONE
Re: Android Permissions
« Reply #3 on: August 06, 2015, 09:37:37 AM »
Hey Alex, is this for Unity 5? I cant find the DLLs in the folder you suggested.
I'm using Unity 4.5.2f1 Pro with PM 1.7.7.f6.

Thanks in advance.

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 219
Re: Android Permissions
« Reply #4 on: August 07, 2015, 10:43:27 AM »
@Clandestine, I remember seeing it in pre 1.7.8 versions, so I imagine its good too


@Alex, it does not appear to be working for me, unless I am doing something wrong.

Below are the steps I took.

In the project tab of Unity, locate:  Plugins\PlayMaker\WebGL\PlayMaker.dll and ensure that WebGL and Android both have checkmarks (nothing else should have checkmarks).  Then click Apply.

In the project tab of Unity, locate:  Plugins\PlayMaker\PlayMaker.dll and remove the checkmark from Android.  Then click Apply.

Click File, Build Settings, click Player settings, Other settings, In Scripting Define Symbols enter "UNITY_WEBGL", press enter.  File, Save Project.

Deleted Network folder from Playmaker\Actions
Deleted wwwObject from Playmaker\Actions

Still getting network permissions
« Last Edit: August 07, 2015, 02:44:44 PM by PlaymakerNOOB »

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 219
Re: Android Permissions Guide
« Reply #5 on: August 07, 2015, 11:06:55 PM »
Fixed, see top post.

clandestine

  • Sr. Member
  • ****
  • Posts: 255
    • ЯKD.ZONE
Re: Android Permissions Guide
« Reply #6 on: August 08, 2015, 04:19:40 AM »
I dont have a PlayMaker folder in the Plugins folder?

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 219
Re: Android Permissions Guide
« Reply #7 on: August 08, 2015, 08:48:48 AM »
It appears playmaker may not be installed or its folders have been moved/deleted.  A fresh unpacking should look like this image.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Android Permissions
« Reply #8 on: August 08, 2015, 12:40:00 PM »
Hey Alex, is this for Unity 5? I cant find the DLLs in the folder you suggested.
I'm using Unity 4.5.2f1 Pro with PM 1.7.7.f6.

Thanks in advance.

Yes, the plugin importer settings are new in Unity 5.

In Unity 4.x do this instead:
- Import PlayMaker\Versions\PlayMakerNACL.unitypackage
- Player Settings > Other Settings > Scripting Define Symbols: UNITY_NACL

This will strip networking from Playmaker.

clandestine

  • Sr. Member
  • ****
  • Posts: 255
    • ЯKD.ZONE
Re: Android Permissions Guide
« Reply #9 on: August 08, 2015, 12:41:18 PM »
Yay!!! Thanks!

clandestine

  • Sr. Member
  • ****
  • Posts: 255
    • ЯKD.ZONE
Re: Android Permissions
« Reply #10 on: August 11, 2015, 10:52:02 AM »
Yes, the plugin importer settings are new in Unity 5.

In Unity 4.x do this instead:
- Import PlayMaker\Versions\PlayMakerNACL.unitypackage
- Player Settings > Other Settings > Scripting Define Symbols: UNITY_NACL

This will strip networking from Playmaker.

I did everything like so, but the android build still wants network access.. hmm

Wrensey

  • Playmaker Newbie
  • *
  • Posts: 23
Re: Android Permissions Guide
« Reply #11 on: March 31, 2021, 06:54:46 PM »
necroing this thread to ask if anyone knows what playmaker action(s) "android.permission.RECORD_AUDIO" could be connected to, if any?

Edit, nevermind this unity thread help me remove the unwanted permissions from my build:
https://answers.unity.com/questions/663197/how-to-prevent-unity-from-adding-permissions-to-an.html
« Last Edit: March 31, 2021, 09:50:18 PM by Wrensey »
Follow me on twitter!