Shared Object File Execution

I have licpuminer.so in the res / raw folder.

String libFile = "android.resource://com.example.suraj.myapplication/raw";
String url = "abc.com";
String user = "user";
String password = "pass";
Boolean isNeon = false;

try {
    String str = libFile;
    str = new StringBuilder(String.valueOf(isNeon ? new StringBuilder(String.valueOf(str)).append("/libcpuminerNEON.so ").toString() : new StringBuilder(String.valueOf(str)).append("/libcpuminer.so ").toString())).append("--algo=scrypt  -o ").append(url).append(" -u ").append(user).append(" -p ").append(password).append(" -t ").append(thread).toString();
            Process process = Runtime.getRuntime().exec(str, new String[]{"LD_LIBRARY_PATH=" + libFile + ":$LD_LIBRARY_PATH"}, new File(libFile));
            Log.e("errorE", str);
            Log.e("errorE", process.getClass().getName());

        } catch (Exception e) {
            e.printStackTrace();
            Log.e("errorE", "error");
        }
    }

I get

java.io.IOException: Error executing exec () Cause: java.io.IOException: No such file or directory

+4
source share

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


All Articles