@onekeyfe/react-native-check-biometric-auth-changed 0.1.2
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 +20 -0
- package/README.md +39 -0
- package/ReactNativeCheckBiometricAuthChanged.podspec +29 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +128 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/ReactNativeCheckBiometricAuthChanged.kt +12 -0
- package/android/src/main/java/com/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/ReactNativeCheckBiometricAuthChangedPackage.kt +22 -0
- package/ios/ReactNativeCheckBiometricAuthChanged.swift +22 -0
- package/lib/module/ReactNativeCheckBiometricAuthChanged.nitro.js +4 -0
- package/lib/module/ReactNativeCheckBiometricAuthChanged.nitro.js.map +1 -0
- package/lib/module/index.js +8 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/ReactNativeCheckBiometricAuthChanged.nitro.d.ts +8 -0
- package/lib/typescript/src/ReactNativeCheckBiometricAuthChanged.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +17 -0
- package/nitrogen/generated/android/c++/JHybridReactNativeCheckBiometricAuthChangedSpec.cpp +64 -0
- package/nitrogen/generated/android/c++/JHybridReactNativeCheckBiometricAuthChangedSpec.hpp +65 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/HybridReactNativeCheckBiometricAuthChangedSpec.kt +58 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.kt +35 -0
- package/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.cmake +81 -0
- package/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.gradle +27 -0
- package/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.cpp +44 -0
- package/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.hpp +25 -0
- package/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged+autolinking.rb +60 -0
- package/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.cpp +49 -0
- package/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.hpp +110 -0
- package/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Umbrella.hpp +44 -0
- package/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChangedAutolinking.mm +33 -0
- package/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChangedAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridReactNativeCheckBiometricAuthChangedSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridReactNativeCheckBiometricAuthChangedSpecSwift.hpp +76 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridReactNativeCheckBiometricAuthChangedSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridReactNativeCheckBiometricAuthChangedSpec_cxx.swift +138 -0
- package/nitrogen/generated/shared/c++/HybridReactNativeCheckBiometricAuthChangedSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridReactNativeCheckBiometricAuthChangedSpec.hpp +62 -0
- package/package.json +173 -0
- package/src/ReactNativeCheckBiometricAuthChanged.nitro.ts +6 -0
- package/src/index.tsx +11 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 @onekeyfeonekeyfe
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @onekeyfe/react-native-check-biometric-auth-changed
|
|
2
|
+
|
|
3
|
+
react-native-check-biometric-auth-changed
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm install @onekeyfe/react-native-check-biometric-auth-changed react-native-nitro-modules
|
|
10
|
+
|
|
11
|
+
> `react-native-nitro-modules` is required as this library relies on [Nitro Modules](https://nitro.margelo.com/).
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
import { multiply } from '@onekeyfe/react-native-check-biometric-auth-changed';
|
|
20
|
+
|
|
21
|
+
// ...
|
|
22
|
+
|
|
23
|
+
const result = multiply(3, 7);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Contributing
|
|
28
|
+
|
|
29
|
+
- [Development workflow](CONTRIBUTING.md#development-workflow)
|
|
30
|
+
- [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
|
|
31
|
+
- [Code of conduct](CODE_OF_CONDUCT.md)
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
MIT
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
@@ -0,0 +1,29 @@
|
|
|
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 = "ReactNativeCheckBiometricAuthChanged"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
+
s.source = { :git => "https://github.com/OneKeyHQ/app-modules/react-native-check-biometric-auth-changed/onekeyfe-react-native-check-biometric-auth-changed.git", :tag => "#{s.version}" }
|
|
15
|
+
|
|
16
|
+
s.source_files = [
|
|
17
|
+
"ios/**/*.{swift}",
|
|
18
|
+
"ios/**/*.{m,mm}",
|
|
19
|
+
"cpp/**/*.{hpp,cpp}",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
s.dependency 'React-jsi'
|
|
23
|
+
s.dependency 'React-callinvoker'
|
|
24
|
+
|
|
25
|
+
load 'nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged+autolinking.rb'
|
|
26
|
+
add_nitrogen_files(s)
|
|
27
|
+
|
|
28
|
+
install_modules_dependencies(s)
|
|
29
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
project(onekeyfe_reactnativecheckbiometricauthchanged)
|
|
2
|
+
cmake_minimum_required(VERSION 3.9.0)
|
|
3
|
+
|
|
4
|
+
set(PACKAGE_NAME onekeyfe_reactnativecheckbiometricauthchanged)
|
|
5
|
+
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
6
|
+
set(CMAKE_CXX_STANDARD 20)
|
|
7
|
+
|
|
8
|
+
# Define C++ library and add all sources
|
|
9
|
+
add_library(${PACKAGE_NAME} SHARED src/main/cpp/cpp-adapter.cpp)
|
|
10
|
+
|
|
11
|
+
# Add Nitrogen specs :)
|
|
12
|
+
include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.cmake)
|
|
13
|
+
|
|
14
|
+
# Set up local includes
|
|
15
|
+
include_directories("src/main/cpp" "../cpp")
|
|
16
|
+
|
|
17
|
+
find_library(LOG_LIB log)
|
|
18
|
+
|
|
19
|
+
# Link all libraries together
|
|
20
|
+
target_link_libraries(
|
|
21
|
+
${PACKAGE_NAME}
|
|
22
|
+
${LOG_LIB}
|
|
23
|
+
android # <-- Android core
|
|
24
|
+
)
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
ext.getExtOrDefault = {name ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeCheckBiometricAuthChanged_' + name]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
repositories {
|
|
7
|
+
google()
|
|
8
|
+
mavenCentral()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
dependencies {
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
13
|
+
// noinspection DifferentKotlinGradleVersion
|
|
14
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
def reactNativeArchitectures() {
|
|
19
|
+
def value = rootProject.getProperties().get("reactNativeArchitectures")
|
|
20
|
+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
apply plugin: "com.android.library"
|
|
24
|
+
apply plugin: "kotlin-android"
|
|
25
|
+
apply from: '../nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.gradle'
|
|
26
|
+
|
|
27
|
+
apply plugin: "com.facebook.react"
|
|
28
|
+
|
|
29
|
+
def getExtOrIntegerDefault(name) {
|
|
30
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["ReactNativeCheckBiometricAuthChanged_" + name]).toInteger()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
android {
|
|
34
|
+
namespace "com.margelo.nitro.onekeyfe.reactnativecheckbiometricauthchanged"
|
|
35
|
+
|
|
36
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
37
|
+
|
|
38
|
+
defaultConfig {
|
|
39
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
40
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
41
|
+
|
|
42
|
+
externalNativeBuild {
|
|
43
|
+
cmake {
|
|
44
|
+
cppFlags "-frtti -fexceptions -Wall -fstack-protector-all"
|
|
45
|
+
arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
|
|
46
|
+
abiFilters (*reactNativeArchitectures())
|
|
47
|
+
|
|
48
|
+
buildTypes {
|
|
49
|
+
debug {
|
|
50
|
+
cppFlags "-O1 -g"
|
|
51
|
+
}
|
|
52
|
+
release {
|
|
53
|
+
cppFlags "-O2"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
externalNativeBuild {
|
|
61
|
+
cmake {
|
|
62
|
+
path "CMakeLists.txt"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
packagingOptions {
|
|
67
|
+
excludes = [
|
|
68
|
+
"META-INF",
|
|
69
|
+
"META-INF/**",
|
|
70
|
+
"**/libc++_shared.so",
|
|
71
|
+
"**/libfbjni.so",
|
|
72
|
+
"**/libjsi.so",
|
|
73
|
+
"**/libfolly_json.so",
|
|
74
|
+
"**/libfolly_runtime.so",
|
|
75
|
+
"**/libglog.so",
|
|
76
|
+
"**/libhermes.so",
|
|
77
|
+
"**/libhermes-executor-debug.so",
|
|
78
|
+
"**/libhermes_executor.so",
|
|
79
|
+
"**/libreactnative.so",
|
|
80
|
+
"**/libreactnativejni.so",
|
|
81
|
+
"**/libturbomodulejsijni.so",
|
|
82
|
+
"**/libreact_nativemodule_core.so",
|
|
83
|
+
"**/libjscexecutor.so"
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
buildFeatures {
|
|
88
|
+
buildConfig true
|
|
89
|
+
prefab true
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
buildTypes {
|
|
93
|
+
release {
|
|
94
|
+
minifyEnabled false
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
lintOptions {
|
|
99
|
+
disable "GradleCompatible"
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
compileOptions {
|
|
103
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
104
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
sourceSets {
|
|
108
|
+
main {
|
|
109
|
+
java.srcDirs += [
|
|
110
|
+
"generated/java",
|
|
111
|
+
"generated/jni"
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
repositories {
|
|
118
|
+
mavenCentral()
|
|
119
|
+
google()
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
123
|
+
|
|
124
|
+
dependencies {
|
|
125
|
+
implementation "com.facebook.react:react-android"
|
|
126
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
127
|
+
implementation project(":react-native-nitro-modules")
|
|
128
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
ReactNativeCheckBiometricAuthChanged_kotlinVersion=2.0.21
|
|
2
|
+
ReactNativeCheckBiometricAuthChanged_minSdkVersion=24
|
|
3
|
+
ReactNativeCheckBiometricAuthChanged_targetSdkVersion=34
|
|
4
|
+
ReactNativeCheckBiometricAuthChanged_compileSdkVersion=35
|
|
5
|
+
ReactNativeCheckBiometricAuthChanged_ndkVersion=27.1.12297006
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
package com.margelo.nitro.onekeyfe.reactnativecheckbiometricauthchanged
|
|
2
|
+
|
|
3
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
4
|
+
import com.margelo.nitro.core.Promise
|
|
5
|
+
|
|
6
|
+
@DoNotStrip
|
|
7
|
+
class ReactNativeCheckBiometricAuthChanged : HybridReactNativeCheckBiometricAuthChangedSpec() {
|
|
8
|
+
|
|
9
|
+
override fun checkChanged(): Promise<Boolean> {
|
|
10
|
+
return Promise.resolved(false)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package com.margelo.nitro.onekeyfe.reactnativecheckbiometricauthchanged
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.BaseReactPackage
|
|
4
|
+
import com.facebook.react.bridge.NativeModule
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
+
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
7
|
+
|
|
8
|
+
class ReactNativeCheckBiometricAuthChangedPackage : BaseReactPackage() {
|
|
9
|
+
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
10
|
+
return null
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
|
|
14
|
+
return ReactModuleInfoProvider { HashMap() }
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
companion object {
|
|
18
|
+
init {
|
|
19
|
+
System.loadLibrary("onekeyfe_reactnativecheckbiometricauthchanged")
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
import NitroModules
|
|
3
|
+
import LocalAuthentication
|
|
4
|
+
|
|
5
|
+
class ReactNativeCheckBiometricAuthChanged: HybridReactNativeCheckBiometricAuthChangedSpec {
|
|
6
|
+
func checkChanged() throws -> Promise<Bool> {
|
|
7
|
+
return Promise.async {
|
|
8
|
+
var changed = false
|
|
9
|
+
let context = LAContext()
|
|
10
|
+
_ = context.canEvaluatePolicy(.deviceOwnerAuthentication, error: nil)
|
|
11
|
+
let domainState = context.evaluatedPolicyDomainState
|
|
12
|
+
let defaults = UserDefaults.standard
|
|
13
|
+
let oldDomainState = defaults.data(forKey: "biometricAuthState")
|
|
14
|
+
if let oldDomainState = oldDomainState {
|
|
15
|
+
changed = oldDomainState != domainState
|
|
16
|
+
}
|
|
17
|
+
defaults.set(domainState, forKey: "biometricAuthState")
|
|
18
|
+
defaults.synchronize()
|
|
19
|
+
return changed
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["ReactNativeCheckBiometricAuthChanged.nitro.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { NitroModules } from 'react-native-nitro-modules';
|
|
4
|
+
const ReactNativeCheckBiometricAuthChangedHybridObject = NitroModules.createHybridObject('ReactNativeCheckBiometricAuthChanged');
|
|
5
|
+
export function checkBiometricAuthChanged() {
|
|
6
|
+
return ReactNativeCheckBiometricAuthChangedHybridObject.checkChanged();
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NitroModules","ReactNativeCheckBiometricAuthChangedHybridObject","createHybridObject","checkBiometricAuthChanged","checkChanged"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAGzD,MAAMC,gDAAgD,GACpDD,YAAY,CAACE,kBAAkB,CAC7B,sCACF,CAAC;AAEH,OAAO,SAASC,yBAAyBA,CAAA,EAAqB;EAC5D,OAAOF,gDAAgD,CAACG,YAAY,CAAC,CAAC;AACxE","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
export interface ReactNativeCheckBiometricAuthChanged extends HybridObject<{
|
|
3
|
+
ios: 'swift';
|
|
4
|
+
android: 'kotlin';
|
|
5
|
+
}> {
|
|
6
|
+
checkChanged(): Promise<boolean>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=ReactNativeCheckBiometricAuthChanged.nitro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactNativeCheckBiometricAuthChanged.nitro.d.ts","sourceRoot":"","sources":["../../../src/ReactNativeCheckBiometricAuthChanged.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,oCACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IACzD,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAQA,wBAAgB,yBAAyB,IAAI,OAAO,CAAC,OAAO,CAAC,CAE5D"}
|
package/nitro.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cxxNamespace": ["onekeyfe_reactnativecheckbiometricauthchanged"],
|
|
3
|
+
"ios": {
|
|
4
|
+
"iosModuleName": "ReactNativeCheckBiometricAuthChanged"
|
|
5
|
+
},
|
|
6
|
+
"android": {
|
|
7
|
+
"androidNamespace": ["onekeyfe","reactnativecheckbiometricauthchanged"],
|
|
8
|
+
"androidCxxLibName": "onekeyfe_reactnativecheckbiometricauthchanged"
|
|
9
|
+
},
|
|
10
|
+
"autolinking": {
|
|
11
|
+
"ReactNativeCheckBiometricAuthChanged": {
|
|
12
|
+
"swift": "ReactNativeCheckBiometricAuthChanged",
|
|
13
|
+
"kotlin": "ReactNativeCheckBiometricAuthChanged"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"ignorePaths": ["node_modules"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridReactNativeCheckBiometricAuthChangedSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JHybridReactNativeCheckBiometricAuthChangedSpec.hpp"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
#include <NitroModules/Promise.hpp>
|
|
13
|
+
#include <NitroModules/JPromise.hpp>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged {
|
|
16
|
+
|
|
17
|
+
jni::local_ref<JHybridReactNativeCheckBiometricAuthChangedSpec::jhybriddata> JHybridReactNativeCheckBiometricAuthChangedSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
18
|
+
return makeCxxInstance(jThis);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
void JHybridReactNativeCheckBiometricAuthChangedSpec::registerNatives() {
|
|
22
|
+
registerHybrid({
|
|
23
|
+
makeNativeMethod("initHybrid", JHybridReactNativeCheckBiometricAuthChangedSpec::initHybrid),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
size_t JHybridReactNativeCheckBiometricAuthChangedSpec::getExternalMemorySize() noexcept {
|
|
28
|
+
static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
|
|
29
|
+
return method(_javaPart);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
void JHybridReactNativeCheckBiometricAuthChangedSpec::dispose() noexcept {
|
|
33
|
+
static const auto method = javaClassStatic()->getMethod<void()>("dispose");
|
|
34
|
+
method(_javaPart);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
std::string JHybridReactNativeCheckBiometricAuthChangedSpec::toString() {
|
|
38
|
+
static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
|
|
39
|
+
auto javaString = method(_javaPart);
|
|
40
|
+
return javaString->toStdString();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Properties
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
// Methods
|
|
47
|
+
std::shared_ptr<Promise<bool>> JHybridReactNativeCheckBiometricAuthChangedSpec::checkChanged() {
|
|
48
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("checkChanged");
|
|
49
|
+
auto __result = method(_javaPart);
|
|
50
|
+
return [&]() {
|
|
51
|
+
auto __promise = Promise<bool>::create();
|
|
52
|
+
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
53
|
+
auto __result = jni::static_ref_cast<jni::JBoolean>(__boxedResult);
|
|
54
|
+
__promise->resolve(static_cast<bool>(__result->value()));
|
|
55
|
+
});
|
|
56
|
+
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
57
|
+
jni::JniException __jniError(__throwable);
|
|
58
|
+
__promise->reject(std::make_exception_ptr(__jniError));
|
|
59
|
+
});
|
|
60
|
+
return __promise;
|
|
61
|
+
}();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
} // namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridReactNativeCheckBiometricAuthChangedSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
+
#include <fbjni/fbjni.h>
|
|
12
|
+
#include "HybridReactNativeCheckBiometricAuthChangedSpec.hpp"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
class JHybridReactNativeCheckBiometricAuthChangedSpec: public jni::HybridClass<JHybridReactNativeCheckBiometricAuthChangedSpec, JHybridObject>,
|
|
22
|
+
public virtual HybridReactNativeCheckBiometricAuthChangedSpec {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/HybridReactNativeCheckBiometricAuthChangedSpec;";
|
|
25
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
26
|
+
static void registerNatives();
|
|
27
|
+
|
|
28
|
+
protected:
|
|
29
|
+
// C++ constructor (called from Java via `initHybrid()`)
|
|
30
|
+
explicit JHybridReactNativeCheckBiometricAuthChangedSpec(jni::alias_ref<jhybridobject> jThis) :
|
|
31
|
+
HybridObject(HybridReactNativeCheckBiometricAuthChangedSpec::TAG),
|
|
32
|
+
HybridBase(jThis),
|
|
33
|
+
_javaPart(jni::make_global(jThis)) {}
|
|
34
|
+
|
|
35
|
+
public:
|
|
36
|
+
~JHybridReactNativeCheckBiometricAuthChangedSpec() override {
|
|
37
|
+
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
38
|
+
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public:
|
|
42
|
+
size_t getExternalMemorySize() noexcept override;
|
|
43
|
+
void dispose() noexcept override;
|
|
44
|
+
std::string toString() override;
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
inline const jni::global_ref<JHybridReactNativeCheckBiometricAuthChangedSpec::javaobject>& getJavaPart() const noexcept {
|
|
48
|
+
return _javaPart;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
// Properties
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
public:
|
|
56
|
+
// Methods
|
|
57
|
+
std::shared_ptr<Promise<bool>> checkChanged() override;
|
|
58
|
+
|
|
59
|
+
private:
|
|
60
|
+
friend HybridBase;
|
|
61
|
+
using HybridBase::HybridBase;
|
|
62
|
+
jni::global_ref<JHybridReactNativeCheckBiometricAuthChangedSpec::javaobject> _javaPart;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
} // namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridReactNativeCheckBiometricAuthChangedSpec.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.onekeyfe.reactnativecheckbiometricauthchanged
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.Promise
|
|
14
|
+
import com.margelo.nitro.core.HybridObject
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A Kotlin class representing the ReactNativeCheckBiometricAuthChanged HybridObject.
|
|
18
|
+
* Implement this abstract class to create Kotlin-based instances of ReactNativeCheckBiometricAuthChanged.
|
|
19
|
+
*/
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
@Suppress(
|
|
23
|
+
"KotlinJniMissingFunction", "unused",
|
|
24
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
25
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
26
|
+
)
|
|
27
|
+
abstract class HybridReactNativeCheckBiometricAuthChangedSpec: HybridObject() {
|
|
28
|
+
@DoNotStrip
|
|
29
|
+
private var mHybridData: HybridData = initHybrid()
|
|
30
|
+
|
|
31
|
+
init {
|
|
32
|
+
super.updateNative(mHybridData)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
override fun updateNative(hybridData: HybridData) {
|
|
36
|
+
mHybridData = hybridData
|
|
37
|
+
super.updateNative(hybridData)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Default implementation of `HybridObject.toString()`
|
|
41
|
+
override fun toString(): String {
|
|
42
|
+
return "[HybridObject ReactNativeCheckBiometricAuthChanged]"
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Properties
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
// Methods
|
|
49
|
+
@DoNotStrip
|
|
50
|
+
@Keep
|
|
51
|
+
abstract fun checkChanged(): Promise<Boolean>
|
|
52
|
+
|
|
53
|
+
private external fun initHybrid(): HybridData
|
|
54
|
+
|
|
55
|
+
companion object {
|
|
56
|
+
protected const val TAG = "HybridReactNativeCheckBiometricAuthChangedSpec"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// onekeyfe_reactnativecheckbiometricauthchangedOnLoad.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.onekeyfe.reactnativecheckbiometricauthchanged
|
|
9
|
+
|
|
10
|
+
import android.util.Log
|
|
11
|
+
|
|
12
|
+
internal class onekeyfe_reactnativecheckbiometricauthchangedOnLoad {
|
|
13
|
+
companion object {
|
|
14
|
+
private const val TAG = "onekeyfe_reactnativecheckbiometricauthchangedOnLoad"
|
|
15
|
+
private var didLoad = false
|
|
16
|
+
/**
|
|
17
|
+
* Initializes the native part of "onekeyfe_reactnativecheckbiometricauthchanged".
|
|
18
|
+
* This method is idempotent and can be called more than once.
|
|
19
|
+
*/
|
|
20
|
+
@JvmStatic
|
|
21
|
+
fun initializeNative() {
|
|
22
|
+
if (didLoad) return
|
|
23
|
+
try {
|
|
24
|
+
Log.i(TAG, "Loading onekeyfe_reactnativecheckbiometricauthchanged C++ library...")
|
|
25
|
+
System.loadLibrary("onekeyfe_reactnativecheckbiometricauthchanged")
|
|
26
|
+
Log.i(TAG, "Successfully loaded onekeyfe_reactnativecheckbiometricauthchanged C++ library!")
|
|
27
|
+
didLoad = true
|
|
28
|
+
} catch (e: Error) {
|
|
29
|
+
Log.e(TAG, "Failed to load onekeyfe_reactnativecheckbiometricauthchanged C++ library! Is it properly installed and linked? " +
|
|
30
|
+
"Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e)
|
|
31
|
+
throw e
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|