@onairos/react-native 3.6.4 → 3.6.5
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 +1 -1
- package/lib/commonjs/components/BodyText.js +1 -1
- package/lib/commonjs/components/BrandMark.js +1 -1
- package/lib/commonjs/components/CodeInput.js +1 -1
- package/lib/commonjs/components/EmailInput.js +1 -1
- package/lib/commonjs/components/GoogleButton.js +1 -1
- package/lib/commonjs/components/HeadingGroup.js +1 -1
- package/lib/commonjs/components/LLMDataInputModal.js +1 -1
- package/lib/commonjs/components/ModalHeader.js +1 -1
- package/lib/commonjs/components/ModalSheet.js +1 -1
- package/lib/commonjs/components/Onairos.js +1 -1
- package/lib/commonjs/components/OnairosButton.js +1 -1
- package/lib/commonjs/components/OnairosSignInButton.js +1 -1
- package/lib/commonjs/components/Overlay.js +1 -1
- package/lib/commonjs/components/PersonaImage.js +1 -1
- package/lib/commonjs/components/PersonaLoadingScreen.js +1 -1
- package/lib/commonjs/components/PersonalizationConsentScreen.js +1 -1
- package/lib/commonjs/components/PinCreationScreen.js +1 -1
- package/lib/commonjs/components/PinInput.js +1 -1
- package/lib/commonjs/components/PlatformConnectorsStep.js +1 -1
- package/lib/commonjs/components/PlatformList.js +1 -1
- package/lib/commonjs/components/PlatformToggle.js +1 -1
- package/lib/commonjs/components/PrimaryButton.js +1 -1
- package/lib/commonjs/components/SignInMatchAnimation.js +1 -1
- package/lib/commonjs/components/SignInStep.js +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +1 -1
- package/lib/commonjs/components/VerificationStep.js +1 -1
- package/lib/commonjs/components/WelcomeScreen.js +1 -1
- package/lib/commonjs/components/icons/Basicproficon.js +1 -1
- package/lib/commonjs/components/icons/Basicprofile.js +1 -1
- package/lib/commonjs/components/icons/Checkbox.js +1 -1
- package/lib/commonjs/components/icons/Checkmark.js +1 -1
- package/lib/commonjs/components/icons/Contentanalysis.js +1 -1
- package/lib/commonjs/components/icons/Contenticon.js +1 -1
- package/lib/commonjs/components/icons/EnochE.js +1 -1
- package/lib/commonjs/components/icons/Personalityicon.js +1 -1
- package/lib/commonjs/components/icons/Personalityprofile.js +1 -1
- package/lib/commonjs/components/icons/Personalitytraits.js +1 -1
- package/lib/commonjs/components/icons/Userpreferences.js +1 -1
- package/lib/commonjs/components/icons/index.js +1 -1
- package/lib/commonjs/components/onboarding/OAuthWebView.js +1 -1
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +1 -1
- package/lib/commonjs/components/onboarding/PinInput.js +1 -1
- package/lib/commonjs/components/onboarding/PlatformConnector.js +1 -1
- package/lib/commonjs/config/api.js +1 -1
- package/lib/commonjs/constants/index.js +1 -1
- package/lib/commonjs/context/AuthContext.js +1 -1
- package/lib/commonjs/hooks/useConnectedAccounts.js +1 -1
- package/lib/commonjs/hooks/useConnections.js +1 -1
- package/lib/commonjs/hooks/useCredentials.js +1 -1
- package/lib/commonjs/hooks/useUserConnections.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/services/apiClient.js +1 -1
- package/lib/commonjs/services/apiKeyService.js +924 -9
- package/lib/commonjs/services/authService.js +627 -10
- package/lib/commonjs/services/biometricPinService.js +1 -1
- package/lib/commonjs/services/chatGPTConversationExtractor.js +1 -1
- package/lib/commonjs/services/chatGPTConversationService.js +1 -1
- package/lib/commonjs/services/claudeConversationExtractor.js +1 -1
- package/lib/commonjs/services/claudeConversationService.js +1 -1
- package/lib/commonjs/services/connectedAccountsService.js +1 -1
- package/lib/commonjs/services/googleAuthService.js +1 -1
- package/lib/commonjs/services/hingeDataExtractor.js +1 -1
- package/lib/commonjs/services/hingeDataService.js +1 -1
- package/lib/commonjs/services/imageCompressionService.js +1 -1
- package/lib/commonjs/services/instagramDataExtractor.js +1 -1
- package/lib/commonjs/services/instagramDataService.js +1 -1
- package/lib/commonjs/services/jwtStorageService.js +1 -1
- package/lib/commonjs/services/linkedinDOMExtractor.js +1 -1
- package/lib/commonjs/services/linkedinProfileService.js +1 -1
- package/lib/commonjs/services/linkedinScrapingService.js +1 -1
- package/lib/commonjs/services/llmDataStorage.js +1 -1
- package/lib/commonjs/services/mobileTrainingService.js +1 -1
- package/lib/commonjs/services/oauthService.js +391 -11
- package/lib/commonjs/services/pinEncryptionService.js +1 -1
- package/lib/commonjs/services/pinStorageUtils.js +1 -1
- package/lib/commonjs/services/platformAuthService.js +1 -1
- package/lib/commonjs/services/sephoraDataExtractor.js +1 -1
- package/lib/commonjs/services/sephoraDataService.js +1 -1
- package/lib/commonjs/services/storageService.js +1 -1
- package/lib/commonjs/services/telegramDataExtractor.js +1 -1
- package/lib/commonjs/services/telegramDataService.js +1 -1
- package/lib/commonjs/services/trainingApiHelpers.js +1 -1
- package/lib/commonjs/services/userConnectionsService.js +1 -1
- package/lib/commonjs/services/youtubeMigrationService.js +1 -1
- package/lib/commonjs/theme/index.js +1 -1
- package/lib/commonjs/types/index.js +1 -1
- package/lib/commonjs/types.js +1 -1
- package/lib/commonjs/utils/Portal.js +1 -1
- package/lib/commonjs/utils/api.js +1 -1
- package/lib/commonjs/utils/assetRegistry.js +1 -1
- package/lib/commonjs/utils/auth.js +1 -1
- package/lib/commonjs/utils/connectorTests.js +1 -1
- package/lib/commonjs/utils/crypto.js +1 -1
- package/lib/commonjs/utils/debugHelper.js +1 -1
- package/lib/commonjs/utils/encryption.js +1 -1
- package/lib/commonjs/utils/eventUtils.js +1 -1
- package/lib/commonjs/utils/haptics.js +1 -1
- package/lib/commonjs/utils/imagePreloader.js +1 -1
- package/lib/commonjs/utils/networkDiagnostics.js +1 -1
- package/lib/commonjs/utils/onairosApi.js +1 -1
- package/lib/commonjs/utils/programmaticFlow.js +1 -1
- package/lib/commonjs/utils/retryHelper.js +1 -1
- package/lib/commonjs/utils/secureStorage.js +1 -1
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +1 -1
- package/lib/commonjs/utils/webviewScripts/claude.js +1 -1
- package/lib/commonjs/utils/webviewScripts/hinge.js +1 -1
- package/lib/commonjs/utils/webviewScripts/index.js +1 -1
- package/lib/commonjs/utils/webviewScripts/instagram.js +1 -1
- package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -1
- package/lib/commonjs/utils/webviewScripts/sephora.js +1 -1
- package/lib/commonjs/utils/webviewScripts/telegram.js +1 -1
- package/lib/module/api/index.js +1 -1
- package/lib/module/components/BodyText.js +1 -1
- package/lib/module/components/BrandMark.js +1 -1
- package/lib/module/components/CodeInput.js +1 -1
- package/lib/module/components/EmailInput.js +1 -1
- package/lib/module/components/GoogleButton.js +1 -1
- package/lib/module/components/HeadingGroup.js +1 -1
- package/lib/module/components/LLMDataInputModal.js +1 -1
- package/lib/module/components/ModalHeader.js +1 -1
- package/lib/module/components/ModalSheet.js +1 -1
- package/lib/module/components/Onairos.js +1 -1
- package/lib/module/components/OnairosButton.js +1 -1
- package/lib/module/components/OnairosSignInButton.js +1 -1
- package/lib/module/components/Overlay.js +1 -1
- package/lib/module/components/PersonaImage.js +1 -1
- package/lib/module/components/PersonaLoadingScreen.js +1 -1
- package/lib/module/components/PersonalizationConsentScreen.js +1 -1
- package/lib/module/components/PinCreationScreen.js +1 -1
- package/lib/module/components/PinInput.js +1 -1
- package/lib/module/components/PlatformConnectorsStep.js +1 -1
- package/lib/module/components/PlatformList.js +1 -1
- package/lib/module/components/PlatformToggle.js +1 -1
- package/lib/module/components/PrimaryButton.js +1 -1
- package/lib/module/components/SignInMatchAnimation.js +1 -1
- package/lib/module/components/SignInStep.js +1 -1
- package/lib/module/components/UniversalOnboarding.js +1 -1
- package/lib/module/components/VerificationStep.js +1 -1
- package/lib/module/components/WelcomeScreen.js +1 -1
- package/lib/module/components/icons/Basicproficon.js +1 -1
- package/lib/module/components/icons/Basicprofile.js +1 -1
- package/lib/module/components/icons/Checkbox.js +1 -1
- package/lib/module/components/icons/Checkmark.js +1 -1
- package/lib/module/components/icons/Contentanalysis.js +1 -1
- package/lib/module/components/icons/Contenticon.js +1 -1
- package/lib/module/components/icons/EnochE.js +1 -1
- package/lib/module/components/icons/Personalityicon.js +1 -1
- package/lib/module/components/icons/Personalityprofile.js +1 -1
- package/lib/module/components/icons/Personalitytraits.js +1 -1
- package/lib/module/components/icons/Userpreferences.js +1 -1
- package/lib/module/components/onboarding/OAuthWebView.js +1 -1
- package/lib/module/components/onboarding/OnboardingHeader.js +1 -1
- package/lib/module/components/onboarding/PinInput.js +1 -1
- package/lib/module/components/onboarding/PlatformConnector.js +1 -1
- package/lib/module/config/api.js +1 -1
- package/lib/module/constants/index.js +1 -1
- package/lib/module/context/AuthContext.js +1 -1
- package/lib/module/hooks/useConnectedAccounts.js +1 -1
- package/lib/module/hooks/useConnections.js +1 -1
- package/lib/module/hooks/useCredentials.js +1 -1
- package/lib/module/hooks/useUserConnections.js +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/services/apiClient.js +1 -1
- package/lib/module/services/apiKeyService.js +898 -1
- package/lib/module/services/authService.js +602 -1
- package/lib/module/services/biometricPinService.js +1 -1
- package/lib/module/services/chatGPTConversationExtractor.js +1 -1
- package/lib/module/services/chatGPTConversationService.js +1 -1
- package/lib/module/services/claudeConversationExtractor.js +1 -1
- package/lib/module/services/claudeConversationService.js +1 -1
- package/lib/module/services/connectedAccountsService.js +1 -1
- package/lib/module/services/googleAuthService.js +1 -1
- package/lib/module/services/hingeDataExtractor.js +1 -1
- package/lib/module/services/hingeDataService.js +1 -1
- package/lib/module/services/imageCompressionService.js +1 -1
- package/lib/module/services/instagramDataExtractor.js +1 -1
- package/lib/module/services/instagramDataService.js +1 -1
- package/lib/module/services/jwtStorageService.js +1 -1
- package/lib/module/services/linkedinDOMExtractor.js +1 -1
- package/lib/module/services/linkedinProfileService.js +1 -1
- package/lib/module/services/linkedinScrapingService.js +1 -1
- package/lib/module/services/llmDataStorage.js +1 -1
- package/lib/module/services/mobileTrainingService.js +1 -1
- package/lib/module/services/oauthService.js +381 -1
- package/lib/module/services/pinEncryptionService.js +1 -1
- package/lib/module/services/pinStorageUtils.js +1 -1
- package/lib/module/services/platformAuthService.js +1 -1
- package/lib/module/services/sephoraDataExtractor.js +1 -1
- package/lib/module/services/sephoraDataService.js +1 -1
- package/lib/module/services/storageService.js +1 -1
- package/lib/module/services/telegramDataExtractor.js +1 -1
- package/lib/module/services/telegramDataService.js +1 -1
- package/lib/module/services/trainingApiHelpers.js +1 -1
- package/lib/module/services/userConnectionsService.js +1 -1
- package/lib/module/services/youtubeMigrationService.js +1 -1
- package/lib/module/theme/index.js +1 -1
- package/lib/module/types.js +1 -1
- package/lib/module/utils/Portal.js +1 -1
- package/lib/module/utils/api.js +1 -1
- package/lib/module/utils/assetRegistry.js +1 -1
- package/lib/module/utils/auth.js +1 -1
- package/lib/module/utils/connectorTests.js +1 -1
- package/lib/module/utils/crypto.js +1 -1
- package/lib/module/utils/debugHelper.js +1 -1
- package/lib/module/utils/encryption.js +1 -1
- package/lib/module/utils/eventUtils.js +1 -1
- package/lib/module/utils/haptics.js +1 -1
- package/lib/module/utils/networkDiagnostics.js +1 -1
- package/lib/module/utils/onairosApi.js +1 -1
- package/lib/module/utils/programmaticFlow.js +1 -1
- package/lib/module/utils/retryHelper.js +1 -1
- package/lib/module/utils/secureStorage.js +1 -1
- package/lib/module/utils/webviewScripts/chatgpt.js +1 -1
- package/lib/module/utils/webviewScripts/claude.js +1 -1
- package/lib/module/utils/webviewScripts/hinge.js +1 -1
- package/lib/module/utils/webviewScripts/index.js +1 -1
- package/lib/module/utils/webviewScripts/instagram.js +1 -1
- package/lib/module/utils/webviewScripts/linkedin.js +1 -1
- package/lib/module/utils/webviewScripts/sephora.js +1 -1
- package/lib/module/utils/webviewScripts/telegram.js +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,391 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function _0x13b7(_0x103c92,_0x13b786){_0x103c92=_0x103c92-0x0;const _0x2a8b29=_0x103c();let _0x28ee2d=_0x2a8b29[_0x103c92];return _0x28ee2d;}Object[_0x13b7(0x0)](exports,'__esModule',{'value':!![]}),exports[_0x13b7(0x1)]=exports[_0x13b7(0x2)]=exports[_0x13b7(0x3)]=exports[_0x13b7(0x4)]=exports[_0x13b7(0x5)]=exports[_0x13b7(0x6)]=void 0x0;var _reactNative=__ONAIROS_REQ_FUNC__(0x0),_secureStorage=__ONAIROS_REQ_FUNC__(0x1),_crypto=__ONAIROS_REQ_FUNC__(0x2),_api=__ONAIROS_REQ_FUNC__(0x3),_api2=__ONAIROS_REQ_FUNC__(0x4);const OAUTH_CONFIGS={'instagram':{'clientId':_0x13b7(0x7),'redirectUri':_0x13b7(0x8),'scope':_0x13b7(0x9),'authorizationEndpoint':'https://api.instagram.com/oauth/authorize','tokenEndpoint':_0x13b7(0xa),'responseType':'code'},'youtube':{'clientId':'YOUR_YOUTUBE_CLIENT_ID','redirectUri':_0x13b7(0xb),'scope':_0x13b7(0xc),'authorizationEndpoint':'https://accounts.google.com/o/oauth2/auth','tokenEndpoint':_0x13b7(0xd),'responseType':_0x13b7(0xe)},'pinterest':{'clientId':'YOUR_PINTEREST_CLIENT_ID','redirectUri':_0x13b7(0xf),'scope':_0x13b7(0x10),'authorizationEndpoint':_0x13b7(0x11),'tokenEndpoint':_0x13b7(0x12),'responseType':_0x13b7(0xe)},'reddit':{'clientId':_0x13b7(0x13),'redirectUri':_0x13b7(0x14),'scope':'identity,read','authorizationEndpoint':_0x13b7(0x15),'tokenEndpoint':'https://www.reddit.com/api/v1/access_token','responseType':_0x13b7(0xe)}},generateState=()=>{const _0x2c6aa5=Math[_0x13b7(0x16)]()['toString'](0x24)[_0x13b7(0x17)](0x2,0xf);return(0x0,_crypto[_0x13b7(0x18)])(_0x2c6aa5)['substring'](0x0,0xa);},initializeOAuthService=()=>{const _0x2eb16a={'Nligh':_0x13b7(0x19)};_reactNative[_0x13b7(0x1a)][_0x13b7(0x1b)](_0x2eb16a['Nligh'],handleDeepLink);};exports[_0x13b7(0x2)]=initializeOAuthService;const cleanupOAuthService=()=>{const _0x3799ca={'yNKnZ':_0x13b7(0x1c),'OpFIw':_0x13b7(0x19),'AQcHP':function(_0x5820b6,_0x5c05b0){return _0x5820b6===_0x5c05b0;}};_0x3799ca[_0x13b7(0x1d)](typeof _reactNative[_0x13b7(0x1a)][_0x13b7(0x1e)],_0x3799ca[_0x13b7(0x1f)])&&(_0x3799ca[_0x13b7(0x1d)](_0x13b7(0x20),_0x13b7(0x21))?typeof _0x271005[_0x13b7(0x1a)][_0x13b7(0x1e)]===_0x3799ca['yNKnZ']&&_0x408a65['Linking'][_0x13b7(0x1e)](_0x3799ca[_0x13b7(0x22)]):_reactNative[_0x13b7(0x1a)][_0x13b7(0x1e)](_0x13b7(0x19)));};exports[_0x13b7(0x5)]=cleanupOAuthService;let currentOAuthState=null,currentOAuthPlatform=null,currentOAuthResolve=null,currentOAuthReject=null;const handleDeepLink=async _0x2e920a=>{const _0x1e4d93={'nZlRU':_0x13b7(0x23),'cMnDa':function(_0x4db5fb,_0x3907e){return _0x4db5fb(_0x3907e);},'uuyZR':_0x13b7(0x19),'Tewhh':function(_0x11cfcf,_0x5e4799){return _0x11cfcf===_0x5e4799;},'UKHNQ':'IonHQ','kpGlq':_0x13b7(0x24),'jnhXt':function(_0x2ed4e2,_0xe9d6ff){return _0x2ed4e2!==_0xe9d6ff;},'tliWZ':'code','EDAla':_0x13b7(0x25),'VxWmO':_0x13b7(0x26),'NTbGf':'OAuth\x20state\x20mismatch\x20-\x20possible\x20CSRF\x20attack','ltYMK':function(_0x768e8f,_0x3c4781){return _0x768e8f(_0x3c4781);},'OZfRB':_0x13b7(0x27),'qmBgV':'gsyXN','bBwpP':function(_0x3b2c3e,_0x289d40){return _0x3b2c3e===_0x289d40;},'SHDKW':_0x13b7(0x28),'cyuPp':function(_0x123b26,_0x2c7b3f){return _0x123b26(_0x2c7b3f);},'rkARI':_0x13b7(0x29),'BNZQk':function(_0x52bc7a,_0x286a82){return _0x52bc7a!==_0x286a82;},'LxCXO':'cCQbW','AWRXs':_0x13b7(0x2a),'FGEzr':function(_0xf5d02a,_0xa6367a){return _0xf5d02a!==_0xa6367a;},'qGKbm':_0x13b7(0x2b)};try{if(_0x1e4d93[_0x13b7(0x2c)]('IonHQ',_0x1e4d93['UKHNQ'])){const {url:_0x122881}=_0x2e920a;if(!_0x122881[_0x13b7(0x2d)](_0x1e4d93[_0x13b7(0x2e)]))return;const _0x5677af=_0x122881[_0x13b7(0x2f)](_0x1e4d93[_0x13b7(0x2e)])[0x1]['split']('?')[0x0];if(_0x1e4d93['jnhXt'](_0x5677af,currentOAuthPlatform))return;const _0x5ef9db=new URL(_0x122881)[_0x13b7(0x30)],_0x5c80cd=_0x5ef9db[_0x13b7(0x31)](_0x1e4d93[_0x13b7(0x32)]),_0x308da2=_0x5ef9db[_0x13b7(0x31)](_0x1e4d93[_0x13b7(0x33)]),_0x5ec4f6=_0x5ef9db[_0x13b7(0x31)](_0x1e4d93[_0x13b7(0x34)]);if(_0x1e4d93[_0x13b7(0x35)](_0x308da2,currentOAuthState)){currentOAuthReject&&_0x1e4d93[_0x13b7(0x36)](currentOAuthReject,new Error(_0x1e4d93[_0x13b7(0x37)]));return;}if(_0x5ec4f6){currentOAuthReject&&_0x1e4d93[_0x13b7(0x38)](currentOAuthReject,new Error(_0x13b7(0x39)+_0x5ec4f6));return;}if(_0x5c80cd){const _0x2b28ca=await exchangeCodeForToken(_0x5677af,_0x5c80cd);currentOAuthResolve&¤tOAuthResolve(_0x2b28ca);}else{if(_0x1e4d93[_0x13b7(0x35)](_0x1e4d93['OZfRB'],_0x1e4d93[_0x13b7(0x3a)])){if(currentOAuthReject){if(_0x1e4d93[_0x13b7(0x3b)](_0x13b7(0x28),_0x1e4d93['SHDKW']))_0x1e4d93[_0x13b7(0x3c)](currentOAuthReject,new Error(_0x1e4d93[_0x13b7(0x3d)]));else throw new _0x3bf0b7(_0x13b7(0x3e)+_0x4d138a);}}else _0x14e439['error'](_0x1e4d93[_0x13b7(0x3f)],_0x4b9083),_0x2c2ddb&&_0x1e4d93[_0x13b7(0x36)](_0x185d6d,_0x1a800a);}}else _0x538cea[_0x13b7(0x1a)]['addEventListener'](_0x1e4d93[_0x13b7(0x40)],_0x154641);}catch(_0x12bfc6){if(_0x1e4d93[_0x13b7(0x41)](_0x1e4d93[_0x13b7(0x42)],_0x1e4d93[_0x13b7(0x43)])){console['error'](_0x1e4d93['nZlRU'],_0x12bfc6);if(currentOAuthReject){if(_0x1e4d93[_0x13b7(0x44)](_0x1e4d93[_0x13b7(0x45)],_0x13b7(0x46)))currentOAuthReject(_0x12bfc6);else throw new _0x45bfb3('Unsupported\x20platform:\x20'+_0xfb9d2d);}}else _0x2f3676=null,_0x34e087=null,_0x157187=null,_0x5976d8=null;}finally{currentOAuthState=null,currentOAuthPlatform=null,currentOAuthResolve=null,currentOAuthReject=null;}},exchangeCodeForToken=async(_0x1ae69a,_0x5d8e0e)=>{const _0x5b352d={'ysOns':function(_0x3176d5){return _0x3176d5();},'dpyRt':_0x13b7(0x47),'Apkel':_0x13b7(0x48),'cLypT':_0x13b7(0x49),'fRZjQ':_0x13b7(0x4a),'KKyrK':_0x13b7(0x25),'LOuDd':function(_0x1a42c8,_0x2d6338){return _0x1a42c8(_0x2d6338);},'uycVp':function(_0x15f123,_0x21921b){return _0x15f123!==_0x21921b;},'aMbWm':_0x13b7(0x4b),'GEyFd':_0x13b7(0x4c),'LdZhD':'nBChC','zxNtF':_0x13b7(0x4d),'bsczF':_0x13b7(0x4e),'zVgfm':function(_0x163f4a,_0x4d881d,_0x3c96c5){return _0x163f4a(_0x4d881d,_0x3c96c5);},'yxdmr':_0x13b7(0x4f),'MbDFD':_0x13b7(0x50)};try{if(_0x5b352d[_0x13b7(0x51)](_0x5b352d['aMbWm'],_0x5b352d[_0x13b7(0x52)])){const _0x2f1a75=OAUTH_CONFIGS[_0x1ae69a];if(!_0x2f1a75){if(_0x5b352d[_0x13b7(0x53)]!==_0x5b352d[_0x13b7(0x54)])throw new Error(_0x13b7(0x3e)+_0x1ae69a);else{_0x4af0a2['error'](_0x13b7(0x55)+_0x843d1+'):',_0x10f056);throw _0x5dd495;}}const _0x10361d=new URLSearchParams({'grant_type':_0x5b352d[_0x13b7(0x56)],'code':_0x5d8e0e,'redirect_uri':_0x2f1a75[_0x13b7(0x57)],'client_id':_0x2f1a75[_0x13b7(0x58)]}),_0x503547=await _0x5b352d[_0x13b7(0x59)](fetch,_0x2f1a75[_0x13b7(0x5a)],{'method':'POST','headers':{'Content-Type':_0x5b352d['yxdmr']},'body':_0x10361d['toString']()}),_0x233d5c=await _0x503547[_0x13b7(0x5b)]();if(!_0x503547['ok'])throw new Error(_0x233d5c['error']||_0x13b7(0x5c));const _0x256dee=await fetchUserInfo(_0x1ae69a,_0x233d5c[_0x13b7(0x5d)]);return{'token':_0x233d5c[_0x13b7(0x5d)],'refreshToken':_0x233d5c[_0x13b7(0x5e)],'expiresIn':_0x233d5c['expires_in'],'username':_0x256dee['username'],'userId':_0x256dee['id']};}else{_0x3d12c8[_0x13b7(0x26)](_0x13b7(0x5f)+_0x3d433d+'):',_0x60a62d);throw _0x2d8d9a;}}catch(_0x1a125a){if(_0x5b352d[_0x13b7(0x51)](_0x5b352d[_0x13b7(0x60)],_0x5b352d[_0x13b7(0x60)]))try{const _0x222c6f=_0x2a2735[_0x4b4f89];if(!_0x222c6f)throw new _0x19999e(_0x13b7(0x3e)+_0x6e3634);const _0x2ce33e=_0x5b352d[_0x13b7(0x61)](_0x345eca),_0x2f9c1c=new _0x438ad5(_0x222c6f[_0x13b7(0x62)]);_0x2f9c1c['searchParams'][_0x13b7(0x63)](_0x5b352d[_0x13b7(0x64)],_0x222c6f[_0x13b7(0x58)]),_0x2f9c1c[_0x13b7(0x30)][_0x13b7(0x63)](_0x5b352d['Apkel'],_0x222c6f['redirectUri']),_0x2f9c1c[_0x13b7(0x30)]['append'](_0x5b352d[_0x13b7(0x65)],_0x222c6f[_0x13b7(0x66)]),_0x2f9c1c['searchParams'][_0x13b7(0x63)](_0x5b352d[_0x13b7(0x67)],_0x222c6f[_0x13b7(0x4a)]),_0x2f9c1c['searchParams'][_0x13b7(0x63)](_0x5b352d[_0x13b7(0x68)],_0x2ce33e),_0x4e9870=_0x2ce33e,_0x1dc5c6=_0x170064,_0x32ba07=_0x9c2c80,_0x4ad07b=_0x4f0943,_0x4dbca1[_0x13b7(0x1a)][_0x13b7(0x69)](_0x2f9c1c['toString']());}catch(_0x40f94d){_0x5b352d[_0x13b7(0x6a)](_0x293d24,_0x40f94d);}else{console[_0x13b7(0x26)](_0x13b7(0x55)+_0x1ae69a+'):',_0x1a125a);throw _0x1a125a;}}},fetchUserInfo=async(_0x2ee072,_0x4b900f)=>{const _0xdb144b={'SqoNH':_0x13b7(0x5c),'mHsPC':_0x13b7(0x6b),'xYiGB':'https://graph.instagram.com/me?fields=id,username','DvmKq':'youtube','rrWIj':_0x13b7(0x6c),'OPsms':'pinterest','Wporv':_0x13b7(0x6d),'TzFXd':'reddit','Khouf':'https://oauth.reddit.com/api/v1/me','Gpmmn':function(_0x59f557,_0x5bd5a5,_0x950cb9){return _0x59f557(_0x5bd5a5,_0x950cb9);},'AVkTU':function(_0x24eccf,_0xf4c94b){return _0x24eccf!==_0xf4c94b;},'vZXhb':_0x13b7(0x6e),'NSXos':_0x13b7(0x6f)};try{let _0x2c9c54,_0x2537db={'Authorization':_0x13b7(0x70)+_0x4b900f};switch(_0x2ee072){case _0xdb144b[_0x13b7(0x71)]:_0x2c9c54=_0xdb144b[_0x13b7(0x72)];break;case _0xdb144b['DvmKq']:_0x2c9c54=_0xdb144b['rrWIj'];break;case _0xdb144b[_0x13b7(0x73)]:_0x2c9c54=_0xdb144b[_0x13b7(0x74)];break;case _0xdb144b[_0x13b7(0x75)]:_0x2c9c54=_0xdb144b[_0x13b7(0x76)];break;default:throw new Error('Unsupported\x20platform:\x20'+_0x2ee072);}const _0x1a4d69=await _0xdb144b[_0x13b7(0x77)](fetch,_0x2c9c54,{'headers':_0x2537db}),_0xedf6ae=await _0x1a4d69[_0x13b7(0x5b)]();if(!_0x1a4d69['ok']){if(_0xdb144b['AVkTU'](_0x13b7(0x6e),_0xdb144b[_0x13b7(0x78)]))throw new _0xe56dc5(_0x2a9858[_0x13b7(0x26)]||_0xdb144b[_0x13b7(0x79)]);else throw new Error(_0xedf6ae[_0x13b7(0x26)]||_0xdb144b[_0x13b7(0x7a)]);}switch(_0x2ee072){case _0xdb144b['mHsPC']:return{'id':_0xedf6ae['id'],'username':_0xedf6ae[_0x13b7(0x7b)]};case _0xdb144b['DvmKq']:return{'id':_0xedf6ae[_0x13b7(0x7c)][0x0]['id'],'username':_0xedf6ae['items'][0x0]['snippet'][_0x13b7(0x7d)]};case'pinterest':return{'id':_0xedf6ae['id'],'username':_0xedf6ae[_0x13b7(0x7b)]||_0xedf6ae['full_name']};case _0xdb144b[_0x13b7(0x75)]:return{'id':_0xedf6ae['id'],'username':_0xedf6ae[_0x13b7(0x7e)]};default:throw new Error(_0x13b7(0x3e)+_0x2ee072);}}catch(_0x1f3fc8){console[_0x13b7(0x26)]('Error\x20fetching\x20user\x20info\x20('+_0x2ee072+'):',_0x1f3fc8);throw _0x1f3fc8;}},connectPlatform=_0x3599c2=>{const _0x351885={'zsiEI':_0x13b7(0x6f),'BzKvm':_0x13b7(0x7f),'vNffj':'client_id','zkfbC':_0x13b7(0x48),'JVvji':_0x13b7(0x49),'bozVS':_0x13b7(0x4a),'PPuik':_0x13b7(0x25),'ECAMG':function(_0x83a86a,_0x67add6){return _0x83a86a!==_0x67add6;},'PWsTi':_0x13b7(0x80),'SLpKH':function(_0x28102c,_0x58e7b3){return _0x28102c(_0x58e7b3);}};return new Promise((_0x4ebb64,_0x3ebfc4)=>{if(_0x351885[_0x13b7(0x81)]!==_0x351885[_0x13b7(0x81)])return _0x55448d[_0x13b7(0x26)](_0x13b7(0x82)+_0x103094+'):',_0x56d088),![];else try{const _0xb60ad1=OAUTH_CONFIGS[_0x3599c2];if(!_0xb60ad1)throw new Error(_0x13b7(0x3e)+_0x3599c2);const _0x19d188=generateState(),_0x47d062=new URL(_0xb60ad1[_0x13b7(0x62)]);_0x47d062[_0x13b7(0x30)]['append'](_0x351885[_0x13b7(0x83)],_0xb60ad1[_0x13b7(0x58)]),_0x47d062[_0x13b7(0x30)][_0x13b7(0x63)](_0x351885['zkfbC'],_0xb60ad1[_0x13b7(0x57)]),_0x47d062[_0x13b7(0x30)][_0x13b7(0x63)](_0x351885[_0x13b7(0x84)],_0xb60ad1['responseType']),_0x47d062[_0x13b7(0x30)][_0x13b7(0x63)](_0x351885[_0x13b7(0x85)],_0xb60ad1[_0x13b7(0x4a)]),_0x47d062[_0x13b7(0x30)][_0x13b7(0x63)](_0x351885[_0x13b7(0x86)],_0x19d188),currentOAuthState=_0x19d188,currentOAuthPlatform=_0x3599c2,currentOAuthResolve=_0x4ebb64,currentOAuthReject=_0x3ebfc4,_reactNative[_0x13b7(0x1a)][_0x13b7(0x69)](_0x47d062[_0x13b7(0x87)]());}catch(_0x28723d){if(_0x351885[_0x13b7(0x88)](_0x351885[_0x13b7(0x89)],_0x351885[_0x13b7(0x89)]))throw new _0x381b69(_0xe7e00d[_0x13b7(0x26)]||_0x351885[_0x13b7(0x8a)]);else _0x351885['SLpKH'](_0x3ebfc4,_0x28723d);}});};exports[_0x13b7(0x4)]=connectPlatform;const disconnectPlatform=async(_0x3bc0f8,_0x2a6f25)=>{const _0x482300={'JbEKb':_0x13b7(0x29),'fpHDz':function(_0x3f8564,_0x3745e3){return _0x3f8564(_0x3745e3);},'TKrNN':_0x13b7(0x8b),'FQmap':function(_0x4b7abc,_0x3e6630){return _0x4b7abc in _0x3e6630;},'BPmWC':function(_0x157777,_0x3db20a){return _0x157777!==_0x3db20a;},'zOpFw':function(_0x458f42,_0x5a07b7){return _0x458f42!==_0x5a07b7;},'uPQKO':_0x13b7(0x8c),'VjNqv':_0x13b7(0x8d)};try{await _api[_0x13b7(0x8e)][_0x13b7(0x8f)](_0x482300['TKrNN'],{'platform':_0x3bc0f8,'username':_0x2a6f25['username']});const _0x5b7895={..._0x2a6f25[_0x13b7(0x90)]};return _0x5b7895&&_0x482300['FQmap'](_0x3bc0f8,_0x5b7895)&&(_0x482300['BPmWC'](_0x13b7(0x91),'JuyyD')?delete _0x5b7895[_0x3bc0f8]:_0x3259ff&&_0x1d8b7b(new _0x281bab(_0x482300['JbEKb']))),await(0x0,_secureStorage['updateCredentials'])({..._0x2a6f25,'platforms':_0x5b7895}),!![];}catch(_0x78f088){if(_0x482300[_0x13b7(0x92)](_0x482300[_0x13b7(0x93)],_0x482300[_0x13b7(0x94)]))return console[_0x13b7(0x26)](_0x13b7(0x95)+_0x3bc0f8+'):',_0x78f088),![];else _0x482300[_0x13b7(0x96)](_0x47a994,new _0x1b3e4a('OAuth\x20error:\x20'+_0x57bead));}};exports[_0x13b7(0x3)]=disconnectPlatform;const storePlatformConnection=async(_0x1fc503,_0x16eb26,_0x3e1fc9)=>{const _0xd4038d={'URsFz':function(_0x20d0ef,_0x167791){return _0x20d0ef(_0x167791);},'MchxB':_0x13b7(0x97),'YlBAV':function(_0x283e81,_0x412e78){return _0x283e81===_0x412e78;},'IyUDC':_0x13b7(0x6b),'IiNQt':'youtube','CjYvS':'pinterest','kDTnJ':function(_0x13378f,_0x146acb){return _0x13378f!==_0x146acb;},'FMJyM':_0x13b7(0x98),'tTasj':function(_0x38d398,_0xcfb099){return _0x38d398*_0xcfb099;},'QKNag':function(_0x31dc31,_0x2a04a9){return _0x31dc31===_0x2a04a9;},'qkGgB':function(_0x391394,_0x5649b2){return _0x391394===_0x5649b2;},'gQcDJ':_0x13b7(0x99)};try{if(_0xd4038d['YlBAV'](_0x13b7(0x9a),'anzVC')){const _0x14be7e=_0xd4038d[_0x13b7(0x9b)](_0x1fc503,_0xd4038d[_0x13b7(0x9c)])||_0xd4038d[_0x13b7(0x9b)](_0x1fc503,_0xd4038d[_0x13b7(0x9d)])||_0xd4038d[_0x13b7(0x9b)](_0x1fc503,_0xd4038d['CjYvS'])||_0xd4038d[_0x13b7(0x9b)](_0x1fc503,_0x13b7(0x99));if(!_0x14be7e){if(_0xd4038d['kDTnJ'](_0xd4038d[_0x13b7(0x9e)],_0xd4038d[_0x13b7(0x9e)]))return _0x146f0a['error'](_0x13b7(0x95)+_0x14187b+'):',_0x57e85f),![];else throw new Error(_0x13b7(0x3e)+_0x1fc503);}const _0xf6c65b={..._0x3e1fc9[_0x13b7(0x90)]},_0x30663a={'username':_0x16eb26[_0x13b7(0x7b)],'userId':_0x16eb26[_0x13b7(0x9f)],'token':_0x16eb26[_0x13b7(0xa0)],'refreshToken':_0x16eb26[_0x13b7(0xa1)],'expiresAt':_0x16eb26['expiresIn']?Date[_0x13b7(0xa2)]()+_0xd4038d[_0x13b7(0xa3)](_0x16eb26[_0x13b7(0xa4)],0x3e8):null,'connectedAt':Date[_0x13b7(0xa2)]()};if(_0xd4038d[_0x13b7(0x9b)](_0x1fc503,_0xd4038d[_0x13b7(0x9c)]))_0xf6c65b[_0x13b7(0x6b)]=_0x30663a;else{if(_0xd4038d[_0x13b7(0xa5)](_0x1fc503,_0xd4038d[_0x13b7(0x9d)]))_0xf6c65b[_0x13b7(0xa6)]=_0x30663a;else{if(_0x1fc503===_0xd4038d[_0x13b7(0xa7)])_0xf6c65b[_0x13b7(0xa8)]=_0x30663a;else{if(_0xd4038d[_0x13b7(0xa9)](_0x1fc503,_0xd4038d[_0x13b7(0xaa)]))_0xf6c65b[_0x13b7(0x99)]=_0x30663a;}}}return await(0x0,_secureStorage[_0x13b7(0xab)])({..._0x3e1fc9,'platforms':_0xf6c65b}),!![];}else _0xd4038d[_0x13b7(0xac)](_0x105557,new _0x2aeb77(_0xd4038d['MchxB']));}catch(_0x594fe7){return console[_0x13b7(0x26)](_0x13b7(0x82)+_0x1fc503+'):',_0x594fe7),![];}};function _0x103c(){const _0x18d9cb=['defineProperty','storePlatformConnection','initializeOAuthService','disconnectPlatform','connectPlatform','cleanupOAuthService','OAuthService','YOUR_INSTAGRAM_CLIENT_ID','onairosanime://auth/instagram','user_profile,user_media','https://api.instagram.com/oauth/access_token','onairosanime://auth/youtube','https://www.googleapis.com/auth/youtube.readonly','https://oauth2.googleapis.com/token','code','onairosanime://auth/pinterest','boards:read,pins:read','https://www.pinterest.com/oauth/','https://api.pinterest.com/v5/oauth/token','YOUR_REDDIT_CLIENT_ID','onairosanime://auth/reddit','https://www.reddit.com/api/v1/authorize','random','substring','sha256','url','Linking','addEventListener','function','AQcHP','removeAllListeners','yNKnZ','bwQwD','icobX','OpFIw','Error\x20handling\x20OAuth\x20deep\x20link:','onairosanime://auth/','state','error','geYtH','ZnDLg','No\x20authorization\x20code\x20received','GdETm','DTDMV','Tewhh','startsWith','kpGlq','split','searchParams','get','tliWZ','EDAla','VxWmO','jnhXt','cMnDa','NTbGf','ltYMK','OAuth\x20error:\x20','qmBgV','bBwpP','cyuPp','rkARI','Unsupported\x20platform:\x20','nZlRU','uuyZR','BNZQk','LxCXO','AWRXs','FGEzr','qGKbm','dYSgg','client_id','redirect_uri','response_type','scope','EYIzg','zJbog','trwZS','authorization_code','application/x-www-form-urlencoded','amtRA','uycVp','GEyFd','LdZhD','zxNtF','Error\x20exchanging\x20code\x20for\x20token\x20(','bsczF','redirectUri','clientId','zVgfm','tokenEndpoint','json','Failed\x20to\x20exchange\x20code\x20for\x20token','access_token','refresh_token','Error\x20fetching\x20user\x20info\x20(','MbDFD','ysOns','authorizationEndpoint','append','dpyRt','cLypT','responseType','fRZjQ','KKyrK','openURL','LOuDd','instagram','https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true','https://api.pinterest.com/v5/user_account','VTeER','Failed\x20to\x20fetch\x20user\x20info','Bearer\x20','mHsPC','xYiGB','OPsms','Wporv','TzFXd','Khouf','Gpmmn','vZXhb','SqoNH','NSXos','username','items','title','name','JhphR','lYgAo','BzKvm','Error\x20storing\x20platform\x20connection\x20(','vNffj','JVvji','bozVS','PPuik','toString','ECAMG','PWsTi','zsiEI','/users/disconnect-platform','oyxCP','sxVDF','onairosApi','post','platforms','RxREN','zOpFw','uPQKO','VjNqv','Error\x20disconnecting\x20platform\x20(','fpHDz','OAuth\x20state\x20mismatch\x20-\x20possible\x20CSRF\x20attack','meOLz','reddit','anzVC','YlBAV','IyUDC','IiNQt','FMJyM','userId','token','refreshToken','now','tTasj','expiresIn','QKNag','youtube','CjYvS','pinterest','qkGgB','gQcDJ','updateCredentials','URsFz','API_CONFIG'];_0x103c=function(){return _0x18d9cb;};return _0x103c();}exports[_0x13b7(0x1)]=storePlatformConnection;const OAuthService=exports[_0x13b7(0x6)]={'initializeOAuthService':initializeOAuthService,'cleanupOAuthService':cleanupOAuthService,'connectPlatform':connectPlatform,'disconnectPlatform':disconnectPlatform,'storePlatformConnection':storePlatformConnection,'_apiBaseUrl':''+_api2[_0x13b7(0xad)]['BASE_URL']};
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.storePlatformConnection = exports.initializeOAuthService = exports.disconnectPlatform = exports.connectPlatform = exports.cleanupOAuthService = exports.OAuthService = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _secureStorage = require("../utils/secureStorage");
|
|
9
|
+
var _crypto = require("../utils/crypto");
|
|
10
|
+
var _api = require("../api");
|
|
11
|
+
var _api2 = require("../config/api");
|
|
12
|
+
// Define OAuth configuration types
|
|
13
|
+
|
|
14
|
+
// Platform-specific OAuth configurations
|
|
15
|
+
const OAUTH_CONFIGS = {
|
|
16
|
+
instagram: {
|
|
17
|
+
clientId: 'YOUR_INSTAGRAM_CLIENT_ID',
|
|
18
|
+
// Replace with actual client ID
|
|
19
|
+
redirectUri: 'onairosanime://auth/instagram',
|
|
20
|
+
scope: 'user_profile,user_media',
|
|
21
|
+
authorizationEndpoint: 'https://api.instagram.com/oauth/authorize',
|
|
22
|
+
tokenEndpoint: 'https://api.instagram.com/oauth/access_token',
|
|
23
|
+
responseType: 'code'
|
|
24
|
+
},
|
|
25
|
+
youtube: {
|
|
26
|
+
clientId: 'YOUR_YOUTUBE_CLIENT_ID',
|
|
27
|
+
// Replace with actual client ID
|
|
28
|
+
redirectUri: 'onairosanime://auth/youtube',
|
|
29
|
+
scope: 'https://www.googleapis.com/auth/youtube.readonly',
|
|
30
|
+
authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
|
|
31
|
+
tokenEndpoint: 'https://oauth2.googleapis.com/token',
|
|
32
|
+
responseType: 'code'
|
|
33
|
+
},
|
|
34
|
+
pinterest: {
|
|
35
|
+
clientId: 'YOUR_PINTEREST_CLIENT_ID',
|
|
36
|
+
// Replace with actual client ID
|
|
37
|
+
redirectUri: 'onairosanime://auth/pinterest',
|
|
38
|
+
scope: 'boards:read,pins:read',
|
|
39
|
+
authorizationEndpoint: 'https://www.pinterest.com/oauth/',
|
|
40
|
+
tokenEndpoint: 'https://api.pinterest.com/v5/oauth/token',
|
|
41
|
+
responseType: 'code'
|
|
42
|
+
},
|
|
43
|
+
reddit: {
|
|
44
|
+
clientId: 'YOUR_REDDIT_CLIENT_ID',
|
|
45
|
+
// Replace with actual client ID
|
|
46
|
+
redirectUri: 'onairosanime://auth/reddit',
|
|
47
|
+
scope: 'identity,read',
|
|
48
|
+
authorizationEndpoint: 'https://www.reddit.com/api/v1/authorize',
|
|
49
|
+
tokenEndpoint: 'https://www.reddit.com/api/v1/access_token',
|
|
50
|
+
responseType: 'code'
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Generate a state value for OAuth to prevent CSRF attacks
|
|
56
|
+
*/
|
|
57
|
+
const generateState = () => {
|
|
58
|
+
const randomValue = Math.random().toString(36).substring(2, 15);
|
|
59
|
+
return (0, _crypto.sha256)(randomValue).substring(0, 10);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Initialize OAuth service handlers and listeners
|
|
64
|
+
*/
|
|
65
|
+
const initializeOAuthService = () => {
|
|
66
|
+
// Set up deep linking handlers for OAuth redirects
|
|
67
|
+
_reactNative.Linking.addEventListener('url', handleDeepLink);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Clean up OAuth service handlers and listeners
|
|
72
|
+
*/
|
|
73
|
+
exports.initializeOAuthService = initializeOAuthService;
|
|
74
|
+
const cleanupOAuthService = () => {
|
|
75
|
+
// Use the modern React Native Linking API
|
|
76
|
+
if (typeof _reactNative.Linking.removeAllListeners === 'function') {
|
|
77
|
+
_reactNative.Linking.removeAllListeners('url');
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// Keep track of current OAuth state and callbacks
|
|
82
|
+
exports.cleanupOAuthService = cleanupOAuthService;
|
|
83
|
+
let currentOAuthState = null;
|
|
84
|
+
let currentOAuthPlatform = null;
|
|
85
|
+
let currentOAuthResolve = null;
|
|
86
|
+
let currentOAuthReject = null;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Handle deep link callbacks from OAuth providers
|
|
90
|
+
*/
|
|
91
|
+
const handleDeepLink = async event => {
|
|
92
|
+
try {
|
|
93
|
+
const {
|
|
94
|
+
url
|
|
95
|
+
} = event;
|
|
96
|
+
|
|
97
|
+
// Check if this is an OAuth callback URL
|
|
98
|
+
if (!url.startsWith('onairosanime://auth/')) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Extract platform from URL path
|
|
103
|
+
const platform = url.split('onairosanime://auth/')[1].split('?')[0];
|
|
104
|
+
|
|
105
|
+
// Only handle if it matches current OAuth flow
|
|
106
|
+
if (platform !== currentOAuthPlatform) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Parse URL parameters
|
|
111
|
+
const params = new URL(url).searchParams;
|
|
112
|
+
const code = params.get('code');
|
|
113
|
+
const state = params.get('state');
|
|
114
|
+
const error = params.get('error');
|
|
115
|
+
|
|
116
|
+
// Validate state to prevent CSRF attacks
|
|
117
|
+
if (state !== currentOAuthState) {
|
|
118
|
+
if (currentOAuthReject) {
|
|
119
|
+
currentOAuthReject(new Error('OAuth state mismatch - possible CSRF attack'));
|
|
120
|
+
}
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Handle errors
|
|
125
|
+
if (error) {
|
|
126
|
+
if (currentOAuthReject) {
|
|
127
|
+
currentOAuthReject(new Error(`OAuth error: ${error}`));
|
|
128
|
+
}
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Proceed with token exchange if code is present
|
|
133
|
+
if (code) {
|
|
134
|
+
const tokenResult = await exchangeCodeForToken(platform, code);
|
|
135
|
+
if (currentOAuthResolve) {
|
|
136
|
+
currentOAuthResolve(tokenResult);
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
if (currentOAuthReject) {
|
|
140
|
+
currentOAuthReject(new Error('No authorization code received'));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
} catch (error) {
|
|
144
|
+
console.error('Error handling OAuth deep link:', error);
|
|
145
|
+
if (currentOAuthReject) {
|
|
146
|
+
currentOAuthReject(error);
|
|
147
|
+
}
|
|
148
|
+
} finally {
|
|
149
|
+
// Reset state
|
|
150
|
+
currentOAuthState = null;
|
|
151
|
+
currentOAuthPlatform = null;
|
|
152
|
+
currentOAuthResolve = null;
|
|
153
|
+
currentOAuthReject = null;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Exchange OAuth authorization code for access token
|
|
159
|
+
*/
|
|
160
|
+
const exchangeCodeForToken = async (platform, code) => {
|
|
161
|
+
try {
|
|
162
|
+
const config = OAUTH_CONFIGS[platform];
|
|
163
|
+
if (!config) {
|
|
164
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Prepare token request parameters
|
|
168
|
+
const params = new URLSearchParams({
|
|
169
|
+
grant_type: 'authorization_code',
|
|
170
|
+
code,
|
|
171
|
+
redirect_uri: config.redirectUri,
|
|
172
|
+
client_id: config.clientId
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// Exchange code for token
|
|
176
|
+
const response = await fetch(config.tokenEndpoint, {
|
|
177
|
+
method: 'POST',
|
|
178
|
+
headers: {
|
|
179
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
180
|
+
},
|
|
181
|
+
body: params.toString()
|
|
182
|
+
});
|
|
183
|
+
const data = await response.json();
|
|
184
|
+
if (!response.ok) {
|
|
185
|
+
throw new Error(data.error || 'Failed to exchange code for token');
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Fetch user information based on the platform
|
|
189
|
+
const userInfo = await fetchUserInfo(platform, data.access_token);
|
|
190
|
+
return {
|
|
191
|
+
token: data.access_token,
|
|
192
|
+
refreshToken: data.refresh_token,
|
|
193
|
+
expiresIn: data.expires_in,
|
|
194
|
+
username: userInfo.username,
|
|
195
|
+
userId: userInfo.id
|
|
196
|
+
};
|
|
197
|
+
} catch (error) {
|
|
198
|
+
console.error(`Error exchanging code for token (${platform}):`, error);
|
|
199
|
+
throw error;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Fetch user information from the connected platform
|
|
205
|
+
*/
|
|
206
|
+
const fetchUserInfo = async (platform, accessToken) => {
|
|
207
|
+
try {
|
|
208
|
+
let endpoint;
|
|
209
|
+
let headers = {
|
|
210
|
+
Authorization: `Bearer ${accessToken}`
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// Platform-specific API endpoints for user info
|
|
214
|
+
switch (platform) {
|
|
215
|
+
case 'instagram':
|
|
216
|
+
endpoint = 'https://graph.instagram.com/me?fields=id,username';
|
|
217
|
+
break;
|
|
218
|
+
case 'youtube':
|
|
219
|
+
endpoint = 'https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true';
|
|
220
|
+
break;
|
|
221
|
+
case 'pinterest':
|
|
222
|
+
endpoint = 'https://api.pinterest.com/v5/user_account';
|
|
223
|
+
break;
|
|
224
|
+
case 'reddit':
|
|
225
|
+
endpoint = 'https://oauth.reddit.com/api/v1/me';
|
|
226
|
+
break;
|
|
227
|
+
default:
|
|
228
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
229
|
+
}
|
|
230
|
+
const response = await fetch(endpoint, {
|
|
231
|
+
headers
|
|
232
|
+
});
|
|
233
|
+
const data = await response.json();
|
|
234
|
+
if (!response.ok) {
|
|
235
|
+
throw new Error(data.error || 'Failed to fetch user info');
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Extract user information based on platform-specific response format
|
|
239
|
+
switch (platform) {
|
|
240
|
+
case 'instagram':
|
|
241
|
+
return {
|
|
242
|
+
id: data.id,
|
|
243
|
+
username: data.username
|
|
244
|
+
};
|
|
245
|
+
case 'youtube':
|
|
246
|
+
return {
|
|
247
|
+
id: data.items[0].id,
|
|
248
|
+
username: data.items[0].snippet.title
|
|
249
|
+
};
|
|
250
|
+
case 'pinterest':
|
|
251
|
+
return {
|
|
252
|
+
id: data.id,
|
|
253
|
+
username: data.username || data.full_name
|
|
254
|
+
};
|
|
255
|
+
case 'reddit':
|
|
256
|
+
return {
|
|
257
|
+
id: data.id,
|
|
258
|
+
username: data.name
|
|
259
|
+
};
|
|
260
|
+
default:
|
|
261
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
262
|
+
}
|
|
263
|
+
} catch (error) {
|
|
264
|
+
console.error(`Error fetching user info (${platform}):`, error);
|
|
265
|
+
throw error;
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Connect to a platform using OAuth
|
|
271
|
+
*/
|
|
272
|
+
const connectPlatform = platform => {
|
|
273
|
+
return new Promise((resolve, reject) => {
|
|
274
|
+
try {
|
|
275
|
+
const config = OAUTH_CONFIGS[platform];
|
|
276
|
+
if (!config) {
|
|
277
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// Generate state for CSRF protection
|
|
281
|
+
const state = generateState();
|
|
282
|
+
|
|
283
|
+
// Build authorization URL
|
|
284
|
+
const authUrl = new URL(config.authorizationEndpoint);
|
|
285
|
+
authUrl.searchParams.append('client_id', config.clientId);
|
|
286
|
+
authUrl.searchParams.append('redirect_uri', config.redirectUri);
|
|
287
|
+
authUrl.searchParams.append('response_type', config.responseType);
|
|
288
|
+
authUrl.searchParams.append('scope', config.scope);
|
|
289
|
+
authUrl.searchParams.append('state', state);
|
|
290
|
+
|
|
291
|
+
// Set up current OAuth state for callback handling
|
|
292
|
+
currentOAuthState = state;
|
|
293
|
+
currentOAuthPlatform = platform;
|
|
294
|
+
currentOAuthResolve = resolve;
|
|
295
|
+
currentOAuthReject = reject;
|
|
296
|
+
|
|
297
|
+
// Open browser or WebView to the authorization URL
|
|
298
|
+
_reactNative.Linking.openURL(authUrl.toString());
|
|
299
|
+
} catch (error) {
|
|
300
|
+
reject(error);
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Disconnect from a platform
|
|
307
|
+
*/
|
|
308
|
+
exports.connectPlatform = connectPlatform;
|
|
309
|
+
const disconnectPlatform = async (platform, credentials) => {
|
|
310
|
+
try {
|
|
311
|
+
// Call Onairos API to disconnect platform
|
|
312
|
+
await _api.onairosApi.post('/users/disconnect-platform', {
|
|
313
|
+
platform,
|
|
314
|
+
username: credentials.username
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
// Update local credentials to remove platform
|
|
318
|
+
const updatedPlatforms = {
|
|
319
|
+
...credentials.platforms
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
// Type-safe platform removal using keyof operator
|
|
323
|
+
if (updatedPlatforms && platform in updatedPlatforms) {
|
|
324
|
+
delete updatedPlatforms[platform];
|
|
325
|
+
}
|
|
326
|
+
await (0, _secureStorage.updateCredentials)({
|
|
327
|
+
...credentials,
|
|
328
|
+
platforms: updatedPlatforms
|
|
329
|
+
});
|
|
330
|
+
return true;
|
|
331
|
+
} catch (error) {
|
|
332
|
+
console.error(`Error disconnecting platform (${platform}):`, error);
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Store platform connection data in user credentials
|
|
339
|
+
*/
|
|
340
|
+
exports.disconnectPlatform = disconnectPlatform;
|
|
341
|
+
const storePlatformConnection = async (platform, connectionData, credentials) => {
|
|
342
|
+
try {
|
|
343
|
+
// Only accept valid platform types
|
|
344
|
+
const validPlatform = platform === 'instagram' || platform === 'youtube' || platform === 'pinterest' || platform === 'reddit';
|
|
345
|
+
if (!validPlatform) {
|
|
346
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Update platforms in credentials with type safety
|
|
350
|
+
const updatedPlatforms = {
|
|
351
|
+
...credentials.platforms
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
// Type-safe assignment
|
|
355
|
+
const platformData = {
|
|
356
|
+
username: connectionData.username,
|
|
357
|
+
userId: connectionData.userId,
|
|
358
|
+
token: connectionData.token,
|
|
359
|
+
refreshToken: connectionData.refreshToken,
|
|
360
|
+
expiresAt: connectionData.expiresIn ? Date.now() + connectionData.expiresIn * 1000 : null,
|
|
361
|
+
connectedAt: Date.now()
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
// Assign platform data based on platform type
|
|
365
|
+
if (platform === 'instagram') updatedPlatforms.instagram = platformData;else if (platform === 'youtube') updatedPlatforms.youtube = platformData;else if (platform === 'pinterest') updatedPlatforms.pinterest = platformData;else if (platform === 'reddit') updatedPlatforms.reddit = platformData;
|
|
366
|
+
|
|
367
|
+
// Update stored credentials
|
|
368
|
+
await (0, _secureStorage.updateCredentials)({
|
|
369
|
+
...credentials,
|
|
370
|
+
platforms: updatedPlatforms
|
|
371
|
+
});
|
|
372
|
+
return true;
|
|
373
|
+
} catch (error) {
|
|
374
|
+
console.error(`Error storing platform connection (${platform}):`, error);
|
|
375
|
+
return false;
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
exports.storePlatformConnection = storePlatformConnection;
|
|
379
|
+
/**
|
|
380
|
+
* Service for handling OAuth connections to various platforms
|
|
381
|
+
*/
|
|
382
|
+
const OAuthService = exports.OAuthService = {
|
|
383
|
+
initializeOAuthService,
|
|
384
|
+
cleanupOAuthService,
|
|
385
|
+
connectPlatform,
|
|
386
|
+
disconnectPlatform,
|
|
387
|
+
storePlatformConnection,
|
|
388
|
+
// Base API URL
|
|
389
|
+
_apiBaseUrl: `${_api2.API_CONFIG.BASE_URL}`
|
|
390
|
+
};
|
|
391
|
+
//# sourceMappingURL=oauthService.js.map
|
|
@@ -5,4 +5,4 @@ var __ONAIROS_REQ_REGISTRY__ = [
|
|
|
5
5
|
require('react-native-crypto-js')
|
|
6
6
|
];
|
|
7
7
|
function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
|
|
8
|
-
Object['defineProperty'](exports,
|
|
8
|
+
Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[_0x1bb8(0x0)]=exports[_0x1bb8(0x1)]=exports[_0x1bb8(0x2)]=exports[_0x1bb8(0x3)]=void 0x0;var _pinStorageUtils=__ONAIROS_REQ_FUNC__(0x0);function _0x1bb8(_0x2455e9,_0x1bb872){_0x2455e9=_0x2455e9-0x0;const _0x132c83=_0x2455();let _0x2f15fd=_0x132c83[_0x2455e9];return _0x2f15fd;}const CryptoJS=__ONAIROS_REQ_FUNC__(0x1),ENCRYPTION_KEY=_0x1bb8(0x4),encryptPin=_0x4690d8=>{const _0x44d64f={'YVERI':_0x1bb8(0x5),'EUluU':_0x1bb8(0x6),'KAMxu':_0x1bb8(0x7),'ctSHj':_0x1bb8(0x8),'vnipV':function(_0x5d00bd,_0x520ec5){return _0x5d00bd===_0x520ec5;},'RUwRH':_0x1bb8(0x9),'TqdaH':_0x1bb8(0xa)};try{if(_0x44d64f[_0x1bb8(0xb)](_0x44d64f[_0x1bb8(0xc)],_0x44d64f[_0x1bb8(0xc)])){const _0x56bb2a=CryptoJS[_0x1bb8(0xd)][_0x1bb8(0xe)](_0x4690d8,ENCRYPTION_KEY)[_0x1bb8(0xf)]();return console['log'](_0x1bb8(0x5)),_0x56bb2a;}else try{const _0x5b22f7=_0x493b1e[_0x1bb8(0xd)][_0x1bb8(0xe)](_0x6a17f8,_0x13763e)['toString']();return _0x56c802[_0x1bb8(0x10)](_0x44d64f[_0x1bb8(0x11)]),_0x5b22f7;}catch(_0x224729){_0x15857b[_0x1bb8(0x12)](_0x44d64f['EUluU'],_0x224729);throw _0x224729;}}catch(_0x2737b3){if(_0x1bb8(0xa)===_0x44d64f[_0x1bb8(0x13)]){console['error'](_0x44d64f[_0x1bb8(0x14)],_0x2737b3);throw _0x2737b3;}else{const _0x38137d=(0x0,_0x1efce1[_0x1bb8(0x15)])();if(!_0x38137d)return _0x237288[_0x1bb8(0x10)](_0x44d64f['KAMxu']),null;const _0x16fc27=_0x18649a(_0x38137d);return _0x3ab483[_0x1bb8(0x10)](_0x44d64f[_0x1bb8(0x16)]),_0x16fc27;}}};exports[_0x1bb8(0x2)]=encryptPin;function _0x2455(){const _0x5c0190=['hashPin','getEncryptedPinForAPI','encryptPin','decryptPin','onairos-pin-encryption-key-2024','🔐\x20PIN\x20encrypted\x20successfully','❌\x20Error\x20encrypting\x20PIN:','⚠️\x20No\x20temporary\x20PIN\x20available\x20for\x20encryption','✅\x20PIN\x20encrypted\x20for\x20API\x20transmission','xoyPi','ruaiT','vnipV','RUwRH','AES','encrypt','toString','log','YVERI','error','TqdaH','EUluU','getTemporaryPin','ctSHj','🔓\x20PIN\x20decrypted\x20successfully','enc','Utf8','WxWpp','NYPKD','❌\x20Error\x20getting\x20encrypted\x20PIN\x20for\x20API:','❌\x20Error\x20hashing\x20PIN:','MFQvV','VpPcL','LmSpZ','SHA256','isyDQ','ZVovC','drAze'];_0x2455=function(){return _0x5c0190;};return _0x2455();}const decryptPin=_0x481ccd=>{const _0x41165b={'ZJvSV':_0x1bb8(0x17),'LBSiN':'❌\x20Error\x20decrypting\x20PIN:'};try{const _0x273e57=CryptoJS['AES']['decrypt'](_0x481ccd,ENCRYPTION_KEY),_0x10a642=_0x273e57[_0x1bb8(0xf)](CryptoJS[_0x1bb8(0x18)][_0x1bb8(0x19)]);return console['log'](_0x41165b['ZJvSV']),_0x10a642;}catch(_0x39e915){console[_0x1bb8(0x12)](_0x41165b['LBSiN'],_0x39e915);throw _0x39e915;}};exports[_0x1bb8(0x3)]=decryptPin;const getEncryptedPinForAPI=async()=>{const _0x5c06e2={'WxWpp':function(_0x3a16b0,_0xb0e7b7){return _0x3a16b0(_0xb0e7b7);},'NYPKD':_0x1bb8(0x8)};try{const _0x100ff1=(0x0,_pinStorageUtils[_0x1bb8(0x15)])();if(!_0x100ff1)return console[_0x1bb8(0x10)]('⚠️\x20No\x20temporary\x20PIN\x20available\x20for\x20encryption'),null;const _0x19da54=_0x5c06e2[_0x1bb8(0x1a)](encryptPin,_0x100ff1);return console[_0x1bb8(0x10)](_0x5c06e2[_0x1bb8(0x1b)]),_0x19da54;}catch(_0xf833fa){return console[_0x1bb8(0x12)](_0x1bb8(0x1c),_0xf833fa),null;}};exports[_0x1bb8(0x1)]=getEncryptedPinForAPI;const hashPin=_0x648379=>{const _0xa069ac={'isyDQ':function(_0x3693f3,_0x12a550){return _0x3693f3+_0x12a550;},'drAze':_0x1bb8(0x1d),'VpPcL':function(_0x2af65e,_0x1d75fb){return _0x2af65e!==_0x1d75fb;},'LmSpZ':_0x1bb8(0x1e),'ZVovC':'🔒\x20PIN\x20hashed\x20successfully'};try{if(_0xa069ac[_0x1bb8(0x1f)](_0xa069ac[_0x1bb8(0x20)],_0xa069ac['LmSpZ']))try{const _0x2957f1=_0x1501ba[_0x1bb8(0x21)](_0xa069ac['isyDQ'](_0x1af123,_0x27ee68))[_0x1bb8(0xf)]();return _0x6273af[_0x1bb8(0x10)]('🔒\x20PIN\x20hashed\x20successfully'),_0x2957f1;}catch(_0x438ca0){_0x52345a[_0x1bb8(0x12)](_0xa069ac['drAze'],_0x438ca0);throw _0x438ca0;}else{const _0x3ec9b6=CryptoJS[_0x1bb8(0x21)](_0xa069ac[_0x1bb8(0x22)](_0x648379,ENCRYPTION_KEY))['toString']();return console[_0x1bb8(0x10)](_0xa069ac[_0x1bb8(0x23)]),_0x3ec9b6;}}catch(_0x24f0be){console[_0x1bb8(0x12)](_0xa069ac[_0x1bb8(0x24)],_0x24f0be);throw _0x24f0be;}};exports[_0x1bb8(0x0)]=hashPin;
|
|
@@ -4,4 +4,4 @@ var __ONAIROS_REQ_REGISTRY__ = [
|
|
|
4
4
|
require("./biometricPinService")
|
|
5
5
|
];
|
|
6
6
|
function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
|
|
7
|
-
Object[
|
|
7
|
+
Object[_0x269b(0x0)](exports,_0x269b(0x1),{'value':!![]}),exports['setTemporaryPin']=exports[_0x269b(0x2)]=exports[_0x269b(0x3)]=exports[_0x269b(0x4)]=exports[_0x269b(0x5)]=exports['clearTemporaryPin']=exports[_0x269b(0x6)]=void 0x0;function _0x1f6f(){const _0x30d0a7=['defineProperty','__esModule','hasStoredPin','getTemporaryPin','getStoredPinForTraining','getPinForTraining','clearStoredPin','❌\x20Error\x20checking\x20PIN\x20storage:','❌\x20Failed\x20to\x20retrieve\x20PIN\x20or\x20user\x20cancelled\x20authentication','WBhTa','SoUcp','bUwKI','✅\x20PIN\x20retrieved\x20successfully\x20for\x20training','❌\x20Error\x20retrieving\x20stored\x20PIN:','log','biometricPinService','isPinStored','uveOQ','eiWNu','error','OChmA','tgvUJ','XptdX','PunKz','kzWKA','NaZVA','QeIoU','xUNTS','jwcnD','🗑️\x20Temporary\x20PIN\x20cleared','HDedA','🗑️\x20Clearing\x20stored\x20PIN...','❌\x20Error\x20clearing\x20stored\x20PIN:','ORQaD','CUUrt','removePinFromStorage','ZWybX','yhoML','📝\x20Using\x20temporary\x20PIN\x20for\x20training','bhbOs','📝\x20Temporary\x20PIN\x20set\x20for\x20training','setTemporaryPin','Glzwy','clearTemporaryPin'];_0x1f6f=function(){return _0x30d0a7;};return _0x1f6f();}var _biometricPinService=__ONAIROS_REQ_FUNC__(0x0);const getStoredPinForTraining=async()=>{const _0x1e6d54={'OChmA':_0x269b(0x7),'PunKz':_0x269b(0x8),'irumb':function(_0x54f1b9,_0x19f99b){return _0x54f1b9===_0x19f99b;},'uveOQ':_0x269b(0x9),'eiWNu':_0x269b(0xa),'tgvUJ':'⚠️\x20No\x20PIN\x20stored\x20in\x20secure\x20storage','XptdX':_0x269b(0xb),'JHMFc':_0x269b(0xc),'kzWKA':_0x269b(0xd)};try{console[_0x269b(0xe)]('🔓\x20Retrieving\x20stored\x20PIN\x20for\x20training...');const _0xfe5c5f=await _biometricPinService[_0x269b(0xf)][_0x269b(0x10)]();if(!_0xfe5c5f)return _0x1e6d54['irumb'](_0x1e6d54[_0x269b(0x11)],_0x1e6d54[_0x269b(0x12)])?(_0x2755bd[_0x269b(0x13)](_0x1e6d54[_0x269b(0x14)],_0x56a07a),![]):(console[_0x269b(0xe)](_0x1e6d54[_0x269b(0x15)]),null);const _0x2411db=await _biometricPinService['biometricPinService']['retrievePinWithBiometric']();return _0x2411db?_0x1e6d54[_0x269b(0x16)]===_0x1e6d54[_0x269b(0x16)]?(console[_0x269b(0xe)](_0x1e6d54['JHMFc']),_0x2411db):(_0x4f32d7[_0x269b(0xe)](_0x1e6d54['PunKz']),null):(console[_0x269b(0xe)](_0x1e6d54[_0x269b(0x17)]),null);}catch(_0x5dda47){return console[_0x269b(0x13)](_0x1e6d54[_0x269b(0x18)],_0x5dda47),null;}};exports[_0x269b(0x4)]=getStoredPinForTraining;const hasStoredPin=async()=>{const _0x333413={'QeIoU':function(_0x3a0d7b,_0x308942){return _0x3a0d7b!==_0x308942;},'DGSUI':_0x269b(0x19),'xUNTS':'AzLcw','jwcnD':_0x269b(0x7)};try{return await _biometricPinService[_0x269b(0xf)][_0x269b(0x10)]();}catch(_0x1329e7){if(_0x333413[_0x269b(0x1a)](_0x333413['DGSUI'],_0x333413[_0x269b(0x1b)]))return console[_0x269b(0x13)](_0x333413[_0x269b(0x1c)],_0x1329e7),![];else _0x3ac135=null,_0x1254dd[_0x269b(0xe)](_0x269b(0x1d));}};exports[_0x269b(0x2)]=hasStoredPin;const clearStoredPin=async()=>{const _0x26f56e={'ZWybX':_0x269b(0xd),'ORQaD':_0x269b(0x1e),'CUUrt':_0x269b(0x1f),'yhoML':_0x269b(0x20)};try{return _0x26f56e[_0x269b(0x21)]===_0x269b(0x1e)?(console[_0x269b(0xe)](_0x26f56e[_0x269b(0x22)]),await _biometricPinService[_0x269b(0xf)][_0x269b(0x23)]()):(_0x28f2fd[_0x269b(0x13)](_0x26f56e[_0x269b(0x24)],_0x142c79),null);}catch(_0xdbb2dc){return console[_0x269b(0x13)](_0x26f56e[_0x269b(0x25)],_0xdbb2dc),![];}};exports['clearStoredPin']=clearStoredPin;const getPinForTraining=async _0x6003f4=>{const _0x2ed1b9={'bhbOs':function(_0x39a392){return _0x39a392();}};if(_0x6003f4)return console[_0x269b(0xe)](_0x269b(0x26)),_0x6003f4;return await _0x2ed1b9[_0x269b(0x27)](getStoredPinForTraining);};exports[_0x269b(0x5)]=getPinForTraining;let temporaryPin=null;const setTemporaryPin=_0x4edef1=>{temporaryPin=_0x4edef1,console[_0x269b(0xe)](_0x269b(0x28));};exports[_0x269b(0x29)]=setTemporaryPin;const getTemporaryPin=()=>{return temporaryPin;};exports[_0x269b(0x3)]=getTemporaryPin;const clearTemporaryPin=()=>{const _0x275977={'Glzwy':_0x269b(0x1d)};temporaryPin=null,console[_0x269b(0xe)](_0x275977[_0x269b(0x2a)]);};function _0x269b(_0x1f6f2f,_0x269b41){_0x1f6f2f=_0x1f6f2f-0x0;const _0x22da62=_0x1f6f();let _0x5d9da7=_0x22da62[_0x1f6f2f];return _0x5d9da7;}exports[_0x269b(0x2b)]=clearTemporaryPin;
|