react-native-device-defense 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -18
- package/android/build.gradle +1 -1
- package/android/src/main/java/{vn/osp/security → com/devicedefense}/DebugDetection.kt +1 -1
- package/android/src/main/java/{vn/osp/security → com/devicedefense}/DeviceSecurityModule.kt +1 -1
- package/android/src/main/java/{vn/osp/security → com/devicedefense}/DeviceSecurityPackage.kt +1 -1
- package/android/src/main/java/{vn/osp/security → com/devicedefense}/EmulatorDetection.kt +1 -1
- package/android/src/main/java/{vn/osp/security → com/devicedefense}/HookDetection.kt +1 -1
- package/android/src/main/java/{vn/osp/security → com/devicedefense}/NativeSecurityCheck.kt +1 -1
- package/android/src/main/java/{vn/osp/security → com/devicedefense}/RootDetection.kt +1 -1
- package/package.json +2 -2
- package/react-native-device-security.podspec +4 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# react-native-device-
|
|
1
|
+
# react-native-device-defense
|
|
2
2
|
|
|
3
3
|
> Multi-layer device security detection for React Native - Root detection, Anti-hook, Anti-debug, Emulator detection
|
|
4
4
|
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm install react-native-device-
|
|
18
|
+
npm install react-native-device-defense
|
|
19
19
|
# or
|
|
20
|
-
yarn add react-native-device-
|
|
20
|
+
yarn add react-native-device-defense
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Android Setup
|
|
@@ -25,22 +25,22 @@ yarn add react-native-device-security
|
|
|
25
25
|
1. Add to `android/settings.gradle`:
|
|
26
26
|
|
|
27
27
|
```gradle
|
|
28
|
-
include ':react-native-device-
|
|
29
|
-
project(':react-native-device-
|
|
28
|
+
include ':react-native-device-defense'
|
|
29
|
+
project(':react-native-device-defense').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-defense/android')
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
2. Add to `android/app/build.gradle`:
|
|
33
33
|
|
|
34
34
|
```gradle
|
|
35
35
|
dependencies {
|
|
36
|
-
implementation project(':react-native-device-
|
|
36
|
+
implementation project(':react-native-device-defense')
|
|
37
37
|
}
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
3. Add to `MainApplication.java`:
|
|
41
41
|
|
|
42
42
|
```java
|
|
43
|
-
import
|
|
43
|
+
import com.devicedefense.DeviceSecurityPackage;
|
|
44
44
|
|
|
45
45
|
@Override
|
|
46
46
|
protected List<ReactPackage> getPackages() {
|
|
@@ -56,7 +56,7 @@ protected List<ReactPackage> getPackages() {
|
|
|
56
56
|
### Basic Usage
|
|
57
57
|
|
|
58
58
|
```typescript
|
|
59
|
-
import DeviceSecurity from 'react-native-device-
|
|
59
|
+
import DeviceSecurity from 'react-native-device-defense';
|
|
60
60
|
|
|
61
61
|
// Check if device is secure
|
|
62
62
|
const isSecure = await DeviceSecurity.isDeviceSecure();
|
|
@@ -74,7 +74,7 @@ if (!isSecure) {
|
|
|
74
74
|
### Advanced Usage with Hook
|
|
75
75
|
|
|
76
76
|
```typescript
|
|
77
|
-
import { useDeviceSecurity } from 'react-native-device-
|
|
77
|
+
import { useDeviceSecurity } from 'react-native-device-defense';
|
|
78
78
|
|
|
79
79
|
function App() {
|
|
80
80
|
const { isSecure, securityStatus, isLoading } = useDeviceSecurity({
|
|
@@ -121,7 +121,7 @@ console.log({
|
|
|
121
121
|
### Block on Security Threat (Recommended for Production)
|
|
122
122
|
|
|
123
123
|
```typescript
|
|
124
|
-
import DeviceSecurity from 'react-native-device-
|
|
124
|
+
import DeviceSecurity from 'react-native-device-defense';
|
|
125
125
|
|
|
126
126
|
// In your app entry point
|
|
127
127
|
DeviceSecurity.blockOnSecurityThreat({
|
|
@@ -188,9 +188,9 @@ Add to `android/app/proguard-rules.pro`:
|
|
|
188
188
|
|
|
189
189
|
```proguard
|
|
190
190
|
# Device Security Library
|
|
191
|
-
-keep class
|
|
192
|
-
-keepclassmembers class
|
|
193
|
-
-dontwarn
|
|
191
|
+
-keep class com.devicedefense.** { *; }
|
|
192
|
+
-keepclassmembers class com.devicedefense.** { *; }
|
|
193
|
+
-dontwarn com.devicedefense.**
|
|
194
194
|
```
|
|
195
195
|
|
|
196
196
|
## Security Techniques
|
|
@@ -223,14 +223,10 @@ Add to `android/app/proguard-rules.pro`:
|
|
|
223
223
|
|
|
224
224
|
MIT
|
|
225
225
|
|
|
226
|
-
## Author
|
|
227
|
-
|
|
228
|
-
OSP <dev@osp.vn>
|
|
229
|
-
|
|
230
226
|
## Contributing
|
|
231
227
|
|
|
232
228
|
Pull requests are welcome!
|
|
233
229
|
|
|
234
230
|
## Support
|
|
235
231
|
|
|
236
|
-
For issues and questions, please open a GitHub issue.
|
|
232
|
+
For issues and questions, please open a GitHub issue at https://github.com/BuiHung1612/react-native-device-security/issues
|
package/android/build.gradle
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-device-defense",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Multi-layer device security detection for React Native (root, hook, debugger, emulator detection)",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"type": "git",
|
|
31
31
|
"url": "git+https://github.com/BuiHung1612/react-native-device-security.git"
|
|
32
32
|
},
|
|
33
|
-
"author": "
|
|
33
|
+
"author": "Hung Bui <https://github.com/BuiHung1612>",
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"bugs": {
|
|
36
36
|
"url": "https://github.com/BuiHung1612/react-native-device-security/issues"
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
Pod::Spec.new do |s|
|
|
2
|
-
s.name = 'react-native-device-
|
|
2
|
+
s.name = 'react-native-device-defense'
|
|
3
3
|
s.version = '1.0.0'
|
|
4
4
|
s.summary = 'Multi-layer device security detection for React Native'
|
|
5
5
|
s.description = <<-DESC
|
|
6
6
|
React Native library for detecting device security threats including root detection,
|
|
7
7
|
hook detection (Frida, Xposed, Magisk), debugger detection, and emulator detection.
|
|
8
8
|
DESC
|
|
9
|
-
s.homepage = 'https://github.com/
|
|
9
|
+
s.homepage = 'https://github.com/BuiHung1612/react-native-device-security'
|
|
10
10
|
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
|
11
|
-
s.author = { '
|
|
11
|
+
s.author = { 'Hung Bui' => 'https://github.com/BuiHung1612' }
|
|
12
12
|
s.platforms = { :ios => '12.0' }
|
|
13
|
-
s.source = { :git => 'https://github.com/
|
|
13
|
+
s.source = { :git => 'https://github.com/BuiHung1612/react-native-device-security.git', :tag => "v#{s.version}" }
|
|
14
14
|
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
15
15
|
s.requires_arc = true
|
|
16
16
|
|