Access denied (0x80004005) on Process.Start () in the Android application

When I try to start a new process, it finds the file to execute (as before, it threw another exception), but throws a denial of access to the exception. There is a similar problem here, but only part of the rights and permissions makes sense to me from the answers, which may be the problem. It was also an idea not to set RedirectStandardOutput to true to detect an error, so I disabled this line. Do I need special permissions, manifest entries, or something similar to enable the start of a new process from my Android application?

This is my code:

try
{
    string strToFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), fileName = "stockfish-8-armeabi-v7a";

    ProcessStartInfo psi = new ProcessStartInfo();
    psi.FileName = System.IO.Path.Combine(strToFolder, fileName);
    psi.UseShellExecute = false;
    psi.CreateNoWindow = true;
    psi.WorkingDirectory = strToFolder;
    //psi.RedirectStandardOutput = true;
    //psi.RedirectStandardError = true;

    stockfishProcess = new System.Diagnostics.Process();
    stockfishProcess.StartInfo = psi;
    stockfishProcess.Start();
}
catch (Exception e)
{
    string estr = e.ToString();
    initialized = false;
}

And this is the exception text

System.ComponentModel.Win32Exception (0x80004005): ApplicationName = '/data/user/0/AlienChessAndroid.AlienChessAndroid/files/stockfish-8-armeabi-v7a', CommandLine = '', CurrentDirectory = '///0/AlienChessAndroid.AlienChessAndroid/', = System.Diagnostics.Process.StartWithCreateProcess(System.Diagnostics.ProcessStartInfo startInfo) [0x0018b] /Users/builder/data/lanes/ 4009/3a62f1ea/source/mono/mcs/class/System/System.Diagnostics/Process.cs:737

+4
2

, . .

string[] cmd = { "chmod", "744", Path.Combine(strToFolder, fileName) };
Java.Lang.Runtime.GetRuntime().Exec(cmd);

, .

+2

, , , , . java (stockfish-8-armeabi-v7a).
, ( PInvoke).

.

0

Source: https://habr.com/ru/post/1678434/


All Articles