Playmaker Forum

PlayMaker Feedback => Feature Requests => Topic started by: PlaymakerNOOB on August 04, 2015, 11:04:02 PM

Title: Android Permissions Guide
Post by: PlaymakerNOOB 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.
Title: Re: Android Permissions
Post by: djaydino 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?
Title: Re: Android Permissions
Post by: Alex Chouls 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...


Title: Re: Android Permissions
Post by: clandestine 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.
Title: Re: Android Permissions
Post by: PlaymakerNOOB 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
Title: Re: Android Permissions Guide
Post by: PlaymakerNOOB on August 07, 2015, 11:06:55 PM
Fixed, see top post.
Title: Re: Android Permissions Guide
Post by: clandestine on August 08, 2015, 04:19:40 AM
I dont have a PlayMaker folder in the Plugins folder?
Title: Re: Android Permissions Guide
Post by: PlaymakerNOOB 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.
Title: Re: Android Permissions
Post by: Alex Chouls 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.
Title: Re: Android Permissions Guide
Post by: clandestine on August 08, 2015, 12:41:18 PM
Yay!!! Thanks!
Title: Re: Android Permissions
Post by: clandestine 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
Title: Re: Android Permissions Guide
Post by: Wrensey 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