Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-iroot

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-iroot - npm Package Compare versions

Comparing version 0.8.1 to 2.0.1

src/android/de/cyberkatze/iroot/Constants.java

16

CHANGELOG.md

@@ -5,2 +5,18 @@ # Cordova Jailbreak/Root Detection Plugin

### v2.0.0
**BREAKING CHANGES**:
- remove nodeJS stuff
- remove cordova hooks
- remove `ENABLE_BUSYBOX_CHECK` plugin preference
- remove `isRootedRedBeerWithoutBusyBoxCheck` function
- add new internal checks
- add simple emulator check
- add simple magisk check (full implementation will be finished soon in `rootbeer` library)
- update documentation / Typings
- update gradle configuration
- bump `rootbeer` from 0.0.7 to 0.0.8
### v0.7.0-0.8.0

@@ -7,0 +23,0 @@

2

package.json
{
"name": "cordova-plugin-iroot",
"version": "0.8.1",
"version": "2.0.1",
"description": "Cordova Jailbreak/Root Detection Plugin for Apache Cordova",

@@ -5,0 +5,0 @@ "types": "./types/index.d.ts",

@@ -1,4 +0,6 @@

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/WuglyakBolgoink/cordova-plugin-iroot/master/LICENSE)
[![Android](https://img.shields.io/badge/android-success-green.svg)](https://shields.io)
[![iOS](https://img.shields.io/badge/iOS-success-green.svg)](https://shields.io)
![version][version-shield]
[![Android][android-shield]][cordova-android-link]
[![iOS][ios-shield]][cordova-ios-link]
[![License][license-shield]](LICENSE)
[![BuyMeCoffee][buymecoffee-shield]][buymecoffee-link]

@@ -12,3 +14,3 @@ <p align="center">

Use this plugin to add an extra layer of security for your app by detecting if the device was `root`ed (android) or `jailbreak`ed (iOS).
Use this plugin to add an extra layer of security for your app by detecting if the device was `root`ed (on android) or `jailbreak`ed (on iOS).

@@ -18,12 +20,21 @@ ## Install

```
cordova plugin add cordova-plugin-iroot --save
cordova plugin add cordova-plugin-iroot
```
### Custom `Android` Install to prevent [False positives](https://github.com/scottyab/rootbeer#false-positives) checks
## postInstall
You can use `ENABLE_BUSYBOX_CHECK` variable to change the logic. By default is `true`.
### iOS
To avoid errors like
> -canOpenURL: failed for URL: "cydia://package/com.example.package" - error: "This app is not allowed to query for scheme cydia"
don’t forget to add `"cydia"` in `LSApplicationQueriesSchemes` key of `info.plist`. Otherwise `canOpenURL` will always return `false`.
```xml
<key>LSApplicationQueriesSchemes</key>
<array>
<string>cydia</string>
</array>
```
cordova plugin add cordova-plugin-iroot --variable ENABLE_BUSYBOX_CHECK=false --save
```

@@ -37,6 +48,3 @@ ## Usage in Javascript

// available => Android
IRoot.isRootedRedBeer(successCallback, failureCallback);
// available => Android
IRoot.isRootedRedBeerWithoutBusyBoxCheck(successCallback, failureCallback);
IRoot.isRootedWithBusyBox(successCallback, failureCallback);
```

@@ -52,12 +60,10 @@

- **iOS**
- [cordova-plugin-jailbreak-detection](https://github.com/leecrossley/cordova-plugin-jailbreak-detection)
- [Shmoopi Anti-Piracy](https://github.com/Shmoopi/AntiPiracy)
- [cordova-plugin-jailbreak-detection](https://github.com/leecrossley/cordova-plugin-jailbreak-detection)
- [Shmoopi Anti-Piracy](https://github.com/Shmoopi/AntiPiracy)
- **Android**
- [RootBeer](https://github.com/scottyab/rootbeer/blob/master/README.md)
- [cordova-plugin-root-detection](https://github.com/trykovyura/cordova-plugin-root-detection)
- [RootBeer](https://github.com/scottyab/rootbeer/blob/master/README.md)
- [cordova-plugin-root-detection](https://github.com/trykovyura/cordova-plugin-root-detection)
- **Articles**
- [Android Root Detection Techniques](https://blog.netspi.com/android-root-detection-techniques/)
## Demo ionic
See [comments](https://github.com/WuglyakBolgoink/cordova-plugin-iroot/issues/1).
## Contributing

@@ -71,25 +77,35 @@

## License
## ToDo's
MIT License
1. Cyanogenmod.superuser
> If the Cyanogenmod ROM is installed, the cyanogenmod.superuser activity may be in the com.android.settings package.
> This can be detected by listing the activities within com.android.settings.
2. Su
> Execute su and then id to check if the current user has a uid of 0 or if it contains (root).
> shell@android:/ $ su
> shell@android:/ # id
> uid=0(root) gid=0(root) groups=1003(graphics),1004(input),1007(log),1009(mount),1011(adb),1015(sdcard_rw),1028(sdcard_r)
3. Busybox
> If a device has been rooted, more often then not Busybox has been installed as well.
> Busybox is a binary that provides many common linux commands. Running Busybox is a good indication that a device has been rooted.
> root@android:/ # busybox df
> Filesystem 1K-blocks Used Available Use% Mounted on
> tmpfs 958500 32 958468 0% /dev
> tmpfs 958500 0 958500 0% /mnt/secure
> tmpfs 958500 0 958500 0% /mnt/asec
> tmpfs 958500 0 958500 0% /mnt/obb
4. Check library
- https://github.com/Stericson/RootTools/tree/master/src/main/java/com/stericson/RootTools
Copyright (c) 2017 Wuglyak Bolgoink
[license-shield]:https://img.shields.io/github/license/WuglyakBolgoink/cordova-plugin-iroot?style=flat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
[buymecoffee-link]: https://www.buymeacoffee.com/aesaythx?style=flat
[buymecoffee-shield]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?style=flat
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
[version-shield]: https://img.shields.io/github/package-json/v/WuglyakBolgoink/cordova-plugin-iroot?color=green
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
[android-shield]: https://img.shields.io/badge/cordova-android-green.svg?style=flat&logo=apache-cordova
[cordova-android-link]: https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html
[ios-shield]: https://img.shields.io/badge/cordova-ios-green.svg?style=flat&logo=apache-cordova
[cordova-ios-link]: https://cordova.apache.org/docs/en/latest/guide/platforms/ios/index.html
/**
* This plugin defines a global IRoot object, which allow you to check if your device was rooted/jailbrocken.
* This plugin defines a global "IRoot" object, which allow you to check if your device was rooted/jailbrocken.
* Although the object is in the global scope, it is not available until after the deviceready event.
*/
interface IIRoot {
interface IRootPlugin {
isRooted(onSuccess: (boolean) => void, onError: (any) => void): void;
isRootedRedBeer(onSuccess: (boolean) => void, onError: (any) => void): void;
isRootedRedBeerWithoutBusyBoxCheck(onSuccess: (boolean) => void, onError: (any) => void): void;
isRootedWithBusyBox(onSuccess: (boolean) => void, onError: (any) => void): void;
}
declare var IRoot: IIRoot;
declare var IRoot: IRootPlugin;

@@ -7,8 +7,5 @@ var exec = require('cordova/exec');

},
isRootedRedBeer: function(onSuccess, onError) {
exec(onSuccess, onError, 'IRoot', 'isRootedRedBeer', []);
},
isRootedRedBeerWithoutBusyBox: function(onSuccess, onError) {
exec(onSuccess, onError, 'IRoot', 'isRootedRedBeerWithoutBusyBox', []);
isRootedWithBusyBox: function(onSuccess, onError) {
exec(onSuccess, onError, 'IRoot', 'isRootedWithBusyBox', []);
}
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc