react-native-dev-guard 0.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/LICENSE +21 -0
- package/README.md +85 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/reply/cache-v2-ca87e29d866016c47643.json +1287 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/reply/cmakeFiles-v1-afc39e04c88d618b9499.json +182 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/reply/codemodel-v2-004ad46f03b4d6b2acd6.json +59 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/reply/index-2026-05-15T08-21-19-0083.json +92 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.cmake/api/v1/reply/target-devguard-Debug-8c0ebbb0cdb88d164b64.json +160 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.ninja_deps +0 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/.ninja_log +15 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeCache.txt +391 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/3.18.1-g262b901/CMakeCCompiler.cmake +77 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/3.18.1-g262b901/CMakeCXXCompiler.cmake +89 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_C.bin +0 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/3.18.1-g262b901/CMakeSystem.cmake +15 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/CMakeOutput.log +236 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/TargetDirectories.txt +3 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/cmake.check_cache +1 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/devguard.dir/devguard-lib.cpp.o +0 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/CMakeFiles/rules.ninja +74 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/additional_project_files.txt +0 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/android_gradle_build.json +40 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/android_gradle_build_mini.json +27 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/build.ninja +154 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/build_file_index.txt +1 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/cmake_install.cmake +54 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/compile_commands.json +12 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/compile_commands.json.bin +0 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/configure_fingerprint.bin +29 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/metadata_generation_command.txt +19 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/prefab_config.json +4 -0
- package/android/.cxx/Debug/4s4f1av3/arm64-v8a/symbol_folder_index.txt +1 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/reply/cache-v2-02400eb6fc4793fa6bf2.json +1287 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/reply/cmakeFiles-v1-d0fc95efa84cbe47849a.json +379 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/reply/codemodel-v2-a7a363de64e45a261589.json +59 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/reply/index-2026-05-15T08-21-21-0243.json +92 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.cmake/api/v1/reply/target-devguard-Debug-53eeaa7145cf9770f3d7.json +160 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.ninja_deps +0 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/.ninja_log +10 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeCache.txt +391 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/3.18.1-g262b901/CMakeCCompiler.cmake +77 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/3.18.1-g262b901/CMakeCXXCompiler.cmake +89 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_C.bin +0 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/3.18.1-g262b901/CMakeSystem.cmake +15 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/CMakeOutput.log +240 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/TargetDirectories.txt +3 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/cmake.check_cache +1 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/devguard.dir/devguard-lib.cpp.o +0 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/CMakeFiles/rules.ninja +74 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/additional_project_files.txt +0 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/android_gradle_build.json +40 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/android_gradle_build_mini.json +27 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/build.ninja +154 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/build_file_index.txt +1 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/cmake_install.cmake +54 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/compile_commands.json +12 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/compile_commands.json.bin +0 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/configure_fingerprint.bin +29 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/metadata_generation_command.txt +19 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/prefab_config.json +4 -0
- package/android/.cxx/Debug/4s4f1av3/armeabi-v7a/symbol_folder_index.txt +1 -0
- package/android/.cxx/Debug/4s4f1av3/hash_key.txt +26 -0
- package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/reply/cache-v2-ec883f5c922c646acf2d.json +1287 -0
- package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/reply/cmakeFiles-v1-028bf03c3b9bd0e609c0.json +379 -0
- package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/reply/codemodel-v2-6c0215a4bb6e3b0b5223.json +59 -0
- package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/reply/index-2026-05-15T08-21-22-0722.json +92 -0
- package/android/.cxx/Debug/4s4f1av3/x86/.cmake/api/v1/reply/target-devguard-Debug-2139b18dc63b630666db.json +160 -0
- package/android/.cxx/Debug/4s4f1av3/x86/.ninja_deps +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86/.ninja_log +10 -0
- package/android/.cxx/Debug/4s4f1av3/x86/CMakeCache.txt +391 -0
- package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/3.18.1-g262b901/CMakeCCompiler.cmake +77 -0
- package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/3.18.1-g262b901/CMakeCXXCompiler.cmake +89 -0
- package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_C.bin +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/3.18.1-g262b901/CMakeSystem.cmake +15 -0
- package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/CMakeOutput.log +230 -0
- package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/TargetDirectories.txt +3 -0
- package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/cmake.check_cache +1 -0
- package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/devguard.dir/devguard-lib.cpp.o +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86/CMakeFiles/rules.ninja +74 -0
- package/android/.cxx/Debug/4s4f1av3/x86/additional_project_files.txt +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86/android_gradle_build.json +40 -0
- package/android/.cxx/Debug/4s4f1av3/x86/android_gradle_build_mini.json +27 -0
- package/android/.cxx/Debug/4s4f1av3/x86/build.ninja +154 -0
- package/android/.cxx/Debug/4s4f1av3/x86/build_file_index.txt +1 -0
- package/android/.cxx/Debug/4s4f1av3/x86/cmake_install.cmake +54 -0
- package/android/.cxx/Debug/4s4f1av3/x86/compile_commands.json +12 -0
- package/android/.cxx/Debug/4s4f1av3/x86/compile_commands.json.bin +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86/configure_fingerprint.bin +29 -0
- package/android/.cxx/Debug/4s4f1av3/x86/metadata_generation_command.txt +19 -0
- package/android/.cxx/Debug/4s4f1av3/x86/prefab_config.json +4 -0
- package/android/.cxx/Debug/4s4f1av3/x86/symbol_folder_index.txt +1 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/reply/cache-v2-7ec870c116aeb770686e.json +1287 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/reply/cmakeFiles-v1-f2e6a276d8adf420c6b9.json +379 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/reply/codemodel-v2-a4f2c2fefb1e4261b2d6.json +59 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/reply/index-2026-05-15T08-21-24-0187.json +92 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/.cmake/api/v1/reply/target-devguard-Debug-077cad881ac8d6864f8f.json +160 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/.ninja_deps +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/.ninja_log +10 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeCache.txt +391 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/3.18.1-g262b901/CMakeCCompiler.cmake +77 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/3.18.1-g262b901/CMakeCXXCompiler.cmake +89 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_C.bin +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/3.18.1-g262b901/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/3.18.1-g262b901/CMakeSystem.cmake +15 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/CMakeOutput.log +230 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/TargetDirectories.txt +3 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/cmake.check_cache +1 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/devguard.dir/devguard-lib.cpp.o +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/CMakeFiles/rules.ninja +74 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/additional_project_files.txt +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/android_gradle_build.json +40 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/android_gradle_build_mini.json +27 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/build.ninja +154 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/build_file_index.txt +1 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/cmake_install.cmake +54 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/compile_commands.json +12 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/compile_commands.json.bin +0 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/configure_fingerprint.bin +29 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/metadata_generation_command.txt +19 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/prefab_config.json +4 -0
- package/android/.cxx/Debug/4s4f1av3/x86_64/symbol_folder_index.txt +1 -0
- package/android/.cxx/tools/debug/arm64-v8a/compile_commands.json +12 -0
- package/android/.cxx/tools/debug/armeabi-v7a/compile_commands.json +12 -0
- package/android/.cxx/tools/debug/x86/compile_commands.json +12 -0
- package/android/.cxx/tools/debug/x86_64/compile_commands.json +12 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build/.transforms/07ab8b2284230b9b98454cb3baa5db54/results.bin +1 -0
- package/android/build/.transforms/07ab8b2284230b9b98454cb3baa5db54/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/devguard/BuildConfig.dex +0 -0
- package/android/build/.transforms/07ab8b2284230b9b98454cb3baa5db54/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/devguard/DevGuardModule.dex +0 -0
- package/android/build/.transforms/07ab8b2284230b9b98454cb3baa5db54/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/devguard/DevGuardPackage.dex +0 -0
- package/android/build/.transforms/07ab8b2284230b9b98454cb3baa5db54/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/ae351402e6cba75b162136aa850e1ba2/results.bin +1 -0
- package/android/build/.transforms/ae351402e6cba75b162136aa850e1ba2/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/devguard/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +9 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/build_command_devguard +4 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/build_model.json +187 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/build_stderr_devguard.txt +0 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/build_stdout_devguard.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/generate_cxx_metadata_111_timing.txt +3 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/generate_cxx_metadata_1463_timing.txt +3 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/generate_cxx_metadata_324_timing.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/generate_cxx_metadata_475_timing.txt +3 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/generate_cxx_metadata_622_timing.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/arm64-v8a/metadata_generation_record.json +41 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/build_command_devguard +4 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/build_model.json +187 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/build_stderr_devguard.txt +0 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/build_stdout_devguard.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/generate_cxx_metadata_111_timing.txt +3 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/generate_cxx_metadata_1459_timing.txt +3 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/generate_cxx_metadata_324_timing.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/generate_cxx_metadata_475_timing.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/generate_cxx_metadata_622_timing.txt +3 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/armeabi-v7a/metadata_generation_record.json +41 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/build_command_devguard +4 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/build_model.json +187 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/build_stderr_devguard.txt +0 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/build_stdout_devguard.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/generate_cxx_metadata_111_timing.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/generate_cxx_metadata_1459_timing.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/generate_cxx_metadata_324_timing.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/generate_cxx_metadata_475_timing.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/generate_cxx_metadata_622_timing.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86/metadata_generation_record.json +41 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/build_command_devguard +4 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/build_model.json +187 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/build_stderr_devguard.txt +0 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/build_stdout_devguard.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/generate_cxx_metadata_111_timing.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/generate_cxx_metadata_1459_timing.txt +3 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/generate_cxx_metadata_324_timing.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/generate_cxx_metadata_475_timing.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/generate_cxx_metadata_622_timing.txt +2 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/logs/x86_64/metadata_generation_record.json +41 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/obj/arm64-v8a/libdevguard.so +0 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/obj/armeabi-v7a/libdevguard.so +0 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/obj/x86/libdevguard.so +0 -0
- package/android/build/intermediates/cxx/Debug/4s4f1av3/obj/x86_64/libdevguard.so +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/react-native-dev-guard_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/devguard/BuildConfig.class +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libdevguard.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/armeabi-v7a/libdevguard.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86/libdevguard.so +0 -0
- package/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/x86_64/libdevguard.so +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +11 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +9 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/arm64-v8a/libdevguard.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/armeabi-v7a/libdevguard.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86/libdevguard.so +0 -0
- package/android/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/x86_64/libdevguard.so +0 -0
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/react-native-dev-guard_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/devguard/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/devguard/DevGuardModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/devguard/DevGuardPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +21 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-dev-guard_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/devguard/DevGuardModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/devguard/DevGuardPackage.class +0 -0
- package/android/build.gradle +47 -0
- package/android/src/main/AndroidManifest.xml +6 -0
- package/android/src/main/cpp/CMakeLists.txt +25 -0
- package/android/src/main/cpp/devguard-lib.cpp +38 -0
- package/android/src/main/java/com/devguard/DevGuardModule.kt +40 -0
- package/android/src/main/java/com/devguard/DevGuardPackage.kt +16 -0
- package/cpp/devguard_core.c +239 -0
- package/cpp/devguard_core.h +35 -0
- package/ios/DevGuard.h +4 -0
- package/ios/DevGuard.mm +44 -0
- package/lib/components/ContactButton.d.ts +9 -0
- package/lib/components/ContactButton.js +31 -0
- package/lib/components/DiagnosticOverlay.d.ts +9 -0
- package/lib/components/DiagnosticOverlay.js +77 -0
- package/lib/components/LockScreen.d.ts +13 -0
- package/lib/components/LockScreen.js +201 -0
- package/lib/components/SecurityToast.d.ts +7 -0
- package/lib/components/SecurityToast.js +92 -0
- package/lib/index.d.ts +52 -0
- package/lib/index.js +410 -0
- package/lib/services/CacheService.d.ts +10 -0
- package/lib/services/CacheService.js +109 -0
- package/lib/services/DevGuardLogger.d.ts +20 -0
- package/lib/services/DevGuardLogger.js +88 -0
- package/lib/services/DeviceTokenService.d.ts +27 -0
- package/lib/services/DeviceTokenService.js +135 -0
- package/lib/services/GuardEnforcement.d.ts +19 -0
- package/lib/services/GuardEnforcement.js +32 -0
- package/lib/services/HardwareService.d.ts +19 -0
- package/lib/services/HardwareService.js +222 -0
- package/lib/services/RemoteWipeService.d.ts +20 -0
- package/lib/services/RemoteWipeService.js +45 -0
- package/lib/services/UsageLogger.d.ts +17 -0
- package/lib/services/UsageLogger.js +52 -0
- package/package.json +63 -0
|
@@ -0,0 +1,135 @@
|
|
|
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.DeviceTokenService = void 0;
|
|
7
|
+
const crypto_js_1 = __importDefault(require("crypto-js"));
|
|
8
|
+
// Conditional import — react-native-keychain is a peer dependency
|
|
9
|
+
let Keychain = null;
|
|
10
|
+
try {
|
|
11
|
+
Keychain = require('react-native-keychain');
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
// Keychain not available — fallback to in-memory with AES encryption
|
|
15
|
+
console.warn('DevGuard: react-native-keychain not installed. Device tokens will not persist across restarts.');
|
|
16
|
+
}
|
|
17
|
+
const TOKEN_SERVICE_KEY = 'com.devguard.device-token';
|
|
18
|
+
const FINGERPRINT_SERVICE_KEY = 'com.devguard.fingerprint';
|
|
19
|
+
class DeviceTokenService {
|
|
20
|
+
static instance;
|
|
21
|
+
cachedToken = null;
|
|
22
|
+
sessionKey;
|
|
23
|
+
fingerprint = null;
|
|
24
|
+
constructor() {
|
|
25
|
+
// Generate a session key without relying on native crypto, which often fails in RN environments
|
|
26
|
+
// without specific polyfills (e.g. react-native-get-random-values).
|
|
27
|
+
this.sessionKey = Date.now().toString(36) + Math.random().toString(36).substring(2);
|
|
28
|
+
}
|
|
29
|
+
static getInstance() {
|
|
30
|
+
if (!DeviceTokenService.instance) {
|
|
31
|
+
DeviceTokenService.instance = new DeviceTokenService();
|
|
32
|
+
}
|
|
33
|
+
return DeviceTokenService.instance;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Retrieves the device registration token.
|
|
37
|
+
* Reads from Keychain/Keystore if available, otherwise from in-memory cache.
|
|
38
|
+
*/
|
|
39
|
+
async getToken() {
|
|
40
|
+
// Try Keychain first (persists across restarts)
|
|
41
|
+
if (Keychain) {
|
|
42
|
+
try {
|
|
43
|
+
const credentials = await Keychain.getGenericPassword({ service: TOKEN_SERVICE_KEY });
|
|
44
|
+
if (credentials && credentials.password) {
|
|
45
|
+
return credentials.password;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
console.warn('DevGuard: Keychain read failed, using in-memory fallback');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// Fallback: in-memory token
|
|
53
|
+
return this.cachedToken;
|
|
54
|
+
}
|
|
55
|
+
/** Persists a registration token using Keychain/Keystore when available. */
|
|
56
|
+
async saveToken(token, useEnclave = false) {
|
|
57
|
+
let finalToken = token;
|
|
58
|
+
if (useEnclave) {
|
|
59
|
+
// Simulated enclave: reverse and prefix
|
|
60
|
+
finalToken = `se:${token.split('').reverse().join('')}`;
|
|
61
|
+
}
|
|
62
|
+
// Primary: Keychain/Keystore (hardware-backed, persists across restarts)
|
|
63
|
+
if (Keychain) {
|
|
64
|
+
try {
|
|
65
|
+
await Keychain.setGenericPassword('devguard', finalToken, {
|
|
66
|
+
service: TOKEN_SERVICE_KEY,
|
|
67
|
+
accessible: Keychain.ACCESSIBLE?.AFTER_FIRST_UNLOCK || undefined,
|
|
68
|
+
securityLevel: Keychain.SECURITY_LEVEL?.SECURE_HARDWARE || undefined,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
console.warn('DevGuard: Keychain write failed, using in-memory fallback');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Secondary: in-memory (always set as backup) - Plain for now due to RNG issues in RN
|
|
76
|
+
this.cachedToken = finalToken;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Removes the registration token. Only called on explicit admin revocation.
|
|
80
|
+
*/
|
|
81
|
+
async clearToken() {
|
|
82
|
+
// Clear Keychain
|
|
83
|
+
if (Keychain) {
|
|
84
|
+
try {
|
|
85
|
+
await Keychain.resetGenericPassword({ service: TOKEN_SERVICE_KEY });
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
// Ignore cleanup errors
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// Clear in-memory
|
|
92
|
+
this.cachedToken = null;
|
|
93
|
+
this.sessionKey = Date.now().toString(36) + Math.random().toString(36).substring(2);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Generates a device fingerprint from hardware identifiers.
|
|
97
|
+
* This fingerprint persists even if the token is wiped, allowing
|
|
98
|
+
* the server to detect re-registrations from the same hardware.
|
|
99
|
+
*/
|
|
100
|
+
static generateFingerprint(deviceId, model, os) {
|
|
101
|
+
const raw = `${deviceId}|${model}|${os}`;
|
|
102
|
+
return crypto_js_1.default.SHA256(raw).toString().substring(0, 16);
|
|
103
|
+
}
|
|
104
|
+
async saveFingerprint(fingerprint) {
|
|
105
|
+
this.fingerprint = fingerprint;
|
|
106
|
+
if (Keychain) {
|
|
107
|
+
try {
|
|
108
|
+
await Keychain.setGenericPassword('devguard', fingerprint, {
|
|
109
|
+
service: FINGERPRINT_SERVICE_KEY,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
// Ignore
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
async getFingerprint() {
|
|
118
|
+
if (this.fingerprint)
|
|
119
|
+
return this.fingerprint;
|
|
120
|
+
if (Keychain) {
|
|
121
|
+
try {
|
|
122
|
+
const credentials = await Keychain.getGenericPassword({ service: FINGERPRINT_SERVICE_KEY });
|
|
123
|
+
if (credentials && credentials.password) {
|
|
124
|
+
this.fingerprint = credentials.password;
|
|
125
|
+
return this.fingerprint;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch (e) {
|
|
129
|
+
// Ignore
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
exports.DeviceTokenService = DeviceTokenService;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
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.
|
|
5
|
+
*/
|
|
6
|
+
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
|
+
*/
|
|
16
|
+
static apply(response: any, metadata: {
|
|
17
|
+
isPhysicalDevice?: boolean;
|
|
18
|
+
}): any;
|
|
19
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GuardEnforcement = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* 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.
|
|
8
|
+
*/
|
|
9
|
+
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) {
|
|
21
|
+
console.warn('DevGuard: Emulator blocked by project policy.');
|
|
22
|
+
return {
|
|
23
|
+
...response,
|
|
24
|
+
status: 'LOCKED',
|
|
25
|
+
title: 'Emulator Detected',
|
|
26
|
+
message: 'This application cannot run on emulators or simulators for security reasons.',
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return response;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.GuardEnforcement = GuardEnforcement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class HardwareService {
|
|
2
|
+
private static instance;
|
|
3
|
+
private deviceId;
|
|
4
|
+
private constructor();
|
|
5
|
+
static getInstance(): HardwareService;
|
|
6
|
+
getDeviceId(): Promise<string>;
|
|
7
|
+
setDeviceUser(username?: string, email?: string, phone?: string, customData?: Record<string, any>): Promise<void>;
|
|
8
|
+
/** Clears stored device-user identity (username, email, phone, customData). */
|
|
9
|
+
clearDeviceUser(): Promise<void>;
|
|
10
|
+
getMetadata(betaFeatures?: any): Promise<any>;
|
|
11
|
+
private getNetworkType;
|
|
12
|
+
/**
|
|
13
|
+
* Collects advanced hardware telemetry as FLAT string fields, matching the
|
|
14
|
+
* Flutter plugin (battery/batteryCharging/batteryThermal/ram/storage) so the
|
|
15
|
+
* admin panel renders Health (Beta) identically on both platforms.
|
|
16
|
+
* Each metric is collected independently so one failure never blocks the rest.
|
|
17
|
+
*/
|
|
18
|
+
private collectAdvancedTelemetry;
|
|
19
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.HardwareService = void 0;
|
|
40
|
+
const react_native_device_info_1 = __importDefault(require("react-native-device-info"));
|
|
41
|
+
const react_native_1 = require("react-native");
|
|
42
|
+
const Keychain = __importStar(require("react-native-keychain"));
|
|
43
|
+
const crypto_js_1 = __importDefault(require("crypto-js"));
|
|
44
|
+
const UsageLogger_1 = require("./UsageLogger");
|
|
45
|
+
const DeviceTokenService_1 = require("./DeviceTokenService");
|
|
46
|
+
class HardwareService {
|
|
47
|
+
static instance;
|
|
48
|
+
deviceId = null;
|
|
49
|
+
constructor() { }
|
|
50
|
+
static getInstance() {
|
|
51
|
+
if (!HardwareService.instance) {
|
|
52
|
+
HardwareService.instance = new HardwareService();
|
|
53
|
+
}
|
|
54
|
+
return HardwareService.instance;
|
|
55
|
+
}
|
|
56
|
+
async getDeviceId() {
|
|
57
|
+
if (this.deviceId)
|
|
58
|
+
return this.deviceId;
|
|
59
|
+
try {
|
|
60
|
+
const id = await react_native_device_info_1.default.getUniqueId();
|
|
61
|
+
if (id && id !== 'unknown') {
|
|
62
|
+
this.deviceId = id;
|
|
63
|
+
return id;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch (e) {
|
|
67
|
+
console.warn('DevGuard: Native DeviceInfo failed, falling back to fingerprint');
|
|
68
|
+
}
|
|
69
|
+
const fingerprint = [
|
|
70
|
+
react_native_1.Platform.OS,
|
|
71
|
+
react_native_1.Platform.Version,
|
|
72
|
+
react_native_device_info_1.default.getBrand(),
|
|
73
|
+
react_native_device_info_1.default.getModel(),
|
|
74
|
+
react_native_device_info_1.default.getSystemName(),
|
|
75
|
+
react_native_device_info_1.default.getBundleId(),
|
|
76
|
+
].join('|');
|
|
77
|
+
this.deviceId = crypto_js_1.default.SHA256(fingerprint).toString().substring(0, 16);
|
|
78
|
+
return this.deviceId;
|
|
79
|
+
}
|
|
80
|
+
async setDeviceUser(username, email, phone, customData) {
|
|
81
|
+
try {
|
|
82
|
+
const userData = JSON.stringify({ username, email, phone, customData });
|
|
83
|
+
await Keychain.setGenericPassword('devguard_user_info', userData, { service: 'devguard.user.service' });
|
|
84
|
+
}
|
|
85
|
+
catch (e) {
|
|
86
|
+
console.warn('DevGuard: Failed to save user info', e);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/** Clears stored device-user identity (username, email, phone, customData). */
|
|
90
|
+
async clearDeviceUser() {
|
|
91
|
+
try {
|
|
92
|
+
await Keychain.resetGenericPassword({ service: 'devguard.user.service' });
|
|
93
|
+
}
|
|
94
|
+
catch (e) {
|
|
95
|
+
// Ignore cleanup errors
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
await Keychain.resetGenericPassword({ service: 'devguard.username.service' });
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
// Ignore cleanup errors
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async getMetadata(betaFeatures = {}) {
|
|
105
|
+
console.log('DevGuard: Collecting Hardware Metadata...');
|
|
106
|
+
const isEmulator = await react_native_device_info_1.default.isEmulator();
|
|
107
|
+
const deviceId = await this.getDeviceId();
|
|
108
|
+
const model = react_native_device_info_1.default.getModel();
|
|
109
|
+
const os = `${react_native_1.Platform.OS} ${react_native_1.Platform.Version}`;
|
|
110
|
+
const usageLogger = UsageLogger_1.UsageLogger.getInstance();
|
|
111
|
+
const tokenService = DeviceTokenService_1.DeviceTokenService.getInstance();
|
|
112
|
+
let username, email, phone, customData;
|
|
113
|
+
try {
|
|
114
|
+
const credentials = await Keychain.getGenericPassword({ service: 'devguard.user.service' });
|
|
115
|
+
if (credentials) {
|
|
116
|
+
const parsed = JSON.parse(credentials.password);
|
|
117
|
+
username = parsed.username;
|
|
118
|
+
email = parsed.email;
|
|
119
|
+
phone = parsed.phone;
|
|
120
|
+
customData = parsed.customData;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
// Fallback to older generic password entry
|
|
124
|
+
const oldCreds = await Keychain.getGenericPassword({ service: 'devguard.username.service' });
|
|
125
|
+
if (oldCreds)
|
|
126
|
+
username = oldCreds.password;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch (e) {
|
|
130
|
+
// Ignore
|
|
131
|
+
}
|
|
132
|
+
const isAdvanced = betaFeatures?.advancedTelemetry === true;
|
|
133
|
+
const metadata = {
|
|
134
|
+
deviceId,
|
|
135
|
+
deviceName: await react_native_device_info_1.default.getDeviceName(),
|
|
136
|
+
model: model,
|
|
137
|
+
brand: react_native_device_info_1.default.getBrand(),
|
|
138
|
+
os: os,
|
|
139
|
+
osVersion: react_native_1.Platform.Version,
|
|
140
|
+
version: react_native_device_info_1.default.getVersion(),
|
|
141
|
+
bundleId: react_native_device_info_1.default.getBundleId(),
|
|
142
|
+
isTablet: react_native_device_info_1.default.isTablet(),
|
|
143
|
+
isEmulator: isEmulator,
|
|
144
|
+
isPhysicalDevice: !isEmulator,
|
|
145
|
+
username: username,
|
|
146
|
+
email: email,
|
|
147
|
+
phone: phone,
|
|
148
|
+
customData: customData,
|
|
149
|
+
networkType: isAdvanced ? await this.getNetworkType() : 'REDACTED',
|
|
150
|
+
fingerprint: DeviceTokenService_1.DeviceTokenService.generateFingerprint(deviceId, model, os),
|
|
151
|
+
deviceToken: await tokenService.getToken(),
|
|
152
|
+
usageLogs: await usageLogger.getLogs(),
|
|
153
|
+
};
|
|
154
|
+
// Advanced telemetry MUST be emitted as FLAT string fields (battery / ram /
|
|
155
|
+
// storage / batteryCharging / batteryThermal) to match the Flutter plugin's
|
|
156
|
+
// DeviceMetadata shape. The admin "Health (Beta)" view reads these flat keys
|
|
157
|
+
// (displayData.battery / .ram / .storage); the old nested objects
|
|
158
|
+
// (ram.total, health.batteryLevel) were unreadable and rendered "No telemetry".
|
|
159
|
+
if (isAdvanced) {
|
|
160
|
+
Object.assign(metadata, await this.collectAdvancedTelemetry());
|
|
161
|
+
}
|
|
162
|
+
return metadata;
|
|
163
|
+
}
|
|
164
|
+
async getNetworkType() {
|
|
165
|
+
try {
|
|
166
|
+
const carrier = await react_native_device_info_1.default.getCarrier();
|
|
167
|
+
if (carrier && carrier.trim() && carrier.toLowerCase() !== 'unknown') {
|
|
168
|
+
return carrier;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch (e) {
|
|
172
|
+
// Ignore — fall through to default.
|
|
173
|
+
}
|
|
174
|
+
return 'WiFi';
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Collects advanced hardware telemetry as FLAT string fields, matching the
|
|
178
|
+
* Flutter plugin (battery/batteryCharging/batteryThermal/ram/storage) so the
|
|
179
|
+
* admin panel renders Health (Beta) identically on both platforms.
|
|
180
|
+
* Each metric is collected independently so one failure never blocks the rest.
|
|
181
|
+
*/
|
|
182
|
+
async collectAdvancedTelemetry() {
|
|
183
|
+
const out = { batteryThermal: 'NORMAL' };
|
|
184
|
+
try {
|
|
185
|
+
const mem = await react_native_device_info_1.default.getTotalMemory();
|
|
186
|
+
if (typeof mem === 'number' && mem > 0) {
|
|
187
|
+
out.ram = `${(mem / (1024 * 1024 * 1024)).toFixed(1)} GB`;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
catch (e) {
|
|
191
|
+
// Ignore individual metric failure.
|
|
192
|
+
}
|
|
193
|
+
try {
|
|
194
|
+
const total = await react_native_device_info_1.default.getTotalDiskCapacity();
|
|
195
|
+
if (typeof total === 'number' && total > 0) {
|
|
196
|
+
out.storage = `${(total / (1024 * 1024 * 1024)).toFixed(1)} GB`;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
catch (e) {
|
|
200
|
+
// Ignore individual metric failure.
|
|
201
|
+
}
|
|
202
|
+
try {
|
|
203
|
+
// getBatteryLevel returns 0..1, or -1 when unavailable (e.g. simulator).
|
|
204
|
+
const level = await react_native_device_info_1.default.getBatteryLevel();
|
|
205
|
+
if (typeof level === 'number' && level >= 0) {
|
|
206
|
+
out.battery = `${Math.round(level * 100)}%`;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
catch (e) {
|
|
210
|
+
// Ignore individual metric failure.
|
|
211
|
+
}
|
|
212
|
+
try {
|
|
213
|
+
const charging = await react_native_device_info_1.default.isBatteryCharging();
|
|
214
|
+
out.batteryCharging = charging ? 'charging' : 'discharging';
|
|
215
|
+
}
|
|
216
|
+
catch (e) {
|
|
217
|
+
// Ignore individual metric failure.
|
|
218
|
+
}
|
|
219
|
+
return out;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
exports.HardwareService = HardwareService;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performs a hardened remote wipe of all local DevGuard security state.
|
|
3
|
+
* Mirrors the Flutter plugin's `RemoteWipeService` so a wipe clears the same
|
|
4
|
+
* surface on both platforms (not just the response cache).
|
|
5
|
+
*/
|
|
6
|
+
export declare class RemoteWipeService {
|
|
7
|
+
/**
|
|
8
|
+
* Clears local security state:
|
|
9
|
+
* - cached server response,
|
|
10
|
+
* - buffered usage logs,
|
|
11
|
+
* - encrypted vault diagnostics (info + errors),
|
|
12
|
+
* - stored device-user identity (username/email/phone/customData).
|
|
13
|
+
*
|
|
14
|
+
* @param projectId The project whose cache should be cleared.
|
|
15
|
+
* @param options.revokeToken Also clear the device registration token.
|
|
16
|
+
*/
|
|
17
|
+
static execute(projectId: string, options?: {
|
|
18
|
+
revokeToken?: boolean;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RemoteWipeService = void 0;
|
|
4
|
+
const CacheService_1 = require("./CacheService");
|
|
5
|
+
const UsageLogger_1 = require("./UsageLogger");
|
|
6
|
+
const DevGuardLogger_1 = require("./DevGuardLogger");
|
|
7
|
+
const DeviceTokenService_1 = require("./DeviceTokenService");
|
|
8
|
+
const HardwareService_1 = require("./HardwareService");
|
|
9
|
+
/**
|
|
10
|
+
* Performs a hardened remote wipe of all local DevGuard security state.
|
|
11
|
+
* Mirrors the Flutter plugin's `RemoteWipeService` so a wipe clears the same
|
|
12
|
+
* surface on both platforms (not just the response cache).
|
|
13
|
+
*/
|
|
14
|
+
class RemoteWipeService {
|
|
15
|
+
/**
|
|
16
|
+
* Clears local security state:
|
|
17
|
+
* - cached server response,
|
|
18
|
+
* - buffered usage logs,
|
|
19
|
+
* - encrypted vault diagnostics (info + errors),
|
|
20
|
+
* - stored device-user identity (username/email/phone/customData).
|
|
21
|
+
*
|
|
22
|
+
* @param projectId The project whose cache should be cleared.
|
|
23
|
+
* @param options.revokeToken Also clear the device registration token.
|
|
24
|
+
*/
|
|
25
|
+
static async execute(projectId, options = {}) {
|
|
26
|
+
await CacheService_1.CacheService.clear();
|
|
27
|
+
await UsageLogger_1.UsageLogger.getInstance().clearLogs();
|
|
28
|
+
try {
|
|
29
|
+
await DevGuardLogger_1.DevGuardLogger.clearAll();
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
// Vault logger may not be initialized — ignore.
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
await HardwareService_1.HardwareService.getInstance().clearDeviceUser();
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
// Ignore cleanup errors.
|
|
39
|
+
}
|
|
40
|
+
if (options.revokeToken) {
|
|
41
|
+
await DeviceTokenService_1.DeviceTokenService.getInstance().clearToken();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.RemoteWipeService = RemoteWipeService;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface UsageEvent {
|
|
2
|
+
type: string;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
data?: any;
|
|
5
|
+
}
|
|
6
|
+
export declare class UsageLogger {
|
|
7
|
+
private static instance;
|
|
8
|
+
private logs;
|
|
9
|
+
private sessionPasscode;
|
|
10
|
+
private constructor();
|
|
11
|
+
static getInstance(): UsageLogger;
|
|
12
|
+
setSessionPasscode(passcode: string): void;
|
|
13
|
+
logEvent(eventType: string, data?: any): Promise<void>;
|
|
14
|
+
getLogs(): Promise<UsageEvent[]>;
|
|
15
|
+
clearLogs(): Promise<void>;
|
|
16
|
+
private crypt;
|
|
17
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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.UsageLogger = void 0;
|
|
7
|
+
const crypto_js_1 = __importDefault(require("crypto-js"));
|
|
8
|
+
class UsageLogger {
|
|
9
|
+
static instance;
|
|
10
|
+
logs = [];
|
|
11
|
+
sessionPasscode = null;
|
|
12
|
+
constructor() { }
|
|
13
|
+
static getInstance() {
|
|
14
|
+
if (!UsageLogger.instance) {
|
|
15
|
+
UsageLogger.instance = new UsageLogger();
|
|
16
|
+
}
|
|
17
|
+
return UsageLogger.instance;
|
|
18
|
+
}
|
|
19
|
+
setSessionPasscode(passcode) {
|
|
20
|
+
this.sessionPasscode = passcode;
|
|
21
|
+
}
|
|
22
|
+
async logEvent(eventType, data) {
|
|
23
|
+
const newEvent = {
|
|
24
|
+
type: eventType,
|
|
25
|
+
timestamp: new Date().toISOString(),
|
|
26
|
+
data,
|
|
27
|
+
};
|
|
28
|
+
this.logs.push(newEvent);
|
|
29
|
+
// Keep only the last 100 logs
|
|
30
|
+
if (this.logs.length > 100) {
|
|
31
|
+
this.logs = this.logs.slice(-100);
|
|
32
|
+
}
|
|
33
|
+
console.log(`DevGuard: Logged event: ${eventType}`);
|
|
34
|
+
}
|
|
35
|
+
async getLogs() {
|
|
36
|
+
return [...this.logs];
|
|
37
|
+
}
|
|
38
|
+
async clearLogs() {
|
|
39
|
+
this.logs = [];
|
|
40
|
+
}
|
|
41
|
+
// XOR Crypt logic from Flutter version (Simulated for parity)
|
|
42
|
+
crypt(text, passcode) {
|
|
43
|
+
const effectivePasscode = passcode || this.sessionPasscode || "secure_default";
|
|
44
|
+
const key = crypto_js_1.default.SHA256(effectivePasscode).toString();
|
|
45
|
+
let result = '';
|
|
46
|
+
for (let i = 0; i < text.length; i++) {
|
|
47
|
+
result += String.fromCharCode(text.charCodeAt(i) ^ key.charCodeAt(i % key.length));
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.UsageLogger = UsageLogger;
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-native-dev-guard",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "DevGuard protection for React Native apps",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "arsarsars1",
|
|
7
|
+
"homepage": "https://github.com/DevGuard-uk/react-native-dev-guard",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/DevGuard-uk/react-native-dev-guard.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"react-native",
|
|
14
|
+
"devguard",
|
|
15
|
+
"license",
|
|
16
|
+
"app-protection",
|
|
17
|
+
"remote-lock",
|
|
18
|
+
"security"
|
|
19
|
+
],
|
|
20
|
+
"main": "lib/index.js",
|
|
21
|
+
"types": "lib/index.d.ts",
|
|
22
|
+
"files": [
|
|
23
|
+
"lib",
|
|
24
|
+
"android",
|
|
25
|
+
"ios",
|
|
26
|
+
"cpp"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"clean": "rimraf lib",
|
|
30
|
+
"build:ts": "tsc",
|
|
31
|
+
"build:obfuscate": "echo 'Skipping obfuscator for RN bundle compat'",
|
|
32
|
+
"build": "npm-run-all clean build:ts build:obfuscate",
|
|
33
|
+
"prepublishOnly": "npm run build",
|
|
34
|
+
"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
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"crypto-js": "^4.2.0",
|
|
38
|
+
"pako": "^2.1.0",
|
|
39
|
+
"react-native-safe-area-context": "^5.5.2",
|
|
40
|
+
"react-native-vault-logger": "^0.1.2"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/crypto-js": "^4.2.2",
|
|
44
|
+
"@types/pako": "^2.0.3",
|
|
45
|
+
"@types/react": "^19.2.0",
|
|
46
|
+
"javascript-obfuscator": "^5.4.2",
|
|
47
|
+
"npm-run-all": "^4.1.5",
|
|
48
|
+
"react": "19.2.3",
|
|
49
|
+
"react-native": "0.85.3",
|
|
50
|
+
"react-native-device-info": "^15.0.2",
|
|
51
|
+
"react-native-jailbreak": "^0.1.0",
|
|
52
|
+
"react-native-keychain": "^10.0.0",
|
|
53
|
+
"rimraf": "^6.1.3",
|
|
54
|
+
"typescript": "^5.8.3"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"@react-native-async-storage/async-storage": ">=1.23.1",
|
|
58
|
+
"react": ">=18",
|
|
59
|
+
"react-native": ">=0.76",
|
|
60
|
+
"react-native-device-info": "*",
|
|
61
|
+
"react-native-keychain": "*"
|
|
62
|
+
}
|
|
63
|
+
}
|