@onairos/react-native 2.0.8 → 2.0.9
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/components/Overlay.js +8 -15
- package/lib/commonjs/components/Overlay.js.map +1 -1
- package/lib/commonjs/utils/secureStorage.js +14 -103
- package/lib/commonjs/utils/secureStorage.js.map +1 -1
- package/lib/module/components/Overlay.js +8 -13
- package/lib/module/components/Overlay.js.map +1 -1
- package/lib/module/utils/secureStorage.js +14 -102
- package/lib/module/utils/secureStorage.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Overlay.tsx +8 -13
- package/src/utils/secureStorage.ts +14 -104
|
@@ -7,13 +7,11 @@ exports.Overlay = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _bottomSheet = require("@gorhom/bottom-sheet");
|
|
10
|
-
var _reactNativeDeviceInfo = _interopRequireDefault(require("react-native-device-info"));
|
|
11
10
|
var _constants = require("../constants");
|
|
12
11
|
var _api = require("../api");
|
|
13
12
|
var _encryption = require("../utils/encryption");
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
14
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } // import DeviceInfo from 'react-native-device-info'; // Comment out device info import
|
|
17
15
|
const Overlay = ({
|
|
18
16
|
data,
|
|
19
17
|
username,
|
|
@@ -50,17 +48,12 @@ const Overlay = ({
|
|
|
50
48
|
};
|
|
51
49
|
const confirmSelection = async () => {
|
|
52
50
|
try {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
default: 'unknown'
|
|
60
|
-
});
|
|
61
|
-
} catch (e) {
|
|
62
|
-
console.warn('Failed to get app identifier:', e);
|
|
63
|
-
}
|
|
51
|
+
// Mock app identifier
|
|
52
|
+
const appId = _reactNative.Platform.select({
|
|
53
|
+
ios: 'com.onairos.mock',
|
|
54
|
+
android: 'com.onairos.mock',
|
|
55
|
+
default: 'unknown'
|
|
56
|
+
});
|
|
64
57
|
const serverPublicKey = await (0, _encryption.getServerPublicKey)();
|
|
65
58
|
const encryptedModelKey = (0, _encryption.encryptModelKey)(serverPublicKey, modelKey);
|
|
66
59
|
const response = await _api.onairosApi.post('getAPIUrlMobile', {
|
|
@@ -81,7 +74,7 @@ const Overlay = ({
|
|
|
81
74
|
closeOverlay();
|
|
82
75
|
}
|
|
83
76
|
} catch (e) {
|
|
84
|
-
console.error('Error
|
|
77
|
+
console.error('Error confirming selection:', e);
|
|
85
78
|
showErrorModal('Failed to confirm selection. Please try again.');
|
|
86
79
|
}
|
|
87
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_bottomSheet","_reactNativeDeviceInfo","_interopRequireDefault","_constants","_api","_encryption","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","Overlay","data","username","modelKey","onResolved","selections","setSelections","useState","details","setDetails","bottomSheetRef","React","useRef","useEffect","initialSelections","keys","forEach","key","getDetails","response","onairosApi","post","Info","AccountInfo","console","error","closeOverlay","_bottomSheetRef$curre","current","dismiss","confirmSelection","appId","Platform","select","ios","DeviceInfo","getBundleId","android","getPackageName","warn","serverPublicKey","getServerPublicKey","encryptedModelKey","encryptModelKey","storage","confirmations","developerURL","EncryptedUserPin","account","proofMode","apiUrl","token","showErrorModal","errorMessage","Alert","alert","text","selectedCount","values","filter","Boolean","createElement","BottomSheetModal","ref","snapPoints","backdropComponent","props","BottomSheetBackdrop","appearsOnIndex","disappearsOnIndex","View","style","styles","container","header","Text","headerTitle","TouchableOpacity","onPress","closeButton","ScrollView","content","entries","map","value","card","checkboxContainer","prev","checkbox","checkboxSelected","cardContent","cardTitle","type","cardDescription","descriptions","reward","cardReward","footer","footerButton","footerButtonText","exports","StyleSheet","create","flex","backgroundColor","COLORS","white","borderTopLeftRadius","borderTopRightRadius","flexDirection","alignItems","justifyContent","padding","primary","fontSize","color","fontWeight","borderRadius","marginBottom","shadowColor","black","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","borderWidth","borderColor","marginRight","gray","success","borderTopWidth","borderTopColor","lightGray","paddingVertical","paddingHorizontal"],"sourceRoot":"..\\..\\..\\src","sources":["components/Overlay.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAA0E,SAAAI,uBAAAI,CAA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AAEV,iBAAM,CAACyB;EAChB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_bottomSheet","_constants","_api","_encryption","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","Overlay","data","username","modelKey","onResolved","selections","setSelections","useState","details","setDetails","bottomSheetRef","React","useRef","useEffect","initialSelections","keys","forEach","key","getDetails","response","onairosApi","post","Info","AccountInfo","console","error","closeOverlay","_bottomSheetRef$curre","current","dismiss","confirmSelection","appId","Platform","select","ios","android","serverPublicKey","getServerPublicKey","encryptedModelKey","encryptModelKey","storage","confirmations","developerURL","EncryptedUserPin","account","proofMode","apiUrl","token","showErrorModal","errorMessage","Alert","alert","text","selectedCount","values","filter","Boolean","createElement","BottomSheetModal","ref","snapPoints","backdropComponent","props","BottomSheetBackdrop","appearsOnIndex","disappearsOnIndex","View","style","styles","container","header","Text","headerTitle","TouchableOpacity","onPress","closeButton","ScrollView","content","entries","map","value","card","checkboxContainer","prev","checkbox","checkboxSelected","cardContent","cardTitle","type","cardDescription","descriptions","reward","cardReward","footer","footerButton","footerButtonText","exports","StyleSheet","create","flex","backgroundColor","COLORS","white","borderTopLeftRadius","borderTopRightRadius","flexDirection","alignItems","justifyContent","padding","primary","fontSize","color","fontWeight","borderRadius","marginBottom","shadowColor","black","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","borderWidth","borderColor","marginRight","gray","success","borderTopWidth","borderTopColor","lightGray","paddingVertical","paddingHorizontal"],"sourceRoot":"..\\..\\..\\src","sources":["components/Overlay.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAA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Q,OAAO;IAC3BgB,WAAW,EAAE;EACf,CAAC;EACDxC,gBAAgB,EAAE;IAChBe,eAAe,EAAEC,iBAAM,CAACQ;EAC1B,CAAC;EACDvB,WAAW,EAAE;IACXa,IAAI,EAAE;EACR,CAAC;EACDZ,SAAS,EAAE;IACTuB,QAAQ,EAAE,EAAE;IACZE,UAAU,EAAE,MAAM;IAClBE,YAAY,EAAE;EAChB,CAAC;EACDzB,eAAe,EAAE;IACfqB,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEV,iBAAM,CAACyB,IAAI;IAClBZ,YAAY,EAAE;EAChB,CAAC;EACDtB,UAAU,EAAE;IACVkB,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEV,iBAAM,CAAC0B,OAAO;IACrBf,UAAU,EAAE;EACd,CAAC;EACDnB,MAAM,EAAE;IACNY,aAAa,EAAE,KAAK;IACpBE,cAAc,EAAE,eAAe;IAC/BD,UAAU,EAAE,QAAQ;IACpBE,OAAO,EAAE,EAAE;IACXoB,cAAc,EAAE,CAAC;IACjBC,cAAc,EAAE5B,iBAAM,CAAC6B;EACzB,CAAC;EACDpC,YAAY,EAAE;IACZqC,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE,EAAE;IACrBnB,YAAY,EAAE,CAAC;IACfb,eAAe,EAAEC,iBAAM,CAACQ;EAC1B,CAAC;EACDd,gBAAgB,EAAE;IAChBgB,KAAK,EAAEV,iBAAM,CAACC,KAAK;IACnBQ,QAAQ,EAAE,EAAE;IACZE,UAAU,EAAE;EACd,CAAC;EACD3D,aAAa,EAAE;IACbyD,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEV,iBAAM,CAACyB;EAChB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,55 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.verifyCredentials = exports.updateCredentials = exports.storeCredentials = exports.hasCredentials = exports.getCredentials = exports.generateDeviceUsername = exports.deleteCredentials = void 0;
|
|
7
|
-
var Keychain = _interopRequireWildcard(require("react-native-keychain"));
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
8
|
var _crypto = require("./crypto");
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
// Temporary in-memory storage
|
|
10
|
+
let mockStorage = {};
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
|
-
* Store credentials
|
|
13
|
+
* Store credentials in memory (temporary solution)
|
|
15
14
|
*/
|
|
16
15
|
const storeCredentials = async (credentials, options = {}) => {
|
|
17
16
|
try {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
biometricPrompt
|
|
21
|
-
} = options;
|
|
22
|
-
|
|
23
|
-
// Create a JSON string of the credentials
|
|
24
|
-
const credentialsString = JSON.stringify(credentials);
|
|
25
|
-
|
|
26
|
-
// Configure security options based on platform
|
|
27
|
-
const securityOptions = {
|
|
28
|
-
service: CREDENTIALS_KEY,
|
|
29
|
-
accessible: Keychain.ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// Add biometric protection if requested
|
|
33
|
-
if (useBiometrics) {
|
|
34
|
-
// iOS specific options
|
|
35
|
-
if (_reactNative.Platform.OS === 'ios') {
|
|
36
|
-
securityOptions.accessControl = Keychain.ACCESS_CONTROL.BIOMETRY_ANY_OR_DEVICE_PASSCODE;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Android specific options
|
|
40
|
-
if (_reactNative.Platform.OS === 'android') {
|
|
41
|
-
securityOptions.accessControl = Keychain.ACCESS_CONTROL.BIOMETRY_ANY;
|
|
42
|
-
if (biometricPrompt) {
|
|
43
|
-
securityOptions.authenticationType = Keychain.AUTHENTICATION_TYPE.BIOMETRIC;
|
|
44
|
-
securityOptions.authenticationPrompt = {
|
|
45
|
-
title: biometricPrompt.title || 'Biometric Authentication',
|
|
46
|
-
subtitle: biometricPrompt.subtitle,
|
|
47
|
-
description: 'Please authenticate to access your Onairos credentials',
|
|
48
|
-
cancel: 'Cancel'
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Store in the secure keychain
|
|
55
|
-
await Keychain.setGenericPassword(credentials.username, credentialsString, securityOptions);
|
|
17
|
+
console.log('[Mock] Storing credentials:', credentials.username);
|
|
18
|
+
mockStorage[credentials.username] = JSON.stringify(credentials);
|
|
56
19
|
return true;
|
|
57
20
|
} catch (error) {
|
|
58
21
|
console.error('Error storing credentials:', error);
|
|
@@ -61,40 +24,17 @@ const storeCredentials = async (credentials, options = {}) => {
|
|
|
61
24
|
};
|
|
62
25
|
|
|
63
26
|
/**
|
|
64
|
-
* Retrieve credentials from
|
|
27
|
+
* Retrieve credentials from memory (temporary solution)
|
|
65
28
|
*/
|
|
66
29
|
exports.storeCredentials = storeCredentials;
|
|
67
30
|
const getCredentials = async (options = {}) => {
|
|
68
31
|
try {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
} = options;
|
|
73
|
-
|
|
74
|
-
// Configure security options
|
|
75
|
-
const securityOptions = {
|
|
76
|
-
service: CREDENTIALS_KEY
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// Add biometric prompt if required
|
|
80
|
-
if (useBiometrics && biometricPrompt) {
|
|
81
|
-
securityOptions.authenticationPrompt = {
|
|
82
|
-
title: biometricPrompt.title || 'Biometric Authentication',
|
|
83
|
-
subtitle: biometricPrompt.subtitle,
|
|
84
|
-
description: 'Please authenticate to access your Onairos credentials',
|
|
85
|
-
cancel: 'Cancel'
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Retrieve from keychain
|
|
90
|
-
const result = await Keychain.getGenericPassword(securityOptions);
|
|
91
|
-
if (!result) {
|
|
32
|
+
// Get the first stored credential (temporary solution)
|
|
33
|
+
const storedCredential = Object.values(mockStorage)[0];
|
|
34
|
+
if (!storedCredential) {
|
|
92
35
|
return null;
|
|
93
36
|
}
|
|
94
|
-
|
|
95
|
-
// Parse the stored JSON
|
|
96
|
-
const credentials = JSON.parse(result.password);
|
|
97
|
-
return credentials;
|
|
37
|
+
return JSON.parse(storedCredential);
|
|
98
38
|
} catch (error) {
|
|
99
39
|
console.error('Error retrieving credentials:', error);
|
|
100
40
|
return null;
|
|
@@ -107,10 +47,7 @@ const getCredentials = async (options = {}) => {
|
|
|
107
47
|
exports.getCredentials = getCredentials;
|
|
108
48
|
const hasCredentials = async () => {
|
|
109
49
|
try {
|
|
110
|
-
|
|
111
|
-
service: CREDENTIALS_KEY
|
|
112
|
-
});
|
|
113
|
-
return !!result;
|
|
50
|
+
return Object.keys(mockStorage).length > 0;
|
|
114
51
|
} catch (error) {
|
|
115
52
|
console.error('Error checking for credentials:', error);
|
|
116
53
|
return false;
|
|
@@ -123,9 +60,7 @@ const hasCredentials = async () => {
|
|
|
123
60
|
exports.hasCredentials = hasCredentials;
|
|
124
61
|
const deleteCredentials = async () => {
|
|
125
62
|
try {
|
|
126
|
-
|
|
127
|
-
service: CREDENTIALS_KEY
|
|
128
|
-
});
|
|
63
|
+
mockStorage = {};
|
|
129
64
|
return true;
|
|
130
65
|
} catch (error) {
|
|
131
66
|
console.error('Error deleting credentials:', error);
|
|
@@ -139,19 +74,14 @@ const deleteCredentials = async () => {
|
|
|
139
74
|
exports.deleteCredentials = deleteCredentials;
|
|
140
75
|
const updateCredentials = async (updates, options = {}) => {
|
|
141
76
|
try {
|
|
142
|
-
// Get current credentials
|
|
143
77
|
const currentCredentials = await getCredentials(options);
|
|
144
78
|
if (!currentCredentials) {
|
|
145
79
|
return false;
|
|
146
80
|
}
|
|
147
|
-
|
|
148
|
-
// Merge updates with current credentials
|
|
149
81
|
const updatedCredentials = {
|
|
150
82
|
...currentCredentials,
|
|
151
83
|
...updates
|
|
152
84
|
};
|
|
153
|
-
|
|
154
|
-
// Store updated credentials
|
|
155
85
|
return await storeCredentials(updatedCredentials, options);
|
|
156
86
|
} catch (error) {
|
|
157
87
|
console.error('Error updating credentials:', error);
|
|
@@ -165,41 +95,22 @@ const updateCredentials = async (updates, options = {}) => {
|
|
|
165
95
|
exports.updateCredentials = updateCredentials;
|
|
166
96
|
const generateDeviceUsername = async () => {
|
|
167
97
|
try {
|
|
168
|
-
// Get a device-specific identifier that we can use
|
|
169
|
-
// This is a simplified example - in production you might want to use
|
|
170
|
-
// a more robust device identifier method
|
|
171
98
|
const deviceInfo = `${_reactNative.Platform.OS}-${_reactNative.Platform.Version}-${Date.now()}`;
|
|
172
|
-
|
|
173
|
-
// Hash it to create a unique identifier
|
|
174
99
|
const username = `onairos_${(0, _crypto.sha256)(deviceInfo).substring(0, 10)}`;
|
|
175
100
|
return username;
|
|
176
101
|
} catch (error) {
|
|
177
102
|
console.error('Error generating device username:', error);
|
|
178
|
-
// Fallback to a timestamp-based username if there's an error
|
|
179
103
|
return `onairos_${Date.now().toString(36)}`;
|
|
180
104
|
}
|
|
181
105
|
};
|
|
182
106
|
|
|
183
107
|
/**
|
|
184
|
-
* Verify
|
|
108
|
+
* Verify credentials (temporary mock implementation)
|
|
185
109
|
*/
|
|
186
110
|
exports.generateDeviceUsername = generateDeviceUsername;
|
|
187
111
|
const verifyCredentials = async credentials => {
|
|
188
112
|
try {
|
|
189
|
-
|
|
190
|
-
if (!credentials || !credentials.accessToken || !credentials.username) {
|
|
191
|
-
return false;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// Check for expiration (example: credentials expire after 30 days)
|
|
195
|
-
const thirtyDaysMs = 30 * 24 * 60 * 60 * 1000;
|
|
196
|
-
const isExpired = Date.now() - credentials.createdAt > thirtyDaysMs;
|
|
197
|
-
if (isExpired) {
|
|
198
|
-
return false;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// Add any additional verification logic here
|
|
202
|
-
|
|
113
|
+
console.log('[Mock] Verifying credentials for:', credentials.username);
|
|
203
114
|
return true;
|
|
204
115
|
} catch (error) {
|
|
205
116
|
console.error('Error verifying credentials:', error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_crypto","mockStorage","storeCredentials","credentials","options","console","log","username","JSON","stringify","error","exports","getCredentials","storedCredential","Object","values","parse","hasCredentials","keys","length","deleteCredentials","updateCredentials","updates","currentCredentials","updatedCredentials","generateDeviceUsername","deviceInfo","Platform","OS","Version","Date","now","sha256","substring","toString","verifyCredentials"],"sourceRoot":"..\\..\\..\\src","sources":["utils/secureStorage.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAwBA;AACA,IAAIE,WAAsC,GAAG,CAAC,CAAC;;AAE/C;AACA;AACA;AACO,MAAMC,gBAAgB,GAAG,MAAAA,CAC9BC,WAA+B,EAC/BC,OAAuB,GAAG,CAAC,CAAC,KACP;EACrB,IAAI;IACFC,OAAO,CAACC,GAAG,CAAC,6BAA6B,EAAEH,WAAW,CAACI,QAAQ,CAAC;IAChEN,WAAW,CAACE,WAAW,CAACI,QAAQ,CAAC,GAAGC,IAAI,CAACC,SAAS,CAACN,WAAW,CAAC;IAC/D,OAAO,IAAI;EACb,CAAC,CAAC,OAAOO,KAAK,EAAE;IACdL,OAAO,CAACK,KAAK,CAAC,4BAA4B,EAAEA,KAAK,CAAC;IAClD,OAAO,KAAK;EACd;AACF,CAAC;;AAED;AACA;AACA;AAFAC,OAAA,CAAAT,gBAAA,GAAAA,gBAAA;AAGO,MAAMU,cAAc,GAAG,MAAAA,CAC5BR,OAAuB,GAAG,CAAC,CAAC,KACW;EACvC,IAAI;IACF;IACA,MAAMS,gBAAgB,GAAGC,MAAM,CAACC,MAAM,CAACd,WAAW,CAAC,CAAC,CAAC,CAAC;IACtD,IAAI,CAACY,gBAAgB,EAAE;MACrB,OAAO,IAAI;IACb;IACA,OAAOL,IAAI,CAACQ,KAAK,CAACH,gBAAgB,CAAC;EACrC,CAAC,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AC;IACnD,OAAO,KAAK;EACd;AACF,CAAC;;AAED;AACA;AACA;AAFAC,OAAA,CAAAU,iBAAA,GAAAA,iBAAA;AAGO,MAAMI,sBAAsB,GAAG,MAAAA,CAAA,KAA6B;EACjE,IAAI;IACF,MAAMC,UAAU,GAAG,GAAGC,qBAAQ,CAACC,EAAE,IAAID,qBAAQ,CAACE,OAAO,IAAIC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAE;IACrE,MAAMxB,QAAQ,GAAG,WAAW,IAAAyB,cAAM,EAACN,UAAU,CAAC,CAACO,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;IACjE,OAAO1B,QAAQ;EACjB,CAAC,CAAC,OAAOG,KAAK,EAAE;IACdL,OAAO,CAACK,KAAK,CAAC,mCAAmC,EAAEA,KAAK,CAAC;IACzD,OAAO,WAAWoB,IAAI,CAACC,GAAG,CAAC,CAAC,CAACG,QAAQ,CAAC,EAAE,CAAC,EAAE;EAC7C;AACF,CAAC;;AAED;AACA;AACA;AAFAvB,OAAA,CAAAc,sBAAA,GAAAA,sBAAA;AAGO,MAAMU,iBAAiB,GAAG,MAC/BhC,WAA+B,IACV;EACrB,IAAI;IACFE,OAAO,CAACC,GAAG,CAAC,mCAAmC,EAAEH,WAAW,CAACI,QAAQ,CAAC;IACtE,OAAO,IAAI;EACb,CAAC,CAAC,OAAOG,KAAK,EAAE;IACdL,OAAO,CAACK,KAAK,CAAC,8BAA8B,EAAEA,KAAK,CAAC;IACpD,OAAO,KAAK;EACd;AACF,CAAC;AAACC,OAAA,CAAAwB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
2
2
|
import React, { useState, useEffect } from 'react';
|
|
3
3
|
import { View, Text, StyleSheet, TouchableOpacity, ScrollView, Alert, Platform } from 'react-native';
|
|
4
4
|
import { BottomSheetModal, BottomSheetBackdrop } from '@gorhom/bottom-sheet';
|
|
5
|
-
import DeviceInfo from 'react-native-device-info';
|
|
5
|
+
// import DeviceInfo from 'react-native-device-info'; // Comment out device info import
|
|
6
6
|
import { COLORS } from '../constants';
|
|
7
7
|
import { onairosApi } from '../api';
|
|
8
8
|
import { encryptModelKey, getServerPublicKey } from '../utils/encryption';
|
|
@@ -42,17 +42,12 @@ export const Overlay = ({
|
|
|
42
42
|
};
|
|
43
43
|
const confirmSelection = async () => {
|
|
44
44
|
try {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
default: 'unknown'
|
|
52
|
-
});
|
|
53
|
-
} catch (e) {
|
|
54
|
-
console.warn('Failed to get app identifier:', e);
|
|
55
|
-
}
|
|
45
|
+
// Mock app identifier
|
|
46
|
+
const appId = Platform.select({
|
|
47
|
+
ios: 'com.onairos.mock',
|
|
48
|
+
android: 'com.onairos.mock',
|
|
49
|
+
default: 'unknown'
|
|
50
|
+
});
|
|
56
51
|
const serverPublicKey = await getServerPublicKey();
|
|
57
52
|
const encryptedModelKey = encryptModelKey(serverPublicKey, modelKey);
|
|
58
53
|
const response = await onairosApi.post('getAPIUrlMobile', {
|
|
@@ -73,7 +68,7 @@ export const Overlay = ({
|
|
|
73
68
|
closeOverlay();
|
|
74
69
|
}
|
|
75
70
|
} catch (e) {
|
|
76
|
-
console.error('Error
|
|
71
|
+
console.error('Error confirming selection:', e);
|
|
77
72
|
showErrorModal('Failed to confirm selection. Please try again.');
|
|
78
73
|
}
|
|
79
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","useEffect","View","Text","StyleSheet","TouchableOpacity","ScrollView","Alert","Platform","BottomSheetModal","BottomSheetBackdrop","
|
|
1
|
+
{"version":3,"names":["React","useState","useEffect","View","Text","StyleSheet","TouchableOpacity","ScrollView","Alert","Platform","BottomSheetModal","BottomSheetBackdrop","COLORS","onairosApi","encryptModelKey","getServerPublicKey","Overlay","data","username","modelKey","onResolved","selections","setSelections","details","setDetails","bottomSheetRef","useRef","initialSelections","Object","keys","forEach","key","getDetails","response","post","Info","AccountInfo","e","console","error","closeOverlay","_bottomSheetRef$curre","current","dismiss","confirmSelection","appId","select","ios","android","default","serverPublicKey","encryptedModelKey","storage","confirmations","developerURL","EncryptedUserPin","account","proofMode","apiUrl","token","showErrorModal","errorMessage","alert","text","selectedCount","values","filter","Boolean","length","createElement","ref","snapPoints","backdropComponent","props","_extends","appearsOnIndex","disappearsOnIndex","style","styles","container","header","headerTitle","onPress","closeButton","content","entries","map","value","card","checkboxContainer","prev","checkbox","checkboxSelected","cardContent","cardTitle","type","cardDescription","descriptions","reward","cardReward","footer","footerButton","footerButtonText","create","flex","backgroundColor","white","borderTopLeftRadius","borderTopRightRadius","flexDirection","alignItems","justifyContent","padding","primary","fontSize","color","fontWeight","borderRadius","marginBottom","shadowColor","black","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","borderWidth","borderColor","marginRight","gray","success","borderTopWidth","borderTopColor","lightGray","paddingVertical","paddingHorizontal"],"sourceRoot":"..\\..\\..\\src","sources":["components/Overlay.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,SACEC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,gBAAgB,EAChBC,UAAU,EACVC,KAAK,EACLC,QAAQ,QACH,cAAc;AACrB,SAASC,gBAAgB,EAAEC,mBAAmB,QAAQ,sBAAsB;AAC5E;AACA,SAASC,MAAM,QAAQ,cAAc;AACrC,SAASC,UAAU,QAAQ,QAAQ;AACnC,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,qBAAqB;AAezE,OAAO,MAAMC,OAA+B,GAAGA,CAAC;EAC9CC,IAAI;EACJC,QAAQ;EACRC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGrB,QAAQ,CAA6B,CAAC,CAAC,CAAC;EA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sH;EAChB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,51 +1,15 @@
|
|
|
1
|
-
import * as Keychain from 'react-native-keychain';
|
|
2
1
|
import { Platform } from 'react-native';
|
|
3
2
|
import { sha256 } from './crypto';
|
|
4
|
-
|
|
3
|
+
// Temporary in-memory storage
|
|
4
|
+
let mockStorage = {};
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Store credentials
|
|
7
|
+
* Store credentials in memory (temporary solution)
|
|
8
8
|
*/
|
|
9
9
|
export const storeCredentials = async (credentials, options = {}) => {
|
|
10
10
|
try {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
biometricPrompt
|
|
14
|
-
} = options;
|
|
15
|
-
|
|
16
|
-
// Create a JSON string of the credentials
|
|
17
|
-
const credentialsString = JSON.stringify(credentials);
|
|
18
|
-
|
|
19
|
-
// Configure security options based on platform
|
|
20
|
-
const securityOptions = {
|
|
21
|
-
service: CREDENTIALS_KEY,
|
|
22
|
-
accessible: Keychain.ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// Add biometric protection if requested
|
|
26
|
-
if (useBiometrics) {
|
|
27
|
-
// iOS specific options
|
|
28
|
-
if (Platform.OS === 'ios') {
|
|
29
|
-
securityOptions.accessControl = Keychain.ACCESS_CONTROL.BIOMETRY_ANY_OR_DEVICE_PASSCODE;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Android specific options
|
|
33
|
-
if (Platform.OS === 'android') {
|
|
34
|
-
securityOptions.accessControl = Keychain.ACCESS_CONTROL.BIOMETRY_ANY;
|
|
35
|
-
if (biometricPrompt) {
|
|
36
|
-
securityOptions.authenticationType = Keychain.AUTHENTICATION_TYPE.BIOMETRIC;
|
|
37
|
-
securityOptions.authenticationPrompt = {
|
|
38
|
-
title: biometricPrompt.title || 'Biometric Authentication',
|
|
39
|
-
subtitle: biometricPrompt.subtitle,
|
|
40
|
-
description: 'Please authenticate to access your Onairos credentials',
|
|
41
|
-
cancel: 'Cancel'
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Store in the secure keychain
|
|
48
|
-
await Keychain.setGenericPassword(credentials.username, credentialsString, securityOptions);
|
|
11
|
+
console.log('[Mock] Storing credentials:', credentials.username);
|
|
12
|
+
mockStorage[credentials.username] = JSON.stringify(credentials);
|
|
49
13
|
return true;
|
|
50
14
|
} catch (error) {
|
|
51
15
|
console.error('Error storing credentials:', error);
|
|
@@ -54,39 +18,16 @@ export const storeCredentials = async (credentials, options = {}) => {
|
|
|
54
18
|
};
|
|
55
19
|
|
|
56
20
|
/**
|
|
57
|
-
* Retrieve credentials from
|
|
21
|
+
* Retrieve credentials from memory (temporary solution)
|
|
58
22
|
*/
|
|
59
23
|
export const getCredentials = async (options = {}) => {
|
|
60
24
|
try {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} = options;
|
|
65
|
-
|
|
66
|
-
// Configure security options
|
|
67
|
-
const securityOptions = {
|
|
68
|
-
service: CREDENTIALS_KEY
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
// Add biometric prompt if required
|
|
72
|
-
if (useBiometrics && biometricPrompt) {
|
|
73
|
-
securityOptions.authenticationPrompt = {
|
|
74
|
-
title: biometricPrompt.title || 'Biometric Authentication',
|
|
75
|
-
subtitle: biometricPrompt.subtitle,
|
|
76
|
-
description: 'Please authenticate to access your Onairos credentials',
|
|
77
|
-
cancel: 'Cancel'
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Retrieve from keychain
|
|
82
|
-
const result = await Keychain.getGenericPassword(securityOptions);
|
|
83
|
-
if (!result) {
|
|
25
|
+
// Get the first stored credential (temporary solution)
|
|
26
|
+
const storedCredential = Object.values(mockStorage)[0];
|
|
27
|
+
if (!storedCredential) {
|
|
84
28
|
return null;
|
|
85
29
|
}
|
|
86
|
-
|
|
87
|
-
// Parse the stored JSON
|
|
88
|
-
const credentials = JSON.parse(result.password);
|
|
89
|
-
return credentials;
|
|
30
|
+
return JSON.parse(storedCredential);
|
|
90
31
|
} catch (error) {
|
|
91
32
|
console.error('Error retrieving credentials:', error);
|
|
92
33
|
return null;
|
|
@@ -98,10 +39,7 @@ export const getCredentials = async (options = {}) => {
|
|
|
98
39
|
*/
|
|
99
40
|
export const hasCredentials = async () => {
|
|
100
41
|
try {
|
|
101
|
-
|
|
102
|
-
service: CREDENTIALS_KEY
|
|
103
|
-
});
|
|
104
|
-
return !!result;
|
|
42
|
+
return Object.keys(mockStorage).length > 0;
|
|
105
43
|
} catch (error) {
|
|
106
44
|
console.error('Error checking for credentials:', error);
|
|
107
45
|
return false;
|
|
@@ -113,9 +51,7 @@ export const hasCredentials = async () => {
|
|
|
113
51
|
*/
|
|
114
52
|
export const deleteCredentials = async () => {
|
|
115
53
|
try {
|
|
116
|
-
|
|
117
|
-
service: CREDENTIALS_KEY
|
|
118
|
-
});
|
|
54
|
+
mockStorage = {};
|
|
119
55
|
return true;
|
|
120
56
|
} catch (error) {
|
|
121
57
|
console.error('Error deleting credentials:', error);
|
|
@@ -128,19 +64,14 @@ export const deleteCredentials = async () => {
|
|
|
128
64
|
*/
|
|
129
65
|
export const updateCredentials = async (updates, options = {}) => {
|
|
130
66
|
try {
|
|
131
|
-
// Get current credentials
|
|
132
67
|
const currentCredentials = await getCredentials(options);
|
|
133
68
|
if (!currentCredentials) {
|
|
134
69
|
return false;
|
|
135
70
|
}
|
|
136
|
-
|
|
137
|
-
// Merge updates with current credentials
|
|
138
71
|
const updatedCredentials = {
|
|
139
72
|
...currentCredentials,
|
|
140
73
|
...updates
|
|
141
74
|
};
|
|
142
|
-
|
|
143
|
-
// Store updated credentials
|
|
144
75
|
return await storeCredentials(updatedCredentials, options);
|
|
145
76
|
} catch (error) {
|
|
146
77
|
console.error('Error updating credentials:', error);
|
|
@@ -153,40 +84,21 @@ export const updateCredentials = async (updates, options = {}) => {
|
|
|
153
84
|
*/
|
|
154
85
|
export const generateDeviceUsername = async () => {
|
|
155
86
|
try {
|
|
156
|
-
// Get a device-specific identifier that we can use
|
|
157
|
-
// This is a simplified example - in production you might want to use
|
|
158
|
-
// a more robust device identifier method
|
|
159
87
|
const deviceInfo = `${Platform.OS}-${Platform.Version}-${Date.now()}`;
|
|
160
|
-
|
|
161
|
-
// Hash it to create a unique identifier
|
|
162
88
|
const username = `onairos_${sha256(deviceInfo).substring(0, 10)}`;
|
|
163
89
|
return username;
|
|
164
90
|
} catch (error) {
|
|
165
91
|
console.error('Error generating device username:', error);
|
|
166
|
-
// Fallback to a timestamp-based username if there's an error
|
|
167
92
|
return `onairos_${Date.now().toString(36)}`;
|
|
168
93
|
}
|
|
169
94
|
};
|
|
170
95
|
|
|
171
96
|
/**
|
|
172
|
-
* Verify
|
|
97
|
+
* Verify credentials (temporary mock implementation)
|
|
173
98
|
*/
|
|
174
99
|
export const verifyCredentials = async credentials => {
|
|
175
100
|
try {
|
|
176
|
-
|
|
177
|
-
if (!credentials || !credentials.accessToken || !credentials.username) {
|
|
178
|
-
return false;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// Check for expiration (example: credentials expire after 30 days)
|
|
182
|
-
const thirtyDaysMs = 30 * 24 * 60 * 60 * 1000;
|
|
183
|
-
const isExpired = Date.now() - credentials.createdAt > thirtyDaysMs;
|
|
184
|
-
if (isExpired) {
|
|
185
|
-
return false;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// Add any additional verification logic here
|
|
189
|
-
|
|
101
|
+
console.log('[Mock] Verifying credentials for:', credentials.username);
|
|
190
102
|
return true;
|
|
191
103
|
} catch (error) {
|
|
192
104
|
console.error('Error verifying credentials:', error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Platform","sha256","mockStorage","storeCredentials","credentials","options","console","log","username","JSON","stringify","error","getCredentials","storedCredential","Object","values","parse","hasCredentials","keys","length","deleteCredentials","updateCredentials","updates","currentCredentials","updatedCredentials","generateDeviceUsername","deviceInfo","OS","Version","Date","now","substring","toString","verifyCredentials"],"sourceRoot":"..\\..\\..\\src","sources":["utils/secureStorage.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,MAAM,QAAQ,UAAU;AAwBjC;AACA,IAAIC,WAAsC,GAAG,CAAC,CAAC;;AAE/C;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAG,MAAAA,CAC9BC,WAA+B,EAC/BC,OAAuB,GAAG,CAAC,CAAC,KACP;EACrB,IAAI;IACFC,OAAO,CAACC,GAAG,CAAC,6BAA6B,EAAEH,WAAW,CAACI,QAAQ,CAAC;IAChEN,WAAW,CAACE,WAAW,CAACI,QAAQ,CAAC,GAAGC,IAAI,CAACC,SAAS,CAACN,WAAW,CAAC;IAC/D,OAAO,IAAI;EACb,CAAC,CAAC,OAAOO,KAAK,EAAE;IACdL,OAAO,CAACK,KAAK,CAAC,4BAA4B,EAAEA,KAAK,CAAC;IAClD,OAAO,KAAK;EACd;AACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAG,MAAAA,CAC5BP,OAAuB,GAAG,CAAC,CAAC,KACW;EACvC,IAAI;IACF;IACA,MAAMQ,gBAAgB,GAAGC,MAAM,CAACC,MAAM,CAACb,WAAW,CAAC,CAAC,CAAC,CAAC;IACtD,IAAI,CAACW,gBAAgB,EAAE;MACrB,OAAO,IAAI;IACb;IACA,OAAOJ,IAAI,CAACO,KAAK,CAACH,gBAAgB,CAAC;EACrC,CAAC,CAAC,OAAOF,KAAK,EAAE;IACdL,OAAO,CAACK,KAAK,CAAC,+BAA+B,EAAEA,KAAK,CAAC;IACrD,OAAO,IAAI;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMM,cAAc,GAAG,MAAAA,CAAA,KAA8B;EAC1D,IAAI;IACF,OAAOH,MAA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CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;IACjE,OAAOvB,QAAQ;EACjB,CAAC,CAAC,OAAOG,KAAK,EAAE;IACdL,OAAO,CAACK,KAAK,CAAC,mCAAmC,EAAEA,KAAK,CAAC;IACzD,OAAO,WAAWkB,IAAI,CAACC,GAAG,CAAC,CAAC,CAACE,QAAQ,CAAC,EAAE,CAAC,EAAE;EAC7C;AACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAG,MAC/B7B,WAA+B,IACV;EACrB,IAAI;IACFE,OAAO,CAACC,GAAG,CAAC,mCAAmC,EAAEH,WAAW,CAACI,QAAQ,CAAC;IACtE,OAAO,IAAI;EACb,CAAC,CAAC,OAAOG,KAAK,EAAE;IACdL,OAAO,CAACK,KAAK,CAAC,8BAA8B,EAAEA,KAAK,CAAC;IACpD,OAAO,KAAK;EACd;AACF,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
Platform,
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
import { BottomSheetModal, BottomSheetBackdrop } from '@gorhom/bottom-sheet';
|
|
12
|
-
import DeviceInfo from 'react-native-device-info';
|
|
12
|
+
// import DeviceInfo from 'react-native-device-info'; // Comment out device info import
|
|
13
13
|
import { COLORS } from '../constants';
|
|
14
14
|
import { onairosApi } from '../api';
|
|
15
15
|
import { encryptModelKey, getServerPublicKey } from '../utils/encryption';
|
|
@@ -66,17 +66,12 @@ export const Overlay: React.FC<OverlayProps> = ({
|
|
|
66
66
|
|
|
67
67
|
const confirmSelection = async () => {
|
|
68
68
|
try {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
default: 'unknown'
|
|
76
|
-
});
|
|
77
|
-
} catch (e) {
|
|
78
|
-
console.warn('Failed to get app identifier:', e);
|
|
79
|
-
}
|
|
69
|
+
// Mock app identifier
|
|
70
|
+
const appId = Platform.select({
|
|
71
|
+
ios: 'com.onairos.mock',
|
|
72
|
+
android: 'com.onairos.mock',
|
|
73
|
+
default: 'unknown'
|
|
74
|
+
});
|
|
80
75
|
|
|
81
76
|
const serverPublicKey = await getServerPublicKey();
|
|
82
77
|
const encryptedModelKey = encryptModelKey(serverPublicKey, modelKey);
|
|
@@ -98,7 +93,7 @@ export const Overlay: React.FC<OverlayProps> = ({
|
|
|
98
93
|
closeOverlay();
|
|
99
94
|
}
|
|
100
95
|
} catch (e) {
|
|
101
|
-
console.error('Error
|
|
96
|
+
console.error('Error confirming selection:', e);
|
|
102
97
|
showErrorModal('Failed to confirm selection. Please try again.');
|
|
103
98
|
}
|
|
104
99
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as Keychain from 'react-native-keychain';
|
|
2
1
|
import { Platform } from 'react-native';
|
|
3
2
|
import { sha256 } from './crypto';
|
|
4
3
|
|
|
@@ -24,56 +23,19 @@ export interface StorageOptions {
|
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
// Temporary in-memory storage
|
|
27
|
+
let mockStorage: { [key: string]: string } = {};
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Store credentials
|
|
30
|
+
* Store credentials in memory (temporary solution)
|
|
31
31
|
*/
|
|
32
32
|
export const storeCredentials = async (
|
|
33
33
|
credentials: OnairosCredentials,
|
|
34
34
|
options: StorageOptions = {}
|
|
35
35
|
): Promise<boolean> => {
|
|
36
36
|
try {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// Create a JSON string of the credentials
|
|
40
|
-
const credentialsString = JSON.stringify(credentials);
|
|
41
|
-
|
|
42
|
-
// Configure security options based on platform
|
|
43
|
-
const securityOptions: Keychain.Options = {
|
|
44
|
-
service: CREDENTIALS_KEY,
|
|
45
|
-
accessible: Keychain.ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// Add biometric protection if requested
|
|
49
|
-
if (useBiometrics) {
|
|
50
|
-
// iOS specific options
|
|
51
|
-
if (Platform.OS === 'ios') {
|
|
52
|
-
securityOptions.accessControl = Keychain.ACCESS_CONTROL.BIOMETRY_ANY_OR_DEVICE_PASSCODE;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Android specific options
|
|
56
|
-
if (Platform.OS === 'android') {
|
|
57
|
-
securityOptions.accessControl = Keychain.ACCESS_CONTROL.BIOMETRY_ANY;
|
|
58
|
-
if (biometricPrompt) {
|
|
59
|
-
securityOptions.authenticationType = Keychain.AUTHENTICATION_TYPE.BIOMETRIC;
|
|
60
|
-
securityOptions.authenticationPrompt = {
|
|
61
|
-
title: biometricPrompt.title || 'Biometric Authentication',
|
|
62
|
-
subtitle: biometricPrompt.subtitle,
|
|
63
|
-
description: 'Please authenticate to access your Onairos credentials',
|
|
64
|
-
cancel: 'Cancel',
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Store in the secure keychain
|
|
71
|
-
await Keychain.setGenericPassword(
|
|
72
|
-
credentials.username,
|
|
73
|
-
credentialsString,
|
|
74
|
-
securityOptions
|
|
75
|
-
);
|
|
76
|
-
|
|
37
|
+
console.log('[Mock] Storing credentials:', credentials.username);
|
|
38
|
+
mockStorage[credentials.username] = JSON.stringify(credentials);
|
|
77
39
|
return true;
|
|
78
40
|
} catch (error) {
|
|
79
41
|
console.error('Error storing credentials:', error);
|
|
@@ -82,39 +44,18 @@ export const storeCredentials = async (
|
|
|
82
44
|
};
|
|
83
45
|
|
|
84
46
|
/**
|
|
85
|
-
* Retrieve credentials from
|
|
47
|
+
* Retrieve credentials from memory (temporary solution)
|
|
86
48
|
*/
|
|
87
49
|
export const getCredentials = async (
|
|
88
50
|
options: StorageOptions = {}
|
|
89
51
|
): Promise<OnairosCredentials | null> => {
|
|
90
52
|
try {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const securityOptions: Keychain.Options = {
|
|
95
|
-
service: CREDENTIALS_KEY,
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// Add biometric prompt if required
|
|
99
|
-
if (useBiometrics && biometricPrompt) {
|
|
100
|
-
securityOptions.authenticationPrompt = {
|
|
101
|
-
title: biometricPrompt.title || 'Biometric Authentication',
|
|
102
|
-
subtitle: biometricPrompt.subtitle,
|
|
103
|
-
description: 'Please authenticate to access your Onairos credentials',
|
|
104
|
-
cancel: 'Cancel',
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Retrieve from keychain
|
|
109
|
-
const result = await Keychain.getGenericPassword(securityOptions);
|
|
110
|
-
|
|
111
|
-
if (!result) {
|
|
53
|
+
// Get the first stored credential (temporary solution)
|
|
54
|
+
const storedCredential = Object.values(mockStorage)[0];
|
|
55
|
+
if (!storedCredential) {
|
|
112
56
|
return null;
|
|
113
57
|
}
|
|
114
|
-
|
|
115
|
-
// Parse the stored JSON
|
|
116
|
-
const credentials: OnairosCredentials = JSON.parse(result.password);
|
|
117
|
-
return credentials;
|
|
58
|
+
return JSON.parse(storedCredential);
|
|
118
59
|
} catch (error) {
|
|
119
60
|
console.error('Error retrieving credentials:', error);
|
|
120
61
|
return null;
|
|
@@ -126,11 +67,7 @@ export const getCredentials = async (
|
|
|
126
67
|
*/
|
|
127
68
|
export const hasCredentials = async (): Promise<boolean> => {
|
|
128
69
|
try {
|
|
129
|
-
|
|
130
|
-
service: CREDENTIALS_KEY,
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
return !!result;
|
|
70
|
+
return Object.keys(mockStorage).length > 0;
|
|
134
71
|
} catch (error) {
|
|
135
72
|
console.error('Error checking for credentials:', error);
|
|
136
73
|
return false;
|
|
@@ -142,7 +79,7 @@ export const hasCredentials = async (): Promise<boolean> => {
|
|
|
142
79
|
*/
|
|
143
80
|
export const deleteCredentials = async (): Promise<boolean> => {
|
|
144
81
|
try {
|
|
145
|
-
|
|
82
|
+
mockStorage = {};
|
|
146
83
|
return true;
|
|
147
84
|
} catch (error) {
|
|
148
85
|
console.error('Error deleting credentials:', error);
|
|
@@ -158,20 +95,14 @@ export const updateCredentials = async (
|
|
|
158
95
|
options: StorageOptions = {}
|
|
159
96
|
): Promise<boolean> => {
|
|
160
97
|
try {
|
|
161
|
-
// Get current credentials
|
|
162
98
|
const currentCredentials = await getCredentials(options);
|
|
163
|
-
|
|
164
99
|
if (!currentCredentials) {
|
|
165
100
|
return false;
|
|
166
101
|
}
|
|
167
|
-
|
|
168
|
-
// Merge updates with current credentials
|
|
169
102
|
const updatedCredentials: OnairosCredentials = {
|
|
170
103
|
...currentCredentials,
|
|
171
104
|
...updates,
|
|
172
105
|
};
|
|
173
|
-
|
|
174
|
-
// Store updated credentials
|
|
175
106
|
return await storeCredentials(updatedCredentials, options);
|
|
176
107
|
} catch (error) {
|
|
177
108
|
console.error('Error updating credentials:', error);
|
|
@@ -184,44 +115,23 @@ export const updateCredentials = async (
|
|
|
184
115
|
*/
|
|
185
116
|
export const generateDeviceUsername = async (): Promise<string> => {
|
|
186
117
|
try {
|
|
187
|
-
// Get a device-specific identifier that we can use
|
|
188
|
-
// This is a simplified example - in production you might want to use
|
|
189
|
-
// a more robust device identifier method
|
|
190
118
|
const deviceInfo = `${Platform.OS}-${Platform.Version}-${Date.now()}`;
|
|
191
|
-
|
|
192
|
-
// Hash it to create a unique identifier
|
|
193
119
|
const username = `onairos_${sha256(deviceInfo).substring(0, 10)}`;
|
|
194
|
-
|
|
195
120
|
return username;
|
|
196
121
|
} catch (error) {
|
|
197
122
|
console.error('Error generating device username:', error);
|
|
198
|
-
// Fallback to a timestamp-based username if there's an error
|
|
199
123
|
return `onairos_${Date.now().toString(36)}`;
|
|
200
124
|
}
|
|
201
125
|
};
|
|
202
126
|
|
|
203
127
|
/**
|
|
204
|
-
* Verify
|
|
128
|
+
* Verify credentials (temporary mock implementation)
|
|
205
129
|
*/
|
|
206
130
|
export const verifyCredentials = async (
|
|
207
131
|
credentials: OnairosCredentials
|
|
208
132
|
): Promise<boolean> => {
|
|
209
133
|
try {
|
|
210
|
-
|
|
211
|
-
if (!credentials || !credentials.accessToken || !credentials.username) {
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// Check for expiration (example: credentials expire after 30 days)
|
|
216
|
-
const thirtyDaysMs = 30 * 24 * 60 * 60 * 1000;
|
|
217
|
-
const isExpired = Date.now() - credentials.createdAt > thirtyDaysMs;
|
|
218
|
-
|
|
219
|
-
if (isExpired) {
|
|
220
|
-
return false;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// Add any additional verification logic here
|
|
224
|
-
|
|
134
|
+
console.log('[Mock] Verifying credentials for:', credentials.username);
|
|
225
135
|
return true;
|
|
226
136
|
} catch (error) {
|
|
227
137
|
console.error('Error verifying credentials:', error);
|