[SOLVED] How to set android permissions?

dareek

  • Posts: 91
Android's App info shows that the app I created in Stencyl can access the following on the device:
  • full network access
  • Google Play billing service
  • view network connections
  • control vibration
  • prevent tablet from sleeping
Preventing from sleeping is fine, but I don't need the rest.
How to get rid of unwanted permissions?

« Last Edit: April 18, 2014, 06:36:25 pm by dareek »

dareek

  • Posts: 91
I think I found somewhat related info that pointed to ../Export/android/bin/AndroidManifest.xml file.
There are lines in that file that have to do something with android permissions,

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

but every time I cut out the code (I am not a programmer so I might be terribly wrong doing that),
after testing the app again, the lines are back in it's place and the app still needs all the permissions.

Anyone have any idea where to look for the solution, please?

rob1221

  • *
  • Posts: 9472
In your Stencyl installation folder, open up
plaf\haxe\lib\openfl-native\1,1,4\templates\android\template\AndroidManifest.xml.

dareek

  • Posts: 91
When I click on the folder, yes, I can open it in the file manager.
I am able to create and delete files in the folder.
The AndroidManifest.xml is set to be read, written and executed.

Edit:
This file is more cryptic than the other one with HTML like instructions I mentioned above.
I don't see any permission.INTERNET, permission.VIBRATE, permission.ACCESS_NETWORK_STATE.

I see
Code: [Select]
::if (ANDROID_PERMISSIONS != null)::::foreach ANDROID_PERMISSIONS::
<uses-permission android:name="::__current__::" />::end::::end::

but have no idea what I could do with that
:(


« Last Edit: April 18, 2014, 05:37:18 pm by dareek »

rob1221

  • *
  • Posts: 9472
OpenFL replaces that code with the actual permission lines.  Try commenting those lines out and adding whatever permissions you need.

dareek

  • Posts: 91
After commenting out
Code: [Select]
# ::if (ANDROID_PERMISSIONS != null)::::foreach ANDROID_PERMISSIONS::
# <uses-permission android:name="::__current__::" />::end::::end::
#
# ::if (ENV_ANDROID_PURCHASES=="YES")::
# <uses-permission android:name="com.android.vending.BILLING" />
# ::end::

and running Test Game again, nothing changed. Android shows that app still needs all the permissions.
Maybe I should clean the project and than compile the thing again?

rob1221

  • *
  • Posts: 9472
Comments in XML start with <!-- and end with -->.

dareek

  • Posts: 91
Commenting out (this time for real with <!--  -->) did the trick.   
Not even one permission needed by the app. :D
Thanks!

Not a straightforward way to set a permissions, but I will sign this as solved.

« Last Edit: April 18, 2014, 06:39:05 pm by dareek »