hawkinswnaf / shell-fork Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
1. What is this? fork is a "remote shell". It allows the user to remotely start a shell, manage jobs, and give input and take output from those jobs. This means that all jobs share fork as their parent and inherit its permissions which is great for Android applications that want to ask for SuperUser only once. All remote interactions with fork are done through fork's standard input and output. 1a. Job control All job control happens over standard I/O. Communication between a fork client and fork is done using an ASCII protocol: COMMAND:TAG:EXTRA: COMMAND: One of START, STOP, INPUT, KILL. START and STOP start and stop processes, respectively. INPUT gives input to a process. KILL kills fork itself. TAG: Identifies the process to be acted upon by the COMMAND. The TAG must be unique among currently running processes. TAGs can be reused once the associated process has finished. EXTRA: Only used by START and INPUT commands. For START commands, the EXTRA gives the command line to be executed to start a job. For INPUT commands, the EXTRA gives the actual input to be sent to the process' standard input. 1b. Job output All job output is doubly tagged by the output type and the process' tag. The output type is one of OUTPUT, DEBUG, and ERROR. Output tagged by DEBUG and ERROR is for debugging and error reporting, respectively. The Java API discards these messages as soon as they are received. Output tagged by OUTPUT is actual job output. After the OUTPUT tag, the job's tag is prepended to output and separated from the actual output with a ":". E.g., OUTPUT:GREP: asdfasdf OUTPUT:GREP: asdfasdf OUTPUT:PS: dddddddddd 2. API The user can interact with fork directly over standard I/O. However, there is an included Java API that hides most of the fork protocol from the user. See the associated JavaDoc for information on how to use that API. 3. Building Building fork itself is done with Make: make This puts the fork binary in the source code's root directory. Building the Java API is done with Ant: ant jar This puts Shell.jar in the source code's root directory. There are associated unit tests that can be build and run with Ant too: ant junit This builds the unit tests and executes them. Unit tests will take about 30 seconds to run. During that time, expect no output. All unit test output will be placed in a file in the source code's root directory (its filename is generated dynamically but will include the TEST- prefix).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.