@onairos/react-native 3.7.1 â 3.7.3
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/lib/commonjs/api/index.js +219 -9
- package/lib/commonjs/assets/icons/spotify.png +0 -0
- package/lib/commonjs/assets/images/spotify.png +0 -0
- package/lib/commonjs/components/BodyText.js +27 -9
- package/lib/commonjs/components/BrandMark.js +111 -10
- package/lib/commonjs/components/CodeInput.js +116 -9
- package/lib/commonjs/components/EmailInput.js +30 -8
- package/lib/commonjs/components/GoogleButton.js +56 -9
- package/lib/commonjs/components/HeadingGroup.js +43 -9
- package/lib/commonjs/components/LLMDataInputModal.js +664 -14
- package/lib/commonjs/components/ModalHeader.js +99 -9
- package/lib/commonjs/components/ModalSheet.js +47 -9
- package/lib/commonjs/components/Onairos.js +380 -14
- package/lib/commonjs/components/OnairosButton.js +313 -13
- package/lib/commonjs/components/OnairosSignInButton.js +130 -12
- package/lib/commonjs/components/Overlay.js +465 -13
- package/lib/commonjs/components/PersonaImage.js +137 -10
- package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
- package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
- package/lib/commonjs/components/PinCreationScreen.js +403 -12
- package/lib/commonjs/components/PinInput.js +464 -9
- package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
- package/lib/commonjs/components/PlatformList.js +137 -10
- package/lib/commonjs/components/PlatformToggle.js +180 -9
- package/lib/commonjs/components/PrimaryButton.js +180 -10
- package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
- package/lib/commonjs/components/SignInStep.js +345 -12
- package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
- package/lib/commonjs/components/VerificationStep.js +176 -11
- package/lib/commonjs/components/WelcomeScreen.js +461 -22
- package/lib/commonjs/components/icons/Basicproficon.js +37 -8
- package/lib/commonjs/components/icons/Basicprofile.js +21 -8
- package/lib/commonjs/components/icons/Checkbox.js +21 -8
- package/lib/commonjs/components/icons/Checkmark.js +27 -8
- package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
- package/lib/commonjs/components/icons/Contenticon.js +39 -8
- package/lib/commonjs/components/icons/EnochE.js +41 -8
- package/lib/commonjs/components/icons/Personalityicon.js +30 -8
- package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
- package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
- package/lib/commonjs/components/icons/Userpreferences.js +21 -8
- package/lib/commonjs/components/icons/index.js +84 -17
- package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
- package/lib/commonjs/components/onboarding/PinInput.js +283 -10
- package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
- package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
- package/lib/commonjs/config/api.js +56 -7
- package/lib/commonjs/constants/index.js +120 -7
- package/lib/commonjs/context/AuthContext.js +345 -10
- package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
- package/lib/commonjs/hooks/useConnections.js +102 -8
- package/lib/commonjs/hooks/useCredentials.js +178 -10
- package/lib/commonjs/hooks/useUserConnections.js +148 -10
- package/lib/commonjs/index.js +439 -34
- package/lib/commonjs/services/apiClient.js +298 -8
- package/lib/commonjs/services/biometricPinService.js +180 -8
- package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
- package/lib/commonjs/services/chatGPTConversationService.js +275 -9
- package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
- package/lib/commonjs/services/claudeConversationService.js +158 -9
- package/lib/commonjs/services/connectedAccountsService.js +310 -10
- package/lib/commonjs/services/googleAuthService.js +252 -11
- package/lib/commonjs/services/hingeDataExtractor.js +105 -8
- package/lib/commonjs/services/hingeDataService.js +150 -9
- package/lib/commonjs/services/imageCompressionService.js +260 -7
- package/lib/commonjs/services/instagramDataExtractor.js +126 -8
- package/lib/commonjs/services/instagramDataService.js +163 -9
- package/lib/commonjs/services/jwtStorageService.js +276 -7
- package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
- package/lib/commonjs/services/linkedinProfileService.js +222 -9
- package/lib/commonjs/services/linkedinScrapingService.js +230 -8
- package/lib/commonjs/services/llmDataStorage.js +294 -8
- package/lib/commonjs/services/mobileTrainingService.js +186 -8
- package/lib/commonjs/services/netflixDataExtractor.js +120 -8
- package/lib/commonjs/services/netflixDataService.js +198 -9
- package/lib/commonjs/services/pinEncryptionService.js +84 -8
- package/lib/commonjs/services/pinStorageUtils.js +105 -7
- package/lib/commonjs/services/platformAuthService.js +1484 -12
- package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
- package/lib/commonjs/services/sephoraDataService.js +200 -9
- package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
- package/lib/commonjs/services/spotifyDataService.js +241 -9
- package/lib/commonjs/services/storageService.js +404 -8
- package/lib/commonjs/services/telegramDataExtractor.js +115 -8
- package/lib/commonjs/services/telegramDataService.js +499 -9
- package/lib/commonjs/services/trainingApiHelpers.js +73 -7
- package/lib/commonjs/services/userConnectionsService.js +340 -10
- package/lib/commonjs/services/youtubeMigrationService.js +416 -10
- package/lib/commonjs/theme/index.js +250 -7
- package/lib/commonjs/types/ambient.d.js +2 -1
- package/lib/commonjs/types/declarations.d.js +2 -1
- package/lib/commonjs/types/index.js +6 -1
- package/lib/commonjs/types/node-fix.d.js +2 -1
- package/lib/commonjs/types/node-override.d.js +2 -1
- package/lib/commonjs/types/opacity.d.js +2 -1
- package/lib/commonjs/types.js +14 -1
- package/lib/commonjs/utils/Portal.js +98 -8
- package/lib/commonjs/utils/api.js +130 -9
- package/lib/commonjs/utils/assetRegistry.js +210 -35
- package/lib/commonjs/utils/auth.js +112 -9
- package/lib/commonjs/utils/connectorTests.js +613 -29
- package/lib/commonjs/utils/crypto.js +62 -8
- package/lib/commonjs/utils/debugHelper.js +64 -1
- package/lib/commonjs/utils/encryption.js +76 -7
- package/lib/commonjs/utils/eventUtils.js +288 -1
- package/lib/commonjs/utils/haptics.js +66 -9
- package/lib/commonjs/utils/imagePreloader.js +6 -1
- package/lib/commonjs/utils/networkDiagnostics.js +226 -8
- package/lib/commonjs/utils/onairosApi.js +350 -9
- package/lib/commonjs/utils/programmaticFlow.js +117 -9
- package/lib/commonjs/utils/retryHelper.js +220 -1
- package/lib/commonjs/utils/secureStorage.js +349 -10
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
- package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
- package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
- package/lib/commonjs/utils/webviewScripts/index.js +698 -15
- package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
- package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
- package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
- package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
- package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
- package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
- package/lib/module/api/index.js +211 -1
- package/lib/module/assets/icons/spotify.png +0 -0
- package/lib/module/assets/images/spotify.png +0 -0
- package/lib/module/components/BodyText.js +20 -1
- package/lib/module/components/BrandMark.js +104 -1
- package/lib/module/components/CodeInput.js +109 -1
- package/lib/module/components/EmailInput.js +23 -1
- package/lib/module/components/GoogleButton.js +49 -1
- package/lib/module/components/HeadingGroup.js +36 -1
- package/lib/module/components/LLMDataInputModal.js +656 -7
- package/lib/module/components/ModalHeader.js +92 -1
- package/lib/module/components/ModalSheet.js +39 -1
- package/lib/module/components/Onairos.js +373 -1
- package/lib/module/components/OnairosButton.js +305 -1
- package/lib/module/components/OnairosSignInButton.js +121 -1
- package/lib/module/components/Overlay.js +456 -1
- package/lib/module/components/PersonaImage.js +129 -1
- package/lib/module/components/PersonaLoadingScreen.js +310 -1
- package/lib/module/components/PersonalizationConsentScreen.js +460 -1
- package/lib/module/components/PinCreationScreen.js +396 -1
- package/lib/module/components/PinInput.js +456 -1
- package/lib/module/components/PlatformConnectorsStep.js +1302 -6
- package/lib/module/components/PlatformList.js +129 -1
- package/lib/module/components/PlatformToggle.js +173 -1
- package/lib/module/components/PrimaryButton.js +172 -1
- package/lib/module/components/SignInMatchAnimation.js +189 -1
- package/lib/module/components/SignInStep.js +338 -1
- package/lib/module/components/UniversalOnboarding.js +2770 -1
- package/lib/module/components/VerificationStep.js +168 -1
- package/lib/module/components/WelcomeScreen.js +453 -1
- package/lib/module/components/icons/Basicproficon.js +30 -1
- package/lib/module/components/icons/Basicprofile.js +14 -1
- package/lib/module/components/icons/Checkbox.js +14 -1
- package/lib/module/components/icons/Checkmark.js +20 -1
- package/lib/module/components/icons/Contentanalysis.js +14 -1
- package/lib/module/components/icons/Contenticon.js +32 -1
- package/lib/module/components/icons/EnochE.js +34 -1
- package/lib/module/components/icons/Personalityicon.js +23 -1
- package/lib/module/components/icons/Personalityprofile.js +14 -1
- package/lib/module/components/icons/Personalitytraits.js +14 -1
- package/lib/module/components/icons/Userpreferences.js +14 -1
- package/lib/module/components/icons/index.js +13 -1
- package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
- package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
- package/lib/module/components/onboarding/PinInput.js +274 -1
- package/lib/module/components/onboarding/PlatformConnector.js +240 -1
- package/lib/module/config/PLATFORM_APIS.md +849 -0
- package/lib/module/config/api.js +47 -1
- package/lib/module/constants/index.js +114 -1
- package/lib/module/context/AuthContext.js +335 -1
- package/lib/module/hooks/useConnectedAccounts.js +106 -1
- package/lib/module/hooks/useConnections.js +95 -1
- package/lib/module/hooks/useCredentials.js +171 -6
- package/lib/module/hooks/useUserConnections.js +140 -1
- package/lib/module/index.js +172 -1
- package/lib/module/services/apiClient.js +295 -1
- package/lib/module/services/biometricPinService.js +169 -1
- package/lib/module/services/chatGPTConversationExtractor.js +149 -1
- package/lib/module/services/chatGPTConversationService.js +268 -1
- package/lib/module/services/claudeConversationExtractor.js +97 -1
- package/lib/module/services/claudeConversationService.js +151 -1
- package/lib/module/services/connectedAccountsService.js +293 -1
- package/lib/module/services/googleAuthService.js +241 -1
- package/lib/module/services/hingeDataExtractor.js +99 -1
- package/lib/module/services/hingeDataService.js +143 -1
- package/lib/module/services/imageCompressionService.js +250 -1
- package/lib/module/services/instagramDataExtractor.js +120 -1
- package/lib/module/services/instagramDataService.js +156 -1
- package/lib/module/services/jwtStorageService.js +257 -1
- package/lib/module/services/linkedinDOMExtractor.js +234 -1
- package/lib/module/services/linkedinProfileService.js +210 -1
- package/lib/module/services/linkedinScrapingService.js +219 -1
- package/lib/module/services/llmDataStorage.js +277 -1
- package/lib/module/services/mobileTrainingService.js +173 -1
- package/lib/module/services/netflixDataExtractor.js +114 -1
- package/lib/module/services/netflixDataService.js +191 -1
- package/lib/module/services/pinEncryptionService.js +74 -6
- package/lib/module/services/pinStorageUtils.js +93 -1
- package/lib/module/services/platformAuthService.js +1461 -1
- package/lib/module/services/sephoraDataExtractor.js +134 -1
- package/lib/module/services/sephoraDataService.js +193 -1
- package/lib/module/services/spotifyDataExtractor.js +142 -1
- package/lib/module/services/spotifyDataService.js +234 -1
- package/lib/module/services/storageService.js +383 -1
- package/lib/module/services/telegramDataExtractor.js +109 -1
- package/lib/module/services/telegramDataService.js +493 -1
- package/lib/module/services/trainingApiHelpers.js +67 -1
- package/lib/module/services/userConnectionsService.js +329 -1
- package/lib/module/services/youtubeMigrationService.js +405 -1
- package/lib/module/theme/index.js +245 -1
- package/lib/module/types.js +10 -1
- package/lib/module/utils/Portal.js +90 -1
- package/lib/module/utils/api.js +118 -1
- package/lib/module/utils/assetRegistry.js +200 -34
- package/lib/module/utils/auth.js +100 -1
- package/lib/module/utils/connectorTests.js +600 -27
- package/lib/module/utils/crypto.js +54 -1
- package/lib/module/utils/debugHelper.js +54 -1
- package/lib/module/utils/encryption.js +67 -1
- package/lib/module/utils/eventUtils.js +270 -1
- package/lib/module/utils/haptics.js +59 -8
- package/lib/module/utils/imagePreloader.js +3 -1
- package/lib/module/utils/networkDiagnostics.js +217 -1
- package/lib/module/utils/onairosApi.js +333 -1
- package/lib/module/utils/programmaticFlow.js +111 -1
- package/lib/module/utils/retryHelper.js +211 -1
- package/lib/module/utils/secureStorage.js +330 -6
- package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
- package/lib/module/utils/webviewScripts/claude.js +370 -1
- package/lib/module/utils/webviewScripts/hinge.js +405 -1
- package/lib/module/utils/webviewScripts/index.js +434 -1
- package/lib/module/utils/webviewScripts/instagram.js +448 -1
- package/lib/module/utils/webviewScripts/linkedin.js +874 -1
- package/lib/module/utils/webviewScripts/netflix.js +376 -1
- package/lib/module/utils/webviewScripts/sephora.js +510 -1
- package/lib/module/utils/webviewScripts/spotify.js +413 -1
- package/lib/module/utils/webviewScripts/telegram.js +672 -1
- package/package.json +2 -2
|
@@ -1 +1,169 @@
|
|
|
1
|
-
import*as Keychain from'react-native-keychain';import{Platform}from'react-native';function _0x5e67(){const _0x454859=['OnairosEventsPIN','user_pin','đą\x20Biometric\x20not\x20available','đĢ\x20Face\x20ID\x20authentication\x20failed','suvay','aMJYd','Ufndl','ZINDV','xIavN','getSupportedBiometryType','uABuf','vuKwC','BIOMETRY_TYPE','TOUCH_ID','mxUjw','FINGERPRINT','FACE','tSvfC','log','etbpy','â\x20Error\x20checking\x20PIN\x20storage:','đą\x20Face\x20ID/Touch\x20ID\x20not\x20available','â\x20Error\x20removing\x20PIN\x20from\x20storage:','sTVqq','ENSNK','â\x20Face\x20ID/Touch\x20ID\x20not\x20available\x20on\x20this\x20device','đą\x20Face\x20ID\x20available,\x20showing\x20authentication\x20prompt...','ios','Cancel','Authenticate\x20with\x20biometric\x20to\x20secure\x20your\x20PIN','đ\x20Keychain\x20storage\x20result:','SqKMv','nXjqb','đ¤\x20User\x20cancelled\x20Face\x20ID\x20authentication','pIDZW','BiometryLockout','â\x20Unknown\x20Face\x20ID\x20error:','xgYwA','error','xeoMr','đ\x20Starting\x20Face\x20ID\x20authentication\x20for\x20PIN\x20storage...','kzldY','HJztg','ACCESS_CONTROL','BIOMETRY_CURRENT_SET','AUTHENTICATION_TYPE','BIOMETRICS','CRaPF','idfKC','Authenticate\x20with\x20Face\x20ID\x20to\x20secure\x20your\x20PIN','PfifR','lUzEF','đ¤\x20Requesting\x20Face\x20ID\x20authentication...','setGenericPassword','XOrqM','KEyrD','StcgT','hzUUw','ClGus','â\x20Face\x20ID\x20authentication\x20failed:','â\x20Error\x20details:','message','code','domain','userInfo','tyNnM','OKurK','kcPHW','includes','MjYQW','cjkMg','JvSHU','mqfzs','BiometryNotAvailable','ZBYhO','xzsaf','QTnsc','rfBfU','oSWYp','nMmbd','tkqvD','kvtTf','đ\x20Face\x20ID\x20locked\x20out\x20-\x20too\x20many\x20failed\x20attempts','â ī¸\x20No\x20PIN\x20found\x20in\x20secure\x20storage','yRZiD','đ\x20Retrieving\x20PIN\x20with\x20biometric\x20authentication...','xaqpj','ktEzA','â
\x20PIN\x20retrieved\x20successfully','ntYNu','rpECu','UserCancel','đ¤\x20User\x20cancelled\x20biometric\x20authentication','dvyvg','dzVCX','kDWXg','getGenericPassword','password','svTSE','XJSmG','TsLpj','aonRB','Jkiih','fOsFR','AuIvW','xJhcX','RCouR','UyWAo','jvcOb','ZjOBX','kPQdx','eRbuT','đī¸\x20Removing\x20PIN\x20from\x20secure\x20storage...','ZXKSC','resetGenericPassword','â
\x20PIN\x20removed\x20successfully','VOhAs','HDioI'];_0x5e67=function(){return _0x454859;};return _0x5e67();}function _0x31e0(_0x5e6767,_0x31e0e8){_0x5e6767=_0x5e6767-0x0;const _0x335064=_0x5e67();let _0x5101a2=_0x335064[_0x5e6767];return _0x5101a2;}const PIN_SERVICE_KEY=_0x31e0(0x0),PIN_USERNAME=_0x31e0(0x1);export const isBiometricAvailable=async()=>{const _0x27c43a={'HXYKQ':_0x31e0(0x2),'etbpy':_0x31e0(0x3),'Ufndl':function(_0x243514,_0x206216){return _0x243514!==_0x206216;},'xIavN':_0x31e0(0x4),'uABuf':'đą\x20Biometric\x20support:','vuKwC':function(_0x5124f4,_0xcfcfe3){return _0x5124f4===_0xcfcfe3;},'mxUjw':function(_0x34d6cf,_0x2b4b00){return _0x34d6cf===_0x2b4b00;},'pKriX':function(_0x4c1891,_0x49775a){return _0x4c1891===_0x49775a;},'tSvfC':_0x31e0(0x5),'MWPuW':'â\x20Error\x20checking\x20biometric\x20availability:'};try{if(_0x27c43a[_0x31e0(0x6)](_0x31e0(0x7),_0x27c43a[_0x31e0(0x8)])){const _0x5cedab=await Keychain[_0x31e0(0x9)]();return console['log'](_0x27c43a[_0x31e0(0xa)],_0x5cedab),_0x27c43a[_0x31e0(0xb)](_0x5cedab,Keychain[_0x31e0(0xc)]['FACE_ID'])||_0x5cedab===Keychain[_0x31e0(0xc)][_0x31e0(0xd)]||_0x27c43a[_0x31e0(0xe)](_0x5cedab,Keychain[_0x31e0(0xc)][_0x31e0(0xf)])||_0x27c43a['pKriX'](_0x5cedab,Keychain['BIOMETRY_TYPE'][_0x31e0(0x10)])||_0x27c43a['vuKwC'](_0x5cedab,Keychain['BIOMETRY_TYPE']['IRIS']);}else return _0x326323['log'](_0x27c43a['HXYKQ']),null;}catch(_0x4aecc3){return _0x27c43a[_0x31e0(0x6)](_0x27c43a[_0x31e0(0x11)],_0x27c43a[_0x31e0(0x11)])?(_0xb1c19d[_0x31e0(0x12)](_0x27c43a[_0x31e0(0x13)]),![]):(console['error'](_0x27c43a['MWPuW'],_0x4aecc3),![]);}};export const storePinWithBiometric=async _0x234a58=>{const _0x34ef29={'xeoMr':_0x31e0(0x14),'ClGus':_0x31e0(0x15),'QTnsc':_0x31e0(0x16),'ROJew':'â
\x20PIN\x20retrieved\x20successfully','DzuMz':_0x31e0(0x17),'xgYwA':_0x31e0(0x18),'kzldY':function(_0xd0a3b8){return _0xd0a3b8();},'HJztg':_0x31e0(0x19),'VOYJa':_0x31e0(0x1a),'CRaPF':function(_0x3c6c6d,_0x156128){return _0x3c6c6d===_0x156128;},'idfKC':_0x31e0(0x1b),'lUzEF':_0x31e0(0x1c),'PfifR':'android','TrRVD':_0x31e0(0x1d),'XOrqM':'â
\x20Face\x20ID\x20authentication\x20successful\x20-\x20PIN\x20stored\x20securely','KEyrD':_0x31e0(0x1e),'StcgT':_0x31e0(0x1f),'hzUUw':_0x31e0(0x20),'tyNnM':function(_0x5dc65e,_0xbd9578){return _0x5dc65e!==_0xbd9578;},'OKurK':function(_0x3a24ff,_0x37b394){return _0x3a24ff!==_0x37b394;},'kcPHW':function(_0x3aad32,_0xd3dbc6){return _0x3aad32!==_0xd3dbc6;},'IXzvu':'UserCancel','MjYQW':function(_0x2c63b5,_0x22d892){return _0x2c63b5===_0x22d892;},'cjkMg':_0x31e0(0x21),'JvSHU':function(_0x8d28ce,_0x38b3ca){return _0x8d28ce!==_0x38b3ca;},'mqfzs':function(_0x28944e,_0x514c5b){return _0x28944e!==_0x514c5b;},'ZBYhO':function(_0x305365,_0x5250b2){return _0x305365===_0x5250b2;},'xzsaf':'KZkxV','rfBfU':function(_0x415e92,_0x412d24){return _0x415e92!==_0x412d24;},'BYArt':'AuthenticationFailed','FZUZg':function(_0x53bd57,_0x4ea8a7){return _0x53bd57===_0x4ea8a7;},'sozXv':_0x31e0(0x22),'oSWYp':'mEsIC','rFVfp':_0x31e0(0x3),'nMmbd':function(_0x56e214,_0x35b954){return _0x56e214!==_0x35b954;},'tkqvD':_0x31e0(0x23),'kvtTf':function(_0x49f2d8,_0x387feb){return _0x49f2d8===_0x387feb;},'HCnRx':function(_0x39b4ad,_0x3e42f7){return _0x39b4ad===_0x3e42f7;},'JPDEV':_0x31e0(0x24)};try{if(_0x34ef29['DzuMz']===_0x34ef29[_0x31e0(0x25)])return _0x405510[_0x31e0(0x26)](_0x34ef29[_0x31e0(0x27)],_0x14ebcd),![];else{console[_0x31e0(0x12)](_0x31e0(0x28));const _0x24d336=await _0x34ef29[_0x31e0(0x29)](isBiometricAvailable);if(!_0x24d336)return console['error'](_0x34ef29[_0x31e0(0x2a)]),![];console[_0x31e0(0x12)](_0x34ef29['VOYJa']);const _0x275ef7={'accessControl':Keychain[_0x31e0(0x2b)][_0x31e0(0x2c)],'authenticationType':Keychain[_0x31e0(0x2d)][_0x31e0(0x2e)],'touchID':!![],'showModal':!![],'kLocalizedFallbackTitle':'',..._0x34ef29[_0x31e0(0x2f)](Platform['OS'],_0x34ef29[_0x31e0(0x30)])&&{'localizedPrompt':_0x31e0(0x31),'localizedCancel':_0x34ef29['lUzEF']},..._0x34ef29[_0x31e0(0x2f)](Platform['OS'],_0x34ef29[_0x31e0(0x32)])&&{'promptMessage':_0x34ef29['TrRVD'],'cancelButtonText':_0x34ef29[_0x31e0(0x33)]}};console[_0x31e0(0x12)](_0x31e0(0x34));const _0x280b72=await Keychain[_0x31e0(0x35)](PIN_USERNAME,_0x234a58,{'service':PIN_SERVICE_KEY,..._0x275ef7});return console[_0x31e0(0x12)](_0x34ef29[_0x31e0(0x36)]),console[_0x31e0(0x12)](_0x34ef29[_0x31e0(0x37)],_0x280b72),!![];}}catch(_0x56a8d8){if(_0x34ef29['CRaPF'](_0x34ef29[_0x31e0(0x38)],_0x34ef29[_0x31e0(0x39)]))return _0x8b6d7a[_0x31e0(0x12)](_0x34ef29[_0x31e0(0x3a)]),![];else{var _0x74ce89,_0xd90495,_0x5a5caf,_0x48319d;console[_0x31e0(0x26)](_0x31e0(0x3b),_0x56a8d8),console[_0x31e0(0x26)](_0x31e0(0x3c),{'message':_0x56a8d8[_0x31e0(0x3d)],'code':_0x56a8d8[_0x31e0(0x3e)],'domain':_0x56a8d8[_0x31e0(0x3f)],'userInfo':_0x56a8d8[_0x31e0(0x40)]});if(_0x56a8d8!==null&&_0x34ef29[_0x31e0(0x41)](_0x56a8d8,void 0x0)&&_0x34ef29[_0x31e0(0x42)](_0x74ce89=_0x56a8d8['message'],null)&&_0x34ef29[_0x31e0(0x43)](_0x74ce89,void 0x0)&&_0x74ce89[_0x31e0(0x44)](_0x34ef29['IXzvu'])||_0x34ef29[_0x31e0(0x45)](_0x34ef29[_0x31e0(0x45)](_0x56a8d8,null)||_0x34ef29['MjYQW'](_0x56a8d8,void 0x0)?void 0x0:_0x56a8d8[_0x31e0(0x3e)],-0x80))return console[_0x31e0(0x12)](_0x34ef29[_0x31e0(0x46)]),![];else{if(_0x34ef29[_0x31e0(0x47)](_0x56a8d8,null)&&_0x34ef29[_0x31e0(0x41)](_0x56a8d8,void 0x0)&&_0x34ef29[_0x31e0(0x48)](_0xd90495=_0x56a8d8['message'],null)&&_0x34ef29[_0x31e0(0x47)](_0xd90495,void 0x0)&&_0xd90495[_0x31e0(0x44)](_0x31e0(0x49))||_0x34ef29['CRaPF'](_0x34ef29[_0x31e0(0x2f)](_0x56a8d8,null)||_0x34ef29[_0x31e0(0x4a)](_0x56a8d8,void 0x0)?void 0x0:_0x56a8d8[_0x31e0(0x3e)],-0x6))return _0x34ef29[_0x31e0(0x47)](_0x34ef29[_0x31e0(0x4b)],'KZkxV')?(_0x1526b0['error'](_0x34ef29[_0x31e0(0x4c)],_0x546d8f),![]):(console['log'](_0x34ef29[_0x31e0(0x3a)]),![]);else{if(_0x56a8d8!==null&&_0x56a8d8!==void 0x0&&_0x34ef29[_0x31e0(0x4d)](_0x5a5caf=_0x56a8d8[_0x31e0(0x3d)],null)&&_0x34ef29[_0x31e0(0x4d)](_0x5a5caf,void 0x0)&&_0x5a5caf[_0x31e0(0x44)](_0x34ef29['BYArt'])||_0x34ef29['FZUZg'](_0x56a8d8===null||_0x34ef29[_0x31e0(0x45)](_0x56a8d8,void 0x0)?void 0x0:_0x56a8d8[_0x31e0(0x3e)],-0x1))return _0x34ef29[_0x31e0(0x43)](_0x34ef29['sozXv'],_0x34ef29[_0x31e0(0x4e)])?(console[_0x31e0(0x12)](_0x34ef29['rFVfp']),![]):(_0x3f34ab[_0x31e0(0x12)](_0x34ef29['ROJew']),_0x4f5bdd['password']);else{if(_0x34ef29[_0x31e0(0x4f)](_0x56a8d8,null)&&_0x34ef29['tyNnM'](_0x56a8d8,void 0x0)&&_0x34ef29[_0x31e0(0x42)](_0x48319d=_0x56a8d8[_0x31e0(0x3d)],null)&&_0x48319d!==void 0x0&&_0x48319d[_0x31e0(0x44)](_0x34ef29[_0x31e0(0x50)])||_0x34ef29[_0x31e0(0x51)](_0x34ef29['HCnRx'](_0x56a8d8,null)||_0x56a8d8===void 0x0?void 0x0:_0x56a8d8[_0x31e0(0x3e)],-0x8))return console[_0x31e0(0x12)](_0x31e0(0x52)),![];}}}return console[_0x31e0(0x26)](_0x34ef29['JPDEV'],_0x56a8d8[_0x31e0(0x3d)]),![];}}};export const retrievePinWithBiometric=async()=>{const _0x23d1b1={'aonRB':_0x31e0(0x52),'AuIvW':_0x31e0(0x21),'fOsFR':_0x31e0(0x53),'eRbuT':'â\x20Error\x20checking\x20biometric\x20availability:','dzVCX':function(_0x5135f1,_0x1fefa1){return _0x5135f1===_0x1fefa1;},'YkPlB':_0x31e0(0x54),'kDWXg':_0x31e0(0x55),'svTSE':function(_0x4b78a6,_0x38d966){return _0x4b78a6===_0x38d966;},'XJSmG':_0x31e0(0x56),'TsLpj':_0x31e0(0x57),'Jkiih':_0x31e0(0x58),'xJhcX':_0x31e0(0x59),'RCouR':_0x31e0(0x5a),'UyWAo':'â\x20Error\x20retrieving\x20PIN\x20with\x20biometric:','jvcOb':function(_0x336f50,_0x6cb586){return _0x336f50!==_0x6cb586;},'wWTmq':function(_0x4294d6,_0xbc2f69){return _0x4294d6!==_0xbc2f69;},'ZjOBX':_0x31e0(0x5b),'Evhxy':_0x31e0(0x5c),'UwOxd':function(_0x5c371c,_0x4384a1){return _0x5c371c!==_0x4384a1;},'kLNWO':_0x31e0(0x49),'kPQdx':_0x31e0(0x5d)};try{if(_0x23d1b1[_0x31e0(0x5e)](_0x31e0(0x54),_0x23d1b1['YkPlB'])){console[_0x31e0(0x12)](_0x23d1b1[_0x31e0(0x5f)]);const _0x1dfece=await Keychain[_0x31e0(0x60)]({'service':PIN_SERVICE_KEY});return _0x1dfece&&_0x1dfece[_0x31e0(0x61)]?_0x23d1b1[_0x31e0(0x62)](_0x23d1b1[_0x31e0(0x63)],_0x23d1b1[_0x31e0(0x64)])?(_0x4d4cb2['log'](_0x23d1b1[_0x31e0(0x65)]),![]):(console['log'](_0x23d1b1[_0x31e0(0x66)]),_0x1dfece['password']):(console['log'](_0x23d1b1[_0x31e0(0x67)]),null);}else return _0x51ee8a['log'](_0x23d1b1[_0x31e0(0x68)]),![];}catch(_0x285bd1){if(_0x23d1b1[_0x31e0(0x62)](_0x23d1b1[_0x31e0(0x69)],_0x23d1b1[_0x31e0(0x6a)]))return _0x24bcf2['log'](_0x23d1b1['fOsFR']),null;else{var _0x323472,_0x592cf6;console[_0x31e0(0x26)](_0x23d1b1[_0x31e0(0x6b)],_0x285bd1);if(_0x23d1b1[_0x31e0(0x6c)](_0x285bd1,null)&&_0x23d1b1['jvcOb'](_0x285bd1,void 0x0)&&_0x23d1b1['wWTmq'](_0x323472=_0x285bd1[_0x31e0(0x3d)],null)&&_0x23d1b1[_0x31e0(0x6c)](_0x323472,void 0x0)&&_0x323472[_0x31e0(0x44)](_0x23d1b1[_0x31e0(0x6d)]))return console[_0x31e0(0x12)](_0x23d1b1['Evhxy']),null;else{if(_0x23d1b1['UwOxd'](_0x285bd1,null)&&_0x23d1b1['jvcOb'](_0x285bd1,void 0x0)&&(_0x592cf6=_0x285bd1[_0x31e0(0x3d)])!==null&&_0x592cf6!==void 0x0&&_0x592cf6[_0x31e0(0x44)](_0x23d1b1['kLNWO']))return _0x23d1b1['jvcOb'](_0x23d1b1[_0x31e0(0x6e)],_0x31e0(0x5d))?(_0x18e310[_0x31e0(0x26)](_0x23d1b1[_0x31e0(0x6f)],_0x162a12),![]):(console[_0x31e0(0x12)]('đą\x20Biometric\x20not\x20available'),null);}return null;}}};export const isPinStored=async()=>{try{const _0x1ec558=await Keychain[_0x31e0(0x60)]({'service':PIN_SERVICE_KEY});return!!(_0x1ec558&&_0x1ec558['password']);}catch(_0x316113){return console[_0x31e0(0x26)](_0x31e0(0x14),_0x316113),![];}};export const removePinFromStorage=async()=>{const _0x3367e1={'jscQh':'â\x20Face\x20ID/Touch\x20ID\x20not\x20available\x20on\x20this\x20device','ZXKSC':_0x31e0(0x70),'HDioI':'CeCYA'};try{return console[_0x31e0(0x12)](_0x3367e1[_0x31e0(0x71)]),await Keychain[_0x31e0(0x72)]({'service':PIN_SERVICE_KEY}),console[_0x31e0(0x12)](_0x31e0(0x73)),!![];}catch(_0x5c429f){return _0x31e0(0x74)===_0x3367e1[_0x31e0(0x75)]?(_0x395f92[_0x31e0(0x26)](_0x3367e1['jscQh']),![]):(console[_0x31e0(0x26)](_0x31e0(0x16),_0x5c429f),![]);}};export const biometricPinService={'storePinWithBiometric':storePinWithBiometric,'retrievePinWithBiometric':retrievePinWithBiometric,'isPinStored':isPinStored,'removePinFromStorage':removePinFromStorage,'isBiometricAvailable':isBiometricAvailable};
|
|
1
|
+
import * as Keychain from 'react-native-keychain';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
|
|
4
|
+
// Service key for PIN storage
|
|
5
|
+
const PIN_SERVICE_KEY = 'OnairosEventsPIN';
|
|
6
|
+
const PIN_USERNAME = 'user_pin';
|
|
7
|
+
/**
|
|
8
|
+
* Check if biometric authentication is available on the device
|
|
9
|
+
*/
|
|
10
|
+
export const isBiometricAvailable = async () => {
|
|
11
|
+
try {
|
|
12
|
+
const biometryType = await Keychain.getSupportedBiometryType();
|
|
13
|
+
console.log('đą Biometric support:', biometryType);
|
|
14
|
+
|
|
15
|
+
// Check for Face ID on iOS or any biometric on Android
|
|
16
|
+
return biometryType === Keychain.BIOMETRY_TYPE.FACE_ID || biometryType === Keychain.BIOMETRY_TYPE.TOUCH_ID || biometryType === Keychain.BIOMETRY_TYPE.FINGERPRINT || biometryType === Keychain.BIOMETRY_TYPE.FACE || biometryType === Keychain.BIOMETRY_TYPE.IRIS;
|
|
17
|
+
} catch (error) {
|
|
18
|
+
console.error('â Error checking biometric availability:', error);
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Store PIN with biometric authentication
|
|
25
|
+
*/
|
|
26
|
+
export const storePinWithBiometric = async pin => {
|
|
27
|
+
try {
|
|
28
|
+
console.log('đ Starting Face ID authentication for PIN storage...');
|
|
29
|
+
|
|
30
|
+
// Check if biometric is available - REQUIRED for this implementation
|
|
31
|
+
const biometricAvailable = await isBiometricAvailable();
|
|
32
|
+
if (!biometricAvailable) {
|
|
33
|
+
console.error('â Face ID/Touch ID not available on this device');
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
console.log('đą Face ID available, showing authentication prompt...');
|
|
37
|
+
|
|
38
|
+
// Configure keychain options for MANDATORY biometric authentication
|
|
39
|
+
const keychainOptions = {
|
|
40
|
+
accessControl: Keychain.ACCESS_CONTROL.BIOMETRY_CURRENT_SET,
|
|
41
|
+
authenticationType: Keychain.AUTHENTICATION_TYPE.BIOMETRICS,
|
|
42
|
+
touchID: true,
|
|
43
|
+
showModal: true,
|
|
44
|
+
kLocalizedFallbackTitle: '',
|
|
45
|
+
// Disable fallback to prevent passcode option
|
|
46
|
+
// Add explicit prompts for better UX
|
|
47
|
+
...(Platform.OS === 'ios' && {
|
|
48
|
+
localizedPrompt: 'Authenticate with Face ID to secure your PIN',
|
|
49
|
+
localizedCancel: 'Cancel'
|
|
50
|
+
}),
|
|
51
|
+
...(Platform.OS === 'android' && {
|
|
52
|
+
promptMessage: 'Authenticate with biometric to secure your PIN',
|
|
53
|
+
cancelButtonText: 'Cancel'
|
|
54
|
+
})
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// Store the PIN - this will trigger the Face ID prompt
|
|
58
|
+
console.log('đ¤ Requesting Face ID authentication...');
|
|
59
|
+
const result = await Keychain.setGenericPassword(PIN_USERNAME, pin, {
|
|
60
|
+
service: PIN_SERVICE_KEY,
|
|
61
|
+
...keychainOptions
|
|
62
|
+
});
|
|
63
|
+
console.log('â
Face ID authentication successful - PIN stored securely');
|
|
64
|
+
console.log('đ Keychain storage result:', result);
|
|
65
|
+
return true;
|
|
66
|
+
} catch (error) {
|
|
67
|
+
var _error$message, _error$message2, _error$message3, _error$message4;
|
|
68
|
+
console.error('â Face ID authentication failed:', error);
|
|
69
|
+
console.error('â Error details:', {
|
|
70
|
+
message: error.message,
|
|
71
|
+
code: error.code,
|
|
72
|
+
domain: error.domain,
|
|
73
|
+
userInfo: error.userInfo
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Handle specific error cases
|
|
77
|
+
if (error !== null && error !== void 0 && (_error$message = error.message) !== null && _error$message !== void 0 && _error$message.includes('UserCancel') || (error === null || error === void 0 ? void 0 : error.code) === -128) {
|
|
78
|
+
console.log('đ¤ User cancelled Face ID authentication');
|
|
79
|
+
return false;
|
|
80
|
+
} else if (error !== null && error !== void 0 && (_error$message2 = error.message) !== null && _error$message2 !== void 0 && _error$message2.includes('BiometryNotAvailable') || (error === null || error === void 0 ? void 0 : error.code) === -6) {
|
|
81
|
+
console.log('đą Face ID/Touch ID not available');
|
|
82
|
+
return false;
|
|
83
|
+
} else if (error !== null && error !== void 0 && (_error$message3 = error.message) !== null && _error$message3 !== void 0 && _error$message3.includes('AuthenticationFailed') || (error === null || error === void 0 ? void 0 : error.code) === -1) {
|
|
84
|
+
console.log('đĢ Face ID authentication failed');
|
|
85
|
+
return false;
|
|
86
|
+
} else if (error !== null && error !== void 0 && (_error$message4 = error.message) !== null && _error$message4 !== void 0 && _error$message4.includes('BiometryLockout') || (error === null || error === void 0 ? void 0 : error.code) === -8) {
|
|
87
|
+
console.log('đ Face ID locked out - too many failed attempts');
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
console.error('â Unknown Face ID error:', error.message);
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Retrieve PIN with biometric authentication
|
|
97
|
+
*/
|
|
98
|
+
export const retrievePinWithBiometric = async () => {
|
|
99
|
+
try {
|
|
100
|
+
console.log('đ Retrieving PIN with biometric authentication...');
|
|
101
|
+
|
|
102
|
+
// Retrieve the PIN (will prompt for biometric if configured)
|
|
103
|
+
const credentials = await Keychain.getGenericPassword({
|
|
104
|
+
service: PIN_SERVICE_KEY
|
|
105
|
+
});
|
|
106
|
+
if (credentials && credentials.password) {
|
|
107
|
+
console.log('â
PIN retrieved successfully');
|
|
108
|
+
return credentials.password;
|
|
109
|
+
} else {
|
|
110
|
+
console.log('â ī¸ No PIN found in secure storage');
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
} catch (error) {
|
|
114
|
+
var _error$message5, _error$message6;
|
|
115
|
+
console.error('â Error retrieving PIN with biometric:', error);
|
|
116
|
+
|
|
117
|
+
// Handle specific error cases
|
|
118
|
+
if (error !== null && error !== void 0 && (_error$message5 = error.message) !== null && _error$message5 !== void 0 && _error$message5.includes('UserCancel')) {
|
|
119
|
+
console.log('đ¤ User cancelled biometric authentication');
|
|
120
|
+
return null;
|
|
121
|
+
} else if (error !== null && error !== void 0 && (_error$message6 = error.message) !== null && _error$message6 !== void 0 && _error$message6.includes('BiometryNotAvailable')) {
|
|
122
|
+
console.log('đą Biometric not available');
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Check if PIN is stored in secure storage
|
|
131
|
+
*/
|
|
132
|
+
export const isPinStored = async () => {
|
|
133
|
+
try {
|
|
134
|
+
const credentials = await Keychain.getGenericPassword({
|
|
135
|
+
service: PIN_SERVICE_KEY
|
|
136
|
+
});
|
|
137
|
+
return !!(credentials && credentials.password);
|
|
138
|
+
} catch (error) {
|
|
139
|
+
console.error('â Error checking PIN storage:', error);
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Remove PIN from secure storage
|
|
146
|
+
*/
|
|
147
|
+
export const removePinFromStorage = async () => {
|
|
148
|
+
try {
|
|
149
|
+
console.log('đī¸ Removing PIN from secure storage...');
|
|
150
|
+
await Keychain.resetGenericPassword({
|
|
151
|
+
service: PIN_SERVICE_KEY
|
|
152
|
+
});
|
|
153
|
+
console.log('â
PIN removed successfully');
|
|
154
|
+
return true;
|
|
155
|
+
} catch (error) {
|
|
156
|
+
console.error('â Error removing PIN from storage:', error);
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
// Export the service object
|
|
162
|
+
export const biometricPinService = {
|
|
163
|
+
storePinWithBiometric,
|
|
164
|
+
retrievePinWithBiometric,
|
|
165
|
+
isPinStored,
|
|
166
|
+
removePinFromStorage,
|
|
167
|
+
isBiometricAvailable
|
|
168
|
+
};
|
|
169
|
+
//# sourceMappingURL=biometricPinService.js.map
|
|
@@ -1 +1,149 @@
|
|
|
1
|
-
import{storeChatGPTConversations,storeChatGPTMemories}from'./chatGPTConversationService';import{Alert}from'react-native';function _0x43fe(){const _0x54dd14=['Data\x20Error','No\x20valid\x20conversations\x20found\x20to\x20export.','â ī¸\x20[CHATGPT_EXTRACTOR]\x20Invalid\x20conversation:','đ\x20[CHATGPT_EXTRACTOR]\x20Initiating\x20conversation\x20export','đ¤\x20[CHATGPT_EXTRACTOR]\x20Username:','đ\x20[CHATGPT_EXTRACTOR]\x20Conversations\x20to\x20send:','grjWQ','UOQnZ','â\x20[CHATGPT_EXTRACTOR]\x20Username\x20is\x20required','Error','default','âšī¸\x20[CHATGPT_EXTRACTOR]\x20No\x20conversations\x20to\x20export\x20-\x20treating\x20as\x20success\x20(connected)','â\x20[CHATGPT_EXTRACTOR]\x20No\x20valid\x20conversations\x20after\x20filtering','Export\x20Failed','â\x20[CHATGPT_EXTRACTOR]\x20Unexpected\x20error\x20storing\x20memories:','âšī¸\x20[CHATGPT_EXTRACTOR]\x20No\x20memories\x20to\x20store\x20-\x20treating\x20as\x20success','â
\x20[CHATGPT_EXTRACTOR]\x20Memories\x20stored\x20successfully','â ī¸\x20[CHATGPT_EXTRACTOR]\x20No\x20memories\x20data\x20provided','lRUhH','đ§ \x20[CHATGPT_EXTRACTOR]\x20Storing\x20ChatGPT\x20memories...','HTwAB','oMpKq','đĄ\x20[CHATGPT_EXTRACTOR]\x20Sending\x20memories\x20to\x20backend...','hGKpX','totFG','HleqR','log','JNMJe','GUqgd','Jqsou','error','CyTfh','alert','ETPYC','LcGbV','SnXBw','txtiL','filter','title','isArray','user_messages','warn','NStpt','gdzaY','length','iXnlT','Oppiq','KDDwS','GDxsE','\x20invalid\x20conversations','đĄ\x20[CHATGPT_EXTRACTOR]\x20Sending\x20to\x20backend...','FheNP','success','đ\x20[CHATGPT_EXTRACTOR]\x20Backend\x20response:','data','â\x20[CHATGPT_EXTRACTOR]\x20Backend\x20storage\x20failed:','wwhKJ','An\x20unknown\x20error\x20occurred\x20during\x20conversation\x20storage.','â\x20[CHATGPT_EXTRACTOR]\x20Unexpected\x20error\x20during\x20export:','vPVCb','gYnsM','qMhoU','Export\x20Error','Fdpkl','vjkfM','yVRlS','bCOvk','vPVkb','YdNbb','items','JjUWr','memory_entries','UEiKn','BcZsC','đ\x20[CHATGPT_EXTRACTOR]\x20Found\x20','\x20memory\x20items,\x20','\x20memory\x20entries,\x20','\x20memories','SQhZx','EniVR','XgPfs','ClJNo','qZuSt','HJoTE','dCtzH','memoriesCount','SiHqT','NGgMQ','đ\x20[CHATGPT_EXTRACTOR]\x20Backend\x20stored\x20','peYTt','aAMyj','lBTLo','ZaUPI','TrMcr','TnRWs','mkNAX','wCLIt','â ī¸\x20[CHATGPT_EXTRACTOR]\x20Filtered\x20out\x20'];_0x43fe=function(){return _0x54dd14;};return _0x43fe();}function _0xe4e8(_0x43fe90,_0xe4e897){_0x43fe90=_0x43fe90-0x0;const _0x2acb40=_0x43fe();let _0x538d90=_0x2acb40[_0x43fe90];return _0x538d90;}export const useChatGPTConversationExtractor=()=>{const _0x2c11c8={'totFG':_0xe4e8(0x0),'Oppiq':_0xe4e8(0x1),'HleqR':_0xe4e8(0x2),'gKoLW':_0xe4e8(0x3),'igRBl':_0xe4e8(0x4),'JNMJe':_0xe4e8(0x5),'GUqgd':_0xe4e8(0x6),'Jqsou':_0xe4e8(0x7),'CyTfh':_0xe4e8(0x8),'ETPYC':_0xe4e8(0x9),'HRlHk':'Username\x20is\x20required\x20to\x20export\x20ChatGPT\x20conversations.','KDDwS':_0xe4e8(0xa),'txtiL':_0xe4e8(0xb),'gdzaY':function(_0x3b50ff,_0x118a93){return _0x3b50ff===_0x118a93;},'iXnlT':_0xe4e8(0xc),'xudJV':function(_0x5318ba,_0x4ded33){return _0x5318ba<_0x4ded33;},'GDxsE':function(_0xe4980c,_0xbade1d){return _0xe4980c-_0xbade1d;},'FheNP':function(_0x3c2f89,_0x5e8268,_0x144ead){return _0x3c2f89(_0x5e8268,_0x144ead);},'wwhKJ':_0xe4e8(0xd),'esqhj':'Export\x20Error','vPVCb':'Failed\x20to\x20connect\x20to\x20the\x20conversation\x20storage\x20service.\x20Please\x20check\x20your\x20network\x20connection.','qamzi':_0xe4e8(0xe),'EniVR':_0xe4e8(0xf),'RxONA':_0xe4e8(0x10),'gYnsM':function(_0x107d2d,_0x5e6feb){return _0x107d2d!==_0x5e6feb;},'qMhoU':_0xe4e8(0x11),'Fdpkl':function(_0x376a56,_0x406836){return _0x376a56!==_0x406836;},'vjkfM':_0xe4e8(0x12),'yVRlS':_0xe4e8(0x13),'bCOvk':_0xe4e8(0x14),'RJJgw':'VkBdc','vPVkb':function(_0x544751,_0x3d7d08){return _0x544751===_0x3d7d08;},'YdNbb':function(_0x39f8ac,_0x16626f){return _0x39f8ac===_0x16626f;},'JjUWr':function(_0x20bdec,_0x3e49b8){return _0x20bdec===_0x3e49b8;},'UEiKn':function(_0x5d50cb,_0x14e063){return _0x5d50cb===_0x14e063;},'BcZsC':function(_0x1951ef,_0x508411){return _0x1951ef===_0x508411;},'GPWLO':function(_0x475ff6,_0x42e7b2){return _0x475ff6===_0x42e7b2;},'SQhZx':function(_0x348a9e,_0x240197){return _0x348a9e===_0x240197;},'AxXyq':function(_0x1c6ac2,_0x32ccd1){return _0x1c6ac2!==_0x32ccd1;},'XgPfs':_0xe4e8(0x15),'qZuSt':_0xe4e8(0x16),'dCtzH':function(_0x41045e,_0x3bca9d){return _0x41045e!==_0x3bca9d;},'peYTt':_0xe4e8(0x17),'aAMyj':'â\x20[CHATGPT_EXTRACTOR]\x20Memories\x20storage\x20failed:','mkNAX':function(_0x35029d,_0x56176a){return _0x35029d===_0x56176a;},'wCLIt':'nJxaN'},_0x38f837=async(_0x2530f2,_0x5ab1c1)=>{const _0x414afe={'vTcvm':_0x2c11c8[_0xe4e8(0x18)],'LcGbV':_0x2c11c8['Oppiq'],'SnXBw':_0xe4e8(0xa),'NStpt':_0x2c11c8[_0xe4e8(0x19)]};console[_0xe4e8(0x1a)](_0x2c11c8['gKoLW']),console['log'](_0x2c11c8['igRBl'],_0x2530f2),console[_0xe4e8(0x1a)](_0x2c11c8[_0xe4e8(0x1b)],_0x5ab1c1['length']);if(!_0x2530f2)return _0x2c11c8[_0xe4e8(0x1c)]!==_0x2c11c8[_0xe4e8(0x1d)]?(console[_0xe4e8(0x1e)](_0x2c11c8[_0xe4e8(0x1f)]),Alert[_0xe4e8(0x20)](_0x2c11c8[_0xe4e8(0x21)],_0x2c11c8['HRlHk'],[{'text':'OK','style':_0x2c11c8['KDDwS']}]),![]):(_0x25473f[_0xe4e8(0x1e)](_0xe4e8(0xc)),Alert[_0xe4e8(0x20)](_0x414afe['vTcvm'],_0x414afe[_0xe4e8(0x22)],[{'text':'OK','style':_0x414afe[_0xe4e8(0x23)]}]),![]);if(!_0x5ab1c1||_0x5ab1c1['length']===0x0)return console['log'](_0x2c11c8[_0xe4e8(0x24)]),!![];const _0x3bdfc1=_0x5ab1c1[_0xe4e8(0x25)](_0x35c982=>{const _0x587902=_0x35c982['conversation_id']&&_0x35c982[_0xe4e8(0x26)]&&Array[_0xe4e8(0x27)](_0x35c982[_0xe4e8(0x28)])&&_0x35c982[_0xe4e8(0x28)]['length']>0x0;return!_0x587902&&console[_0xe4e8(0x29)](_0x414afe[_0xe4e8(0x2a)],_0x35c982),_0x587902;});if(_0x2c11c8[_0xe4e8(0x2b)](_0x3bdfc1[_0xe4e8(0x2c)],0x0))return console[_0xe4e8(0x1e)](_0x2c11c8[_0xe4e8(0x2d)]),Alert[_0xe4e8(0x20)](_0x2c11c8[_0xe4e8(0x18)],_0x2c11c8[_0xe4e8(0x2e)],[{'text':'OK','style':_0x2c11c8[_0xe4e8(0x2f)]}]),![];_0x2c11c8['xudJV'](_0x3bdfc1[_0xe4e8(0x2c)],_0x5ab1c1[_0xe4e8(0x2c)])&&console['warn']('â ī¸\x20[CHATGPT_EXTRACTOR]\x20Filtered\x20out\x20'+_0x2c11c8[_0xe4e8(0x30)](_0x5ab1c1['length'],_0x3bdfc1['length'])+_0xe4e8(0x31));try{console[_0xe4e8(0x1a)](_0xe4e8(0x32));const _0x3e96c2=await _0x2c11c8[_0xe4e8(0x33)](storeChatGPTConversations,_0x2530f2,_0x3bdfc1);return _0x3e96c2[_0xe4e8(0x34)]?(console[_0xe4e8(0x1a)]('â
\x20[CHATGPT_EXTRACTOR]\x20Export\x20completed\x20successfully'),console[_0xe4e8(0x1a)](_0xe4e8(0x35),_0x3e96c2[_0xe4e8(0x36)]),!![]):(console['error'](_0xe4e8(0x37),_0x3e96c2[_0xe4e8(0x1e)]),Alert[_0xe4e8(0x20)](_0x2c11c8[_0xe4e8(0x38)],_0x3e96c2['error']||_0xe4e8(0x39),[{'text':'OK','style':_0x2c11c8[_0xe4e8(0x2f)]}]),![]);}catch(_0x4e1a1a){return console['error'](_0xe4e8(0x3a),_0x4e1a1a),Alert['alert'](_0x2c11c8['esqhj'],_0x2c11c8[_0xe4e8(0x3b)],[{'text':'OK','style':_0x2c11c8[_0xe4e8(0x2f)]}]),![];}},_0x1cac9d=async _0x6ed3b9=>{const _0xd1d4b7={'SiHqT':_0x2c11c8['RxONA'],'NGgMQ':function(_0x25ea89,_0x21a341){return _0x2c11c8[_0xe4e8(0x3c)](_0x25ea89,_0x21a341);},'lBTLo':_0x2c11c8[_0xe4e8(0x3d)],'ZaUPI':_0xe4e8(0x3a),'TrMcr':_0xe4e8(0x3e),'TnRWs':'Failed\x20to\x20connect\x20to\x20the\x20conversation\x20storage\x20service.\x20Please\x20check\x20your\x20network\x20connection.'};if(_0x2c11c8[_0xe4e8(0x3f)](_0x2c11c8[_0xe4e8(0x40)],_0x2c11c8[_0xe4e8(0x40)]))return _0x516829[_0xe4e8(0x1e)](_0x2c11c8['qamzi'],_0x21895d),![];else{var _0x391f33,_0x35c81b,_0x36d924;console[_0xe4e8(0x1a)](_0x2c11c8[_0xe4e8(0x41)]);if(!_0x6ed3b9)return _0x2c11c8['Fdpkl'](_0x2c11c8[_0xe4e8(0x42)],_0x2c11c8['RJJgw'])?(console['warn'](_0x2c11c8['qMhoU']),![]):(_0x4aae10['log'](_0x2c11c8['EniVR']),!![]);const _0x9502c4=(_0x2c11c8[_0xe4e8(0x43)](_0x6ed3b9,null)||_0x2c11c8['YdNbb'](_0x6ed3b9,void 0x0)||_0x2c11c8[_0xe4e8(0x44)](_0x391f33=_0x6ed3b9[_0xe4e8(0x45)],null)||_0x2c11c8['YdNbb'](_0x391f33,void 0x0)?void 0x0:_0x391f33[_0xe4e8(0x2c)])||0x0,_0x5c18e0=(_0x2c11c8[_0xe4e8(0x46)](_0x6ed3b9,null)||_0x2c11c8['YdNbb'](_0x6ed3b9,void 0x0)||(_0x35c81b=_0x6ed3b9[_0xe4e8(0x47)])===null||_0x2c11c8[_0xe4e8(0x48)](_0x35c81b,void 0x0)?void 0x0:_0x35c81b[_0xe4e8(0x2c)])||0x0,_0x5e552f=(_0x2c11c8[_0xe4e8(0x49)](_0x6ed3b9,null)||_0x6ed3b9===void 0x0||_0x2c11c8[_0xe4e8(0x49)](_0x36d924=_0x6ed3b9['memories'],null)||_0x36d924===void 0x0?void 0x0:_0x36d924[_0xe4e8(0x2c)])||0x0;console[_0xe4e8(0x1a)](_0xe4e8(0x4a)+_0x9502c4+_0xe4e8(0x4b)+_0x5c18e0+_0xe4e8(0x4c)+_0x5e552f+_0xe4e8(0x4d));if(_0x2c11c8['GPWLO'](_0x9502c4,0x0)&&_0x5c18e0===0x0&&_0x2c11c8[_0xe4e8(0x4e)](_0x5e552f,0x0))return console['log'](_0x2c11c8[_0xe4e8(0x4f)]),!![];try{if(_0x2c11c8['AxXyq'](_0x2c11c8[_0xe4e8(0x50)],_0xe4e8(0x51))){console[_0xe4e8(0x1a)](_0x2c11c8[_0xe4e8(0x52)]);const _0x23fa26=await storeChatGPTMemories(_0x6ed3b9);if(_0x23fa26[_0xe4e8(0x34)]){if(_0xe4e8(0x53)===_0xe4e8(0x53)){var _0x5d9e9b;return console[_0xe4e8(0x1a)](_0x2c11c8['RxONA']),_0x2c11c8[_0xe4e8(0x54)](_0x5d9e9b=_0x23fa26[_0xe4e8(0x36)],null)&&_0x5d9e9b!==void 0x0&&_0x5d9e9b[_0xe4e8(0x55)]&&console[_0xe4e8(0x1a)]('đ\x20[CHATGPT_EXTRACTOR]\x20Backend\x20stored\x20'+_0x23fa26['data'][_0xe4e8(0x55)]+'\x20memories'),!![];}else{var _0x1b7099;return _0xa5073f['log'](_0xd1d4b7[_0xe4e8(0x56)]),_0xd1d4b7[_0xe4e8(0x57)](_0x1b7099=_0x290a40['data'],null)&&_0x1b7099!==void 0x0&&_0x1b7099[_0xe4e8(0x55)]&&_0xe7abb7[_0xe4e8(0x1a)](_0xe4e8(0x58)+_0x127e3f[_0xe4e8(0x36)][_0xe4e8(0x55)]+_0xe4e8(0x4d)),!![];}}else return _0x2c11c8['Fdpkl'](_0x2c11c8[_0xe4e8(0x59)],'xSZAo')?(console[_0xe4e8(0x1e)](_0x2c11c8[_0xe4e8(0x5a)],_0x23fa26[_0xe4e8(0x1e)]),![]):(_0x162e1b[_0xe4e8(0x29)](_0xd1d4b7[_0xe4e8(0x5b)]),![]);}else return _0x399f95['error'](_0xd1d4b7[_0xe4e8(0x5c)],_0x506811),Alert['alert'](_0xd1d4b7[_0xe4e8(0x5d)],_0xd1d4b7[_0xe4e8(0x5e)],[{'text':'OK','style':_0xe4e8(0xa)}]),![];}catch(_0x4c8c2d){if(_0x2c11c8[_0xe4e8(0x5f)]('nJxaN',_0x2c11c8[_0xe4e8(0x60)]))return console['error'](_0xe4e8(0xe),_0x4c8c2d),![];else _0x1cb309[_0xe4e8(0x29)](_0xe4e8(0x61)+(_0x28818a[_0xe4e8(0x2c)]-_0x401cdd[_0xe4e8(0x2c)])+'\x20invalid\x20conversations');}}};return{'initiateConversationExport':_0x38f837,'storeMemories':_0x1cac9d};};
|
|
1
|
+
/**
|
|
2
|
+
* ChatGPT Conversation Extractor
|
|
3
|
+
*
|
|
4
|
+
* Orchestrates the ChatGPT conversation export flow:
|
|
5
|
+
* 1. Receives extracted conversations from WebView
|
|
6
|
+
* 2. Validates and formats data
|
|
7
|
+
* 3. Sends to backend via chatGPTConversationService
|
|
8
|
+
* 4. Also handles ChatGPT memories export
|
|
9
|
+
*
|
|
10
|
+
* This acts as the bridge between OAuthWebView and the backend API.
|
|
11
|
+
*
|
|
12
|
+
* @reference iOS implementation: onairos-flutter/ios/Classes/OnairosChatGPTConnectorPlugin.swift
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { storeChatGPTConversations, storeChatGPTMemories } from './chatGPTConversationService';
|
|
16
|
+
import { Alert } from 'react-native';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Hook for ChatGPT conversation extraction operations
|
|
20
|
+
*/
|
|
21
|
+
export const useChatGPTConversationExtractor = () => {
|
|
22
|
+
/**
|
|
23
|
+
* Initiate conversation export to backend
|
|
24
|
+
*
|
|
25
|
+
* @param username - User identifier
|
|
26
|
+
* @param conversations - Array of conversations with user messages
|
|
27
|
+
* @returns true if successful, false otherwise
|
|
28
|
+
*/
|
|
29
|
+
const initiateConversationExport = async (username, conversations) => {
|
|
30
|
+
console.log('đ [CHATGPT_EXTRACTOR] Initiating conversation export');
|
|
31
|
+
console.log('đ¤ [CHATGPT_EXTRACTOR] Username:', username);
|
|
32
|
+
console.log('đ [CHATGPT_EXTRACTOR] Conversations to send:', conversations.length);
|
|
33
|
+
|
|
34
|
+
// Validation
|
|
35
|
+
if (!username) {
|
|
36
|
+
console.error('â [CHATGPT_EXTRACTOR] Username is required');
|
|
37
|
+
Alert.alert('Error', 'Username is required to export ChatGPT conversations.', [{
|
|
38
|
+
text: 'OK',
|
|
39
|
+
style: 'default'
|
|
40
|
+
}]);
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Handle 0 conversations as success - user might be new or have cleared history
|
|
45
|
+
// This matches iOS behavior where empty conversations still counts as successful connection
|
|
46
|
+
if (!conversations || conversations.length === 0) {
|
|
47
|
+
console.log('âšī¸ [CHATGPT_EXTRACTOR] No conversations to export - treating as success (connected)');
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Validate conversation structure
|
|
52
|
+
const validConversations = conversations.filter(conv => {
|
|
53
|
+
const isValid = conv.conversation_id && conv.title && Array.isArray(conv.user_messages) && conv.user_messages.length > 0;
|
|
54
|
+
if (!isValid) {
|
|
55
|
+
console.warn('â ī¸ [CHATGPT_EXTRACTOR] Invalid conversation:', conv);
|
|
56
|
+
}
|
|
57
|
+
return isValid;
|
|
58
|
+
});
|
|
59
|
+
if (validConversations.length === 0) {
|
|
60
|
+
console.error('â [CHATGPT_EXTRACTOR] No valid conversations after filtering');
|
|
61
|
+
Alert.alert('Data Error', 'No valid conversations found to export.', [{
|
|
62
|
+
text: 'OK',
|
|
63
|
+
style: 'default'
|
|
64
|
+
}]);
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (validConversations.length < conversations.length) {
|
|
68
|
+
console.warn(`â ī¸ [CHATGPT_EXTRACTOR] Filtered out ${conversations.length - validConversations.length} invalid conversations`);
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
console.log('đĄ [CHATGPT_EXTRACTOR] Sending to backend...');
|
|
72
|
+
const result = await storeChatGPTConversations(username, validConversations);
|
|
73
|
+
if (result.success) {
|
|
74
|
+
console.log('â
[CHATGPT_EXTRACTOR] Export completed successfully');
|
|
75
|
+
console.log('đ [CHATGPT_EXTRACTOR] Backend response:', result.data);
|
|
76
|
+
return true;
|
|
77
|
+
} else {
|
|
78
|
+
console.error('â [CHATGPT_EXTRACTOR] Backend storage failed:', result.error);
|
|
79
|
+
Alert.alert('Export Failed', result.error || 'An unknown error occurred during conversation storage.', [{
|
|
80
|
+
text: 'OK',
|
|
81
|
+
style: 'default'
|
|
82
|
+
}]);
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
} catch (error) {
|
|
86
|
+
console.error('â [CHATGPT_EXTRACTOR] Unexpected error during export:', error);
|
|
87
|
+
Alert.alert('Export Error', 'Failed to connect to the conversation storage service. Please check your network connection.', [{
|
|
88
|
+
text: 'OK',
|
|
89
|
+
style: 'default'
|
|
90
|
+
}]);
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Store ChatGPT memories on backend
|
|
97
|
+
* MATCHES iOS: OnairosChatGPTConnectorPlugin.swift saveMemories() + sendMemoriesToBackend()
|
|
98
|
+
*
|
|
99
|
+
* @param memoriesData - Raw ChatGPT memories JSON from WebView
|
|
100
|
+
* @returns true if successful, false otherwise
|
|
101
|
+
*/
|
|
102
|
+
const storeMemories = async memoriesData => {
|
|
103
|
+
var _memoriesData$items, _memoriesData$memory_, _memoriesData$memorie;
|
|
104
|
+
console.log('đ§ [CHATGPT_EXTRACTOR] Storing ChatGPT memories...');
|
|
105
|
+
|
|
106
|
+
// Validation
|
|
107
|
+
if (!memoriesData) {
|
|
108
|
+
console.warn('â ī¸ [CHATGPT_EXTRACTOR] No memories data provided');
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Count items (matches iOS logging)
|
|
113
|
+
const itemsCount = (memoriesData === null || memoriesData === void 0 || (_memoriesData$items = memoriesData.items) === null || _memoriesData$items === void 0 ? void 0 : _memoriesData$items.length) || 0;
|
|
114
|
+
const entriesCount = (memoriesData === null || memoriesData === void 0 || (_memoriesData$memory_ = memoriesData.memory_entries) === null || _memoriesData$memory_ === void 0 ? void 0 : _memoriesData$memory_.length) || 0;
|
|
115
|
+
const memoriesCount = (memoriesData === null || memoriesData === void 0 || (_memoriesData$memorie = memoriesData.memories) === null || _memoriesData$memorie === void 0 ? void 0 : _memoriesData$memorie.length) || 0;
|
|
116
|
+
console.log(`đ [CHATGPT_EXTRACTOR] Found ${itemsCount} memory items, ${entriesCount} memory entries, ${memoriesCount} memories`);
|
|
117
|
+
|
|
118
|
+
// If no memories, still treat as success (user might not have any memories)
|
|
119
|
+
if (itemsCount === 0 && entriesCount === 0 && memoriesCount === 0) {
|
|
120
|
+
console.log('âšī¸ [CHATGPT_EXTRACTOR] No memories to store - treating as success');
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
try {
|
|
124
|
+
console.log('đĄ [CHATGPT_EXTRACTOR] Sending memories to backend...');
|
|
125
|
+
const result = await storeChatGPTMemories(memoriesData);
|
|
126
|
+
if (result.success) {
|
|
127
|
+
var _result$data;
|
|
128
|
+
console.log('â
[CHATGPT_EXTRACTOR] Memories stored successfully');
|
|
129
|
+
if ((_result$data = result.data) !== null && _result$data !== void 0 && _result$data.memoriesCount) {
|
|
130
|
+
console.log(`đ [CHATGPT_EXTRACTOR] Backend stored ${result.data.memoriesCount} memories`);
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
133
|
+
} else {
|
|
134
|
+
console.error('â [CHATGPT_EXTRACTOR] Memories storage failed:', result.error);
|
|
135
|
+
// Don't show alert for memories failure - it's secondary data
|
|
136
|
+
// The main conversation export is what matters
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
} catch (error) {
|
|
140
|
+
console.error('â [CHATGPT_EXTRACTOR] Unexpected error storing memories:', error);
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
return {
|
|
145
|
+
initiateConversationExport,
|
|
146
|
+
storeMemories
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=chatGPTConversationExtractor.js.map
|