@react-native-ohos/react-native-sensitive-info 6.0.1-rc.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 (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.OpenSource +11 -0
  3. package/README.md +13 -0
  4. package/build/index.es.js +33 -0
  5. package/build/index.es.js.map +1 -0
  6. package/build/index.js +35 -0
  7. package/build/index.js.map +1 -0
  8. package/harmony/react_native_sensitive_info/BuildProfile.ets +17 -0
  9. package/harmony/react_native_sensitive_info/build-profile.json5 +28 -0
  10. package/harmony/react_native_sensitive_info/hvigorfile.ts +6 -0
  11. package/harmony/react_native_sensitive_info/index.ets +7 -0
  12. package/harmony/react_native_sensitive_info/obfuscation-rules.txt +18 -0
  13. package/harmony/react_native_sensitive_info/oh-package.json5 +13 -0
  14. package/harmony/react_native_sensitive_info/src/main/cpp/CMakeLists.txt +9 -0
  15. package/harmony/react_native_sensitive_info/src/main/cpp/SensitiveInfoPackage.h +19 -0
  16. package/harmony/react_native_sensitive_info/src/main/cpp/generated/RNOH/generated/BaseReactNativeSensitiveInfoPackage.h +72 -0
  17. package/harmony/react_native_sensitive_info/src/main/cpp/generated/RNOH/generated/turbo_modules/SensitiveInfoNativeModule.cpp +24 -0
  18. package/harmony/react_native_sensitive_info/src/main/cpp/generated/RNOH/generated/turbo_modules/SensitiveInfoNativeModule.h +16 -0
  19. package/harmony/react_native_sensitive_info/src/main/cpp/generated/react/renderer/components/react_native_sensitive_info/ComponentDescriptors.h +24 -0
  20. package/harmony/react_native_sensitive_info/src/main/cpp/generated/react/renderer/components/react_native_sensitive_info/EventEmitters.cpp +16 -0
  21. package/harmony/react_native_sensitive_info/src/main/cpp/generated/react/renderer/components/react_native_sensitive_info/EventEmitters.h +17 -0
  22. package/harmony/react_native_sensitive_info/src/main/cpp/generated/react/renderer/components/react_native_sensitive_info/Props.cpp +19 -0
  23. package/harmony/react_native_sensitive_info/src/main/cpp/generated/react/renderer/components/react_native_sensitive_info/Props.h +18 -0
  24. package/harmony/react_native_sensitive_info/src/main/cpp/generated/react/renderer/components/react_native_sensitive_info/ShadowNodes.cpp +17 -0
  25. package/harmony/react_native_sensitive_info/src/main/cpp/generated/react/renderer/components/react_native_sensitive_info/ShadowNodes.h +23 -0
  26. package/harmony/react_native_sensitive_info/src/main/cpp/generated/react/renderer/components/react_native_sensitive_info/States.cpp +16 -0
  27. package/harmony/react_native_sensitive_info/src/main/cpp/generated/react/renderer/components/react_native_sensitive_info/States.h +19 -0
  28. package/harmony/react_native_sensitive_info/src/main/ets/Logger.ts +64 -0
  29. package/harmony/react_native_sensitive_info/src/main/ets/RNSensitiveInfoPackage.ts +46 -0
  30. package/harmony/react_native_sensitive_info/src/main/ets/RNSensitiveInfoTurboModule.ts +230 -0
  31. package/harmony/react_native_sensitive_info/src/main/ets/generated/components/ts.ts +5 -0
  32. package/harmony/react_native_sensitive_info/src/main/ets/generated/index.ets +5 -0
  33. package/harmony/react_native_sensitive_info/src/main/ets/generated/ts.ts +6 -0
  34. package/harmony/react_native_sensitive_info/src/main/ets/generated/turboModules/SensitiveInfoNativeModule.ts +34 -0
  35. package/harmony/react_native_sensitive_info/src/main/ets/generated/turboModules/ts.ts +5 -0
  36. package/harmony/react_native_sensitive_info/src/main/ets/pages/index.ets +26 -0
  37. package/harmony/react_native_sensitive_info/src/main/ets/tools.ts +60 -0
  38. package/harmony/react_native_sensitive_info/src/main/ets/utils/Calc.ets +9 -0
  39. package/harmony/react_native_sensitive_info/src/main/module.json5 +11 -0
  40. package/harmony/react_native_sensitive_info/src/main/resources/base/element/color.json +8 -0
  41. package/harmony/react_native_sensitive_info/src/main/resources/base/element/string.json +16 -0
  42. package/harmony/react_native_sensitive_info/src/main/resources/base/media/background.png +0 -0
  43. package/harmony/react_native_sensitive_info/src/main/resources/base/media/foreground.png +0 -0
  44. package/harmony/react_native_sensitive_info/src/main/resources/base/media/layered_image.json +7 -0
  45. package/harmony/react_native_sensitive_info/src/main/resources/base/media/startIcon.png +0 -0
  46. package/harmony/react_native_sensitive_info/src/main/resources/base/profile/main_pages.json +5 -0
  47. package/harmony/react_native_sensitive_info/src/main/resources/en_US/element/string.json +16 -0
  48. package/harmony/react_native_sensitive_info/src/main/resources/zh_CN/element/string.json +16 -0
  49. package/harmony/react_native_sensitive_info/src/mock/mock-config.json5 +2 -0
  50. package/harmony/react_native_sensitive_info/src/ohosTest/ets/test/Ability.test.ets +41 -0
  51. package/harmony/react_native_sensitive_info/src/ohosTest/ets/test/List.test.ets +11 -0
  52. package/harmony/react_native_sensitive_info/src/ohosTest/ets/testability/TestAbility.ets +61 -0
  53. package/harmony/react_native_sensitive_info/src/ohosTest/ets/testability/pages/Index.ets +23 -0
  54. package/harmony/react_native_sensitive_info/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets +98 -0
  55. package/harmony/react_native_sensitive_info/src/ohosTest/module.json5 +28 -0
  56. package/harmony/react_native_sensitive_info/src/ohosTest/resources/base/element/color.json +8 -0
  57. package/harmony/react_native_sensitive_info/src/ohosTest/resources/base/element/string.json +16 -0
  58. package/harmony/react_native_sensitive_info/src/ohosTest/resources/base/media/icon.png +0 -0
  59. package/harmony/react_native_sensitive_info/src/ohosTest/resources/base/profile/test_pages.json +5 -0
  60. package/harmony/react_native_sensitive_info/src/test/List.test.ets +11 -0
  61. package/harmony/react_native_sensitive_info/src/test/LocalUnit.test.ets +39 -0
  62. package/harmony/react_native_sensitive_info/ts.ts +9 -0
  63. package/harmony/react_native_sensitive_info.har +0 -0
  64. package/index.d.ts +74 -0
  65. package/package.json +70 -0
  66. package/react-native-sensitive-info.podspec +19 -0
  67. package/src/NativeSensitiveInfo.ts +81 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 ClassApp
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ [
2
+ {
3
+ "Name": "react-native-sensitive-info",
4
+ "License": "MIT License",
5
+ "License File": "https://github.com/mCodex/react-native-sensitive-info/blob/master/LICENSE",
6
+ "Version Number": "6.0.0-alpha.9",
7
+ "Owner" : "xiafeng@huawei.com",
8
+ "Upstream URL": "https://github.com/mCodex/react-native-sensitive-info",
9
+ "Description": "react-native-sensitive-info manages all data stored in Android Shared Preferences and iOS Keychain. You can set, get and delete keys/values using simple methods."
10
+ }
11
+ ]
package/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # @react-native-ohos/react-native-sensitive-info
2
+
3
+ This project is based on [react-native-sensitive-info ](https://github.com/mCodex/react-native-sensitive-info)
4
+
5
+ ## Documentation
6
+
7
+ [中文](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-sensitive-info.md)
8
+
9
+ [English](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/react-native-sensitive-info.md)
10
+
11
+ ## License
12
+
13
+ This library is licensed under [The MIT License (MIT)](https://github.com/mCodex/react-native-sensitive-info/blob/master/LICENSE).
@@ -0,0 +1,33 @@
1
+ import { TurboModuleRegistry, NativeModules } from 'react-native';
2
+
3
+ var RNSensitiveInfo = TurboModuleRegistry ? TurboModuleRegistry.get('SensitiveInfoNativeModule') : NativeModules.RNSensitiveInfo;
4
+ module.exports = {
5
+ setItem: function (key, value, options) {
6
+ return RNSensitiveInfo.setItem(key, value, options);
7
+ },
8
+ getItem: function (key, options) {
9
+ return RNSensitiveInfo.getItem(key, options);
10
+ },
11
+ hasItem: function (key, options) {
12
+ return RNSensitiveInfo.hasItem(key, options);
13
+ },
14
+ getAllItems: function (options) {
15
+ return RNSensitiveInfo.getAllItems(options);
16
+ },
17
+ deleteItem: function (key, options) {
18
+ return RNSensitiveInfo.deleteItem(key, options);
19
+ },
20
+ isSensorAvailable: function () {
21
+ return RNSensitiveInfo.isSensorAvailable();
22
+ },
23
+ hasEnrolledFingerprints: function () {
24
+ return RNSensitiveInfo.hasEnrolledFingerprints();
25
+ },
26
+ cancelFingerprintAuth: function () {
27
+ return RNSensitiveInfo.cancelFingerprintAuth();
28
+ },
29
+ setInvalidatedByBiometricEnrollment: function (set) {
30
+ return RNSensitiveInfo.setInvalidatedByBiometricEnrollment(set);
31
+ }
32
+ };
33
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":["../RNSensitiveInfo.ts"],"sourcesContent":["import { NativeModules } from 'react-native';\r\n\r\nimport { TurboModuleRegistry } from 'react-native';\r\nvar RNSensitiveInfo = TurboModuleRegistry ? TurboModuleRegistry.get('SensitiveInfoNativeModule') : NativeModules.RNSensitiveInfo;\r\nmodule.exports = {\r\n setItem(key, value, options){\r\n return RNSensitiveInfo.setItem(key, value, options);\r\n },\r\n getItem(key, options){\r\n return RNSensitiveInfo.getItem(key, options);\r\n },\r\n hasItem(key, options){\r\n return RNSensitiveInfo.hasItem(key, options);\r\n },\r\n getAllItems(options){\r\n return RNSensitiveInfo.getAllItems(options);\r\n },\r\n deleteItem(key, options){\r\n return RNSensitiveInfo.deleteItem(key, options);\r\n },\r\n isSensorAvailable() {\r\n return RNSensitiveInfo.isSensorAvailable();\r\n },\r\n hasEnrolledFingerprints(){\r\n return RNSensitiveInfo.hasEnrolledFingerprints();\r\n },\r\n cancelFingerprintAuth(){\r\n return RNSensitiveInfo.cancelFingerprintAuth();\r\n },\r\n setInvalidatedByBiometricEnrollment(set){\r\n return RNSensitiveInfo.setInvalidatedByBiometricEnrollment(set);\r\n }\r\n}"],"names":[],"mappings":";;AAGA,IAAI,eAAe,GAAG,mBAAmB,GAAG,mBAAmB,CAAC,GAAG,CAAC,2BAA2B,CAAC,GAAG,aAAa,CAAC,eAAe,CAAC;AACjI,MAAM,CAAC,OAAO,GAAG;AACb,IAAA,OAAO,EAAC,UAAA,GAAG,EAAE,KAAK,EAAE,OAAO,EAAA;QACvB,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;KACvD;IACD,OAAO,EAAA,UAAC,GAAG,EAAE,OAAO,EAAA;QAChB,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KAChD;IACD,OAAO,EAAA,UAAC,GAAG,EAAE,OAAO,EAAA;QAChB,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KAChD;AACD,IAAA,WAAW,YAAC,OAAO,EAAA;AACf,QAAA,OAAO,eAAe,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAC/C;IACD,UAAU,EAAA,UAAC,GAAG,EAAE,OAAO,EAAA;QACnB,OAAO,eAAe,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACnD;IACD,iBAAiB,EAAA,YAAA;AACb,QAAA,OAAO,eAAe,CAAC,iBAAiB,EAAE,CAAC;KAC9C;IACD,uBAAuB,EAAA,YAAA;AACnB,QAAA,OAAO,eAAe,CAAC,uBAAuB,EAAE,CAAC;KACpD;IACD,qBAAqB,EAAA,YAAA;AACjB,QAAA,OAAO,eAAe,CAAC,qBAAqB,EAAE,CAAC;KAClD;AACD,IAAA,mCAAmC,YAAC,GAAG,EAAA;AACnC,QAAA,OAAO,eAAe,CAAC,mCAAmC,CAAC,GAAG,CAAC,CAAC;KACnE;CACJ"}
package/build/index.js ADDED
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ var reactNative = require('react-native');
4
+
5
+ var RNSensitiveInfo = reactNative.TurboModuleRegistry ? reactNative.TurboModuleRegistry.get('SensitiveInfoNativeModule') : reactNative.NativeModules.RNSensitiveInfo;
6
+ module.exports = {
7
+ setItem: function (key, value, options) {
8
+ return RNSensitiveInfo.setItem(key, value, options);
9
+ },
10
+ getItem: function (key, options) {
11
+ return RNSensitiveInfo.getItem(key, options);
12
+ },
13
+ hasItem: function (key, options) {
14
+ return RNSensitiveInfo.hasItem(key, options);
15
+ },
16
+ getAllItems: function (options) {
17
+ return RNSensitiveInfo.getAllItems(options);
18
+ },
19
+ deleteItem: function (key, options) {
20
+ return RNSensitiveInfo.deleteItem(key, options);
21
+ },
22
+ isSensorAvailable: function () {
23
+ return RNSensitiveInfo.isSensorAvailable();
24
+ },
25
+ hasEnrolledFingerprints: function () {
26
+ return RNSensitiveInfo.hasEnrolledFingerprints();
27
+ },
28
+ cancelFingerprintAuth: function () {
29
+ return RNSensitiveInfo.cancelFingerprintAuth();
30
+ },
31
+ setInvalidatedByBiometricEnrollment: function (set) {
32
+ return RNSensitiveInfo.setInvalidatedByBiometricEnrollment(set);
33
+ }
34
+ };
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../RNSensitiveInfo.ts"],"sourcesContent":["import { NativeModules } from 'react-native';\r\n\r\nimport { TurboModuleRegistry } from 'react-native';\r\nvar RNSensitiveInfo = TurboModuleRegistry ? TurboModuleRegistry.get('SensitiveInfoNativeModule') : NativeModules.RNSensitiveInfo;\r\nmodule.exports = {\r\n setItem(key, value, options){\r\n return RNSensitiveInfo.setItem(key, value, options);\r\n },\r\n getItem(key, options){\r\n return RNSensitiveInfo.getItem(key, options);\r\n },\r\n hasItem(key, options){\r\n return RNSensitiveInfo.hasItem(key, options);\r\n },\r\n getAllItems(options){\r\n return RNSensitiveInfo.getAllItems(options);\r\n },\r\n deleteItem(key, options){\r\n return RNSensitiveInfo.deleteItem(key, options);\r\n },\r\n isSensorAvailable() {\r\n return RNSensitiveInfo.isSensorAvailable();\r\n },\r\n hasEnrolledFingerprints(){\r\n return RNSensitiveInfo.hasEnrolledFingerprints();\r\n },\r\n cancelFingerprintAuth(){\r\n return RNSensitiveInfo.cancelFingerprintAuth();\r\n },\r\n setInvalidatedByBiometricEnrollment(set){\r\n return RNSensitiveInfo.setInvalidatedByBiometricEnrollment(set);\r\n }\r\n}"],"names":["TurboModuleRegistry","NativeModules"],"mappings":";;;;AAGA,IAAI,eAAe,GAAGA,+BAAmB,GAAGA,+BAAmB,CAAC,GAAG,CAAC,2BAA2B,CAAC,GAAGC,yBAAa,CAAC,eAAe,CAAC;AACjI,MAAM,CAAC,OAAO,GAAG;AACb,IAAA,OAAO,EAAC,UAAA,GAAG,EAAE,KAAK,EAAE,OAAO,EAAA;QACvB,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;KACvD;IACD,OAAO,EAAA,UAAC,GAAG,EAAE,OAAO,EAAA;QAChB,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KAChD;IACD,OAAO,EAAA,UAAC,GAAG,EAAE,OAAO,EAAA;QAChB,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KAChD;AACD,IAAA,WAAW,YAAC,OAAO,EAAA;AACf,QAAA,OAAO,eAAe,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAC/C;IACD,UAAU,EAAA,UAAC,GAAG,EAAE,OAAO,EAAA;QACnB,OAAO,eAAe,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACnD;IACD,iBAAiB,EAAA,YAAA;AACb,QAAA,OAAO,eAAe,CAAC,iBAAiB,EAAE,CAAC;KAC9C;IACD,uBAAuB,EAAA,YAAA;AACnB,QAAA,OAAO,eAAe,CAAC,uBAAuB,EAAE,CAAC;KACpD;IACD,qBAAqB,EAAA,YAAA;AACjB,QAAA,OAAO,eAAe,CAAC,qBAAqB,EAAE,CAAC;KAClD;AACD,IAAA,mCAAmC,YAAC,GAAG,EAAA;AACnC,QAAA,OAAO,eAAe,CAAC,mCAAmC,CAAC,GAAG,CAAC,CAAC;KACnE;CACJ;;"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Use these variables when you tailor your ArkTS code. They must be of the const type.
3
+ */
4
+ export const HAR_VERSION = '6.0.0-alpha.9-0.0.2';
5
+ export const BUILD_MODE_NAME = 'debug';
6
+ export const DEBUG = true;
7
+ export const TARGET_NAME = 'default';
8
+
9
+ /**
10
+ * BuildProfile Class is used only for compatibility purposes.
11
+ */
12
+ export default class BuildProfile {
13
+ static readonly HAR_VERSION = HAR_VERSION;
14
+ static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15
+ static readonly DEBUG = DEBUG;
16
+ static readonly TARGET_NAME = TARGET_NAME;
17
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "apiType": "stageMode",
3
+ "buildOption": {
4
+ },
5
+ "buildOptionSet": [
6
+ {
7
+ "name": "release",
8
+ "arkOptions": {
9
+ "obfuscation": {
10
+ "ruleOptions": {
11
+ "enable": true,
12
+ "files": [
13
+ "./obfuscation-rules.txt"
14
+ ]
15
+ }
16
+ }
17
+ }
18
+ },
19
+ ],
20
+ "targets": [
21
+ {
22
+ "name": "default"
23
+ },
24
+ {
25
+ "name": "ohosTest",
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,6 @@
1
+ import { harTasks } from '@ohos/hvigor-ohos-plugin';
2
+
3
+ export default {
4
+ system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5
+ plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6
+ }
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ export * from "./ts"
@@ -0,0 +1,18 @@
1
+ # Define project specific obfuscation rules here.
2
+ # You can include the obfuscation configuration files in the current module's build-profile.json5.
3
+ #
4
+ # For more details, see
5
+ # https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
6
+
7
+ # Obfuscation options:
8
+ # -disable-obfuscation: disable all obfuscations
9
+ # -enable-property-obfuscation: obfuscate the property names
10
+ # -enable-toplevel-obfuscation: obfuscate the names in the global scope
11
+ # -compact: remove unnecessary blank spaces and all line feeds
12
+ # -remove-log: remove all console.* statements
13
+ # -print-namecache: print the name cache that contains the mapping from the old names to new names
14
+ # -apply-namecache: reuse the given cache file
15
+
16
+ # Keep options:
17
+ # -keep-property-name: specifies property names that you want to keep
18
+ # -keep-global-name: specifies names that you want to keep in the global scope
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@react-native-ohos/react_native_sensitive_info",
3
+ "version": "6.0.1-rc.1",
4
+ "description": "Keep the screen from going to sleep",
5
+ "main": "index.ets",
6
+ "author": "",
7
+ "license": "Apache-2.0",
8
+ "dependencies": {
9
+ "@rnoh/react-native-openharmony": 'file:../react_native_openharmony'
10
+ }
11
+ }
12
+
13
+
@@ -0,0 +1,9 @@
1
+ cmake_minimum_required(VERSION 3.13)
2
+ set(CMAKE_VERBOSE_MAKEFILE on)
3
+
4
+ set(rnoh_sensitive_info_generated_dir "${CMAKE_CURRENT_SOURCE_DIR}/generated")
5
+ file(GLOB_RECURSE rnoh_sensitive_info_generated_SRC "${rnoh_sensitive_info_generated_dir}/**/*.cpp")
6
+ file(GLOB rnoh_sensitive_info_SRC CONFIGURE_DEPENDS *.cpp)
7
+ add_library(rnoh_sensitive_info SHARED ${rnoh_sensitive_info_SRC} ${rnoh_sensitive_info_generated_SRC})
8
+ target_include_directories(rnoh_sensitive_info PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${rnoh_sensitive_info_generated_dir} ${CMAKE_CURRENT_SOURCE_DIR}/generated/RNOH/generated)
9
+ target_link_libraries(rnoh_sensitive_info PUBLIC rnoh)
@@ -0,0 +1,19 @@
1
+ // Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
2
+ // Use of this source code is governed by a MIT license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef SENSITIVEINFOPACKAGE_H
6
+ #define SENSITIVEINFOPACKAGE_H
7
+
8
+
9
+ #include "generated/RNOH/generated/BaseReactNativeSensitiveInfoPackage.h"
10
+ #pragma once
11
+
12
+
13
+ namespace rnoh {
14
+ class SensitiveInfoPackage : public BaseReactNativeSensitiveInfoPackage {
15
+ using Super = BaseReactNativeSensitiveInfoPackage;
16
+ using Super::Super;
17
+ };
18
+ } // namespace rnoh
19
+ #endif //SENSITIVEINFOPACKAGE_H
@@ -0,0 +1,72 @@
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ #pragma once
6
+
7
+ #include "RNOH/Package.h"
8
+ #include "RNOH/ArkTSTurboModule.h"
9
+ #include "RNOH/generated/turbo_modules/SensitiveInfoNativeModule.h"
10
+
11
+ namespace rnoh {
12
+
13
+ class BaseReactNativeSensitiveInfoPackageTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
14
+ public:
15
+ SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
16
+ if (name == "SensitiveInfoNativeModule") {
17
+ return std::make_shared<SensitiveInfoNativeModule>(ctx, name);
18
+ }
19
+ return nullptr;
20
+ };
21
+ };
22
+
23
+ class BaseReactNativeSensitiveInfoPackageEventEmitRequestHandler : public EventEmitRequestHandler {
24
+ public:
25
+ void handleEvent(Context const &ctx) override {
26
+ auto eventEmitter = ctx.shadowViewRegistry->getEventEmitter<facebook::react::EventEmitter>(ctx.tag);
27
+ auto componentName = ctx.shadowViewRegistry->getComponentName(ctx.tag);
28
+
29
+ if (eventEmitter == nullptr) {
30
+ return;
31
+ }
32
+
33
+ std::vector<std::string> supportedComponentNames = {
34
+ };
35
+
36
+ std::vector<std::string> supportedEventNames = {
37
+ };
38
+
39
+ if (std::find(supportedComponentNames.begin(), supportedComponentNames.end(), componentName) != supportedComponentNames.end() &&
40
+ std::find(supportedEventNames.begin(), supportedEventNames.end(), ctx.eventName) != supportedEventNames.end()) {
41
+ eventEmitter->dispatchEvent(ctx.eventName, ArkJS(ctx.env).getDynamic(ctx.payload));
42
+ }
43
+ }
44
+ };
45
+
46
+
47
+ class BaseReactNativeSensitiveInfoPackage : public Package {
48
+ public:
49
+ BaseReactNativeSensitiveInfoPackage(Package::Context ctx) : Package(ctx){};
50
+
51
+ std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
52
+ return std::make_unique<BaseReactNativeSensitiveInfoPackageTurboModuleFactoryDelegate>();
53
+ }
54
+
55
+ std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override {
56
+ return {
57
+ };
58
+ }
59
+
60
+ ComponentJSIBinderByString createComponentJSIBinderByName() override {
61
+ return {
62
+ };
63
+ };
64
+
65
+ EventEmitRequestHandlers createEventEmitRequestHandlers() override {
66
+ return {
67
+ std::make_shared<BaseReactNativeSensitiveInfoPackageEventEmitRequestHandler>(),
68
+ };
69
+ }
70
+ };
71
+
72
+ } // namespace rnoh
@@ -0,0 +1,24 @@
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ #include "SensitiveInfoNativeModule.h"
6
+
7
+ namespace rnoh {
8
+ using namespace facebook;
9
+
10
+ SensitiveInfoNativeModule::SensitiveInfoNativeModule(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
11
+ methodMap_ = {
12
+ ARK_ASYNC_METHOD_METADATA(setItem, 3),
13
+ ARK_ASYNC_METHOD_METADATA(getItem, 2),
14
+ ARK_ASYNC_METHOD_METADATA(hasItem, 2),
15
+ ARK_ASYNC_METHOD_METADATA(getAllItems, 1),
16
+ ARK_ASYNC_METHOD_METADATA(deleteItem, 2),
17
+ ARK_ASYNC_METHOD_METADATA(isSensorAvailable, 0),
18
+ ARK_ASYNC_METHOD_METADATA(hasEnrolledFingerprints, 0),
19
+ ARK_METHOD_METADATA(cancelFingerprintAuth, 0),
20
+ ARK_METHOD_METADATA(setInvalidatedByBiometricEnrollment, 1),
21
+ };
22
+ }
23
+
24
+ } // namespace rnoh
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ #pragma once
6
+
7
+ #include "RNOH/ArkTSTurboModule.h"
8
+
9
+ namespace rnoh {
10
+
11
+ class JSI_EXPORT SensitiveInfoNativeModule : public ArkTSTurboModule {
12
+ public:
13
+ SensitiveInfoNativeModule(const ArkTSTurboModule::Context ctx, const std::string name);
14
+ };
15
+
16
+ } // namespace rnoh
@@ -0,0 +1,24 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateComponentDescriptorH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include "ShadowNodes.h"
14
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
15
+ #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
16
+
17
+ namespace facebook::react {
18
+
19
+
20
+
21
+ void react_native_sensitive_info_registerComponentDescriptorsFromCodegen(
22
+ std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
23
+
24
+ } // namespace facebook::react
@@ -0,0 +1,16 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateEventEmitterCpp.js
9
+ */
10
+
11
+ #include "EventEmitters.h"
12
+
13
+
14
+ namespace facebook::react {
15
+
16
+ } // namespace facebook::react
@@ -0,0 +1,17 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateEventEmitterH.js
9
+ */
10
+ #pragma once
11
+
12
+ #include <react/renderer/components/view/ViewEventEmitter.h>
13
+
14
+
15
+ namespace facebook::react {
16
+
17
+ } // namespace facebook::react
@@ -0,0 +1,19 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GeneratePropsCpp.js
9
+ */
10
+
11
+ #include "Props.h"
12
+ #include <react/renderer/core/PropsParserContext.h>
13
+ #include <react/renderer/core/propsConversions.h>
14
+
15
+ namespace facebook::react {
16
+
17
+
18
+
19
+ } // namespace facebook::react
@@ -0,0 +1,18 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GeneratePropsH.js
9
+ */
10
+ #pragma once
11
+
12
+
13
+
14
+ namespace facebook::react {
15
+
16
+
17
+
18
+ } // namespace facebook::react
@@ -0,0 +1,17 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateShadowNodeCpp.js
9
+ */
10
+
11
+ #include "ShadowNodes.h"
12
+
13
+ namespace facebook::react {
14
+
15
+
16
+
17
+ } // namespace facebook::react
@@ -0,0 +1,23 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateShadowNodeH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include "EventEmitters.h"
14
+ #include "Props.h"
15
+ #include "States.h"
16
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
17
+ #include <jsi/jsi.h>
18
+
19
+ namespace facebook::react {
20
+
21
+
22
+
23
+ } // namespace facebook::react
@@ -0,0 +1,16 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateStateCpp.js
9
+ */
10
+ #include "States.h"
11
+
12
+ namespace facebook::react {
13
+
14
+
15
+
16
+ } // namespace facebook::react
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateStateH.js
8
+ */
9
+ #pragma once
10
+
11
+ #ifdef ANDROID
12
+ #include <folly/dynamic.h>
13
+ #endif
14
+
15
+ namespace facebook::react {
16
+
17
+
18
+
19
+ } // namespace facebook::react
@@ -0,0 +1,64 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2024 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import hilog from '@ohos.hilog';
26
+
27
+ class Logger {
28
+ private domain: number;
29
+ private prefix: string;
30
+ private format: string = '%{public}s, %{public}s';
31
+ private isDebug: boolean;
32
+
33
+ /**
34
+ * constructor.
35
+ *
36
+ * @param Prefix Identifies the log tag.
37
+ * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF.
38
+ */
39
+ constructor(prefix: string = 'blobUtil', domain: number = 0xFF00, isDebug = false) {
40
+ this.prefix = prefix;
41
+ this.domain = domain;
42
+ this.isDebug = isDebug;
43
+ }
44
+
45
+ debug(...args: string[]): void {
46
+ if (this.isDebug) {
47
+ hilog.debug(this.domain, this.prefix, this.format, args);
48
+ }
49
+ }
50
+
51
+ info(...args: string[]): void {
52
+ hilog.info(this.domain, this.prefix, this.format, args);
53
+ }
54
+
55
+ warn(...args: string[]): void {
56
+ hilog.warn(this.domain, this.prefix, this.format, args);
57
+ }
58
+
59
+ error(...args: string[]): void {
60
+ hilog.error(this.domain, this.prefix, this.format, args);
61
+ }
62
+ }
63
+
64
+ export default new Logger('RNSensitiveInfo', 0xFF00, false)