- Home /
Handling Permissions in Unity Android while loading .so binary file
I am trying to load stockfish android binary for the android App.
``` string filepath = Application.persistentDataPath + "/" + "stockfish.android.armv7.so"; UnityEngine.Debug.Log(filepath); if (!File.Exists(filepath)) { WWW executable = new WWW("jar:file://" + Application.dataPath + "!/assets/" + "stockfish.android.armv7.so"); while (!executable.isDone) { } File.WriteAllBytes(filepath, executable.bytes);
//change permissions via plugin
}
var plugin = new AndroidJavaClass("com.DefaultCompany.NewUnityProject");
string command = "chmod 777 "+filepath;
var outPut = plugin.CallStatic<string>("ExecuteCommand",command);
UnityEngine.Debug.Log(outPut);
```
Stock fish location.
``` Assets/Plugins/Android/stockfish-10-armv7.so ```
stockfish location in Android build
``` /data/com.DefaultCompany.NewUnityProject/files/stockfish.android.armv7.so```
```
abd logcat log ```
The package:com.DefaultCompany.NewUnityProject is moved to foreground 02-06 23:23:49.953 14125 14125 D _V_GameModeManager: updateRunningPackage isGame = false, packageName = , id = -1 02-06 23:23:49.953 1377 6191 I _V_ABE : PowerEngineService enter the forgound 02-06 23:23:49.954 597 6373 E lsc_nvram: [do_mkdir] fail to mkdir [/data/vendor/shading_otp]: 13[Permission denied] (do_mkdir){#65:vendor/mediatek/proprietary/hardware/mtkcam/aaa/source/mt6765/lsc_mgr/LscUtil.h} 02-06 23:23:49.954 597 14231 E lsc_nvram: [do_mkdir] fail to mkdir [/data/vendor/shading_otp]: 13[Permission denied] (do_mkdir){#65:vendor/mediatek/proprietary/hardware/mtkcam/aaa/source/mt6765/lsc_mgr/LscUtil.h}
```
Any ideas for handling such case will be helpful. Thanks in Advance
Can you please reformate the question to forum style, discord not working here.
I think markdown not working here
Your answer
Follow this Question
Related Questions
does unity 5.3 android sms billing status require configuration changes ? 0 Answers
How to ask for permissions in Android for communicating with stockfish binary in Unity 0 Answers
Changing Write Access when game already published 1 Answer
Can't Read CSV from Download Folder in Android Device (C# Unity) 1 Answer
Unity 5.1 adds permission READ_PHONE_STATE automatically 1 Answer