@oxyhq/services 26.0.1 → 26.0.4
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/README.md +2 -2
- package/android/src/main/java/so/oxy/identity/OxyIdentityStore.kt +21 -127
- package/android/src/main/java/so/oxy/session/OxyBackgroundSession.kt +184 -0
- package/android/src/main/java/so/oxy/session/OxyBackgroundSessionApi.kt +162 -0
- package/android/src/main/java/so/oxy/session/OxyBackgroundSessionModule.kt +116 -0
- package/android/src/main/java/so/oxy/session/OxyBackgroundSessionStore.kt +179 -0
- package/android/src/main/java/so/oxy/session/OxyBackgroundToken.kt +61 -0
- package/android/src/main/java/so/oxy/storage/OxyEncryptedPrefs.kt +241 -0
- package/expo-module.config.json +4 -1
- package/lib/commonjs/index.js +18 -49
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notifications/deviceNotifications.js +63 -0
- package/lib/commonjs/notifications/deviceNotifications.js.map +1 -1
- package/lib/commonjs/ui/boot/runProviderColdBoot.js +20 -64
- package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/commonjs/ui/components/AvatarCameraBadge.js +2 -2
- package/lib/commonjs/ui/components/AvatarCameraBadge.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +4 -4
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +13 -1
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +29 -24
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +8 -7
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +20 -26
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +68 -58
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/types.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js +2 -2
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +2 -2
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +3 -1
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
- package/lib/commonjs/ui/components/logo/LogoText.js +4 -4
- package/lib/commonjs/ui/components/logo/LogoText.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +2 -2
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +2 -2
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
- package/lib/commonjs/ui/components/styles/shadow.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +32 -46
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/commitSessionFlow.js +3 -43
- package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +15 -2
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/context/useOxyAccountGraph.js +3 -4
- package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js +5 -5
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +11 -11
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js +9 -9
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js +3 -2
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/userCache.js +17 -17
- package/lib/commonjs/ui/hooks/queries/userCache.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAssets.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAsyncAction.js +7 -7
- package/lib/commonjs/ui/hooks/useAsyncAction.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +8 -4
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAvatarPicker.js +5 -5
- package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/commonjs/ui/hooks/useOnlineStatus.js +3 -2
- package/lib/commonjs/ui/hooks/useOnlineStatus.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +0 -2
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSettingToggle.js +4 -4
- package/lib/commonjs/ui/hooks/useSettingToggle.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js +68 -11
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -1
- package/lib/commonjs/ui/navigation/accountDialogManager.js +2 -0
- package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/commonjs/ui/oauth/browserAuthTransport.js +66 -64
- package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -1
- package/lib/commonjs/ui/oauth/oauthPopup.js +47 -0
- package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountMembersScreen.js +10 -10
- package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +41 -19
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +4 -4
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +9 -9
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AvatarCropScreen.js +3 -3
- package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ChangeAvatarScreen.js +6 -7
- package/lib/commonjs/ui/screens/ChangeAvatarScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +4 -4
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +46 -14
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +5 -5
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileScreen.js +2 -3
- package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +2 -2
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +90 -89
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +20 -20
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FollowersListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FollowingListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +7 -7
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +9 -34
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +3 -3
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +3 -3
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +15 -15
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +19 -19
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +15 -15
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +17 -7
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +2 -2
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +13 -7
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +5 -6
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +1 -4
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +34 -24
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +3 -4
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/session/backgroundSession.js +258 -0
- package/lib/commonjs/ui/session/backgroundSession.js.map +1 -0
- package/lib/commonjs/ui/session/index.js +7 -0
- package/lib/commonjs/ui/session/index.js.map +1 -1
- package/lib/commonjs/ui/session/useBackgroundSessionSync.js +81 -0
- package/lib/commonjs/ui/session/useBackgroundSessionSync.js.map +1 -0
- package/lib/commonjs/ui/utils/fileManagement.js +24 -24
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
- package/lib/commonjs/ui/utils/netConnectivity.js +28 -0
- package/lib/commonjs/ui/utils/netConnectivity.js.map +1 -0
- package/lib/commonjs/ui/utils/oauthReturn.js +19 -30
- package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
- package/lib/commonjs/ui/utils/userUtils.js +27 -28
- package/lib/commonjs/ui/utils/userUtils.js.map +1 -1
- package/lib/module/index.js +20 -8
- package/lib/module/index.js.map +1 -1
- package/lib/module/notifications/deviceNotifications.js +62 -0
- package/lib/module/notifications/deviceNotifications.js.map +1 -1
- package/lib/module/ui/boot/runProviderColdBoot.js +21 -65
- package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/module/ui/components/AvatarCameraBadge.js +1 -1
- package/lib/module/ui/components/AvatarCameraBadge.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +1 -1
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialogScreen.js +13 -1
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +25 -20
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +7 -6
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +12 -18
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +68 -58
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/module/ui/components/authChooser/types.js.map +1 -1
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js +1 -1
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js.map +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +3 -1
- package/lib/module/ui/components/internal/PinInput.js.map +1 -1
- package/lib/module/ui/components/logo/LogoText.js +4 -4
- package/lib/module/ui/components/logo/LogoText.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSummaryStep.js +2 -2
- package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -1
- package/lib/module/ui/components/styles/shadow.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +35 -49
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/commitSessionFlow.js +3 -42
- package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +15 -2
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/context/useOxyAccountGraph.js +3 -4
- package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/usePaymentQueries.js +3 -2
- package/lib/module/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/userCache.js +17 -17
- package/lib/module/ui/hooks/queries/userCache.js.map +1 -1
- package/lib/module/ui/hooks/useAssets.js.map +1 -1
- package/lib/module/ui/hooks/useAsyncAction.js +1 -1
- package/lib/module/ui/hooks/useAsyncAction.js.map +1 -1
- package/lib/module/ui/hooks/useAuth.js +8 -4
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useAvatarPicker.js +1 -1
- package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/module/ui/hooks/useOnlineStatus.js +3 -2
- package/lib/module/ui/hooks/useOnlineStatus.js.map +1 -1
- package/lib/module/ui/hooks/useSessionManagement.js +0 -2
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js.map +1 -1
- package/lib/module/ui/hooks/useSurfaceHeader.js +68 -11
- package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -1
- package/lib/module/ui/navigation/accountDialogManager.js +2 -0
- package/lib/module/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/module/ui/oauth/browserAuthTransport.js +66 -64
- package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -1
- package/lib/module/ui/oauth/oauthPopup.js +48 -1
- package/lib/module/ui/oauth/oauthPopup.js.map +1 -1
- package/lib/module/ui/screens/AccountMembersScreen.js +1 -1
- package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +37 -15
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/module/ui/screens/ChangeAvatarScreen.js +4 -5
- package/lib/module/ui/screens/ChangeAvatarScreen.js.map +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js +2 -2
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.js +45 -13
- package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +4 -4
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileScreen.js +3 -4
- package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +1 -1
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +94 -91
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/FollowersListScreen.js.map +1 -1
- package/lib/module/ui/screens/FollowingListScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +5 -30
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +3 -3
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +4 -4
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +11 -11
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +18 -8
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +14 -8
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +5 -6
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +1 -4
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +15 -5
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +4 -5
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/module/ui/session/backgroundSession.js +252 -0
- package/lib/module/ui/session/backgroundSession.js.map +1 -0
- package/lib/module/ui/session/index.js +1 -0
- package/lib/module/ui/session/index.js.map +1 -1
- package/lib/module/ui/session/useBackgroundSessionSync.js +76 -0
- package/lib/module/ui/session/useBackgroundSessionSync.js.map +1 -0
- package/lib/module/ui/utils/fileManagement.js +25 -25
- package/lib/module/ui/utils/fileManagement.js.map +1 -1
- package/lib/module/ui/utils/netConnectivity.js +23 -0
- package/lib/module/ui/utils/netConnectivity.js.map +1 -0
- package/lib/module/ui/utils/oauthReturn.js +20 -30
- package/lib/module/ui/utils/oauthReturn.js.map +1 -1
- package/lib/module/ui/utils/userUtils.js +27 -28
- package/lib/module/ui/utils/userUtils.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -2
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +51 -0
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +11 -30
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AvatarCameraBadge.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +7 -0
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +3 -0
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +6 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/internal/PinInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/types.d.ts +6 -6
- package/lib/typescript/commonjs/ui/components/payment/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +0 -40
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +11 -2
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +26 -7
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +0 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts +3 -2
- package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/usePaymentQueries.d.ts +3 -2
- package/lib/typescript/commonjs/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts +2 -2
- package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts +2 -2
- package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +10 -6
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts +3 -2
- package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts +7 -2
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +8 -0
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +6 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts +2 -2
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts +3 -0
- package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts +3 -0
- package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts +7 -0
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/backgroundSession.d.ts +42 -0
- package/lib/typescript/commonjs/ui/session/backgroundSession.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/session/index.d.ts +1 -0
- package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts +23 -0
- package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +27 -19
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +5 -5
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts +17 -0
- package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +15 -12
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/userUtils.d.ts +7 -14
- package/lib/typescript/commonjs/ui/utils/userUtils.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -2
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/notifications/deviceNotifications.d.ts +51 -0
- package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -1
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +11 -30
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AvatarCameraBadge.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +7 -0
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts +2 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +3 -0
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/types.d.ts +6 -0
- package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts +1 -1
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/internal/PinInput.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/types.d.ts +6 -6
- package/lib/typescript/module/ui/components/payment/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +0 -40
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +11 -2
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +26 -7
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +0 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts +3 -2
- package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts +3 -2
- package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/userCache.d.ts +2 -2
- package/lib/typescript/module/ui/hooks/queries/userCache.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAssets.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useAssets.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts +2 -2
- package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts +10 -6
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts +3 -2
- package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts +7 -2
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +8 -0
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +6 -0
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts +2 -2
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts +3 -0
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts +3 -0
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts +7 -0
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/trustTier.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/trustTier.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/backgroundSession.d.ts +42 -0
- package/lib/typescript/module/ui/session/backgroundSession.d.ts.map +1 -0
- package/lib/typescript/module/ui/session/index.d.ts +1 -0
- package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts +23 -0
- package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts.map +1 -0
- package/lib/typescript/module/ui/types/navigation.d.ts +27 -19
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/fileManagement.d.ts +5 -5
- package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/netConnectivity.d.ts +17 -0
- package/lib/typescript/module/ui/utils/netConnectivity.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts +15 -12
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/userUtils.d.ts +7 -14
- package/lib/typescript/module/ui/utils/userUtils.d.ts.map +1 -1
- package/lib/typescript/types/expo-image-picker.d.ts +35 -0
- package/package.json +32 -12
- package/src/index.ts +19 -16
- package/src/notifications/deviceNotifications.ts +82 -0
- package/src/types/expo-image-picker.d.ts +35 -0
- package/src/ui/boot/__tests__/coldBootNoIdpRedirect.test.ts +215 -0
- package/src/ui/boot/runProviderColdBoot.ts +24 -101
- package/src/ui/components/AvatarCameraBadge.tsx +2 -1
- package/src/ui/components/FollowButton.tsx +1 -1
- package/src/ui/components/OxyAccountDialogScreen.tsx +13 -1
- package/src/ui/components/OxyAuthChooser.tsx +31 -20
- package/src/ui/components/OxyProvider.tsx +8 -7
- package/src/ui/components/OxySignInButton.tsx +2 -1
- package/src/ui/components/ProfileButton.tsx +15 -20
- package/src/ui/components/authChooser/AccountsMenuView.tsx +66 -57
- package/src/ui/components/authChooser/types.ts +6 -0
- package/src/ui/components/authChooser/useUsernameAvailability.ts +1 -1
- package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
- package/src/ui/components/internal/PinInput.tsx +1 -0
- package/src/ui/components/logo/LogoText.tsx +4 -4
- package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
- package/src/ui/components/payment/PaymentSummaryStep.tsx +2 -2
- package/src/ui/components/payment/types.ts +24 -24
- package/src/ui/components/styles/shadow.tsx +2 -2
- package/src/ui/context/OxyContext.tsx +35 -46
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +13 -89
- package/src/ui/context/commitSessionFlow.ts +3 -61
- package/src/ui/context/hooks/useAuthOperations.ts +26 -1
- package/src/ui/context/oxyContextTypes.ts +26 -7
- package/src/ui/context/useOxyAccountGraph.ts +4 -4
- package/src/ui/hooks/mutations/mutationFactory.ts +1 -1
- package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
- package/src/ui/hooks/mutations/useServicesMutations.ts +1 -1
- package/src/ui/hooks/queries/paymentTypes.ts +3 -2
- package/src/ui/hooks/queries/usePaymentQueries.ts +3 -2
- package/src/ui/hooks/queries/userCache.ts +169 -148
- package/src/ui/hooks/useAssets.ts +1 -1
- package/src/ui/hooks/useAsyncAction.ts +3 -3
- package/src/ui/hooks/useAuth.ts +12 -6
- package/src/ui/hooks/useAvatarPicker.ts +1 -1
- package/src/ui/hooks/useOnlineStatus.ts +3 -2
- package/src/ui/hooks/useSessionManagement.ts +0 -2
- package/src/ui/hooks/useSettingToggle.ts +1 -1
- package/src/ui/hooks/useSurfaceHeader.ts +90 -15
- package/src/ui/navigation/accountDialogManager.ts +9 -0
- package/src/ui/oauth/__tests__/oauthPopup.test.ts +26 -0
- package/src/ui/oauth/browserAuthTransport.ts +55 -49
- package/src/ui/oauth/oauthPopup.ts +61 -3
- package/src/ui/screens/AccountMembersScreen.tsx +1 -1
- package/src/ui/screens/AccountSettingsScreen.tsx +45 -17
- package/src/ui/screens/AccountVerificationScreen.tsx +1 -1
- package/src/ui/screens/AppInfoScreen.tsx +1 -1
- package/src/ui/screens/AvatarCropScreen.tsx +1 -1
- package/src/ui/screens/ChangeAvatarScreen.tsx +7 -4
- package/src/ui/screens/ConnectedAppsScreen.tsx +2 -2
- package/src/ui/screens/CreateAccountScreen.tsx +55 -15
- package/src/ui/screens/EditProfileFieldScreen.tsx +4 -4
- package/src/ui/screens/EditProfileScreen.tsx +6 -3
- package/src/ui/screens/FAQScreen.tsx +1 -1
- package/src/ui/screens/FeedbackScreen.tsx +741 -575
- package/src/ui/screens/FileManagementScreen.tsx +1 -1
- package/src/ui/screens/FollowersListScreen.tsx +3 -0
- package/src/ui/screens/FollowingListScreen.tsx +3 -0
- package/src/ui/screens/HelpSupportScreen.tsx +1 -1
- package/src/ui/screens/HistoryViewScreen.tsx +5 -20
- package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
- package/src/ui/screens/LegalDocumentsScreen.tsx +1 -1
- package/src/ui/screens/ManageAccountScreen.tsx +9 -2
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +4 -4
- package/src/ui/screens/PrivacySettingsScreen.tsx +15 -12
- package/src/ui/screens/ProfileScreen.tsx +24 -6
- package/src/ui/screens/SavesCollectionsScreen.tsx +1 -1
- package/src/ui/screens/UserListScreen.tsx +18 -8
- package/src/ui/screens/WelcomeNewUserScreen.tsx +6 -6
- package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +1 -1
- package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +14 -5
- package/src/ui/screens/trust/TrustCenterScreen.tsx +2 -2
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +6 -5
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
- package/src/ui/screens/trust/TrustRulesScreen.tsx +1 -1
- package/src/ui/screens/trust/trustTier.ts +1 -1
- package/src/ui/session/__tests__/backgroundSession.test.ts +392 -0
- package/src/ui/session/backgroundSession.ts +313 -0
- package/src/ui/session/index.ts +1 -0
- package/src/ui/session/useBackgroundSessionSync.ts +92 -0
- package/src/ui/types/navigation.ts +27 -19
- package/src/ui/utils/fileManagement.ts +108 -92
- package/src/ui/utils/netConnectivity.ts +27 -0
- package/src/ui/utils/oauthReturn.ts +23 -33
- package/src/ui/utils/userUtils.ts +27 -32
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +0 -48
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +0 -1
- package/lib/commonjs/ui/utils/crossOriginRestore.js +0 -140
- package/lib/commonjs/ui/utils/crossOriginRestore.js.map +0 -1
- package/lib/module/ui/oauth/legacyRedirectLanes.js +0 -44
- package/lib/module/ui/oauth/legacyRedirectLanes.js.map +0 -1
- package/lib/module/ui/utils/crossOriginRestore.js +0 -131
- package/lib/module/ui/utils/crossOriginRestore.js.map +0 -1
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +0 -40
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts +0 -43
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +0 -1
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +0 -40
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts +0 -43
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +0 -1
- package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +0 -281
- package/src/ui/oauth/legacyRedirectLanes.ts +0 -43
- package/src/ui/utils/__tests__/crossOriginRestore.test.ts +0 -143
- package/src/ui/utils/crossOriginRestore.ts +0 -169
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
package so.oxy.session
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.content.SharedPreferences
|
|
5
|
+
import so.oxy.storage.OxyEncryptedPrefs
|
|
6
|
+
import so.oxy.storage.RecoveryPolicy
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* On-device storage for the background session credential and the short access
|
|
10
|
+
* token minted from it.
|
|
11
|
+
*
|
|
12
|
+
* Its own EncryptedSharedPreferences file — it never reads or writes the app's
|
|
13
|
+
* device credential (`oxy.auth.v1` in expo-secure-store). That separation is the
|
|
14
|
+
* whole point of the design: `POST /session/device/token` rotates the device
|
|
15
|
+
* secret on every mint and the presented secret dies 60 seconds later, so
|
|
16
|
+
* background code that touched it would be a second writer to a value the JS
|
|
17
|
+
* runtime depends on, and a worker killed between the mint and the local write
|
|
18
|
+
* would sign the user out of the app. Nothing here can do that.
|
|
19
|
+
*
|
|
20
|
+
* WRITERS: JS (via [OxyBackgroundSessionModule], while the app runs) owns the
|
|
21
|
+
* credential; native (via [OxyBackgroundSession]) owns only the cached token.
|
|
22
|
+
* Neither ever rotates the credential — the server does not rotate it either.
|
|
23
|
+
*/
|
|
24
|
+
internal object OxyBackgroundSessionStore {
|
|
25
|
+
/**
|
|
26
|
+
* Suffix is the hosting app's package name. Oxy apps share the `so.oxy.shared`
|
|
27
|
+
* Android UID (and therefore one data directory), so a single global prefs name
|
|
28
|
+
* would let one app that leaves `backgroundSession` off wipe another app's
|
|
29
|
+
* live credential on launch. Scoping by package keeps each app's widget/sync
|
|
30
|
+
* store independent.
|
|
31
|
+
*/
|
|
32
|
+
private const val PREFS_NAME_PREFIX = "oxy_background_session_"
|
|
33
|
+
|
|
34
|
+
private fun prefsName(context: Context): String = PREFS_NAME_PREFIX + context.packageName
|
|
35
|
+
|
|
36
|
+
private const val KEY_BASE_URL = "baseUrl"
|
|
37
|
+
private const val KEY_DEVICE_ID = "deviceId"
|
|
38
|
+
private const val KEY_SECRET = "secret"
|
|
39
|
+
private const val KEY_ACCOUNT_ID = "accountId"
|
|
40
|
+
private const val KEY_EXPIRES_AT = "expiresAt"
|
|
41
|
+
|
|
42
|
+
private const val KEY_TOKEN = "token"
|
|
43
|
+
private const val KEY_TOKEN_EXPIRES_AT = "tokenExpiresAt"
|
|
44
|
+
private const val KEY_TOKEN_ACCOUNT_ID = "tokenAccountId"
|
|
45
|
+
|
|
46
|
+
/** The provisioned credential. [expiresAt] is epoch millis. */
|
|
47
|
+
internal data class Credential(
|
|
48
|
+
val baseUrl: String,
|
|
49
|
+
val deviceId: String,
|
|
50
|
+
val secret: String,
|
|
51
|
+
val accountId: String,
|
|
52
|
+
val expiresAt: Long,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
/** A previously minted access token. [expiresAt] is epoch millis. */
|
|
56
|
+
internal data class CachedToken(
|
|
57
|
+
val accessToken: String,
|
|
58
|
+
val expiresAt: Long,
|
|
59
|
+
val accountId: String,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* [RecoveryPolicy.RebuildFileOnly] — this store must NEVER escalate to a
|
|
64
|
+
* UID-shared master-key reset.
|
|
65
|
+
*
|
|
66
|
+
* What it holds is disposable: the app re-provisions the credential on its next
|
|
67
|
+
* foreground, so "no credential" is a complete recovery that costs the user
|
|
68
|
+
* nothing (background refreshes render signed out until then). A master-key reset
|
|
69
|
+
* would wipe every other Oxy store sharing the alias — including the self-custody
|
|
70
|
+
* identity keypair, which is IRREPLACEABLE. Trading someone else's unrecoverable
|
|
71
|
+
* data to save data we can simply ask for again is never the right trade, so the
|
|
72
|
+
* escalation is not merely discouraged here, it is unreachable.
|
|
73
|
+
*/
|
|
74
|
+
private fun prefs(context: Context): SharedPreferences =
|
|
75
|
+
OxyEncryptedPrefs.open(context, prefsName(context), RecoveryPolicy.RebuildFileOnly)
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The stored credential, or null when absent, incomplete, or expired.
|
|
79
|
+
*
|
|
80
|
+
* An expired credential is DELETED on the way out rather than merely ignored:
|
|
81
|
+
* it can never become valid again (only JS can provision, and it will write a
|
|
82
|
+
* fresh one), so leaving it on disk would keep a dead secret at rest for as
|
|
83
|
+
* long as the app went unopened.
|
|
84
|
+
*/
|
|
85
|
+
fun readCredential(context: Context): Credential? {
|
|
86
|
+
val p = prefs(context)
|
|
87
|
+
val baseUrl = p.getString(KEY_BASE_URL, null)
|
|
88
|
+
val deviceId = p.getString(KEY_DEVICE_ID, null)
|
|
89
|
+
val secret = p.getString(KEY_SECRET, null)
|
|
90
|
+
val accountId = p.getString(KEY_ACCOUNT_ID, null)
|
|
91
|
+
val expiresAt = p.getLong(KEY_EXPIRES_AT, 0L)
|
|
92
|
+
if (
|
|
93
|
+
baseUrl.isNullOrEmpty() ||
|
|
94
|
+
deviceId.isNullOrEmpty() ||
|
|
95
|
+
secret.isNullOrEmpty() ||
|
|
96
|
+
accountId.isNullOrEmpty() ||
|
|
97
|
+
expiresAt <= 0L
|
|
98
|
+
) {
|
|
99
|
+
return null
|
|
100
|
+
}
|
|
101
|
+
if (expiresAt <= System.currentTimeMillis()) {
|
|
102
|
+
clear(context)
|
|
103
|
+
return null
|
|
104
|
+
}
|
|
105
|
+
return Credential(baseUrl, deviceId, secret, accountId, expiresAt)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Replace the credential.
|
|
110
|
+
*
|
|
111
|
+
* Clears any cached token in the SAME commit: a token minted for the previous
|
|
112
|
+
* credential must never survive alongside a new one, or a switch could serve
|
|
113
|
+
* the previous account's bearer for up to its remaining lifetime.
|
|
114
|
+
*
|
|
115
|
+
* `commit()` (synchronous) because the very next thing that reads this may be a
|
|
116
|
+
* WorkManager worker on another thread.
|
|
117
|
+
*/
|
|
118
|
+
fun writeCredential(context: Context, credential: Credential) {
|
|
119
|
+
prefs(context).edit()
|
|
120
|
+
.putString(KEY_BASE_URL, credential.baseUrl)
|
|
121
|
+
.putString(KEY_DEVICE_ID, credential.deviceId)
|
|
122
|
+
.putString(KEY_SECRET, credential.secret)
|
|
123
|
+
.putString(KEY_ACCOUNT_ID, credential.accountId)
|
|
124
|
+
.putLong(KEY_EXPIRES_AT, credential.expiresAt)
|
|
125
|
+
.remove(KEY_TOKEN)
|
|
126
|
+
.remove(KEY_TOKEN_EXPIRES_AT)
|
|
127
|
+
.remove(KEY_TOKEN_ACCOUNT_ID)
|
|
128
|
+
.commit()
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** The account the stored credential belongs to, without touching the network. */
|
|
132
|
+
fun readAccountId(context: Context): String? = readCredential(context)?.accountId
|
|
133
|
+
|
|
134
|
+
/** Drop the credential AND any cached token. Safe to call when already empty. */
|
|
135
|
+
fun clear(context: Context) {
|
|
136
|
+
prefs(context).edit().clear().commit()
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* A cached token still worth reusing for [accountId], or null.
|
|
141
|
+
*
|
|
142
|
+
* Rejects a token minted for a DIFFERENT account (defence in depth — writing a
|
|
143
|
+
* credential already clears the cache) and one inside [reuseFloorMs] of its
|
|
144
|
+
* expiry, so a token cannot expire midway through the request it was fetched
|
|
145
|
+
* for.
|
|
146
|
+
*/
|
|
147
|
+
fun readToken(context: Context, accountId: String, reuseFloorMs: Long): CachedToken? {
|
|
148
|
+
val p = prefs(context)
|
|
149
|
+
val token = p.getString(KEY_TOKEN, null)
|
|
150
|
+
val tokenAccountId = p.getString(KEY_TOKEN_ACCOUNT_ID, null)
|
|
151
|
+
val expiresAt = p.getLong(KEY_TOKEN_EXPIRES_AT, 0L)
|
|
152
|
+
if (token.isNullOrEmpty() || tokenAccountId.isNullOrEmpty() || expiresAt <= 0L) {
|
|
153
|
+
return null
|
|
154
|
+
}
|
|
155
|
+
if (tokenAccountId != accountId) {
|
|
156
|
+
return null
|
|
157
|
+
}
|
|
158
|
+
if (expiresAt - reuseFloorMs <= System.currentTimeMillis()) {
|
|
159
|
+
return null
|
|
160
|
+
}
|
|
161
|
+
return CachedToken(token, expiresAt, tokenAccountId)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Cache a freshly minted token so sibling workers in the same refresh cycle
|
|
166
|
+
* share one mint instead of one each (which would also burn the per-device rate
|
|
167
|
+
* limit).
|
|
168
|
+
*
|
|
169
|
+
* `apply()` rather than `commit()`: unlike the credential this is a pure
|
|
170
|
+
* optimization, and a lost write only costs one extra mint.
|
|
171
|
+
*/
|
|
172
|
+
fun writeToken(context: Context, token: CachedToken) {
|
|
173
|
+
prefs(context).edit()
|
|
174
|
+
.putString(KEY_TOKEN, token.accessToken)
|
|
175
|
+
.putLong(KEY_TOKEN_EXPIRES_AT, token.expiresAt)
|
|
176
|
+
.putString(KEY_TOKEN_ACCOUNT_ID, token.accountId)
|
|
177
|
+
.apply()
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
package so.oxy.session
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The outcome of [OxyBackgroundSession.accessToken].
|
|
5
|
+
*
|
|
6
|
+
* Four cases rather than a nullable token, because a background caller must treat
|
|
7
|
+
* them differently and cannot tell them apart from `null`: "the user is signed
|
|
8
|
+
* out" is a final answer to render, while "the network is down" is something to
|
|
9
|
+
* retry, and conflating the two either blanks a widget that should keep its last
|
|
10
|
+
* content or retries something that will never succeed.
|
|
11
|
+
*/
|
|
12
|
+
sealed interface OxyBackgroundToken {
|
|
13
|
+
/**
|
|
14
|
+
* A usable bearer for [accountId], valid until [expiresAt] (epoch millis).
|
|
15
|
+
*
|
|
16
|
+
* [accountId] is the account the token was minted for, echoed by the server —
|
|
17
|
+
* NOT a local guess. Key any cached content by it and discard content
|
|
18
|
+
* belonging to a different account, so a switch can never render one account's
|
|
19
|
+
* data under another's name.
|
|
20
|
+
*
|
|
21
|
+
* [baseUrl] is the API origin the credential was provisioned against; use it
|
|
22
|
+
* for the subsequent authenticated request rather than a hardcoded host, so a
|
|
23
|
+
* staging/self-hosted app talks to its own backend.
|
|
24
|
+
*/
|
|
25
|
+
data class Available(
|
|
26
|
+
val accessToken: String,
|
|
27
|
+
val expiresAt: Long,
|
|
28
|
+
val accountId: String,
|
|
29
|
+
val baseUrl: String,
|
|
30
|
+
) : OxyBackgroundToken
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* There is no usable credential and there will not be one until the user opens
|
|
34
|
+
* the app: none was ever provisioned, it expired, or the server revoked it
|
|
35
|
+
* (sign-out, account switch, or the account left this device).
|
|
36
|
+
*
|
|
37
|
+
* FINAL for this run. Render the signed-out state and report success —
|
|
38
|
+
* retrying cannot change the answer. The local record has already been deleted.
|
|
39
|
+
*/
|
|
40
|
+
data object SignedOut : OxyBackgroundToken
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The mint could not be completed for a reason a later attempt could get past:
|
|
44
|
+
* no network, a timeout, a 5xx, a rate limit, or ANY ambiguous 401.
|
|
45
|
+
*
|
|
46
|
+
* The credential is KEPT. Retry with backoff and keep showing the last known
|
|
47
|
+
* content; do not render a signed-out state, because the user is not signed
|
|
48
|
+
* out. See [OxyBackgroundSessionApi] for why an unrecognised 401 lands here
|
|
49
|
+
* rather than in [SignedOut].
|
|
50
|
+
*/
|
|
51
|
+
data class Transient(val cause: Exception) : OxyBackgroundToken
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The server answered, but not in a shape this build can read.
|
|
55
|
+
*
|
|
56
|
+
* The credential is KEPT (nothing proves it is bad) but retrying is pointless:
|
|
57
|
+
* the same body would come back. Log it and stop; this means the wire contract
|
|
58
|
+
* moved and the app needs updating.
|
|
59
|
+
*/
|
|
60
|
+
data class Malformed(val cause: Exception) : OxyBackgroundToken
|
|
61
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
package so.oxy.storage
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.content.SharedPreferences
|
|
5
|
+
import android.util.Log
|
|
6
|
+
import androidx.security.crypto.EncryptedSharedPreferences
|
|
7
|
+
import androidx.security.crypto.MasterKey
|
|
8
|
+
import java.io.IOException
|
|
9
|
+
import java.security.GeneralSecurityException
|
|
10
|
+
import java.security.KeyStore
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* How far [OxyEncryptedPrefs.open] may go to recover a file whose keyset it
|
|
14
|
+
* cannot read.
|
|
15
|
+
*
|
|
16
|
+
* This exists because the callers do NOT have the same stakes, and the last-resort
|
|
17
|
+
* recovery is UID-wide rather than file-local. Every store must therefore state
|
|
18
|
+
* what it is worth: the choice belongs to the data's owner, not to the helper.
|
|
19
|
+
*/
|
|
20
|
+
internal enum class RecoveryPolicy {
|
|
21
|
+
/**
|
|
22
|
+
* Wipe and rebuild only this file. If that still fails, GIVE UP — propagate the
|
|
23
|
+
* failure and touch nothing shared.
|
|
24
|
+
*
|
|
25
|
+
* The right policy for any store holding DISPOSABLE data, i.e. data some other
|
|
26
|
+
* authority can re-create. "No data" is then a complete, cost-free recovery, and
|
|
27
|
+
* paying for it with a UID-wide key reset would be trading someone else's
|
|
28
|
+
* irreplaceable data for something we can simply ask for again.
|
|
29
|
+
*/
|
|
30
|
+
RebuildFileOnly,
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Wipe and rebuild this file, and if that still fails, regenerate the UID-shared
|
|
34
|
+
* master key and rebuild again.
|
|
35
|
+
*
|
|
36
|
+
* Only defensible for a store whose loss is ALREADY catastrophic, because the
|
|
37
|
+
* reset invalidates every other Oxy prefs file wrapped by that key (see
|
|
38
|
+
* [OxyEncryptedPrefs]). Do not choose this to make a store more robust — it makes
|
|
39
|
+
* every OTHER store less so.
|
|
40
|
+
*/
|
|
41
|
+
RegenerateSharedMasterKey,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The ONE way this package opens a hardware-backed [EncryptedSharedPreferences]
|
|
46
|
+
* file.
|
|
47
|
+
*
|
|
48
|
+
* Two stores are built on it — the cross-app identity keypair
|
|
49
|
+
* (`so.oxy.identity.OxyIdentityStore`) and the background session credential
|
|
50
|
+
* (`so.oxy.session.OxyBackgroundSessionStore`) — and both need the same two
|
|
51
|
+
* non-obvious properties below. They are implemented once here rather than per
|
|
52
|
+
* store: a second copy would be a copy of exactly the reasoning that is easiest
|
|
53
|
+
* to get wrong, and the failure mode of getting it wrong is silent (every read
|
|
54
|
+
* degrades to "absent" with no exception at the call site).
|
|
55
|
+
*
|
|
56
|
+
* What is NOT shared is how much each caller may destroy to save itself. That is
|
|
57
|
+
* [RecoveryPolicy], and it is a required argument precisely so the difference
|
|
58
|
+
* cannot be inherited by accident.
|
|
59
|
+
*
|
|
60
|
+
* ## One memoized instance per file (CRITICAL)
|
|
61
|
+
*
|
|
62
|
+
* `EncryptedSharedPreferences.create()` must be called AT MOST ONCE per file per
|
|
63
|
+
* process. It is NOT safe to re-instantiate: when a second instance is created
|
|
64
|
+
* for the same file while another is live (e.g. a JS write thread and a Binder
|
|
65
|
+
* thread, or a WorkManager worker and the app's main thread), Tink's keyset load
|
|
66
|
+
* races and the next decrypt throws `AEADBadTagException` — which silently turned
|
|
67
|
+
* every cross-app read into "no shared identity". So instances are created once,
|
|
68
|
+
* lazily, under a lock, keyed by file name on the process-global application
|
|
69
|
+
* context, and reused for every subsequent read/write.
|
|
70
|
+
*
|
|
71
|
+
* The cache is keyed by file name ALONE, which is correct because each file has
|
|
72
|
+
* exactly one owning store and therefore exactly one policy. Two callers opening
|
|
73
|
+
* the same file with different policies would be a bug in the callers, not
|
|
74
|
+
* something this cache should try to reconcile.
|
|
75
|
+
*
|
|
76
|
+
* ## Keyset self-heal (CRITICAL)
|
|
77
|
+
*
|
|
78
|
+
* The androidx master key that wraps each file's Tink keyset lives under the
|
|
79
|
+
* UID-scoped default alias [MasterKey.DEFAULT_MASTER_KEY_ALIAS] — ONE entry for
|
|
80
|
+
* the whole `so.oxy.shared` UID. When a NEW package joins that shared UID, that
|
|
81
|
+
* master key can be rotated/regenerated, leaving keysets already written on disk
|
|
82
|
+
* wrapped under the OLD key. `create()` then fails GCM verification
|
|
83
|
+
* (`AEADBadTag` -> `GeneralSecurityException`, or an unreadable keyset ->
|
|
84
|
+
* `IOException`) on EVERY read/write, and `EncryptedSharedPreferences` never
|
|
85
|
+
* self-heals — the slot stays permanently dead.
|
|
86
|
+
*
|
|
87
|
+
* Recovery is bounded and has no retry loop:
|
|
88
|
+
* 1. ALWAYS: delete only the affected file (the stale wrapped keyset) and rebuild
|
|
89
|
+
* against the current master key. This heals the common rotation case without
|
|
90
|
+
* touching the master key, so other files keep their keysets.
|
|
91
|
+
* 2. ONLY under [RecoveryPolicy.RegenerateSharedMasterKey]: if a fresh keyset
|
|
92
|
+
* still cannot be built the master key itself is unusable, so delete its
|
|
93
|
+
* keystore alias to force a new one, wipe the file again, and rebuild.
|
|
94
|
+
*
|
|
95
|
+
* Stage 2 is UID-WIDE COLLATERAL: regenerating the shared master key makes every
|
|
96
|
+
* OTHER Oxy prefs file wrapped by it unreadable, so each of those heals itself via
|
|
97
|
+
* stage 1 on its next open — meaning it DELETES their contents. For a store whose
|
|
98
|
+
* data is re-creatable that is survivable; for the self-custody identity keypair it
|
|
99
|
+
* is not, which is the whole reason a disposable store must never reach stage 2.
|
|
100
|
+
* Under [RecoveryPolicy.RebuildFileOnly] the failure simply propagates, and the
|
|
101
|
+
* `runCatching {}` at every call site degrades to "absent".
|
|
102
|
+
*
|
|
103
|
+
* None of this touches the app's device session, which lives in expo-secure-store
|
|
104
|
+
* under a DISTINCT prefs file ("SecureStore") and DISTINCT keystore aliases
|
|
105
|
+
* ("key_v1"-derived), not the androidx master key.
|
|
106
|
+
*/
|
|
107
|
+
internal object OxyEncryptedPrefs {
|
|
108
|
+
private const val TAG = "OxyEncryptedPrefs"
|
|
109
|
+
private const val ANDROID_KEYSTORE = "AndroidKeyStore"
|
|
110
|
+
|
|
111
|
+
/** Memoized instances, keyed by prefs file name. Guarded by [lock]. */
|
|
112
|
+
private val instances = mutableMapOf<String, SharedPreferences>()
|
|
113
|
+
private val lock = Any()
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The process-wide instance for [prefsName], creating (and recovering) it on
|
|
117
|
+
* first use. [recovery] states how much this caller may destroy to get a working
|
|
118
|
+
* file — see [RecoveryPolicy]; there is no default, on purpose.
|
|
119
|
+
*
|
|
120
|
+
* Throws when the file cannot be built within the chosen policy; callers wrap in
|
|
121
|
+
* `runCatching {}` and degrade to "absent".
|
|
122
|
+
*/
|
|
123
|
+
fun open(context: Context, prefsName: String, recovery: RecoveryPolicy): SharedPreferences {
|
|
124
|
+
synchronized(lock) {
|
|
125
|
+
instances[prefsName]?.let { return it }
|
|
126
|
+
val appContext = context.applicationContext
|
|
127
|
+
return openOrHeal(appContext, prefsName, recovery).also { instances[prefsName] = it }
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private fun openOrHeal(
|
|
132
|
+
appContext: Context,
|
|
133
|
+
prefsName: String,
|
|
134
|
+
recovery: RecoveryPolicy,
|
|
135
|
+
): SharedPreferences {
|
|
136
|
+
return try {
|
|
137
|
+
build(appContext, prefsName)
|
|
138
|
+
} catch (corrupt: GeneralSecurityException) {
|
|
139
|
+
healKeyset(appContext, prefsName, recovery, corrupt)
|
|
140
|
+
} catch (corrupt: IOException) {
|
|
141
|
+
healKeyset(appContext, prefsName, recovery, corrupt)
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Stage 1: wipe ONLY this file (which holds the stale wrapped keyset) and
|
|
147
|
+
* rebuild against the current master key. Where it goes next is the caller's
|
|
148
|
+
* policy, not this function's decision.
|
|
149
|
+
*/
|
|
150
|
+
private fun healKeyset(
|
|
151
|
+
appContext: Context,
|
|
152
|
+
prefsName: String,
|
|
153
|
+
recovery: RecoveryPolicy,
|
|
154
|
+
cause: Exception,
|
|
155
|
+
): SharedPreferences {
|
|
156
|
+
Log.w(
|
|
157
|
+
TAG,
|
|
158
|
+
"keyset for '$prefsName' unreadable (rotated master key); cleared and regenerated: ${cause.message}",
|
|
159
|
+
cause
|
|
160
|
+
)
|
|
161
|
+
appContext.deleteSharedPreferences(prefsName)
|
|
162
|
+
return try {
|
|
163
|
+
build(appContext, prefsName)
|
|
164
|
+
} catch (stillCorrupt: GeneralSecurityException) {
|
|
165
|
+
escalateOrGiveUp(appContext, prefsName, recovery, stillCorrupt)
|
|
166
|
+
} catch (stillCorrupt: IOException) {
|
|
167
|
+
escalateOrGiveUp(appContext, prefsName, recovery, stillCorrupt)
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The stage-1-failed fork, and the one place the severity difference between
|
|
173
|
+
* callers is decided.
|
|
174
|
+
*
|
|
175
|
+
* [RecoveryPolicy.RebuildFileOnly] rethrows: this file stays unavailable, which
|
|
176
|
+
* its owner can recover from, and no shared key is touched. Anything else would
|
|
177
|
+
* let a disposable store destroy an irreplaceable one.
|
|
178
|
+
*/
|
|
179
|
+
private fun escalateOrGiveUp(
|
|
180
|
+
appContext: Context,
|
|
181
|
+
prefsName: String,
|
|
182
|
+
recovery: RecoveryPolicy,
|
|
183
|
+
cause: Exception,
|
|
184
|
+
): SharedPreferences {
|
|
185
|
+
if (recovery == RecoveryPolicy.RebuildFileOnly) {
|
|
186
|
+
Log.w(
|
|
187
|
+
TAG,
|
|
188
|
+
"'$prefsName' is still unreadable after a file reset. Giving up rather than " +
|
|
189
|
+
"regenerating the UID-shared master key, which would wipe every other Oxy " +
|
|
190
|
+
"store including the self-custody identity. Its owner re-creates it instead.",
|
|
191
|
+
cause
|
|
192
|
+
)
|
|
193
|
+
throw cause
|
|
194
|
+
}
|
|
195
|
+
return regenerateMasterKeyAndRebuild(appContext, prefsName, cause)
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Stage 2, reachable ONLY via [RecoveryPolicy.RegenerateSharedMasterKey]: the
|
|
200
|
+
* androidx master key itself is unusable, so delete its keystore alias to force a
|
|
201
|
+
* fresh one, wipe the now-stale file again, and rebuild.
|
|
202
|
+
*
|
|
203
|
+
* See the UID-wide collateral note in [OxyEncryptedPrefs] — this is destructive
|
|
204
|
+
* to every other store sharing the alias. The alias is used ONLY by androidx
|
|
205
|
+
* EncryptedSharedPreferences, so it never touches expo-secure-store's aliases. A
|
|
206
|
+
* throw here propagates to the call-site `runCatching {}`.
|
|
207
|
+
*/
|
|
208
|
+
private fun regenerateMasterKeyAndRebuild(
|
|
209
|
+
appContext: Context,
|
|
210
|
+
prefsName: String,
|
|
211
|
+
cause: Exception
|
|
212
|
+
): SharedPreferences {
|
|
213
|
+
Log.w(
|
|
214
|
+
TAG,
|
|
215
|
+
"keyset for '$prefsName' still unreadable after reset; deleting master key " +
|
|
216
|
+
"'${MasterKey.DEFAULT_MASTER_KEY_ALIAS}' and regenerating: ${cause.message}",
|
|
217
|
+
cause
|
|
218
|
+
)
|
|
219
|
+
KeyStore.getInstance(ANDROID_KEYSTORE).apply {
|
|
220
|
+
load(null)
|
|
221
|
+
if (containsAlias(MasterKey.DEFAULT_MASTER_KEY_ALIAS)) {
|
|
222
|
+
deleteEntry(MasterKey.DEFAULT_MASTER_KEY_ALIAS)
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
appContext.deleteSharedPreferences(prefsName)
|
|
226
|
+
return build(appContext, prefsName)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
private fun build(appContext: Context, prefsName: String): SharedPreferences {
|
|
230
|
+
val masterKey = MasterKey.Builder(appContext)
|
|
231
|
+
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
|
|
232
|
+
.build()
|
|
233
|
+
return EncryptedSharedPreferences.create(
|
|
234
|
+
appContext,
|
|
235
|
+
prefsName,
|
|
236
|
+
masterKey,
|
|
237
|
+
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
|
|
238
|
+
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
}
|
package/expo-module.config.json
CHANGED
package/lib/commonjs/index.js
CHANGED
|
@@ -183,30 +183,12 @@ Object.defineProperty(exports, "extractErrorMessage", {
|
|
|
183
183
|
return _errorHandlers.extractErrorMessage;
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
|
-
Object.defineProperty(exports, "getExpoPushToken", {
|
|
187
|
-
enumerable: true,
|
|
188
|
-
get: function () {
|
|
189
|
-
return _deviceNotifications.getExpoPushToken;
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
186
|
Object.defineProperty(exports, "handleAuthError", {
|
|
193
187
|
enumerable: true,
|
|
194
188
|
get: function () {
|
|
195
189
|
return _errorHandlers.handleAuthError;
|
|
196
190
|
}
|
|
197
191
|
});
|
|
198
|
-
Object.defineProperty(exports, "hasNotificationPermission", {
|
|
199
|
-
enumerable: true,
|
|
200
|
-
get: function () {
|
|
201
|
-
return _deviceNotifications.hasNotificationPermission;
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
Object.defineProperty(exports, "installForegroundNotificationHandler", {
|
|
205
|
-
enumerable: true,
|
|
206
|
-
get: function () {
|
|
207
|
-
return _deviceNotifications.installForegroundNotificationHandler;
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
192
|
Object.defineProperty(exports, "invalidateAccountQueries", {
|
|
211
193
|
enumerable: true,
|
|
212
194
|
get: function () {
|
|
@@ -297,24 +279,12 @@ Object.defineProperty(exports, "openOAuthPopup", {
|
|
|
297
279
|
return _oauthPopup.openOAuthPopup;
|
|
298
280
|
}
|
|
299
281
|
});
|
|
300
|
-
Object.defineProperty(exports, "pushTokenPlatform", {
|
|
301
|
-
enumerable: true,
|
|
302
|
-
get: function () {
|
|
303
|
-
return _deviceNotifications.pushTokenPlatform;
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
282
|
Object.defineProperty(exports, "queryKeys", {
|
|
307
283
|
enumerable: true,
|
|
308
284
|
get: function () {
|
|
309
285
|
return _queryKeys.queryKeys;
|
|
310
286
|
}
|
|
311
287
|
});
|
|
312
|
-
Object.defineProperty(exports, "requestNotificationPermission", {
|
|
313
|
-
enumerable: true,
|
|
314
|
-
get: function () {
|
|
315
|
-
return _deviceNotifications.requestNotificationPermission;
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
288
|
Object.defineProperty(exports, "setOxyAssetInstance", {
|
|
319
289
|
enumerable: true,
|
|
320
290
|
get: function () {
|
|
@@ -333,18 +303,6 @@ Object.defineProperty(exports, "subscribeToAccountDialog", {
|
|
|
333
303
|
return _accountDialogManager.subscribeToAccountDialog;
|
|
334
304
|
}
|
|
335
305
|
});
|
|
336
|
-
Object.defineProperty(exports, "subscribeToNotificationResponses", {
|
|
337
|
-
enumerable: true,
|
|
338
|
-
get: function () {
|
|
339
|
-
return _deviceNotifications.subscribeToNotificationResponses;
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
|
-
Object.defineProperty(exports, "takeLaunchNotificationData", {
|
|
343
|
-
enumerable: true,
|
|
344
|
-
get: function () {
|
|
345
|
-
return _deviceNotifications.takeLaunchNotificationData;
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
306
|
Object.defineProperty(exports, "upsertCachedUser", {
|
|
349
307
|
enumerable: true,
|
|
350
308
|
get: function () {
|
|
@@ -752,7 +710,6 @@ var _useOnlineStatus = require("./ui/hooks/useOnlineStatus.js");
|
|
|
752
710
|
var _useOxyEvent = require("./ui/hooks/useOxyEvent.js");
|
|
753
711
|
var _errorHandlers = require("./ui/utils/errorHandlers.js");
|
|
754
712
|
var _useFileFiltering = require("./ui/hooks/useFileFiltering.js");
|
|
755
|
-
var _deviceNotifications = require("./notifications/deviceNotifications.js");
|
|
756
713
|
var _OxySignInButton = _interopRequireDefault(require("./ui/components/OxySignInButton.js"));
|
|
757
714
|
var _oauthPopup = require("./ui/oauth/oauthPopup.js");
|
|
758
715
|
var _OxyAuthPrompt = require("./ui/components/OxyAuthPrompt.js");
|
|
@@ -860,13 +817,25 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
860
817
|
// ---------------------------------------------------------------------------
|
|
861
818
|
|
|
862
819
|
// ---------------------------------------------------------------------------
|
|
863
|
-
// Device notifications
|
|
820
|
+
// Device notifications — DELIBERATELY NOT EXPORTED HERE
|
|
864
821
|
// ---------------------------------------------------------------------------
|
|
865
|
-
// The
|
|
866
|
-
//
|
|
867
|
-
//
|
|
868
|
-
//
|
|
869
|
-
//
|
|
822
|
+
// The `expo-notifications` adapter lives behind its own entry point:
|
|
823
|
+
//
|
|
824
|
+
// import { getExpoPushToken } from '@oxyhq/services/notifications';
|
|
825
|
+
//
|
|
826
|
+
// It is the one module in this package whose dependencies (`expo-notifications`
|
|
827
|
+
// and `expo-constants`) are optional peers that an app which does not use push
|
|
828
|
+
// genuinely never installs. Re-exporting it from THIS barrel is what made that
|
|
829
|
+
// optionality a lie: a barrel export puts the module in the import graph of
|
|
830
|
+
// every consumer, and `tsc` must resolve the specifier of an `import()` even
|
|
831
|
+
// when the call is lazy and wrapped in try/catch — so every consumer without
|
|
832
|
+
// `expo-notifications` failed with TS2307 (plus TS7006 cascades) whether or not
|
|
833
|
+
// it had ever heard of push. Behind a subpath the module is only ever pulled in
|
|
834
|
+
// by an app that asked for it, which is what "optional peer" is supposed to
|
|
835
|
+
// mean.
|
|
836
|
+
//
|
|
837
|
+
// Do NOT re-add these exports here. `__tests__/notifications/barrelIsolation.test.ts`
|
|
838
|
+
// fails if you do.
|
|
870
839
|
|
|
871
840
|
// ---------------------------------------------------------------------------
|
|
872
841
|
// UI components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","_reactNative","_OxyProvider","_interopRequireDefault","_OxyContext","_useAuth","_identityBinding","_authStore","_accountStore","_assetStore","_useAssets","_useFileDownloadUrl","_useFollow","_useStorage","_useAccountQueries","_useServicesQueries","_useSecurityQueries","_useAuthMethods","_usePaymentQueries","_useAccountMutations","_useServicesMutations","_mutationFactory","_mutationKeys","_queryKeys","_userCache","_useMutationStatus","_useOnlineStatus","_useOxyEvent","_errorHandlers","_useFileFiltering","
|
|
1
|
+
{"version":3,"names":["_core","require","_reactNative","_OxyProvider","_interopRequireDefault","_OxyContext","_useAuth","_identityBinding","_authStore","_accountStore","_assetStore","_useAssets","_useFileDownloadUrl","_useFollow","_useStorage","_useAccountQueries","_useServicesQueries","_useSecurityQueries","_useAuthMethods","_usePaymentQueries","_useAccountMutations","_useServicesMutations","_mutationFactory","_mutationKeys","_queryKeys","_userCache","_useMutationStatus","_useOnlineStatus","_useOxyEvent","_errorHandlers","_useFileFiltering","_OxySignInButton","_oauthPopup","_OxyAuthPrompt","_OxyOAuthCallback","_OxyConsentScreen","_RequireOxyAuth","_FollowButton","_OxyPayButton","_LogoIcon","_LogoText","_ProfileButton","_OxyAuthChooser","_OxySignInRequestSurface","_useSwitchableAccounts","_ProfileScreen","_ManageAccountScreen","_NotificationsScreen","_PreferencesScreen","_ConnectedAppsScreen","_CreateAccountScreen","_AccountMembersScreen","_AccountSettingsScreen","_bottomSheetManager","_useSurfaceHeader","_SurfaceHeaderAction","_accountDialogManager","e","__esModule","default","setPlatformOS","Platform","OS"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAEA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,gBAAA,GAAAN,OAAA;AAKA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAgBA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,mBAAA,GAAAX,OAAA;AACA,IAAAY,UAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AAMA,IAAAc,kBAAA,GAAAd,OAAA;AAUA,IAAAe,mBAAA,GAAAf,OAAA;AAQA,IAAAgB,mBAAA,GAAAhB,OAAA;AAKA,IAAAiB,eAAA,GAAAjB,OAAA;AACA,IAAAkB,kBAAA,GAAAlB,OAAA;AAyBA,IAAAmB,oBAAA,GAAAnB,OAAA;AAUA,IAAAoB,qBAAA,GAAApB,OAAA;AAOA,IAAAqB,gBAAA,GAAArB,OAAA;AAUA,IAAAsB,aAAA,GAAAtB,OAAA;AAQA,IAAAuB,UAAA,GAAAvB,OAAA;AAmBA,IAAAwB,UAAA,GAAAxB,OAAA;AAIA,IAAAyB,kBAAA,GAAAzB,OAAA;AAEA,IAAA0B,gBAAA,GAAA1B,OAAA;AACA,IAAA2B,YAAA,GAAA3B,OAAA;AAKA,IAAA4B,cAAA,GAAA5B,OAAA;AAWA,IAAA6B,iBAAA,GAAA7B,OAAA;AA+BA,IAAA8B,gBAAA,GAAA3B,sBAAA,CAAAH,OAAA;AAOA,IAAA+B,WAAA,GAAA/B,OAAA;AAUA,IAAAgC,cAAA,GAAAhC,OAAA;AAEA,IAAAiC,iBAAA,GAAAjC,OAAA;AAEA,IAAAkC,iBAAA,GAAAlC,OAAA;AAYA,IAAAmC,eAAA,GAAAnC,OAAA;AAGA,IAAAoC,aAAA,GAAAjC,sBAAA,CAAAH,OAAA;AAEA,IAAAqC,aAAA,GAAAlC,sBAAA,CAAAH,OAAA;AACA,IAAAsC,SAAA,GAAAtC,OAAA;AACA,IAAAuC,SAAA,GAAAvC,OAAA;AAKA,IAAAwC,cAAA,GAAArC,sBAAA,CAAAH,OAAA;AASA,IAAAyC,eAAA,GAAAtC,sBAAA,CAAAH,OAAA;AAWA,IAAA0C,wBAAA,GAAA1C,OAAA;AAUA,IAAA2C,sBAAA,GAAA3C,OAAA;AAIA,IAAA4C,cAAA,GAAAzC,sBAAA,CAAAH,OAAA;AACA,IAAA6C,oBAAA,GAAA1C,sBAAA,CAAAH,OAAA;AACA,IAAA8C,oBAAA,GAAA3C,sBAAA,CAAAH,OAAA;AACA,IAAA+C,kBAAA,GAAA5C,sBAAA,CAAAH,OAAA;AACA,IAAAgD,oBAAA,GAAA7C,sBAAA,CAAAH,OAAA;AAGA,IAAAiD,oBAAA,GAAA9C,sBAAA,CAAAH,OAAA;AACA,IAAAkD,qBAAA,GAAA/C,sBAAA,CAAAH,OAAA;AACA,IAAAmD,sBAAA,GAAAhD,sBAAA,CAAAH,OAAA;AAKA,IAAAoD,mBAAA,GAAApD,OAAA;AAMA,IAAAqD,iBAAA,GAAArD,OAAA;AACA,IAAAsD,oBAAA,GAAAtD,OAAA;AAMA,IAAAuD,qBAAA,GAAAvD,OAAA;AAI8C,SAAAG,uBAAAqD,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AApV9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAIA,IAAAG,mBAAa,EAACC,qBAAQ,CAACC,EAAgB,CAAC;;AAExC;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;;AAgBA;AACA;AACA;;AAOA;AACA;AACA;;AAgCA;;AAeA;AACA;AACA;;AA2BA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;;AAIA;;AAMA;AACA;AACA;;AASA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAQA;AACA;AACA;AACA;;AAsBA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AAOA;;AAKA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;AACA","ignoreList":[]}
|