{"id":14008457,"url":"https://github.com/d4rken/RxShell","last_synced_at":"2025-07-24T03:32:46.753Z","repository":{"id":37664703,"uuid":"110054572","full_name":"d4rken/RxShell","owner":"d4rken","description":"Easy shell access for Android apps using RxJava.","archived":false,"fork":false,"pushed_at":"2022-12-10T17:38:13.000Z","size":349,"stargazers_count":286,"open_issues_count":3,"forks_count":75,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-05-19T20:11:23.541Z","etag":null,"topics":["android","root","rxjava","shell"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d4rken.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://www.buymeacoffee.com/tydarken"]}},"created_at":"2017-11-09T02:04:54.000Z","updated_at":"2025-05-13T23:00:12.000Z","dependencies_parsed_at":"2023-01-26T07:01:10.024Z","dependency_job_id":null,"html_url":"https://github.com/d4rken/RxShell","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/d4rken/RxShell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rken%2FRxShell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rken%2FRxShell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rken%2FRxShell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rken%2FRxShell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d4rken","download_url":"https://codeload.github.com/d4rken/RxShell/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rken%2FRxShell/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266789225,"owners_count":23984252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","root","rxjava","shell"],"created_at":"2024-08-10T11:01:41.694Z","updated_at":"2025-07-24T03:32:46.268Z","avatar_url":"https://github.com/d4rken.png","language":"Java","readme":"# RxShell\n\n![Build](https://github.com/d4rken/RxShell/actions/workflows/android.yml/badge.svg)\n[ ![Download](https://jitpack.io/v/d4rken/rxshell.svg)](https://jitpack.io/#d4rken/rxshell)\n[ ![Coverage Status](https://coveralls.io/repos/github/d4rken/RxShell/badge.svg?branch=master)](https://coveralls.io/github/d4rken/RxShell?branch=master)\n\nA library that helps your app interact with shells on Android.\n\n## Quickstart\nInclude the library in your modules `build.gradle` file:\n```groovy\nimplementation 'eu.darken.rxshell:\u003cinsert-latest-release\u003e'\n```\n\nNow your project is ready to use the library, let's quickly talk about a few core concepts:\n\n1. You construct a shell using `RxCmdShell.builder()`.\n2. The shell has to be opened before use (`shell.open()`), which will launch the process and give you a `RxCmdShell.Session` to work with.\n3. Build your commands with `Cmd.builder(\"your command\")`.\n4. Commands are run with `session.submit(command)`, `cmd.submit(session)` or `cmd.execute(session)`.\n5. Remember to `close()` the session to release resources.\n\n### Examples\n#### Single-Shot execution\nIf you pass a shell builder to the command it will be used for a single shot execution.\n\nA shell is created and opened, used and closed.\n\n`Cmd.execute(...)` is shorthand for `Cmd.submit(...).blockingGet()`, so don't run it from a UI thread.\n\n```java\nCmd.Result result = Cmd.builder(\"echo hello\").execute(RxCmdShell.builder());\n```\n\n#### Reusing a shell\nIf you want to issue multiple commands, you can reuse the shell which is faster and uses less resources.\n\n```java\nRxCmdShell.Session session = RxCmdShell.builder().build().open().blockingGet();\n// Blocking\nCmd.Result result1 = Cmd.builder(\"echo straw\").execute(session);\n// Async\nCmd.builder(\"echo berry\").submit(session).subscribe(result -\u003e Log.i(\"ExitCode: \" + result.getExitCode()));\nshell.close().blockingGet();\n```\n\nThe default shell process is launched using `sh`, if you want to open a root shell (using `su`) tell the ShellBuilder!\n```java\nCmd.Result result = Cmd.builder(\"echo hello\").execute(RxCmdShell.builder().root(true));\n```\n\n#### Checking root access\n```java\n// General info\nnew RootContext.Builder(getContext()).build().subscribe(c -\u003e {/* c.getRoot().getState() */});\n// Just root state\nRoot root = new Root.Builder().build().blockingGet();\nif(root.getState() == Root.State.ROOTED) /* yay */\n\n```\n\n## Used by\n* [SD Maid](https://github.com/d4rken/sdmaid-public), which was also the motivation for this library.\n\n## Alternatives\nWhile this is obviously :^) the best library, there are alternatives you could be interested in:\n\n* [@Chainfire's](https://twitter.com/ChainfireXDA) [libsuperuser](https://github.com/Chainfire/libsuperuser)\n* [@SpazeDog's](https://github.com/SpazeDog) [rootfw](https://github.com/SpazeDog/rootfw)\n* [@topjohnwu's](https://twitter.com/topjohnwu) [libsu](https://github.com/topjohnwu/libsu)\n","funding_links":["https://www.buymeacoffee.com/tydarken"],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4rken%2FRxShell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd4rken%2FRxShell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4rken%2FRxShell/lists"}