https://github.com/raederdev/cordova-plugin-root
Cordova plugin to detect, request and use superuser permissions on Android devices.
https://github.com/raederdev/cordova-plugin-root
Last synced: about 2 months ago
JSON representation
Cordova plugin to detect, request and use superuser permissions on Android devices.
- Host: GitHub
- URL: https://github.com/raederdev/cordova-plugin-root
- Owner: RaederDev
- License: mit
- Created: 2016-11-10T16:04:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-10T22:05:31.000Z (over 9 years ago)
- Last Synced: 2024-10-18T23:14:20.788Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 3.91 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.');
});
```