Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run command synchronously? #109

Open
RHSaliya opened this issue Feb 7, 2021 · 0 comments
Open

How to run command synchronously? #109

RHSaliya opened this issue Feb 7, 2021 · 0 comments

Comments

@RHSaliya
Copy link

RHSaliya commented Feb 7, 2021

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.

@RHSaliya RHSaliya changed the title How to run command synchronously? How to run command asynchronously? Feb 7, 2021
@RHSaliya RHSaliya changed the title How to run command asynchronously? How to run command synchronously? Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@RHSaliya and others