1.0.11 • Published 5 years ago
react-native-jail-root v1.0.11
react-native-jail-root
Getting started
$ npm install react-native-jail-root --save
Mostly automatic installation
$ react-native link react-native-jail-root
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-jail-root
and addRNJailRoot.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNJailRoot.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNJailRootPackage;
to the imports at the top of the file - Add
new RNJailRootPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-jail-root' project(':react-native-jail-root').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-jail-root/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-jail-root')
Usage
Soon it will be available for iOS
import RNJailRoot from 'react-native-jail-root';
...
const checkJB = async () => {
if (Platform.OS === 'android') {
await RNJailRoot.check();
await RNJailRoot.getStatus((error, jailbroken) => {
console.log(jailbroken); // Either true or false
});
}
};
...