GitXplorerGitXplorer
R

cordova-plugin-root

public
3 stars
1 forks
1 issues

Commits

List of commits on branch master.
Unverified
a6c41bf7d55b66fd7166a119bb658cec4bdb9b6d

Merge branch 'release/1.0.0'

RRaederDev committed 8 years ago
Unverified
21e9f996d348eb7e566dcc6cac213c9046a3b804

update name

RRaederDev committed 8 years ago
Unverified
1e8d945f23930766e5c24dc1a2b0e073de35daf6

update documentation and add package json for NPM

RRaederDev committed 8 years ago
Unverified
c2de7f412f6c59d7d3dcc57ba7ca2f1b5bf16922

create first plugin version

RRaederDev committed 8 years ago
Unverified
a6d49f536d617a538191927282ba274a0740bda5

Initial commit

RRaederDev committed 8 years ago

README

The README file for this repository.

cordova-plugin-root

Detect, request and use superuser permissions on Android devices.

Installation

Cordova:

cordova plugin add cordova-plugin-root

Ionic:

ionic plugin add cordova-plugin-root

Usage

isAvailable

Checks if SU functionality is available. Note that THIS WILL OPEN A SU PERMISSION POPUP.

root.isAvailable(function(res) {
    if(res)
        console.log("SU access is available and granted");
    else
        console.log("SU access was denied or is not available");
}, function() {
    console.error('An error occoured while checking for SU availability');
});

run

Executes the given command as root.
Please note that the fail callback will not always be executed.
You should manually verify that the command you issued actually worked.

root.run('whoami', function(res) {
    console.log(res); //['root']
}, function() {
    console.error('An error occoured while executing the command.');
});