react-native-dev-guard 0.0.1 → 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.
Files changed (353) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +190 -44
  3. package/android/src/main/cpp/devguard-lib.cpp +12 -11
  4. package/android/src/main/java/com/devguard/DevGuardModule.kt +15 -0
  5. package/cpp/devguard_core.c +82 -4
  6. package/cpp/devguard_core.h +15 -13
  7. package/ios/DevGuard.mm +20 -6
  8. package/lib/components/LockScreen.d.ts +2 -0
  9. package/lib/components/LockScreen.js +90 -44
  10. package/lib/index.d.ts +4 -1
  11. package/lib/index.js +179 -152
  12. package/lib/internal/obf.d.ts +72 -0
  13. package/lib/internal/obf.js +100 -0
  14. package/lib/services/CacheService.d.ts +5 -1
  15. package/lib/services/CacheService.js +8 -12
  16. package/lib/services/DevGuardLogger.d.ts +1 -1
  17. package/lib/services/DevGuardLogger.js +13 -3
  18. package/lib/services/DeviceTokenService.d.ts +4 -1
  19. package/lib/services/DeviceTokenService.js +5 -2
  20. package/lib/services/GuardEnforcement.d.ts +3 -12
  21. package/lib/services/GuardEnforcement.js +34 -15
  22. package/lib/services/HardwareService.d.ts +14 -1
  23. package/lib/services/HardwareService.js +63 -1
  24. package/lib/services/cacheCrypto.d.ts +6 -0
  25. package/lib/services/cacheCrypto.js +40 -0
  26. package/lib/types/branding.d.ts +21 -0
  27. package/lib/types/branding.js +30 -0
  28. package/lib/utils/contactUrls.d.ts +4 -0
  29. package/lib/utils/contactUrls.js +18 -0
  30. package/package.json +28 -8
  31. package/react-native-dev-guard.podspec +19 -0
  32. package/screenshots/access-suspended.png +0 -0
  33. package/screenshots/payment-reminder.png +0 -0
  34. package/screenshots/welcome-screen.png +0 -0
  35. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
  36. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
  37. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
  38. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/reply/cache-v2-ca87e29d866016c47643.json +0 -1287
  39. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/reply/cmakeFiles-v1-afc39e04c88d618b9499.json +0 -182
  40. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/reply/codemodel-v2-004ad46f03b4d6b2acd6.json +0 -59
  41. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/reply/index-2026-05-15T08-21-19-0083.json +0 -92
  42. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/reply/target-devguard-Debug-8c0ebbb0cdb88d164b64.json +0 -160
  43. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.ninja_deps +0 -0
  44. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.ninja_log +0 -15
  45. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeCache.txt +0 -391
  46. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/3.18.1-g262b901/CMakeCCompiler.cmake +0 -77
  47. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/3.18.1-g262b901/CMakeCXXCompiler.cmake +0 -89
  48. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_C.bin +0 -0
  49. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_CXX.bin +0 -0
  50. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/3.18.1-g262b901/CMakeSystem.cmake +0 -15
  51. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/CMakeOutput.log +0 -236
  52. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/TargetDirectories.txt +0 -3
  53. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/cmake.check_cache +0 -1
  54. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/devguard.dir/devguard-lib.cpp.o +0 -0
  55. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/rules.ninja +0 -74
  56. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/additional_project_files.txt +0 -0
  57. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/android_gradle_build.json +0 -40
  58. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/android_gradle_build_mini.json +0 -27
  59. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/build.ninja +0 -154
  60. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/build_file_index.txt +0 -1
  61. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/cmake_install.cmake +0 -54
  62. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/compile_commands.json +0 -12
  63. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/compile_commands.json.bin +0 -0
  64. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/configure_fingerprint.bin +0 -29
  65. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/metadata_generation_command.txt +0 -19
  66. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/prefab_config.json +0 -4
  67. package/android/.cxx/Debug/4s4f1av3/arm64-v8a/symbol_folder_index.txt +0 -1
  68. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
  69. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
  70. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
  71. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/reply/cache-v2-02400eb6fc4793fa6bf2.json +0 -1287
  72. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/reply/cmakeFiles-v1-d0fc95efa84cbe47849a.json +0 -379
  73. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/reply/codemodel-v2-a7a363de64e45a261589.json +0 -59
  74. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/reply/index-2026-05-15T08-21-21-0243.json +0 -92
  75. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/reply/target-devguard-Debug-53eeaa7145cf9770f3d7.json +0 -160
  76. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.ninja_deps +0 -0
  77. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.ninja_log +0 -10
  78. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeCache.txt +0 -391
  79. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/3.18.1-g262b901/CMakeCCompiler.cmake +0 -77
  80. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/3.18.1-g262b901/CMakeCXXCompiler.cmake +0 -89
  81. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_C.bin +0 -0
  82. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_CXX.bin +0 -0
  83. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/3.18.1-g262b901/CMakeSystem.cmake +0 -15
  84. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/CMakeOutput.log +0 -240
  85. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/TargetDirectories.txt +0 -3
  86. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/cmake.check_cache +0 -1
  87. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/devguard.dir/devguard-lib.cpp.o +0 -0
  88. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/rules.ninja +0 -74
  89. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/additional_project_files.txt +0 -0
  90. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/android_gradle_build.json +0 -40
  91. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/android_gradle_build_mini.json +0 -27
  92. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/build.ninja +0 -154
  93. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/build_file_index.txt +0 -1
  94. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/cmake_install.cmake +0 -54
  95. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/compile_commands.json +0 -12
  96. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/compile_commands.json.bin +0 -0
  97. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/configure_fingerprint.bin +0 -29
  98. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/metadata_generation_command.txt +0 -19
  99. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/prefab_config.json +0 -4
  100. package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/symbol_folder_index.txt +0 -1
  101. package/android/.cxx/Debug/4s4f1av3/hash_key.txt +0 -26
  102. package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
  103. package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
  104. package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
  105. package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/reply/cache-v2-ec883f5c922c646acf2d.json +0 -1287
  106. package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/reply/cmakeFiles-v1-028bf03c3b9bd0e609c0.json +0 -379
  107. package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/reply/codemodel-v2-6c0215a4bb6e3b0b5223.json +0 -59
  108. package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/reply/index-2026-05-15T08-21-22-0722.json +0 -92
  109. package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/reply/target-devguard-Debug-2139b18dc63b630666db.json +0 -160
  110. package/android/.cxx/Debug/4s4f1av3/x86/.ninja_deps +0 -0
  111. package/android/.cxx/Debug/4s4f1av3/x86/.ninja_log +0 -10
  112. package/android/.cxx/Debug/4s4f1av3/x86/CMakeCache.txt +0 -391
  113. package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/3.18.1-g262b901/CMakeCCompiler.cmake +0 -77
  114. package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/3.18.1-g262b901/CMakeCXXCompiler.cmake +0 -89
  115. package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_C.bin +0 -0
  116. package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_CXX.bin +0 -0
  117. package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/3.18.1-g262b901/CMakeSystem.cmake +0 -15
  118. package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/CMakeOutput.log +0 -230
  119. package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/TargetDirectories.txt +0 -3
  120. package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/cmake.check_cache +0 -1
  121. package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/devguard.dir/devguard-lib.cpp.o +0 -0
  122. package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/rules.ninja +0 -74
  123. package/android/.cxx/Debug/4s4f1av3/x86/additional_project_files.txt +0 -0
  124. package/android/.cxx/Debug/4s4f1av3/x86/android_gradle_build.json +0 -40
  125. package/android/.cxx/Debug/4s4f1av3/x86/android_gradle_build_mini.json +0 -27
  126. package/android/.cxx/Debug/4s4f1av3/x86/build.ninja +0 -154
  127. package/android/.cxx/Debug/4s4f1av3/x86/build_file_index.txt +0 -1
  128. package/android/.cxx/Debug/4s4f1av3/x86/cmake_install.cmake +0 -54
  129. package/android/.cxx/Debug/4s4f1av3/x86/compile_commands.json +0 -12
  130. package/android/.cxx/Debug/4s4f1av3/x86/compile_commands.json.bin +0 -0
  131. package/android/.cxx/Debug/4s4f1av3/x86/configure_fingerprint.bin +0 -29
  132. package/android/.cxx/Debug/4s4f1av3/x86/metadata_generation_command.txt +0 -19
  133. package/android/.cxx/Debug/4s4f1av3/x86/prefab_config.json +0 -4
  134. package/android/.cxx/Debug/4s4f1av3/x86/symbol_folder_index.txt +0 -1
  135. package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
  136. package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
  137. package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
  138. package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/reply/cache-v2-7ec870c116aeb770686e.json +0 -1287
  139. package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/reply/cmakeFiles-v1-f2e6a276d8adf420c6b9.json +0 -379
  140. package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/reply/codemodel-v2-a4f2c2fefb1e4261b2d6.json +0 -59
  141. package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/reply/index-2026-05-15T08-21-24-0187.json +0 -92
  142. package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/reply/target-devguard-Debug-077cad881ac8d6864f8f.json +0 -160
  143. package/android/.cxx/Debug/4s4f1av3/x86_64/.ninja_deps +0 -0
  144. package/android/.cxx/Debug/4s4f1av3/x86_64/.ninja_log +0 -10
  145. package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeCache.txt +0 -391
  146. package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/3.18.1-g262b901/CMakeCCompiler.cmake +0 -77
  147. package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/3.18.1-g262b901/CMakeCXXCompiler.cmake +0 -89
  148. package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_C.bin +0 -0
  149. package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_CXX.bin +0 -0
  150. package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/3.18.1-g262b901/CMakeSystem.cmake +0 -15
  151. package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/CMakeOutput.log +0 -230
  152. package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/TargetDirectories.txt +0 -3
  153. package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/cmake.check_cache +0 -1
  154. package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/devguard.dir/devguard-lib.cpp.o +0 -0
  155. package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/rules.ninja +0 -74
  156. package/android/.cxx/Debug/4s4f1av3/x86_64/additional_project_files.txt +0 -0
  157. package/android/.cxx/Debug/4s4f1av3/x86_64/android_gradle_build.json +0 -40
  158. package/android/.cxx/Debug/4s4f1av3/x86_64/android_gradle_build_mini.json +0 -27
  159. package/android/.cxx/Debug/4s4f1av3/x86_64/build.ninja +0 -154
  160. package/android/.cxx/Debug/4s4f1av3/x86_64/build_file_index.txt +0 -1
  161. package/android/.cxx/Debug/4s4f1av3/x86_64/cmake_install.cmake +0 -54
  162. package/android/.cxx/Debug/4s4f1av3/x86_64/compile_commands.json +0 -12
  163. package/android/.cxx/Debug/4s4f1av3/x86_64/compile_commands.json.bin +0 -0
  164. package/android/.cxx/Debug/4s4f1av3/x86_64/configure_fingerprint.bin +0 -29
  165. package/android/.cxx/Debug/4s4f1av3/x86_64/metadata_generation_command.txt +0 -19
  166. package/android/.cxx/Debug/4s4f1av3/x86_64/prefab_config.json +0 -4
  167. package/android/.cxx/Debug/4s4f1av3/x86_64/symbol_folder_index.txt +0 -1
  168. package/android/.cxx/tools/debug/arm64-v8a/compile_commands.json +0 -12
  169. package/android/.cxx/tools/debug/armeabi-v7a/compile_commands.json +0 -12
  170. package/android/.cxx/tools/debug/x86/compile_commands.json +0 -12
  171. package/android/.cxx/tools/debug/x86_64/compile_commands.json +0 -12
  172. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  173. package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
  174. package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
  175. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  176. package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
  177. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  178. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  179. package/android/.gradle/8.9/gc.properties +0 -0
  180. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  181. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  182. package/android/.gradle/vcs-1/gc.properties +0 -0
  183. package/android/build/.transforms/07ab8b2284230b9b98454cb3baa5db54/results.bin +0 -1
  184. package/android/build/.transforms/07ab8b2284230b9b98454cb3baa5db54/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/devguard/BuildConfig.dex +0 -0
  185. package/android/build/.transforms/07ab8b2284230b9b98454cb3baa5db54/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/devguard/DevGuardModule.dex +0 -0
  186. package/android/build/.transforms/07ab8b2284230b9b98454cb3baa5db54/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/devguard/DevGuardPackage.dex +0 -0
  187. package/android/build/.transforms/07ab8b2284230b9b98454cb3baa5db54/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  188. package/android/build/.transforms/ae351402e6cba75b162136aa850e1ba2/results.bin +0 -1
  189. package/android/build/.transforms/ae351402e6cba75b162136aa850e1ba2/transformed/classes/classes_dex/classes.dex +0 -0
  190. package/android/build/generated/source/buildConfig/debug/com/devguard/BuildConfig.java +0 -10
  191. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -9
  192. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
  193. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
  194. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
  195. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  196. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  197. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  198. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/build_command_devguard +0 -4
  199. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/build_model.json +0 -187
  200. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/build_stderr_devguard.txt +0 -0
  201. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/build_stdout_devguard.txt +0 -2
  202. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/generate_cxx_metadata_111_timing.txt +0 -3
  203. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/generate_cxx_metadata_1463_timing.txt +0 -3
  204. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/generate_cxx_metadata_324_timing.txt +0 -2
  205. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/generate_cxx_metadata_475_timing.txt +0 -3
  206. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/generate_cxx_metadata_622_timing.txt +0 -2
  207. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/metadata_generation_record.json +0 -41
  208. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/build_command_devguard +0 -4
  209. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/build_model.json +0 -187
  210. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/build_stderr_devguard.txt +0 -0
  211. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/build_stdout_devguard.txt +0 -2
  212. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/generate_cxx_metadata_111_timing.txt +0 -3
  213. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/generate_cxx_metadata_1459_timing.txt +0 -3
  214. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/generate_cxx_metadata_324_timing.txt +0 -2
  215. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/generate_cxx_metadata_475_timing.txt +0 -2
  216. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/generate_cxx_metadata_622_timing.txt +0 -3
  217. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/metadata_generation_record.json +0 -41
  218. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/build_command_devguard +0 -4
  219. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/build_model.json +0 -187
  220. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/build_stderr_devguard.txt +0 -0
  221. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/build_stdout_devguard.txt +0 -2
  222. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/generate_cxx_metadata_111_timing.txt +0 -2
  223. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/generate_cxx_metadata_1459_timing.txt +0 -2
  224. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/generate_cxx_metadata_324_timing.txt +0 -2
  225. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/generate_cxx_metadata_475_timing.txt +0 -2
  226. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/generate_cxx_metadata_622_timing.txt +0 -2
  227. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/metadata_generation_record.json +0 -41
  228. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/build_command_devguard +0 -4
  229. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/build_model.json +0 -187
  230. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/build_stderr_devguard.txt +0 -0
  231. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/build_stdout_devguard.txt +0 -2
  232. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/generate_cxx_metadata_111_timing.txt +0 -2
  233. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/generate_cxx_metadata_1459_timing.txt +0 -3
  234. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/generate_cxx_metadata_324_timing.txt +0 -2
  235. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/generate_cxx_metadata_475_timing.txt +0 -2
  236. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/generate_cxx_metadata_622_timing.txt +0 -2
  237. package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/metadata_generation_record.json +0 -41
  238. package/android/build/intermediates/cxx/Debug/4s4f1av3/obj/arm64-v8a/libdevguard.so +0 -0
  239. package/android/build/intermediates/cxx/Debug/4s4f1av3/obj/armeabi-v7a/libdevguard.so +0 -0
  240. package/android/build/intermediates/cxx/Debug/4s4f1av3/obj/x86/libdevguard.so +0 -0
  241. package/android/build/intermediates/cxx/Debug/4s4f1av3/obj/x86_64/libdevguard.so +0 -0
  242. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
  243. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  244. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  245. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  246. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
  247. package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/react-native-dev-guard_debug.kotlin_module +0 -0
  248. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/devguard/BuildConfig.class +0 -0
  249. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libdevguard.so +0 -0
  250. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/armeabi-v7a/libdevguard.so +0 -0
  251. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86/libdevguard.so +0 -0
  252. package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86_64/libdevguard.so +0 -0
  253. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
  254. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -11
  255. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -9
  256. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/arm64-v8a/libdevguard.so +0 -0
  257. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/armeabi-v7a/libdevguard.so +0 -0
  258. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86/libdevguard.so +0 -0
  259. package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86_64/libdevguard.so +0 -0
  260. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
  261. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
  262. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/react-native-dev-guard_debug.kotlin_module +0 -0
  263. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/devguard/BuildConfig.class +0 -0
  264. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/devguard/DevGuardModule.class +0 -0
  265. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/devguard/DevGuardPackage.class +0 -0
  266. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  267. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
  268. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  269. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  270. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  271. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  272. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  273. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  274. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  275. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  276. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  277. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  278. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  279. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  280. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  281. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  282. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  283. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  284. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  285. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  286. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  287. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  288. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  289. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  290. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  291. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  292. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  293. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  294. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  295. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  296. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  297. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  298. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  299. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  300. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  301. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  302. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  303. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  304. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  305. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  306. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  307. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  308. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  309. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  310. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  311. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  312. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  313. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  314. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  315. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  316. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  317. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  318. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  319. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  320. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  321. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  322. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  323. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  324. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
  325. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  326. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  327. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  328. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  329. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  330. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  331. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  332. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  333. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  334. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  335. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  336. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  337. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  338. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  339. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  340. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  341. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  342. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  343. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  344. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  345. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  346. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  347. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  348. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  349. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -21
  350. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  351. package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-dev-guard_debug.kotlin_module +0 -0
  352. package/android/build/tmp/kotlin-classes/debug/com/devguard/DevGuardModule.class +0 -0
  353. package/android/build/tmp/kotlin-classes/debug/com/devguard/DevGuardPackage.class +0 -0
@@ -32,22 +32,17 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
35
  Object.defineProperty(exports, "__esModule", { value: true });
39
36
  exports.CacheService = void 0;
40
37
  const Keychain = __importStar(require("react-native-keychain"));
41
- const crypto_js_1 = __importDefault(require("crypto-js"));
38
+ const cacheCrypto_1 = require("./cacheCrypto");
42
39
  class CacheService {
43
40
  static SERVICE_NAME = 'devguard.cache.service';
44
41
  static WIPE_SERVICE = 'devguard.wipe.service';
45
42
  static async saveResponse(projectId, response) {
46
43
  try {
47
44
  const dataString = JSON.stringify(response);
48
- // Use projectId as the encryption key for the payload
49
- const encrypted = crypto_js_1.default.AES.encrypt(dataString, projectId).toString();
50
- // Store in secure keychain
45
+ const encrypted = (0, cacheCrypto_1.encryptCachePayload)(projectId, dataString);
51
46
  await Keychain.setGenericPassword(`devguard_${projectId}`, encrypted, { service: this.SERVICE_NAME });
52
47
  }
53
48
  catch (e) {
@@ -58,10 +53,7 @@ class CacheService {
58
53
  try {
59
54
  const credentials = await Keychain.getGenericPassword({ service: this.SERVICE_NAME });
60
55
  if (credentials && credentials.username === `devguard_${projectId}`) {
61
- const encrypted = credentials.password;
62
- // Decrypt using projectId
63
- const bytes = crypto_js_1.default.AES.decrypt(encrypted, projectId);
64
- const decrypted = bytes.toString(crypto_js_1.default.enc.Utf8);
56
+ const decrypted = (0, cacheCrypto_1.decryptCachePayload)(projectId, credentials.password);
65
57
  if (decrypted) {
66
58
  return JSON.parse(decrypted);
67
59
  }
@@ -81,7 +73,11 @@ class CacheService {
81
73
  console.warn('DevGuard Cache: Failed to clear cache', e);
82
74
  }
83
75
  }
84
- /** Last remote-wipe nonce executed on this device, or null. */
76
+ /**
77
+ * Returns the last remote-wipe nonce this client has executed, or null.
78
+ * Stored separately from the response cache so it survives a cache wipe
79
+ * (parity with Flutter's nonce persistence).
80
+ */
85
81
  static async getLastWipeNonce(projectId) {
86
82
  try {
87
83
  const credentials = await Keychain.getGenericPassword({ service: this.WIPE_SERVICE });
@@ -3,7 +3,7 @@ export declare class DevGuardLogger {
3
3
  static showConsoleLogs: boolean;
4
4
  private static initialized;
5
5
  private static infoLogs;
6
- static init(): Promise<void>;
6
+ static init(deviceId: string): Promise<void>;
7
7
  static enableConsoleLogs(): void;
8
8
  static info(message: string, data?: Record<string, any>): void;
9
9
  static warning(message: string, data?: Record<string, any>): void;
@@ -1,18 +1,28 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.DevGuardLogger = void 0;
7
+ const crypto_js_1 = __importDefault(require("crypto-js"));
4
8
  const react_native_vault_logger_1 = require("react-native-vault-logger");
9
+ function deriveVaultKeyMaterial(deviceId, salt) {
10
+ const hex = crypto_js_1.default.SHA256(`${deviceId}_${salt}`).toString(crypto_js_1.default.enc.Hex);
11
+ return crypto_js_1.default.enc.Hex.parse(hex).toString(crypto_js_1.default.enc.Latin1);
12
+ }
5
13
  class DevGuardLogger {
6
14
  static showConsoleLogs = false;
7
15
  static initialized = false;
8
16
  static infoLogs = [];
9
- static async init() {
17
+ static async init(deviceId) {
10
18
  if (this.initialized)
11
19
  return;
12
20
  try {
21
+ const encryptionKey = deriveVaultKeyMaterial(deviceId, 'dg_vault_key_v1');
22
+ const encryptionIV = deriveVaultKeyMaterial(deviceId, 'dg_vault_iv_v1').substring(0, 16);
13
23
  await react_native_vault_logger_1.CrashLogService.init({
14
- encryptionKey: 'DevGuard_Secure_Vault_Key_32_Ch!',
15
- encryptionIV: 'DevGuard_IV_16_C',
24
+ encryptionKey,
25
+ encryptionIV,
16
26
  maxLogCount: 1000,
17
27
  });
18
28
  this.initialized = true;
@@ -10,7 +10,10 @@ export declare class DeviceTokenService {
10
10
  * Reads from Keychain/Keystore if available, otherwise from in-memory cache.
11
11
  */
12
12
  getToken(): Promise<string | null>;
13
- /** Persists a registration token using Keychain/Keystore when available. */
13
+ /**
14
+ * Persists a registration token received from the server.
15
+ * Uses hardware-backed Keychain/Keystore when available (parity with Flutter's flutter_secure_storage).
16
+ */
14
17
  saveToken(token: string, useEnclave?: boolean): Promise<void>;
15
18
  /**
16
19
  * Removes the registration token. Only called on explicit admin revocation.
@@ -52,11 +52,14 @@ class DeviceTokenService {
52
52
  // Fallback: in-memory token
53
53
  return this.cachedToken;
54
54
  }
55
- /** Persists a registration token using Keychain/Keystore when available. */
55
+ /**
56
+ * Persists a registration token received from the server.
57
+ * Uses hardware-backed Keychain/Keystore when available (parity with Flutter's flutter_secure_storage).
58
+ */
56
59
  async saveToken(token, useEnclave = false) {
57
60
  let finalToken = token;
58
61
  if (useEnclave) {
59
- // Simulated enclave: reverse and prefix
62
+ // Simulated Enclave: Reverse and prefix (parity with Flutter)
60
63
  finalToken = `se:${token.split('').reverse().join('')}`;
61
64
  }
62
65
  // Primary: Keychain/Keystore (hardware-backed, persists across restarts)
@@ -1,19 +1,10 @@
1
1
  /**
2
2
  * Client-side policy enforcement applied to a server response before it is
3
- * shown to the user. Mirrors the Flutter plugin's `GuardEnforcement` so both
4
- * platforms behave identically.
3
+ * shown to the user. Mirrors Flutter `GuardEnforcement` + native `dg_e1`.
5
4
  */
6
5
  export declare class GuardEnforcement {
7
- /**
8
- * Applies enforcement rules to a fresh server response.
9
- *
10
- * - `blockEmulators`: if the project blocks emulators and the current device
11
- * is not a physical device, the response is overridden to LOCKED.
12
- *
13
- * @param response The parsed server response (mutated copy returned).
14
- * @param metadata The device metadata collected for this sync.
15
- */
6
+ private static evaluatePolicy;
16
7
  static apply(response: any, metadata: {
17
8
  isPhysicalDevice?: boolean;
18
- }): any;
9
+ }, isCompromised?: boolean): Promise<any>;
19
10
  }
@@ -1,29 +1,48 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GuardEnforcement = void 0;
4
+ const react_native_1 = require("react-native");
5
+ const obf_1 = require("../internal/obf");
6
+ const { DevGuard: DevGuardNative } = react_native_1.NativeModules;
4
7
  /**
5
8
  * Client-side policy enforcement applied to a server response before it is
6
- * shown to the user. Mirrors the Flutter plugin's `GuardEnforcement` so both
7
- * platforms behave identically.
9
+ * shown to the user. Mirrors Flutter `GuardEnforcement` + native `dg_e1`.
8
10
  */
9
11
  class GuardEnforcement {
10
- /**
11
- * Applies enforcement rules to a fresh server response.
12
- *
13
- * - `blockEmulators`: if the project blocks emulators and the current device
14
- * is not a physical device, the response is overridden to LOCKED.
15
- *
16
- * @param response The parsed server response (mutated copy returned).
17
- * @param metadata The device metadata collected for this sync.
18
- */
19
- static apply(response, metadata) {
20
- if (response?.blockEmulators === true && metadata?.isPhysicalDevice === false) {
12
+ static async evaluatePolicy(blockEmulators, isPhysicalDevice, isCompromised) {
13
+ if (typeof DevGuardNative?.evaluatePolicy === 'function') {
14
+ try {
15
+ return await DevGuardNative.evaluatePolicy(blockEmulators, isPhysicalDevice, isCompromised);
16
+ }
17
+ catch {
18
+ // Fall through to JS fallback when native bridge unavailable (e.g. tests).
19
+ }
20
+ }
21
+ if (isCompromised)
22
+ return obf_1.PolicyLock.compromised;
23
+ if (blockEmulators && !isPhysicalDevice)
24
+ return obf_1.PolicyLock.emulator;
25
+ return obf_1.PolicyLock.allow;
26
+ }
27
+ static async apply(response, metadata, isCompromised = false) {
28
+ const isPhysical = metadata?.isPhysicalDevice !== false;
29
+ const code = await this.evaluatePolicy(response?.blockEmulators === true, isPhysical, isCompromised);
30
+ if (code === obf_1.PolicyLock.compromised) {
31
+ console.warn(obf_1.Obf.compromisedLog);
32
+ return {
33
+ ...response,
34
+ status: 'LOCKED',
35
+ title: obf_1.Obf.securityTitle,
36
+ message: obf_1.Obf.compromisedMessage,
37
+ };
38
+ }
39
+ if (code === obf_1.PolicyLock.emulator) {
21
40
  console.warn('DevGuard: Emulator blocked by project policy.');
22
41
  return {
23
42
  ...response,
24
43
  status: 'LOCKED',
25
- title: 'Emulator Detected',
26
- message: 'This application cannot run on emulators or simulators for security reasons.',
44
+ title: obf_1.Obf.emulatorTitle,
45
+ message: obf_1.Obf.emulatorMessage,
27
46
  };
28
47
  }
29
48
  return response;
@@ -5,7 +5,11 @@ export declare class HardwareService {
5
5
  static getInstance(): HardwareService;
6
6
  getDeviceId(): Promise<string>;
7
7
  setDeviceUser(username?: string, email?: string, phone?: string, customData?: Record<string, any>): Promise<void>;
8
- /** Clears stored device-user identity (username, email, phone, customData). */
8
+ /**
9
+ * Clears all stored device-user identity (username/email/phone/customData).
10
+ * Used by the hardened remote wipe (parity with Flutter's
11
+ * SecureStorageService.deleteAllDeviceUserKeys).
12
+ */
9
13
  clearDeviceUser(): Promise<void>;
10
14
  getMetadata(betaFeatures?: any): Promise<any>;
11
15
  private getNetworkType;
@@ -16,4 +20,13 @@ export declare class HardwareService {
16
20
  * Each metric is collected independently so one failure never blocks the rest.
17
21
  */
18
22
  private collectAdvancedTelemetry;
23
+ /**
24
+ * Collects GPS only if permission is already granted — never prompts during sync.
25
+ *
26
+ * Uses a cached position (low accuracy, high maximumAge) to avoid waking the GPS
27
+ * radio. Denied or unavailable permission returns null silently — it must not
28
+ * pollute the error vault.
29
+ */
30
+ private getLocationPassive;
31
+ private isLocationPermissionGranted;
19
32
  }
@@ -86,7 +86,11 @@ class HardwareService {
86
86
  console.warn('DevGuard: Failed to save user info', e);
87
87
  }
88
88
  }
89
- /** Clears stored device-user identity (username, email, phone, customData). */
89
+ /**
90
+ * Clears all stored device-user identity (username/email/phone/customData).
91
+ * Used by the hardened remote wipe (parity with Flutter's
92
+ * SecureStorageService.deleteAllDeviceUserKeys).
93
+ */
90
94
  async clearDeviceUser() {
91
95
  try {
92
96
  await Keychain.resetGenericPassword({ service: 'devguard.user.service' });
@@ -216,7 +220,65 @@ class HardwareService {
216
220
  catch (e) {
217
221
  // Ignore individual metric failure.
218
222
  }
223
+ const location = await this.getLocationPassive();
224
+ if (location) {
225
+ out.location = location;
226
+ }
219
227
  return out;
220
228
  }
229
+ /**
230
+ * Collects GPS only if permission is already granted — never prompts during sync.
231
+ *
232
+ * Uses a cached position (low accuracy, high maximumAge) to avoid waking the GPS
233
+ * radio. Denied or unavailable permission returns null silently — it must not
234
+ * pollute the error vault.
235
+ */
236
+ async getLocationPassive() {
237
+ if (react_native_1.Platform.OS !== 'android' && react_native_1.Platform.OS !== 'ios')
238
+ return null;
239
+ if (!(await this.isLocationPermissionGranted()))
240
+ return null;
241
+ try {
242
+ // Optional peer: host app installs react-native-geolocation-service for GPS telemetry.
243
+ const Geolocation = require('react-native-geolocation-service').default;
244
+ return await new Promise((resolve) => {
245
+ Geolocation.getCurrentPosition((position) => {
246
+ const { latitude, longitude } = position.coords;
247
+ resolve(`${latitude.toFixed(4)},${longitude.toFixed(4)}`);
248
+ }, () => resolve(null), {
249
+ enableHighAccuracy: false,
250
+ maximumAge: 86_400_000,
251
+ timeout: 5_000,
252
+ });
253
+ });
254
+ }
255
+ catch {
256
+ return null;
257
+ }
258
+ }
259
+ async isLocationPermissionGranted() {
260
+ if (react_native_1.Platform.OS === 'android') {
261
+ try {
262
+ const fine = await react_native_1.PermissionsAndroid.check(react_native_1.PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
263
+ const coarse = await react_native_1.PermissionsAndroid.check(react_native_1.PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION);
264
+ return fine || coarse;
265
+ }
266
+ catch {
267
+ return false;
268
+ }
269
+ }
270
+ if (react_native_1.Platform.OS === 'ios') {
271
+ try {
272
+ // Optional peer: react-native-permissions (check only — never request).
273
+ const { check, PERMISSIONS, RESULTS } = require('react-native-permissions');
274
+ const status = await check(PERMISSIONS.IOS.LOCATION_WHEN_IN_USE);
275
+ return status === RESULTS.GRANTED || status === RESULTS.LIMITED;
276
+ }
277
+ catch {
278
+ return false;
279
+ }
280
+ }
281
+ return false;
282
+ }
221
283
  }
222
284
  exports.HardwareService = HardwareService;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * AES-CBC with key/IV derived from projectId — no OpenSSL random salt (RN-safe).
3
+ * Parity with DevGuardLogger vault key derivation; avoids Node crypto RNG on Android/Hermes.
4
+ */
5
+ export declare function encryptCachePayload(projectId: string, plainText: string): string;
6
+ export declare function decryptCachePayload(projectId: string, cipherText: string): string | null;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.encryptCachePayload = encryptCachePayload;
7
+ exports.decryptCachePayload = decryptCachePayload;
8
+ const crypto_js_1 = __importDefault(require("crypto-js"));
9
+ const CACHE_KEY_SALT = 'dg_cache_key_v1';
10
+ const CACHE_IV_SALT = 'dg_cache_iv_v1';
11
+ /** OpenSSL salted ciphertext prefix (legacy passphrase-based AES). */
12
+ const LEGACY_OPENSSL_PREFIX = 'U2FsdGVk';
13
+ function deriveCacheKeyIv(projectId) {
14
+ const keyHex = crypto_js_1.default.SHA256(`${projectId}_${CACHE_KEY_SALT}`).toString(crypto_js_1.default.enc.Hex);
15
+ const ivHex = crypto_js_1.default.SHA256(`${projectId}_${CACHE_IV_SALT}`).toString(crypto_js_1.default.enc.Hex);
16
+ return {
17
+ key: crypto_js_1.default.enc.Hex.parse(keyHex),
18
+ iv: crypto_js_1.default.enc.Hex.parse(ivHex.substring(0, 32)),
19
+ };
20
+ }
21
+ /**
22
+ * AES-CBC with key/IV derived from projectId — no OpenSSL random salt (RN-safe).
23
+ * Parity with DevGuardLogger vault key derivation; avoids Node crypto RNG on Android/Hermes.
24
+ */
25
+ function encryptCachePayload(projectId, plainText) {
26
+ const { key, iv } = deriveCacheKeyIv(projectId);
27
+ return crypto_js_1.default.AES.encrypt(plainText, key, { iv }).toString();
28
+ }
29
+ function decryptCachePayload(projectId, cipherText) {
30
+ const { key, iv } = deriveCacheKeyIv(projectId);
31
+ const decrypted = crypto_js_1.default.AES.decrypt(cipherText, key, { iv }).toString(crypto_js_1.default.enc.Utf8);
32
+ if (decrypted)
33
+ return decrypted;
34
+ // Legacy entries used passphrase mode (random salt → needs native crypto RNG).
35
+ if (cipherText.startsWith(LEGACY_OPENSSL_PREFIX)) {
36
+ const legacy = crypto_js_1.default.AES.decrypt(cipherText, projectId).toString(crypto_js_1.default.enc.Utf8);
37
+ return legacy || null;
38
+ }
39
+ return null;
40
+ }
@@ -0,0 +1,21 @@
1
+ export interface LockScreenBranding {
2
+ brandName?: string | null;
3
+ logoUrl?: string | null;
4
+ primaryColor?: string;
5
+ accentColor?: string | null;
6
+ websiteUrl?: string | null;
7
+ hidePoweredBy?: boolean;
8
+ }
9
+ /** Default lock-screen palette when API sends no branding colors (Flutter PaymentWall parity). */
10
+ export declare const DEFAULT_LOCK_PRIMARY = "#d32f2f";
11
+ export declare const DEFAULT_LOCK_ACCENT = "#b71c1c";
12
+ export declare function parseHexColor(hex?: string | null, fallback?: string): string;
13
+ export declare function resolveBrandingFooter(branding?: LockScreenBranding | null): {
14
+ hasCustom: boolean;
15
+ label: string;
16
+ brand: string;
17
+ url: string;
18
+ hidePoweredBy: boolean;
19
+ primaryColor: string;
20
+ accentColor: string;
21
+ };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_LOCK_ACCENT = exports.DEFAULT_LOCK_PRIMARY = void 0;
4
+ exports.parseHexColor = parseHexColor;
5
+ exports.resolveBrandingFooter = resolveBrandingFooter;
6
+ /** Default lock-screen palette when API sends no branding colors (Flutter PaymentWall parity). */
7
+ exports.DEFAULT_LOCK_PRIMARY = '#d32f2f';
8
+ exports.DEFAULT_LOCK_ACCENT = '#b71c1c';
9
+ function parseHexColor(hex, fallback = exports.DEFAULT_LOCK_PRIMARY) {
10
+ if (!hex)
11
+ return fallback;
12
+ const normalized = hex.startsWith('#') ? hex : `#${hex}`;
13
+ return /^#[0-9A-Fa-f]{6}$/.test(normalized) ? normalized : fallback;
14
+ }
15
+ function resolveBrandingFooter(branding) {
16
+ const hasCustom = !!branding && (!!branding.brandName?.trim() || !!branding.logoUrl?.trim());
17
+ return {
18
+ hasCustom,
19
+ label: hasCustom ? 'Powered by' : 'Secured by',
20
+ brand: hasCustom
21
+ ? branding?.brandName?.trim() || 'DevGuard'
22
+ : 'DevGuard',
23
+ url: hasCustom && branding?.websiteUrl?.trim()
24
+ ? branding.websiteUrl.trim()
25
+ : 'https://devguard.uk',
26
+ hidePoweredBy: branding?.hidePoweredBy === true,
27
+ primaryColor: parseHexColor(branding?.primaryColor, exports.DEFAULT_LOCK_PRIMARY),
28
+ accentColor: parseHexColor(branding?.accentColor || branding?.primaryColor, exports.DEFAULT_LOCK_ACCENT),
29
+ };
30
+ }
@@ -0,0 +1,4 @@
1
+ /** Build contact deep-links for lock-screen support buttons (Flutter ContactButton parity). */
2
+ export declare function buildWhatsAppUrl(raw: string): string;
3
+ export declare function buildMailtoUrl(raw: string): string;
4
+ export declare function buildTelUrl(raw: string): string;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /** Build contact deep-links for lock-screen support buttons (Flutter ContactButton parity). */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.buildWhatsAppUrl = buildWhatsAppUrl;
5
+ exports.buildMailtoUrl = buildMailtoUrl;
6
+ exports.buildTelUrl = buildTelUrl;
7
+ function buildWhatsAppUrl(raw) {
8
+ const digits = raw.replace(/[^0-9]/g, '');
9
+ return digits ? `https://wa.me/${digits}` : '';
10
+ }
11
+ function buildMailtoUrl(raw) {
12
+ const email = raw.trim();
13
+ return email ? `mailto:${email}` : '';
14
+ }
15
+ function buildTelUrl(raw) {
16
+ const phone = raw.replace(/[^\d+]/g, '');
17
+ return phone ? `tel:${phone}` : '';
18
+ }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "react-native-dev-guard",
3
- "version": "0.0.1",
3
+ "version": "1.0.1",
4
4
  "description": "DevGuard protection for React Native apps",
5
5
  "license": "MIT",
6
- "author": "arsarsars1",
6
+ "author": "DevGuard-uk",
7
7
  "homepage": "https://github.com/DevGuard-uk/react-native-dev-guard",
8
8
  "repository": {
9
9
  "type": "git",
@@ -21,15 +21,21 @@
21
21
  "types": "lib/index.d.ts",
22
22
  "files": [
23
23
  "lib",
24
- "android",
25
- "ios",
26
- "cpp"
24
+ "cpp",
25
+ "ios/DevGuard.h",
26
+ "ios/DevGuard.mm",
27
+ "android/build.gradle",
28
+ "android/src",
29
+ "react-native-dev-guard.podspec",
30
+ "screenshots"
27
31
  ],
28
32
  "scripts": {
29
33
  "clean": "rimraf lib",
30
- "build:ts": "tsc",
34
+ "gen:obf": "node tool/genObf.js",
35
+ "build:ts": "npm run gen:obf && tsc",
31
36
  "build:obfuscate": "echo 'Skipping obfuscator for RN bundle compat'",
32
37
  "build": "npm-run-all clean build:ts build:obfuscate",
38
+ "test": "npm run build && node --test test/branding.test.js test/obf.test.js",
33
39
  "prepublishOnly": "npm run build",
34
40
  "verify:versions": "node -e \"const rn=require('react-native/package.json');const r=require('react/package.json');console.log('react-native',rn.version,'react',r.version);\""
35
41
  },
@@ -37,7 +43,7 @@
37
43
  "crypto-js": "^4.2.0",
38
44
  "pako": "^2.1.0",
39
45
  "react-native-safe-area-context": "^5.5.2",
40
- "react-native-vault-logger": "^0.1.2"
46
+ "react-native-vault-logger": "^0.1.3"
41
47
  },
42
48
  "devDependencies": {
43
49
  "@types/crypto-js": "^4.2.2",
@@ -58,6 +64,20 @@
58
64
  "react": ">=18",
59
65
  "react-native": ">=0.76",
60
66
  "react-native-device-info": "*",
61
- "react-native-keychain": "*"
67
+ "react-native-geolocation-service": "*",
68
+ "react-native-keychain": "*",
69
+ "react-native-permissions": "*"
70
+ },
71
+ "peerDependenciesMeta": {
72
+ "react-native-geolocation-service": {
73
+ "optional": true
74
+ },
75
+ "react-native-permissions": {
76
+ "optional": true
77
+ }
78
+ },
79
+ "overrides": {
80
+ "image-size": "2.0.2",
81
+ "shell-quote": "1.8.4"
62
82
  }
63
83
  }
@@ -0,0 +1,19 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "react-native-dev-guard"
7
+ s.version = package["version"]
8
+ s.summary = package["description"]
9
+ s.homepage = package["homepage"] || "https://github.com/DevGuard-uk/react-native-dev-guard"
10
+ s.license = package["license"] || "MIT"
11
+ s.authors = package["author"] || "DevGuard"
12
+
13
+ s.platforms = { :ios => "15.1" }
14
+ s.source = { :git => (package.dig("repository", "url") || "https://github.com/DevGuard-uk/react-native-dev-guard.git"), :tag => "v#{s.version}" }
15
+
16
+ s.source_files = "ios/**/*.{h,m,mm,cpp}", "cpp/**/*.{h,c,cpp}"
17
+
18
+ s.dependency "React-Core"
19
+ end
Binary file
Binary file
Binary file