├── package ├── Podfile.template ├── ios │ ├── RNIsDeviceRooted.h │ ├── RNIsDeviceRooted.ios.js │ ├── RNIsDeviceRooted.m │ └── RNIsDeviceRooted.xcodeproj │ │ └── project.pbxproj ├── react-native-isDeviceRooted-0.1.3.tgz ├── android │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── app │ │ ├── src │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── java │ │ │ │ └── my │ │ │ │ └── fin │ │ │ │ ├── RNIsDeviceRootedPackage.java │ │ │ │ └── RNIsDeviceRootedModule.java │ │ └── build.gradle │ ├── build.gradle │ ├── gradlew.bat │ └── gradlew ├── index.js ├── package.json ├── License └── README.md ├── Podfile.template ├── ios ├── RNIsDeviceRooted.h ├── RNIsDeviceRooted.ios.js ├── RNIsDeviceRooted.m └── RNIsDeviceRooted.xcodeproj │ └── project.pbxproj ├── android ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── app │ ├── src │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── my │ │ │ └── fin │ │ │ ├── RNIsDeviceRootedPackage.java │ │ │ └── RNIsDeviceRootedModule.java │ └── build.gradle ├── build.gradle ├── gradlew.bat └── gradlew ├── index.js ├── package.json ├── License ├── .gitignore ├── .npmignore └── README.md /package/Podfile.template: -------------------------------------------------------------------------------- 1 | #RNIsDeviceRooted 2 | 3 | pod 'UIDevice-PasscodeStatus', '~> 0.0.2' -------------------------------------------------------------------------------- /Podfile.template: -------------------------------------------------------------------------------- 1 | #RNIsDeviceRooted 2 | target "RNIsDeviceRooted" do 3 | pod 'UIDevice-PasscodeStatus', '~> 0.0.2' 4 | end -------------------------------------------------------------------------------- /ios/RNIsDeviceRooted.h: -------------------------------------------------------------------------------- 1 | #import "RCTBridgeModule.h" 2 | 3 | @interface RNIsDeviceRooted : NSObject 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /package/ios/RNIsDeviceRooted.h: -------------------------------------------------------------------------------- 1 | #import "RCTBridgeModule.h" 2 | 3 | @interface RNIsDeviceRooted : NSObject 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beast/react-native-isDeviceRooted/HEAD/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 2 | import { NativeModules } from 'react-native'; 3 | 4 | const { RNIsDeviceRooted } = NativeModules; 5 | 6 | export default RNIsDeviceRooted; 7 | -------------------------------------------------------------------------------- /package/react-native-isDeviceRooted-0.1.3.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beast/react-native-isDeviceRooted/HEAD/package/react-native-isDeviceRooted-0.1.3.tgz -------------------------------------------------------------------------------- /package/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beast/react-native-isDeviceRooted/HEAD/package/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /package/index.js: -------------------------------------------------------------------------------- 1 | 2 | import { NativeModules } from 'react-native'; 3 | 4 | const { RNIsDeviceRooted } = NativeModules; 5 | 6 | export default RNIsDeviceRooted; 7 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /package/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Sep 09 14:30:05 MYT 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /package/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Sep 09 14:30:05 MYT 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /ios/RNIsDeviceRooted.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @providesModule RNIsDeviceRooted 3 | * @flow 4 | */ 5 | 'use strict'; 6 | 7 | var NativeRNIsDeviceRooted = require('NativeModules').RNIsDeviceRooted; 8 | 9 | /** 10 | * High-level docs for the RNIsDeviceRooted iOS API can be written here. 11 | */ 12 | 13 | var RNIsDeviceRooted = { 14 | test: function() { 15 | NativeRNIsDeviceRooted.test(); 16 | } 17 | }; 18 | 19 | module.exports = RNIsDeviceRooted; 20 | -------------------------------------------------------------------------------- /package/ios/RNIsDeviceRooted.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @providesModule RNIsDeviceRooted 3 | * @flow 4 | */ 5 | 'use strict'; 6 | 7 | var NativeRNIsDeviceRooted = require('NativeModules').RNIsDeviceRooted; 8 | 9 | /** 10 | * High-level docs for the RNIsDeviceRooted iOS API can be written here. 11 | */ 12 | 13 | var RNIsDeviceRooted = { 14 | test: function() { 15 | NativeRNIsDeviceRooted.test(); 16 | } 17 | }; 18 | 19 | module.exports = RNIsDeviceRooted; 20 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | apply plugin: 'com.android.library' 3 | 4 | android { 5 | compileSdkVersion 23 6 | buildToolsVersion "23.0.1" 7 | 8 | defaultConfig { 9 | minSdkVersion 16 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.0" 13 | ndk { 14 | abiFilters "armeabi-v7a", "x86" 15 | } 16 | } 17 | lintOptions { 18 | warning 'InvalidPackage' 19 | } 20 | } 21 | 22 | dependencies { 23 | compile 'com.facebook.react:react-native:0.20.+' 24 | } 25 | -------------------------------------------------------------------------------- /package/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | apply plugin: 'com.android.library' 3 | 4 | android { 5 | compileSdkVersion 23 6 | buildToolsVersion "23.0.1" 7 | 8 | defaultConfig { 9 | minSdkVersion 16 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.0" 13 | ndk { 14 | abiFilters "armeabi-v7a", "x86" 15 | } 16 | } 17 | lintOptions { 18 | warning 'InvalidPackage' 19 | } 20 | } 21 | 22 | dependencies { 23 | compile 'com.facebook.react:react-native:0.20.+' 24 | } 25 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.1.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$projectDir/../../node_modules/react-native/android" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /package/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.1.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$projectDir/../../node_modules/react-native/android" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-is-device-rooted", 3 | "version": "1.0.3", 4 | "description": "A React Native Library to check if a device is rooted or jailbroken. It also checks if screen lock is enabled", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "react-native", 11 | "rooted", 12 | "jailbroken", 13 | "screenlock", 14 | "passcode", 15 | "ios", 16 | "android", 17 | "secured" 18 | ], 19 | "author": "yaoyang2004@gmail.com", 20 | "license": "MIT", 21 | "repository": { 22 | "type": "git", 23 | "url": "https://github.com/beast/react-native-isDeviceRooted" 24 | }, 25 | "peerDependencies": { 26 | "react-native": "^0.27.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-isDeviceRooted", 3 | "version": "0.1.7", 4 | "description": "A React Native Library to check if a device is rooted or jailbroken. It also checks if screen lock is enabled", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "react-native", 11 | "rooted", 12 | "jailbroken", 13 | "screenlock", 14 | "passcode", 15 | "ios", 16 | "android", 17 | "secured" 18 | ], 19 | "author": "yaoyang2004@gmail.com", 20 | "license": "MIT", 21 | "repository": { 22 | "type": "git", 23 | "url": "https://github.com/beast/react-native-isDeviceRooted" 24 | }, 25 | "peerDependencies": { 26 | "react-native": "^0.27.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /package/ios/RNIsDeviceRooted.m: -------------------------------------------------------------------------------- 1 | #import "RNIsDeviceRooted.h" 2 | #import "UIDevice+PasscodeStatus.h" 3 | 4 | @implementation RNIsDeviceRooted 5 | 6 | RCT_EXPORT_MODULE(RNIsDeviceRooted); 7 | 8 | RCT_EXPORT_METHOD(isDeviceLocked:(RCTResponseSenderBlock)callback) 9 | { 10 | // todo: import UIdevice passcodestatus then call the method to verify and return the callback to javascript 11 | LNPasscodeStatus status = [UIDevice currentDevice].passcodeStatus; 12 | 13 | switch (status) { 14 | case LNPasscodeStatusEnabled: 15 | callback(@[[NSNull null], @true]); 16 | break; 17 | 18 | case LNPasscodeStatusDisabled: 19 | callback(@[[NSNull null], @false]); 20 | break; 21 | 22 | case LNPasscodeStatusUnknown: 23 | default: 24 | callback(@[@"Unable to retrieve the status of passcode.", @false]); 25 | break; 26 | } 27 | 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /android/app/src/main/java/my/fin/RNIsDeviceRootedPackage.java: -------------------------------------------------------------------------------- 1 | 2 | package my.fin; 3 | 4 | import java.util.Arrays; 5 | import java.util.Collections; 6 | import java.util.List; 7 | 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.bridge.NativeModule; 10 | import com.facebook.react.bridge.ReactApplicationContext; 11 | import com.facebook.react.uimanager.ViewManager; 12 | import com.facebook.react.bridge.JavaScriptModule; 13 | public class RNIsDeviceRootedPackage implements ReactPackage { 14 | @Override 15 | public List createNativeModules(ReactApplicationContext reactContext) { 16 | return Arrays.asList(new RNIsDeviceRootedModule(reactContext)); 17 | } 18 | 19 | @Override 20 | public List> createJSModules() { 21 | return Collections.emptyList(); 22 | } 23 | 24 | @Override 25 | public List createViewManagers(ReactApplicationContext reactContext) { 26 | return Collections.emptyList(); 27 | } 28 | } -------------------------------------------------------------------------------- /package/android/app/src/main/java/my/fin/RNIsDeviceRootedPackage.java: -------------------------------------------------------------------------------- 1 | 2 | package my.fin; 3 | 4 | import java.util.Arrays; 5 | import java.util.Collections; 6 | import java.util.List; 7 | 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.bridge.NativeModule; 10 | import com.facebook.react.bridge.ReactApplicationContext; 11 | import com.facebook.react.uimanager.ViewManager; 12 | import com.facebook.react.bridge.JavaScriptModule; 13 | public class RNIsDeviceRootedPackage implements ReactPackage { 14 | @Override 15 | public List createNativeModules(ReactApplicationContext reactContext) { 16 | return Arrays.asList(new RNIsDeviceRootedModule(reactContext)); 17 | } 18 | 19 | @Override 20 | public List> createJSModules() { 21 | return Collections.emptyList(); 22 | } 23 | 24 | @Override 25 | public List createViewManagers(ReactApplicationContext reactContext) { 26 | return Collections.emptyList(); 27 | } 28 | } -------------------------------------------------------------------------------- /License: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Yang Yao 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /package/License: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Yang Yao 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /package/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /package/android/app/src/main/java/my/fin/RNIsDeviceRootedModule.java: -------------------------------------------------------------------------------- 1 | 2 | package my.fin; 3 | 4 | import com.facebook.react.bridge.ReactApplicationContext; 5 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 6 | import com.facebook.react.bridge.ReactMethod; 7 | import com.facebook.react.bridge.Callback; 8 | import java.io.File; 9 | import java.io.BufferedReader; 10 | import java.io.InputStreamReader; 11 | import android.content.Context; 12 | import android.app.KeyguardManager; 13 | 14 | 15 | public class RNIsDeviceRootedModule extends ReactContextBaseJavaModule { 16 | 17 | private final ReactApplicationContext reactContext; 18 | 19 | public RNIsDeviceRootedModule(ReactApplicationContext reactContext) { 20 | super(reactContext); 21 | this.reactContext = reactContext; 22 | } 23 | 24 | @Override 25 | public String getName() { 26 | return "RNIsDeviceRooted"; 27 | } 28 | 29 | @ReactMethod 30 | public void isDeviceRooted(Callback errorCallback, Callback successCallback) { 31 | try { 32 | boolean isRooted = checkRootMethod1() || checkRootMethod2() || checkRootMethod3(); 33 | successCallback.invoke(isRooted); 34 | } 35 | catch (Exception e) { 36 | errorCallback.invoke(e.getMessage()); 37 | } 38 | } 39 | 40 | @ReactMethod 41 | public void isDeviceLocked(Callback errorCallback,Callback successCallback) { 42 | try { 43 | boolean isRooted = isLockScreenDisabled(); 44 | successCallback.invoke(isRooted); 45 | } 46 | catch (Exception e) { 47 | errorCallback.invoke(e.getMessage()); 48 | } 49 | } 50 | 51 | private boolean isLockScreenDisabled() { 52 | KeyguardManager km = (KeyguardManager) this.reactContext.getSystemService(Context.KEYGUARD_SERVICE); 53 | if (km.isKeyguardSecure()) 54 | return true; 55 | else 56 | return false; 57 | } 58 | 59 | private static boolean checkRootMethod1() { 60 | String buildTags = android.os.Build.TAGS; 61 | return buildTags != null && buildTags.contains("test-keys"); 62 | } 63 | 64 | private static boolean checkRootMethod2() { 65 | String[] paths = { "/system/app/Superuser.apk", "/sbin/su", "/system/bin/su", "/system/xbin/su", "/data/local/xbin/su", "/data/local/bin/su", "/system/sd/xbin/su", 66 | "/system/bin/failsafe/su", "/data/local/su" }; 67 | for (String path : paths) { 68 | if (new File(path).exists()) return true; 69 | } 70 | return false; 71 | } 72 | 73 | private static boolean checkRootMethod3() { 74 | Process process = null; 75 | try { 76 | process = Runtime.getRuntime().exec(new String[] { "/system/xbin/which", "su" }); 77 | BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream())); 78 | if (in.readLine() != null) return true; 79 | return false; 80 | } catch (Throwable t) { 81 | return false; 82 | } finally { 83 | if (process != null) process.destroy(); 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /package/README.md: -------------------------------------------------------------------------------- 1 | 2 | # react-native-isDeviceRooted (WIP) 3 | 4 | ##Features 5 | ### Android 6 | - [x] Check if the device is rooted. 7 | - [x] Check if the device has screen lock enabled. 8 | 9 | ### iOS (WIP) 10 | - [ ] Check if the device is jailbroken. 11 | - [ ] Check if the device has screen lock enabled. 12 | 13 | ##Requirements 14 | ### Android 15 | API 16+ 16 | ### iOS 17 | iOS 8+ 18 | ### React Native 19 | RN 0.27+ 20 | 21 | 22 | ## Getting started 23 | 24 | `$ npm install react-native-isDeviceRooted --save` 25 | 26 | ### Mostly automatic installation 27 | Please follow manual instructions if this is not working. (iOS is not quite there yet. Suggestions welcome.) 28 | 29 | `$ rnpm link react-native-isDeviceRooted` 30 | 31 | ### Manual installation 32 | 33 | 34 | #### iOS 35 | 36 | 1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` 37 | 2. Go to `node_modules` ➜ `react-native-isDeviceRooted` and add `RNIsDeviceRooted.xcodeproj` 38 | 3. In XCode, in the project navigator, select your project. Add `libRNIsDeviceRooted.a` to your project's `Build Phases` ➜ `Link Binary With Libraries` 39 | 4. Click RNIsDeviceRooted.xcodeproj in the project navigator and go the **Build Settings** tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for **Header Search Paths** and make sure it contains $(SRCROOT)/../react-native/React, $(SRCROOT)/../../React, ${SRCROOT}/../../ios/Pods/Headers/Public marked as **recursive**. 40 | 5. Inside your ios directory add a file named **Podfile** with the following [content](https://github.com/beast/react-native-isDeviceRooted/blob/master/Podfile.template) 41 | 6. Run pod install --project-directory=ios 42 | 7. Run react-native run-ios 43 | 44 | Note: If you are building inside of xcode, make sure you open the workspace file not the proejct file. 45 | 46 | #### Android 47 | 48 | 1. Open up `android/app/src/main/java/[...]/MainActivity.java` 49 | - Add `import my.fin.RNIsDeviceRootedPackage;` to the imports at the top of the file 50 | - Add `new RNIsDeviceRootedPackage()` to the list returned by the `getPackages()` method 51 | 2. Append the following lines to `android/settings.gradle`: 52 | ``` 53 | include ':react-native-isDeviceRooted' 54 | project(':react-native-isDeviceRooted').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-isDeviceRooted/android/app') 55 | ``` 56 | 3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: 57 | ``` 58 | compile project(':react-native-isDeviceRooted') 59 | ``` 60 | 61 | ## Usage 62 | ```javascript 63 | import RNIsDeviceRooted from 'react-native-isDeviceRooted'; 64 | 65 | // Check if device is rooted or jailbroken. 66 | RNIsDeviceRooted.isDeviceRooted((err) => { console.log(err); }, 67 | (isRooted) => { console.log(isRooted); }); 68 | 69 | // Check if device has screenslock enabled. 70 | RNIsDeviceRooted.isDeviceLocked((err) => { console.log(err); }, 71 | (isLocked) => { console.log(isLocked); }); 72 | ``` 73 | 74 | ##License 75 | [MIT](./License) 76 | 77 | ##Credit 78 | liamnichols - [UIDevice-Password](https://github.com/liamnichols/UIDevice-PasscodeStatus) 79 | -------------------------------------------------------------------------------- /android/app/src/main/java/my/fin/RNIsDeviceRootedModule.java: -------------------------------------------------------------------------------- 1 | 2 | package my.fin; 3 | 4 | import com.facebook.react.bridge.ReactApplicationContext; 5 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 6 | import com.facebook.react.bridge.ReactMethod; 7 | import com.facebook.react.bridge.Promise; 8 | import java.io.File; 9 | import java.io.BufferedReader; 10 | import java.io.InputStreamReader; 11 | import android.content.Context; 12 | import android.app.KeyguardManager; 13 | 14 | 15 | public class RNIsDeviceRootedModule extends ReactContextBaseJavaModule { 16 | 17 | private final ReactApplicationContext reactContext; 18 | 19 | public RNIsDeviceRootedModule(ReactApplicationContext reactContext) { 20 | super(reactContext); 21 | this.reactContext = reactContext; 22 | } 23 | 24 | @Override 25 | public String getName() { 26 | return "RNIsDeviceRooted"; 27 | } 28 | 29 | @ReactMethod 30 | public void isDeviceRooted(Promise promise) { 31 | try { 32 | boolean isRooted = checkRootMethod1() || checkRootMethod2() || checkRootMethod3() || canExecuteSu(); 33 | promise.resolve(isRooted); 34 | } 35 | catch (Exception e) { 36 | promise.reject(e); 37 | } 38 | } 39 | 40 | @ReactMethod 41 | public void isDeviceLocked(Promise promise) { 42 | try { 43 | boolean isLocked = isLockScreenDisabled(); 44 | promise.resolve(isLocked); 45 | } 46 | catch (Exception e) { 47 | promise.reject(e); 48 | } 49 | } 50 | 51 | private boolean isLockScreenDisabled() { 52 | KeyguardManager km = (KeyguardManager) this.reactContext.getSystemService(Context.KEYGUARD_SERVICE); 53 | if (km.isKeyguardSecure()) 54 | return true; 55 | else 56 | return false; 57 | } 58 | 59 | private static boolean checkRootMethod1() { 60 | String buildTags = android.os.Build.TAGS; 61 | return buildTags != null && buildTags.contains("test-keys"); 62 | } 63 | 64 | private static boolean checkRootMethod2() { 65 | String[] paths = { "/system/app/Superuser.apk", "/sbin/su", "/system/bin/su", "/system/xbin/su", "/data/local/xbin/su", "/data/local/bin/su", "/system/sd/xbin/su", 66 | "/system/bin/failsafe/su", "/data/local/su" }; 67 | for (String path : paths) { 68 | if (new File(path).exists()) return true; 69 | } 70 | return false; 71 | } 72 | 73 | private static boolean checkRootMethod3() { 74 | Process process = null; 75 | try { 76 | process = Runtime.getRuntime().exec(new String[] { "/system/xbin/which", "su" }); 77 | BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream())); 78 | if (in.readLine() != null) return true; 79 | return false; 80 | } catch (Throwable t) { 81 | return false; 82 | } finally { 83 | if (process != null) process.destroy(); 84 | } 85 | } 86 | 87 | private static boolean canExecuteSu() { 88 | boolean executedSuccesfully; 89 | try { 90 | Runtime.getRuntime().exec("su"); 91 | executedSuccesfully = true; 92 | } catch (Exception e) { 93 | executedSuccesfully = false; 94 | } 95 | return executedSuccesfully; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /ios/RNIsDeviceRooted.m: -------------------------------------------------------------------------------- 1 | #import "RNIsDeviceRooted.h" 2 | #import "UIDevice+PasscodeStatus.h" 3 | 4 | @implementation RNIsDeviceRooted 5 | 6 | RCT_EXPORT_MODULE(RNIsDeviceRooted); 7 | 8 | RCT_REMAP_METHOD(isDeviceLocked, 9 | lockresolver:(RCTPromiseResolveBlock)resolve 10 | rejecter:(RCTPromiseRejectBlock)reject) 11 | { 12 | 13 | @try{ 14 | LNPasscodeStatus status = [UIDevice currentDevice].passcodeStatus; 15 | switch (status) { 16 | case LNPasscodeStatusEnabled: 17 | resolve(@true); 18 | break; 19 | 20 | case LNPasscodeStatusDisabled: 21 | resolve(@false); 22 | break; 23 | 24 | case LNPasscodeStatusUnknown: 25 | default: 26 | resolve(@false); 27 | break; 28 | } 29 | 30 | } @catch (NSException *exception) 31 | { 32 | reject(@"error", @"error retrieving password status", exception); 33 | } 34 | 35 | } 36 | 37 | RCT_REMAP_METHOD(isDeviceRooted, 38 | rootresolver:(RCTPromiseResolveBlock)resolve 39 | rejecter:(RCTPromiseRejectBlock)reject) 40 | { 41 | // todo: import UIdevice passcodestatus then call the method to verify and return the callback to javascript 42 | 43 | @try{ 44 | BOOL isRooted = isJailbroken(); 45 | if (isRooted){ 46 | resolve(@true); 47 | } else { 48 | resolve(@false); 49 | } 50 | 51 | } @catch (NSException *exception) 52 | { 53 | reject(@"error", @"error trying to detect jailbreaking", exception); 54 | } 55 | 56 | } 57 | 58 | BOOL isJailbroken() 59 | { 60 | #if !(TARGET_IPHONE_SIMULATOR) 61 | 62 | if ([[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/Cydia.app"] || 63 | [[NSFileManager defaultManager] fileExistsAtPath:@"/Library/MobileSubstrate/MobileSubstrate.dylib"] || 64 | [[NSFileManager defaultManager] fileExistsAtPath:@"/bin/bash"] || 65 | [[NSFileManager defaultManager] fileExistsAtPath:@"/usr/sbin/sshd"] || 66 | [[NSFileManager defaultManager] fileExistsAtPath:@"/etc/apt"] || 67 | [[NSFileManager defaultManager] fileExistsAtPath:@"/private/var/lib/apt/"] || 68 | [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"cydia://package/com.example.package"]]) { 69 | return YES; 70 | } 71 | 72 | FILE *f = NULL ; 73 | if ((f = fopen("/bin/bash", "r")) || 74 | (f = fopen("/Applications/Cydia.app", "r")) || 75 | (f = fopen("/Library/MobileSubstrate/MobileSubstrate.dylib", "r")) || 76 | (f = fopen("/usr/sbin/sshd", "r")) || 77 | (f = fopen("/etc/apt", "r"))) { 78 | fclose(f); 79 | return YES; 80 | } 81 | fclose(f); 82 | 83 | NSError *error; 84 | NSString *stringToBeWritten = @"This is a test."; 85 | [stringToBeWritten writeToFile:@"/private/jailbreak.txt" atomically:YES encoding:NSUTF8StringEncoding error:&error]; 86 | [[NSFileManager defaultManager] removeItemAtPath:@"/private/jailbreak.txt" error:nil]; 87 | if(error == nil) 88 | { 89 | return YES; 90 | } 91 | 92 | #endif 93 | 94 | return NO; 95 | } 96 | 97 | @end 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | ############ 3 | # Node 4 | ############ 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | 15 | # Directory for instrumented libs generated by jscoverage/JSCover 16 | lib-cov 17 | 18 | # Coverage directory used by tools like istanbul 19 | coverage 20 | 21 | # nyc test coverage 22 | .nyc_output 23 | 24 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 25 | .grunt 26 | 27 | # node-waf configuration 28 | .lock-wscript 29 | 30 | # Compiled binary addons (http://nodejs.org/api/addons.html) 31 | build/Release 32 | 33 | # Dependency directories 34 | node_modules 35 | jspm_packages 36 | 37 | # Optional npm cache directory 38 | .npm 39 | 40 | # Optional REPL history 41 | .node_repl_history 42 | 43 | ################ 44 | # JetBrains 45 | ################ 46 | .idea 47 | 48 | ## File-based project format: 49 | *.iws 50 | 51 | ## Plugin-specific files: 52 | 53 | # IntelliJ 54 | /out/ 55 | 56 | # mpeltonen/sbt-idea plugin 57 | .idea_modules/ 58 | 59 | # JIRA plugin 60 | atlassian-ide-plugin.xml 61 | 62 | # Crashlytics plugin (for Android Studio and IntelliJ) 63 | com_crashlytics_export_strings.xml 64 | crashlytics.properties 65 | crashlytics-build.properties 66 | fabric.properties 67 | 68 | 69 | ############ 70 | # iOS 71 | ############ 72 | # Xcode 73 | # 74 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 75 | 76 | ## Build generated 77 | ios/build/ 78 | ios/DerivedData/ 79 | 80 | ## Various settings 81 | *.pbxuser 82 | !default.pbxuser 83 | *.mode1v3 84 | !default.mode1v3 85 | *.mode2v3 86 | !default.mode2v3 87 | *.perspectivev3 88 | !default.perspectivev3 89 | ios/xcuserdata/ 90 | 91 | ## Other 92 | *.moved-aside 93 | *.xcuserstate 94 | 95 | ## Obj-C/Swift specific 96 | *.hmap 97 | *.ipa 98 | *.dSYM.zip 99 | *.dSYM 100 | 101 | # CocoaPods 102 | # 103 | # We recommend against adding the Pods directory to your .gitignore. However 104 | # you should judge for yourself, the pros and cons are mentioned at: 105 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 106 | # 107 | ios/Pods/ 108 | 109 | # Carthage 110 | # 111 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 112 | # Carthage/Checkouts 113 | 114 | Carthage/Build 115 | 116 | # fastlane 117 | # 118 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 119 | # screenshots whenever they are needed. 120 | # For more information about the recommended setup visit: 121 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 122 | 123 | fastlane/report.xml 124 | fastlane/screenshots 125 | 126 | 127 | ############ 128 | # Android 129 | ############ 130 | # Built application files 131 | *.apk 132 | *.ap_ 133 | 134 | # Files for the Dalvik VM 135 | *.dex 136 | 137 | # Java class files 138 | *.class 139 | 140 | # Generated files 141 | android/bin/ 142 | android/gen/ 143 | android/out/ 144 | 145 | # Gradle files 146 | android/.gradle/ 147 | android/build/ 148 | 149 | # Local configuration file (sdk path, etc) 150 | local.properties 151 | 152 | # Proguard folder generated by Eclipse 153 | android/proguard/ 154 | 155 | # Log Files 156 | *.log 157 | 158 | # Android Studio Navigation editor temp files 159 | android/.navigation/ 160 | 161 | # Android Studio captures folder 162 | android/captures/ 163 | 164 | # Intellij 165 | *.iml 166 | 167 | # Keystore files 168 | *.jks 169 | 170 | ################## 171 | # React-Native 172 | ################## 173 | # OSX 174 | # 175 | .DS_Store 176 | 177 | # Xcode 178 | # 179 | build/ 180 | *.pbxuser 181 | !default.pbxuser 182 | *.mode1v3 183 | !default.mode1v3 184 | *.mode2v3 185 | !default.mode2v3 186 | *.perspectivev3 187 | !default.perspectivev3 188 | xcuserdata 189 | *.xccheckout 190 | *.moved-aside 191 | DerivedData 192 | *.hmap 193 | *.ipa 194 | *.xcuserstate 195 | project.xcworkspace 196 | 197 | # Android/IJ 198 | # 199 | .idea 200 | .gradle 201 | local.properties 202 | 203 | # node.js 204 | # 205 | node_modules/ 206 | npm-debug.log 207 | 208 | # BUCK 209 | buck-out/ 210 | \.buckd/ 211 | android/app/libs 212 | android/keystores/debug.keystore 213 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | example/ 2 | test/ 3 | res/generated/ 4 | 5 | .npmignore 6 | 7 | ################# 8 | # from .gitignore: 9 | ################ 10 | 11 | 12 | ############ 13 | # Node 14 | ############ 15 | # Logs 16 | logs 17 | *.log 18 | npm-debug.log* 19 | 20 | # Runtime data 21 | pids 22 | *.pid 23 | *.seed 24 | 25 | # Directory for instrumented libs generated by jscoverage/JSCover 26 | lib-cov 27 | 28 | # Coverage directory used by tools like istanbul 29 | coverage 30 | 31 | # nyc test coverage 32 | .nyc_output 33 | 34 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 35 | .grunt 36 | 37 | # node-waf configuration 38 | .lock-wscript 39 | 40 | # Compiled binary addons (http://nodejs.org/api/addons.html) 41 | build/Release 42 | 43 | # Dependency directories 44 | node_modules 45 | jspm_packages 46 | 47 | # Optional npm cache directory 48 | .npm 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | 53 | ################ 54 | # JetBrains 55 | ################ 56 | .idea 57 | 58 | ## File-based project format: 59 | *.iws 60 | 61 | ## Plugin-specific files: 62 | 63 | # IntelliJ 64 | /out/ 65 | 66 | # mpeltonen/sbt-idea plugin 67 | .idea_modules/ 68 | 69 | # JIRA plugin 70 | atlassian-ide-plugin.xml 71 | 72 | # Crashlytics plugin (for Android Studio and IntelliJ) 73 | com_crashlytics_export_strings.xml 74 | crashlytics.properties 75 | crashlytics-build.properties 76 | fabric.properties 77 | 78 | 79 | ############ 80 | # iOS 81 | ############ 82 | # Xcode 83 | # 84 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 85 | 86 | ## Build generated 87 | ios/build/ 88 | ios/DerivedData/ 89 | 90 | ## Various settings 91 | *.pbxuser 92 | !default.pbxuser 93 | *.mode1v3 94 | !default.mode1v3 95 | *.mode2v3 96 | !default.mode2v3 97 | *.perspectivev3 98 | !default.perspectivev3 99 | ios/xcuserdata/ 100 | 101 | ## Other 102 | *.moved-aside 103 | *.xcuserstate 104 | 105 | ## Obj-C/Swift specific 106 | *.hmap 107 | *.ipa 108 | *.dSYM.zip 109 | *.dSYM 110 | 111 | # CocoaPods 112 | # 113 | # We recommend against adding the Pods directory to your .gitignore. However 114 | # you should judge for yourself, the pros and cons are mentioned at: 115 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 116 | # 117 | ios/Pods/ 118 | 119 | # Carthage 120 | # 121 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 122 | # Carthage/Checkouts 123 | 124 | Carthage/Build 125 | 126 | # fastlane 127 | # 128 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 129 | # screenshots whenever they are needed. 130 | # For more information about the recommended setup visit: 131 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 132 | 133 | fastlane/report.xml 134 | fastlane/screenshots 135 | 136 | 137 | ############ 138 | # Android 139 | ############ 140 | # Built application files 141 | *.apk 142 | *.ap_ 143 | 144 | # Files for the Dalvik VM 145 | *.dex 146 | 147 | # Java class files 148 | *.class 149 | 150 | # Generated files 151 | android/bin/ 152 | android/gen/ 153 | android/out/ 154 | android/app/build/ 155 | 156 | # Gradle files 157 | android/.gradle/ 158 | android/build/ 159 | 160 | # Local configuration file (sdk path, etc) 161 | local.properties 162 | 163 | # Proguard folder generated by Eclipse 164 | android/proguard/ 165 | 166 | # Log Files 167 | *.log 168 | 169 | # Android Studio Navigation editor temp files 170 | android/.navigation/ 171 | 172 | # Android Studio captures folder 173 | android/captures/ 174 | 175 | # Intellij 176 | *.iml 177 | 178 | # Keystore files 179 | *.jks 180 | 181 | ################## 182 | # React-Native 183 | ################## 184 | # OSX 185 | # 186 | .DS_Store 187 | 188 | # Xcode 189 | # 190 | build/ 191 | *.pbxuser 192 | !default.pbxuser 193 | *.mode1v3 194 | !default.mode1v3 195 | *.mode2v3 196 | !default.mode2v3 197 | *.perspectivev3 198 | !default.perspectivev3 199 | xcuserdata 200 | *.xccheckout 201 | *.moved-aside 202 | DerivedData 203 | *.hmap 204 | *.ipa 205 | *.xcuserstate 206 | project.xcworkspace 207 | 208 | # Android/IJ 209 | # 210 | .idea 211 | .gradle 212 | local.properties 213 | 214 | # node.js 215 | # 216 | node_modules/ 217 | npm-debug.log 218 | 219 | # BUCK 220 | buck-out/ 221 | \.buckd/ 222 | android/app/libs 223 | android/keystores/debug.keystore 224 | 225 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # react-native-isDeviceRooted 3 | [![NPM](https://nodei.co/npm/react-native-is-device-rooted.png)](https://www.npmjs.com/package/react-native-is-device-rooted) 4 | 5 | ##Features 6 | ### Android 7 | - [x] Check if the device is rooted. 8 | - [x] Check if the device has screen lock enabled. 9 | 10 | ### iOS (WIP) 11 | - [x] Check if the device is jailbroken. 12 | - [x] Check if the device has screen lock enabled. 13 | 14 | ##Requirements 15 | ### Android 16 | API 16+ 17 | ### iOS 18 | iOS 8+ 19 | ### React Native 20 | RN 0.27+ 21 | 22 | 23 | ## Getting started 24 | 25 | `$ npm install react-native-is-device-rooted --save` 26 | 27 | ### Mostly automatic installation 28 | Please follow manual instructions since rnpm only help with basic linking. 29 | **Note: iOS will not automatically install because I am wrapping another library via cocoapods. Please follow manual instruction. (Suggestions welcome.)** 30 | 31 | `$ rnpm link react-native-is-device-rooted` 32 | 33 | ## Manual installation 34 | 35 | 36 | ### iOS 37 | 38 | 1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` 39 | 2. Go to `node_modules` ➜ `react-native-isDeviceRooted` and add `RNIsDeviceRooted.xcodeproj` 40 | 3. In XCode, in the project navigator, select your project. Add `libRNIsDeviceRooted.a` to your project's `Build Phases` ➜ `Link Binary With Libraries` 41 | 4. Click RNIsDeviceRooted.xcodeproj in the project navigator and go the **Build Settings** tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for **Header Search Paths** and make sure it contains the following and all marked as **recursive**: 42 | 43 | **$(SRCROOT)/../../React 44 | $(SRCROOT)/../../react-native/React 45 | ${SRCROOT}/../../react-native-is-device-rooted/ios/Pods/Headers/Public 46 | ${SRCROOT}/../../react-native-is-device-rooted/ios/Pods/Headers/Public/UIDevice-PasscodeStatus** 47 | 48 | 5. Inside your {ReactNativeProject}/ios directory add a file named **Podfile** with the following [content](https://github.com/beast/react-native-isDeviceRooted/blob/master/Podfile.template) 49 | 6. Run pod install in the directory mentioned in step 5. 50 | 7. Run react-native run-ios or build in Xcode. 51 | 52 | **Note: If you are building inside of xcode, make sure you open the workspace file not the proejct file.** 53 | 54 | #### CocoaPods Warning 55 | 56 | If you get the following warning. 57 | 58 | ``` 59 | !] The ` [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation 60 | - Use the `$(inherited)` flag, or 61 | - Remove the build settings from the target. 62 | 63 | [!] The ` [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation 64 | - Use the `$(inherited)` flag, or 65 | - Remove the build settings from the target. 66 | ``` 67 | 68 | Click `.xcodeproj` in the project navigator and go the `Build Settings` tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for `Other Linker Flags` and replace the value `-ObjC` with the value `$(inherited)` for your Application's Target. 69 | 70 | #### libpods Error 71 | If you received an libpods error for the RNIsDeviceRooted project, it's safe to remove under its build phases settings > Link binary with libraries 72 | 73 | 74 | ### Android 75 | 76 | 1. Open up `android/app/src/main/java/[...]/MainApplication.java` 77 | - Add `import my.fin.RNIsDeviceRootedPackage;` to the imports at the top of the file 78 | - Add `new RNIsDeviceRootedPackage()` to the list returned by the `getPackages()` method 79 | 2. Append the following lines to `android/settings.gradle`: 80 | ``` 81 | include ':react-native-is-device-rooted' 82 | project(':react-native-is-device-rooted').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-is-device-rooted/android/app') 83 | ``` 84 | 3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: 85 | ``` 86 | compile project(':react-native-is-device-rooted') 87 | ``` 88 | 89 | ## Usage 90 | ```javascript 91 | import RNIsDeviceRooted from 'react-native-is-device-rooted'; 92 | 93 | // Check if device is rooted or jailbroken. 94 | const isRooted = RNIsDeviceRooted.isDeviceRooted(); 95 | console.log(isRooted); 96 | 97 | 98 | // Check if device has screenslock enabled. 99 | const isLocked = await RNIsDeviceRooted.isDeviceLocked(); 100 | console.log(isLocked); 101 | ``` 102 | 103 | ##License 104 | [MIT](./License) 105 | 106 | ##Credit 107 | liamnichols - [UIDevice-Password](https://github.com/liamnichols/UIDevice-PasscodeStatus) 108 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /package/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /ios/RNIsDeviceRooted.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 13BE3DEE1AC21097009241FE /* RNIsDeviceRooted.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* RNIsDeviceRooted.m */; }; 11 | /* End PBXBuildFile section */ 12 | 13 | /* Begin PBXCopyFilesBuildPhase section */ 14 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 15 | isa = PBXCopyFilesBuildPhase; 16 | buildActionMask = 2147483647; 17 | dstPath = "include/$(PRODUCT_NAME)"; 18 | dstSubfolderSpec = 16; 19 | files = ( 20 | ); 21 | runOnlyForDeploymentPostprocessing = 0; 22 | }; 23 | /* End PBXCopyFilesBuildPhase section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 134814201AA4EA6300B7C361 /* libRNIsDeviceRooted.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNIsDeviceRooted.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27 | 13BE3DEC1AC21097009241FE /* RNIsDeviceRooted.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNIsDeviceRooted.h; sourceTree = ""; }; 28 | 13BE3DED1AC21097009241FE /* RNIsDeviceRooted.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNIsDeviceRooted.m; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 134814211AA4EA7D00B7C361 /* Products */ = { 43 | isa = PBXGroup; 44 | children = ( 45 | 134814201AA4EA6300B7C361 /* libRNIsDeviceRooted.a */, 46 | ); 47 | name = Products; 48 | sourceTree = ""; 49 | }; 50 | 58B511D21A9E6C8500147676 = { 51 | isa = PBXGroup; 52 | children = ( 53 | 13BE3DEC1AC21097009241FE /* RNIsDeviceRooted.h */, 54 | 13BE3DED1AC21097009241FE /* RNIsDeviceRooted.m */, 55 | 134814211AA4EA7D00B7C361 /* Products */, 56 | ); 57 | sourceTree = ""; 58 | }; 59 | /* End PBXGroup section */ 60 | 61 | /* Begin PBXNativeTarget section */ 62 | 58B511DA1A9E6C8500147676 /* RNIsDeviceRooted */ = { 63 | isa = PBXNativeTarget; 64 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNIsDeviceRooted" */; 65 | buildPhases = ( 66 | 58B511D71A9E6C8500147676 /* Sources */, 67 | 58B511D81A9E6C8500147676 /* Frameworks */, 68 | 58B511D91A9E6C8500147676 /* CopyFiles */, 69 | ); 70 | buildRules = ( 71 | ); 72 | dependencies = ( 73 | ); 74 | name = RNIsDeviceRooted; 75 | productName = RCTDataManager; 76 | productReference = 134814201AA4EA6300B7C361 /* libRNIsDeviceRooted.a */; 77 | productType = "com.apple.product-type.library.static"; 78 | }; 79 | /* End PBXNativeTarget section */ 80 | 81 | /* Begin PBXProject section */ 82 | 58B511D31A9E6C8500147676 /* Project object */ = { 83 | isa = PBXProject; 84 | attributes = { 85 | LastUpgradeCheck = 0610; 86 | ORGANIZATIONNAME = Facebook; 87 | TargetAttributes = { 88 | 58B511DA1A9E6C8500147676 = { 89 | CreatedOnToolsVersion = 6.1.1; 90 | }; 91 | }; 92 | }; 93 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNIsDeviceRooted" */; 94 | compatibilityVersion = "Xcode 3.2"; 95 | developmentRegion = English; 96 | hasScannedForEncodings = 0; 97 | knownRegions = ( 98 | en, 99 | ); 100 | mainGroup = 58B511D21A9E6C8500147676; 101 | productRefGroup = 58B511D21A9E6C8500147676; 102 | projectDirPath = ""; 103 | projectRoot = ""; 104 | targets = ( 105 | 58B511DA1A9E6C8500147676 /* RNIsDeviceRooted */, 106 | ); 107 | }; 108 | /* End PBXProject section */ 109 | 110 | /* Begin PBXSourcesBuildPhase section */ 111 | 58B511D71A9E6C8500147676 /* Sources */ = { 112 | isa = PBXSourcesBuildPhase; 113 | buildActionMask = 2147483647; 114 | files = ( 115 | 13BE3DEE1AC21097009241FE /* RNIsDeviceRooted.m in Sources */, 116 | ); 117 | runOnlyForDeploymentPostprocessing = 0; 118 | }; 119 | /* End PBXSourcesBuildPhase section */ 120 | 121 | /* Begin XCBuildConfiguration section */ 122 | 58B511ED1A9E6C8500147676 /* Debug */ = { 123 | isa = XCBuildConfiguration; 124 | buildSettings = { 125 | ALWAYS_SEARCH_USER_PATHS = NO; 126 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 127 | CLANG_CXX_LIBRARY = "libc++"; 128 | CLANG_ENABLE_MODULES = YES; 129 | CLANG_ENABLE_OBJC_ARC = YES; 130 | CLANG_WARN_BOOL_CONVERSION = YES; 131 | CLANG_WARN_CONSTANT_CONVERSION = YES; 132 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 133 | CLANG_WARN_EMPTY_BODY = YES; 134 | CLANG_WARN_ENUM_CONVERSION = YES; 135 | CLANG_WARN_INT_CONVERSION = YES; 136 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 137 | CLANG_WARN_UNREACHABLE_CODE = YES; 138 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 139 | COPY_PHASE_STRIP = NO; 140 | ENABLE_STRICT_OBJC_MSGSEND = YES; 141 | GCC_C_LANGUAGE_STANDARD = gnu99; 142 | GCC_DYNAMIC_NO_PIC = NO; 143 | GCC_OPTIMIZATION_LEVEL = 0; 144 | GCC_PREPROCESSOR_DEFINITIONS = ( 145 | "DEBUG=1", 146 | "$(inherited)", 147 | ); 148 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 149 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 150 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 151 | GCC_WARN_UNDECLARED_SELECTOR = YES; 152 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 153 | GCC_WARN_UNUSED_FUNCTION = YES; 154 | GCC_WARN_UNUSED_VARIABLE = YES; 155 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 156 | MTL_ENABLE_DEBUG_INFO = YES; 157 | ONLY_ACTIVE_ARCH = YES; 158 | SDKROOT = iphoneos; 159 | }; 160 | name = Debug; 161 | }; 162 | 58B511EE1A9E6C8500147676 /* Release */ = { 163 | isa = XCBuildConfiguration; 164 | buildSettings = { 165 | ALWAYS_SEARCH_USER_PATHS = NO; 166 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 167 | CLANG_CXX_LIBRARY = "libc++"; 168 | CLANG_ENABLE_MODULES = YES; 169 | CLANG_ENABLE_OBJC_ARC = YES; 170 | CLANG_WARN_BOOL_CONVERSION = YES; 171 | CLANG_WARN_CONSTANT_CONVERSION = YES; 172 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 173 | CLANG_WARN_EMPTY_BODY = YES; 174 | CLANG_WARN_ENUM_CONVERSION = YES; 175 | CLANG_WARN_INT_CONVERSION = YES; 176 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 177 | CLANG_WARN_UNREACHABLE_CODE = YES; 178 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 179 | COPY_PHASE_STRIP = YES; 180 | ENABLE_NS_ASSERTIONS = NO; 181 | ENABLE_STRICT_OBJC_MSGSEND = YES; 182 | GCC_C_LANGUAGE_STANDARD = gnu99; 183 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 184 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 185 | GCC_WARN_UNDECLARED_SELECTOR = YES; 186 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 187 | GCC_WARN_UNUSED_FUNCTION = YES; 188 | GCC_WARN_UNUSED_VARIABLE = YES; 189 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 190 | MTL_ENABLE_DEBUG_INFO = NO; 191 | SDKROOT = iphoneos; 192 | VALIDATE_PRODUCT = YES; 193 | }; 194 | name = Release; 195 | }; 196 | 58B511F01A9E6C8500147676 /* Debug */ = { 197 | isa = XCBuildConfiguration; 198 | buildSettings = { 199 | HEADER_SEARCH_PATHS = ( 200 | "$(inherited)", 201 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 202 | "$(SRCROOT)/../../React/**", 203 | "$(SRCROOT)/../../node_modules/react-native/React/**", 204 | ); 205 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 206 | OTHER_LDFLAGS = "-ObjC"; 207 | PRODUCT_NAME = RNIsDeviceRooted; 208 | SKIP_INSTALL = YES; 209 | }; 210 | name = Debug; 211 | }; 212 | 58B511F11A9E6C8500147676 /* Release */ = { 213 | isa = XCBuildConfiguration; 214 | buildSettings = { 215 | HEADER_SEARCH_PATHS = ( 216 | "$(inherited)", 217 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 218 | "$(SRCROOT)/../../React/**", 219 | ); 220 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 221 | OTHER_LDFLAGS = "-ObjC"; 222 | PRODUCT_NAME = RNIsDeviceRooted; 223 | SKIP_INSTALL = YES; 224 | }; 225 | name = Release; 226 | }; 227 | /* End XCBuildConfiguration section */ 228 | 229 | /* Begin XCConfigurationList section */ 230 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNIsDeviceRooted" */ = { 231 | isa = XCConfigurationList; 232 | buildConfigurations = ( 233 | 58B511ED1A9E6C8500147676 /* Debug */, 234 | 58B511EE1A9E6C8500147676 /* Release */, 235 | ); 236 | defaultConfigurationIsVisible = 0; 237 | defaultConfigurationName = Release; 238 | }; 239 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNIsDeviceRooted" */ = { 240 | isa = XCConfigurationList; 241 | buildConfigurations = ( 242 | 58B511F01A9E6C8500147676 /* Debug */, 243 | 58B511F11A9E6C8500147676 /* Release */, 244 | ); 245 | defaultConfigurationIsVisible = 0; 246 | defaultConfigurationName = Release; 247 | }; 248 | /* End XCConfigurationList section */ 249 | }; 250 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 251 | } 252 | -------------------------------------------------------------------------------- /package/ios/RNIsDeviceRooted.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 13BE3DEE1AC21097009241FE /* RNIsDeviceRooted.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* RNIsDeviceRooted.m */; }; 11 | /* End PBXBuildFile section */ 12 | 13 | /* Begin PBXCopyFilesBuildPhase section */ 14 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 15 | isa = PBXCopyFilesBuildPhase; 16 | buildActionMask = 2147483647; 17 | dstPath = "include/$(PRODUCT_NAME)"; 18 | dstSubfolderSpec = 16; 19 | files = ( 20 | ); 21 | runOnlyForDeploymentPostprocessing = 0; 22 | }; 23 | /* End PBXCopyFilesBuildPhase section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 134814201AA4EA6300B7C361 /* libRNIsDeviceRooted.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNIsDeviceRooted.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27 | 13BE3DEC1AC21097009241FE /* RNIsDeviceRooted.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNIsDeviceRooted.h; sourceTree = ""; }; 28 | 13BE3DED1AC21097009241FE /* RNIsDeviceRooted.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNIsDeviceRooted.m; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 134814211AA4EA7D00B7C361 /* Products */ = { 43 | isa = PBXGroup; 44 | children = ( 45 | 134814201AA4EA6300B7C361 /* libRNIsDeviceRooted.a */, 46 | ); 47 | name = Products; 48 | sourceTree = ""; 49 | }; 50 | 58B511D21A9E6C8500147676 = { 51 | isa = PBXGroup; 52 | children = ( 53 | 13BE3DEC1AC21097009241FE /* RNIsDeviceRooted.h */, 54 | 13BE3DED1AC21097009241FE /* RNIsDeviceRooted.m */, 55 | 134814211AA4EA7D00B7C361 /* Products */, 56 | ); 57 | sourceTree = ""; 58 | }; 59 | /* End PBXGroup section */ 60 | 61 | /* Begin PBXNativeTarget section */ 62 | 58B511DA1A9E6C8500147676 /* RNIsDeviceRooted */ = { 63 | isa = PBXNativeTarget; 64 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNIsDeviceRooted" */; 65 | buildPhases = ( 66 | 58B511D71A9E6C8500147676 /* Sources */, 67 | 58B511D81A9E6C8500147676 /* Frameworks */, 68 | 58B511D91A9E6C8500147676 /* CopyFiles */, 69 | ); 70 | buildRules = ( 71 | ); 72 | dependencies = ( 73 | ); 74 | name = RNIsDeviceRooted; 75 | productName = RCTDataManager; 76 | productReference = 134814201AA4EA6300B7C361 /* libRNIsDeviceRooted.a */; 77 | productType = "com.apple.product-type.library.static"; 78 | }; 79 | /* End PBXNativeTarget section */ 80 | 81 | /* Begin PBXProject section */ 82 | 58B511D31A9E6C8500147676 /* Project object */ = { 83 | isa = PBXProject; 84 | attributes = { 85 | LastUpgradeCheck = 0610; 86 | ORGANIZATIONNAME = Facebook; 87 | TargetAttributes = { 88 | 58B511DA1A9E6C8500147676 = { 89 | CreatedOnToolsVersion = 6.1.1; 90 | }; 91 | }; 92 | }; 93 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNIsDeviceRooted" */; 94 | compatibilityVersion = "Xcode 3.2"; 95 | developmentRegion = English; 96 | hasScannedForEncodings = 0; 97 | knownRegions = ( 98 | en, 99 | ); 100 | mainGroup = 58B511D21A9E6C8500147676; 101 | productRefGroup = 58B511D21A9E6C8500147676; 102 | projectDirPath = ""; 103 | projectRoot = ""; 104 | targets = ( 105 | 58B511DA1A9E6C8500147676 /* RNIsDeviceRooted */, 106 | ); 107 | }; 108 | /* End PBXProject section */ 109 | 110 | /* Begin PBXSourcesBuildPhase section */ 111 | 58B511D71A9E6C8500147676 /* Sources */ = { 112 | isa = PBXSourcesBuildPhase; 113 | buildActionMask = 2147483647; 114 | files = ( 115 | 13BE3DEE1AC21097009241FE /* RNIsDeviceRooted.m in Sources */, 116 | ); 117 | runOnlyForDeploymentPostprocessing = 0; 118 | }; 119 | /* End PBXSourcesBuildPhase section */ 120 | 121 | /* Begin XCBuildConfiguration section */ 122 | 58B511ED1A9E6C8500147676 /* Debug */ = { 123 | isa = XCBuildConfiguration; 124 | buildSettings = { 125 | ALWAYS_SEARCH_USER_PATHS = NO; 126 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 127 | CLANG_CXX_LIBRARY = "libc++"; 128 | CLANG_ENABLE_MODULES = YES; 129 | CLANG_ENABLE_OBJC_ARC = YES; 130 | CLANG_WARN_BOOL_CONVERSION = YES; 131 | CLANG_WARN_CONSTANT_CONVERSION = YES; 132 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 133 | CLANG_WARN_EMPTY_BODY = YES; 134 | CLANG_WARN_ENUM_CONVERSION = YES; 135 | CLANG_WARN_INT_CONVERSION = YES; 136 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 137 | CLANG_WARN_UNREACHABLE_CODE = YES; 138 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 139 | COPY_PHASE_STRIP = NO; 140 | ENABLE_STRICT_OBJC_MSGSEND = YES; 141 | GCC_C_LANGUAGE_STANDARD = gnu99; 142 | GCC_DYNAMIC_NO_PIC = NO; 143 | GCC_OPTIMIZATION_LEVEL = 0; 144 | GCC_PREPROCESSOR_DEFINITIONS = ( 145 | "DEBUG=1", 146 | "$(inherited)", 147 | ); 148 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 149 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 150 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 151 | GCC_WARN_UNDECLARED_SELECTOR = YES; 152 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 153 | GCC_WARN_UNUSED_FUNCTION = YES; 154 | GCC_WARN_UNUSED_VARIABLE = YES; 155 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 156 | MTL_ENABLE_DEBUG_INFO = YES; 157 | ONLY_ACTIVE_ARCH = YES; 158 | SDKROOT = iphoneos; 159 | }; 160 | name = Debug; 161 | }; 162 | 58B511EE1A9E6C8500147676 /* Release */ = { 163 | isa = XCBuildConfiguration; 164 | buildSettings = { 165 | ALWAYS_SEARCH_USER_PATHS = NO; 166 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 167 | CLANG_CXX_LIBRARY = "libc++"; 168 | CLANG_ENABLE_MODULES = YES; 169 | CLANG_ENABLE_OBJC_ARC = YES; 170 | CLANG_WARN_BOOL_CONVERSION = YES; 171 | CLANG_WARN_CONSTANT_CONVERSION = YES; 172 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 173 | CLANG_WARN_EMPTY_BODY = YES; 174 | CLANG_WARN_ENUM_CONVERSION = YES; 175 | CLANG_WARN_INT_CONVERSION = YES; 176 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 177 | CLANG_WARN_UNREACHABLE_CODE = YES; 178 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 179 | COPY_PHASE_STRIP = YES; 180 | ENABLE_NS_ASSERTIONS = NO; 181 | ENABLE_STRICT_OBJC_MSGSEND = YES; 182 | GCC_C_LANGUAGE_STANDARD = gnu99; 183 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 184 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 185 | GCC_WARN_UNDECLARED_SELECTOR = YES; 186 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 187 | GCC_WARN_UNUSED_FUNCTION = YES; 188 | GCC_WARN_UNUSED_VARIABLE = YES; 189 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 190 | MTL_ENABLE_DEBUG_INFO = NO; 191 | SDKROOT = iphoneos; 192 | VALIDATE_PRODUCT = YES; 193 | }; 194 | name = Release; 195 | }; 196 | 58B511F01A9E6C8500147676 /* Debug */ = { 197 | isa = XCBuildConfiguration; 198 | buildSettings = { 199 | HEADER_SEARCH_PATHS = ( 200 | "$(inherited)", 201 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 202 | "$(SRCROOT)/../../React/**", 203 | "$(SRCROOT)/../../node_modules/react-native/React/**", 204 | ); 205 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 206 | OTHER_LDFLAGS = "-ObjC"; 207 | PRODUCT_NAME = RNIsDeviceRooted; 208 | SKIP_INSTALL = YES; 209 | }; 210 | name = Debug; 211 | }; 212 | 58B511F11A9E6C8500147676 /* Release */ = { 213 | isa = XCBuildConfiguration; 214 | buildSettings = { 215 | HEADER_SEARCH_PATHS = ( 216 | "$(inherited)", 217 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 218 | "$(SRCROOT)/../../React/**", 219 | ); 220 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 221 | OTHER_LDFLAGS = "-ObjC"; 222 | PRODUCT_NAME = RNIsDeviceRooted; 223 | SKIP_INSTALL = YES; 224 | }; 225 | name = Release; 226 | }; 227 | /* End XCBuildConfiguration section */ 228 | 229 | /* Begin XCConfigurationList section */ 230 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNIsDeviceRooted" */ = { 231 | isa = XCConfigurationList; 232 | buildConfigurations = ( 233 | 58B511ED1A9E6C8500147676 /* Debug */, 234 | 58B511EE1A9E6C8500147676 /* Release */, 235 | ); 236 | defaultConfigurationIsVisible = 0; 237 | defaultConfigurationName = Release; 238 | }; 239 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNIsDeviceRooted" */ = { 240 | isa = XCConfigurationList; 241 | buildConfigurations = ( 242 | 58B511F01A9E6C8500147676 /* Debug */, 243 | 58B511F11A9E6C8500147676 /* Release */, 244 | ); 245 | defaultConfigurationIsVisible = 0; 246 | defaultConfigurationName = Release; 247 | }; 248 | /* End XCConfigurationList section */ 249 | }; 250 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 251 | } 252 | --------------------------------------------------------------------------------