react-native-device-defense 1.0.5 → 1.0.8

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.
@@ -7,10 +7,7 @@
7
7
  #include <unistd.h>
8
8
  #include <android/log.h>
9
9
  #include <stdexcept>
10
- #include <openssl/opensslv.h>
11
- #include <openssl/x509.h>
12
- #include <openssl/pem.h>
13
- #include <openssl/err.h>
10
+
14
11
 
15
12
  #define LOG_TAG "DeviceSecurityNative"
16
13
  #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
@@ -370,7 +370,7 @@ class DeviceSecurityModule(reactContext: ReactApplicationContext) :
370
370
 
371
371
  // Show alert if requested
372
372
  if (showAlert) {
373
- val activity = getCurrentActivity()
373
+ val activity = reactApplicationContext.currentActivity
374
374
  activity?.runOnUiThread {
375
375
  android.app.AlertDialog.Builder(activity)
376
376
  .setCancelable(false)
@@ -384,7 +384,7 @@ class DeviceSecurityModule(reactContext: ReactApplicationContext) :
384
384
  }
385
385
  } else {
386
386
  // Exit without alert
387
- getCurrentActivity()?.finishAffinity()
387
+ reactApplicationContext.currentActivity?.finishAffinity()
388
388
  System.exit(0)
389
389
  }
390
390
  } else {
@@ -10,6 +10,7 @@ import com.facebook.react.uimanager.ViewManager
10
10
  /**
11
11
  * React Native package for device security module
12
12
  */
13
+ @Suppress("DEPRECATION")
13
14
  class DeviceSecurityPackage : ReactPackage {
14
15
 
15
16
  override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
@@ -115,6 +115,7 @@ class EmulatorDetection(private val context: Context) {
115
115
  /**
116
116
  * Check for emulator features
117
117
  */
118
+ @Suppress("DEPRECATION", "MissingPermission")
118
119
  private fun checkEmulatorFeatures(): Boolean {
119
120
  try {
120
121
  val telephonyManager = context.getSystemService(Context.TELEPHONY_SERVICE) as? TelephonyManager
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-device-defense",
3
- "version": "1.0.5",
3
+ "version": "1.0.8",
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",