refactor: rename package to RNAuthentication and update dependencies

feat: add postinstall script for patch-package

fix: update react-native-biometrics to support device credentials

refactor: remove FaceAuth, Home, LockScreen, Managelock, and related auth files

chore: update TypeScript configuration for React Native
This commit is contained in:
mansi-dev
2026-01-27 23:20:10 +05:30
parent 4b48e7cdcb
commit 9b9472162e
37 changed files with 1184 additions and 1487 deletions

View File

@@ -0,0 +1,56 @@
diff --git a/node_modules/react-native-biometrics/android/src/main/java/com/rnbiometrics/ReactNativeBiometrics.java b/node_modules/react-native-biometrics/android/src/main/java/com/rnbiometrics/ReactNativeBiometrics.java
index 624ecd9..d135072 100644
--- a/node_modules/react-native-biometrics/android/src/main/java/com/rnbiometrics/ReactNativeBiometrics.java
+++ b/node_modules/react-native-biometrics/android/src/main/java/com/rnbiometrics/ReactNativeBiometrics.java
@@ -182,24 +182,38 @@ public class ReactNativeBiometrics extends ReactContextBaseJavaModule {
}
}
- private PromptInfo getPromptInfo(String promptMessage, String cancelButtonText, boolean allowDeviceCredentials) {
- PromptInfo.Builder builder = new PromptInfo.Builder().setTitle(promptMessage);
+ private BiometricPrompt.PromptInfo getPromptInfo(
+ String promptMessage,
+ String cancelButtonText,
+ boolean allowDeviceCredentials
+) {
+ BiometricPrompt.PromptInfo.Builder builder =
+ new BiometricPrompt.PromptInfo.Builder()
+ .setTitle(promptMessage);
+
+ builder.setAllowedAuthenticators(
+ getAllowedAuthenticators(allowDeviceCredentials)
+ );
+
+ if (!allowDeviceCredentials || isCurrentSDK29OrEarlier()) {
+ builder.setNegativeButtonText(cancelButtonText);
+ }
- builder.setAllowedAuthenticators(getAllowedAuthenticators(allowDeviceCredentials));
+ return builder.build();
+}
- if (allowDeviceCredentials == false || isCurrentSDK29OrEarlier()) {
- builder.setNegativeButtonText(cancelButtonText);
- }
+private int getAllowedAuthenticators(boolean allowDeviceCredentials) {
+ int authenticators = BiometricManager.Authenticators.BIOMETRIC_WEAK;
- return builder.build();
+ if (allowDeviceCredentials) {
+ authenticators |= BiometricManager.Authenticators.DEVICE_CREDENTIAL;
}
- private int getAllowedAuthenticators(boolean allowDeviceCredentials) {
- if (allowDeviceCredentials && !isCurrentSDK29OrEarlier()) {
- return BiometricManager.Authenticators.BIOMETRIC_STRONG | BiometricManager.Authenticators.DEVICE_CREDENTIAL;
- }
- return BiometricManager.Authenticators.BIOMETRIC_STRONG;
- }
+ return authenticators;
+}
+
+
+
private boolean isCurrentSDK29OrEarlier() {
return Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q;