Giter Club home page Giter Club logo

Comments (3)

M1cha avatar M1cha commented on June 27, 2024

I just saw that I can use:

Runtime.getRuntime().exec("su -c \"/path/to/binary\"");

I thought it would be more complicated since RootShell has a lot code to do this.

from roottools.

Stericson avatar Stericson commented on June 27, 2024

Hey,

Yep, it's that simple.

RootShell has a lot more code in it because it handles everything. It keeps the shell open, handles processing input and output, as well as making sure commands don't stay running too long and cause a ANR and it also handles keeping a long running process open by setting the command timeout to 0.

Rootshell technically also has support for multiple shells at one time (one root Shell, one normal shell, and one custom shell)

from roottools.

M1cha avatar M1cha commented on June 27, 2024

what I did might be interesting for RootTools, too.
I wrote a small binary called syscall_server which runs in the background all time and - as the name might suggest - allows you to execute syscall commands from stdin.

This way I can simply read/write files with custom input and output streams and I don't need to copy files to the app cache anymore.

Here's the C++ part: https://github.com/grub4android/external_syscallserver/blob/master/syscall_server.c
I didn't upload the java part yet, but the usage is as easy as: "new RootOutputStream(file);"

from roottools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.