All Projects → d4rken → Rxshell

d4rken / Rxshell

Licence: apache-2.0
Easy shell access for Android apps using RxJava.

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Rxshell

Youtubeextractor
A helper to extract the metadata, including streaming video Urls from a YouTube video
Stars: ✭ 170 (-10.05%)
Mutual labels:  rxjava
Httprequest
基于Retrofit2+RxJava2+OkHttp3的网络请求框架,可以完美的应用到组件化、MVP模式等项目中
Stars: ✭ 181 (-4.23%)
Mutual labels:  rxjava
Cookman
一款菜谱查询工具Android APP
Stars: ✭ 186 (-1.59%)
Mutual labels:  rxjava
Fountain
Android Kotlin paged endpoints made easy
Stars: ✭ 175 (-7.41%)
Mutual labels:  rxjava
Mvvm Architecture Android Beginners
This repository contains a sample app that implements MVVM architecture using Kotlin, ViewModel, LiveData, and etc.
Stars: ✭ 176 (-6.88%)
Mutual labels:  rxjava
Rxpermission
Reactive permissions for Android
Stars: ✭ 182 (-3.7%)
Mutual labels:  rxjava
Jreadhub
Readhub Android 客户端——官网 : https://readhub.cn
Stars: ✭ 168 (-11.11%)
Mutual labels:  rxjava
Androidgeek
"Android Geek(Android极客)"一个专门为Android程序猿打造的极客应用。主要包括: 干货笔记、GitHub Trending、密码管理 .......
Stars: ✭ 187 (-1.06%)
Mutual labels:  rxjava
Rxjava Spring Boot Starter
RxJava Spring MVC integration
Stars: ✭ 180 (-4.76%)
Mutual labels:  rxjava
Cartoon
漫画软件——使用MVP + Retrofit + RxJava开发
Stars: ✭ 186 (-1.59%)
Mutual labels:  rxjava
Disposer
Easily dispose rxJava streams with Android's Lifecycle
Stars: ✭ 176 (-6.88%)
Mutual labels:  rxjava
Socialloginmanager
DEPRECATED
Stars: ✭ 178 (-5.82%)
Mutual labels:  rxjava
Materialistic
A material-design Hacker News Android reader
Stars: ✭ 2,163 (+1044.44%)
Mutual labels:  rxjava
Reactivebeacons
Android library scanning BLE beacons nearby with RxJava
Stars: ✭ 171 (-9.52%)
Mutual labels:  rxjava
Reactivewifi
Android library listening available WiFi Access Points and related information with RxJava Observables
Stars: ✭ 186 (-1.59%)
Mutual labels:  rxjava
Projectx
This repository might be a starting point for building Android interview tasks. There is also providing a basic sample template based on layered architecture using Dagger2 and Architecture Components.
Stars: ✭ 169 (-10.58%)
Mutual labels:  rxjava
Rxbus
Event Bus By RxJava.
Stars: ✭ 2,126 (+1024.87%)
Mutual labels:  rxjava
Javawebsocketclient
RxJava WebSocket library for Java and Android
Stars: ✭ 188 (-0.53%)
Mutual labels:  rxjava
Rootpy
A pythonic interface for the ROOT libraries on top of the PyROOT bindings.
Stars: ✭ 186 (-1.59%)
Mutual labels:  root
Androidbasemvp
🚀一个快速搭建MVP+RxJava2+Retrofit 基础框架,主要是封装有Http网络请求、日志、缓存、加载等待、toast、页面状态布局管理、权限、RxBus、Glide图片加载等组件,方便快速开发新项目、减少开发成本。
Stars: ✭ 184 (-2.65%)
Mutual labels:  rxjava

RxShell

Build Status Download Coverage Status

A library that helps your app interact with shells on Android.

Quickstart

Include the library in your modules build.gradle file:

implementation 'eu.darken.rxshell:core:<insert-latest-release>'
implementation 'eu.darken.rxshell:root:<insert-latest-release>' // For root related extensions

Now your project is ready to use the library, let's quickly talk about a few core concepts:

  1. You construct a shell using RxCmdShell.builder().
  2. The shell has to be opened before use (shell.open()), which will launch the process and give you a RxCmdShell.Session to work with.
  3. Build your commands with Cmd.builder("your command").
  4. Commands are run with session.submit(command), cmd.submit(session) or cmd.execute(session).
  5. Remember to close() the session to release resources.

Examples

Single-Shot execution

If you pass a shell builder to the command it will be used for a single shot execution.

A shell is created and opened, used and closed.

Cmd.execute(...) is shorthand for Cmd.submit(...).blockingGet(), so don't run it from a UI thread.

Cmd.Result result = Cmd.builder("echo hello").execute(RxCmdShell.builder());

Reusing a shell

If you want to issue multiple commands, you can reuse the shell which is faster and uses less resources.

RxCmdShell.Session session = RxCmdShell.builder().build().open().blockingGet();
// Blocking
Cmd.Result result1 = Cmd.builder("echo straw").execute(session);
// Async
Cmd.builder("echo berry").submit(session).subscribe(result -> Log.i("ExitCode: " + result.getExitCode()));
shell.close().blockingGet();

The default shell process is launched using sh, if you want to open a root shell (using su) tell the ShellBuilder!

Cmd.Result result = Cmd.builder("echo hello").execute(RxCmdShell.builder().root(true));

Checking root access

// General info
new RootContext.Builder(getContext()).build().subscribe(c -> {/* c.getRoot().getState() */});
// Just root state
Root root = new Root.Builder().build().blockingGet();
if(root.getState() == Root.State.ROOTED) /* yay */

Used by

  • SD Maid, which was also the motivation for this library.

Alternatives

While this is obviously :^) the best library, there are alternatives you could be interested in:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].