libsuperuser
libsuperuser copied to clipboard
How to run command synchronously?
I want to run command libsupeuser library to access values after some actions are performed how can I do that?
Example:
private final Shell.Interactive su = new Shell.Builder().useSU().open();
su.addCommand("command", 0, (Shell.OnCommandResultListener2) (commandCode, exitCode, STDOUT, STDERR) -> {
someBoolean = STDOUT.size() > 0;
});
return someBoolean;
here value of someBoolean is returned before it is evaluated.