$ npm install react-native-rootbeer --save
$ react-native link react-native-rootbeer
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNRootbeerPackage;
to the imports at the top of the file - Add
new RNRootbeerPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-react-native-rootbeer' project(':react-native-react-native-rootbeer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-react-native-rootbeer/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-react-native-rootbeer')
import RNRootbeer from 'react-native-rootbeer';
// Checking if rooted
const isRooted = await RNRootbeer.isRooted()
// OR
const isRootedWithoutBusyBoxCheck = await RNRootbeer.isRootedWithoutBusyBoxCheck()