Skip to content

JuneTwooo/cordova-plugin-shell-exec-ROOT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-shell-exec

Apache Cordova Plugin to Execute Root Commands Android in Smartphone's Operating System Shell.

This is a MODIFIED version of https://github.com/petervojtek/cordova-plugin-shell-exec to be complatible with all commands formats without using arrays.
See Useage and Examples
Note: All Commands Excutes in Root Mode at the moment, this can be modified later.

Supported Platforms

  • Android

Installation

$ cordova plugin add https://github.com/Poyser1911/cordova-plugin-shell-exec.git

Usage

window.ShellExec.exec(cmd, callback);

cmd : String.

callback : function will return a object with two keys - exitStatus and output.

Examples: "Quotes Around Path are optional"

var cmd = 'ls';
cmd = 'ls /data';
cmd = 'ls "/data/system\ prefs""; //escaped Whitespace

cmd = 'ls && ls /data && cp "/data/data/com.example.app" "/data/data/com.example.app2" && rm -r -f  "/data/data/com.example.app2"'; //Using &&
window.ShellExec.exec(cmd, (res) =>{
  alert('exit status: ' + res.exitStatus)
  alert('cmd output: ' + res.output)
})

Alerts Result Preview

alt text

alt text

Alerts Result IFError Preview

alt text


About

Shell Exec pour root (android)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 92.5%
  • JavaScript 7.5%