mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-03 12:06:21 +01:00
cacheFolderPath
This commit is contained in:
parent
2294c851cb
commit
abf2ea148f
3 changed files with 7 additions and 7 deletions
|
@ -236,12 +236,12 @@ export class AppStorage {
|
|||
* Database file is deterministically derived from encryption key.
|
||||
*/
|
||||
async getRealm() {
|
||||
const tempFolderPath = RNFS.TemporaryDirectoryPath; // Path to temporary folder
|
||||
const cacheFolderPath = RNFS.CachesDirectoryPath; // Path to cache folder
|
||||
const password = this.hashIt(this.cachedPassword || 'fyegjitkyf[eqjnc.lf');
|
||||
const buf = Buffer.from(this.hashIt(password) + this.hashIt(password), 'hex');
|
||||
const encryptionKey = Int8Array.from(buf);
|
||||
const fileName = this.hashIt(this.hashIt(password)) + '-wallettransactions.realm';
|
||||
const path = `${tempFolderPath}/${fileName}`; // Use temporary folder path
|
||||
const path = `${cacheFolderPath}/${fileName}`; // Use cache folder path
|
||||
|
||||
const schema = [
|
||||
{
|
||||
|
@ -270,7 +270,7 @@ export class AppStorage {
|
|||
* @returns {Promise<Realm>}
|
||||
*/
|
||||
async openRealmKeyValue(): Promise<Realm> {
|
||||
const tempFolderPath = RNFS.TemporaryDirectoryPath; // Path to temporary folder
|
||||
const cacheFolderPath = RNFS.CachesDirectoryPath; // Path to cache folder
|
||||
const service = 'realm_encryption_key';
|
||||
let password;
|
||||
const credentials = await Keychain.getGenericPassword({ service });
|
||||
|
@ -284,7 +284,7 @@ export class AppStorage {
|
|||
|
||||
const buf = Buffer.from(password, 'hex');
|
||||
const encryptionKey = Int8Array.from(buf);
|
||||
const path = `${tempFolderPath}/keyvalue.realm`; // Use temporary folder path
|
||||
const path = `${cacheFolderPath}/keyvalue.realm`; // Use cache folder path
|
||||
|
||||
const schema = [
|
||||
{
|
||||
|
|
|
@ -109,11 +109,11 @@ let _realm: Realm | undefined;
|
|||
async function _getRealm() {
|
||||
if (_realm) return _realm;
|
||||
|
||||
const tempFolderPath = RNFS.CachesDirectoryPath; // Path to temporary folder
|
||||
const cacheFolderPath = RNFS.CachesDirectoryPath; // Path to cache folder
|
||||
const password = bitcoin.crypto.sha256(Buffer.from('fyegjitkyf[eqjnc.lf')).toString('hex');
|
||||
const buf = Buffer.from(password + password, 'hex');
|
||||
const encryptionKey = Int8Array.from(buf);
|
||||
const path = `${tempFolderPath}/electrumcache.realm`; // Use temporary folder path
|
||||
const path = `${cacheFolderPath}/electrumcache.realm`; // Use cache folder path
|
||||
|
||||
const schema = [
|
||||
{
|
||||
|
|
|
@ -227,7 +227,7 @@ export const WalletCarouselItem = ({ item, _, onPress, handleLongPress, isSelect
|
|||
<Text
|
||||
numberOfLines={1}
|
||||
key={balance} // force component recreation on balance change. To fix right-to-left languages, like Farsi
|
||||
ellipsizeMode='middle'
|
||||
ellipsizeMode="middle"
|
||||
style={[iStyles.balance, { color: colors.inverseForegroundColor }]}
|
||||
>
|
||||
{`${balance} `}
|
||||
|
|
Loading…
Add table
Reference in a new issue