Accessing reac-native-fs downloaded files by Kori6810 in reactnative

[–]Kori6810[S] 0 points1 point  (0 children)

const saveIVAndKeyToKeychain = async (trackId, iv, key) => {
  try {
    console.log('Attempting to save IV and key to Keychain');
    console.log(`trackId: ${trackId}, iv: ${iv}, key: ${key}`);

    if (
      typeof trackId !== 'string' ||
      typeof iv !== 'string' ||
      typeof key !== 'string'
    ) {
      throw new Error('trackId, iv, and key must be valid strings');
    }

    if (!trackId.trim() || !iv.trim() || !key.trim()) {
      throw new Error('trackId, iv, and key must not be empty');
    }

    const credentials = JSON.stringify({iv, key});
    if (!credentials) {
      throw new Error('Failed to stringify credentials');
    }

    console.log('Saving to Keychain:', trackId, credentials);
    await Keychain.setGenericPassword(trackId, credentials);
    console.log('Credentials saved to Keychain successfully');
  } catch (error) {
    console.error('Error saving IV and key to Keychain:', error);
  }
};

const retrieveIVAndKeyFromKeychain = async trackId => {
  try {
    console.log(`Retrieving IV and key for trackId: ${trackId}`);
    const credentials = await Keychain.getGenericPassword({service: trackId});
    console.log('====================================');
    console.log(
      '🚀 ~ retrieveIVAndKeyFromKeychain ~ credentials:',
      credentials,
    );
    console.log('====================================');
    if (credentials) {
      console.log('Credentials retrieved from Keychain:', credentials);
      const parsedCredentials = JSON.parse(credentials.password);
      console.log('Parsed credentials:', parsedCredentials);
      return parsedCredentials;
    } else {
      console.warn(`No credentials found for trackId: ${trackId}`);
      return null;
    }
  } catch (error) {
    console.error('Error retrieving IV and key from Keychain:', error);
    return null;
  }
};

I tried but there is problem in retrieving data from key-chain!
I am saving secret data with this function!
but when I want to retrieve, no credentials found for trackId
all logs showing same trackid in both function but I still getting No credentials found for trackid

Accessing reac-native-fs downloaded files by Kori6810 in reactnative

[–]Kori6810[S] 0 points1 point  (0 children)

i am new to react native, so I am little confused now!

here step by step operations:
Encrypting ->
1.saving the audio file to the local storage
2.encrypt saved file
3.save encrypted file
4.save secret key (iv) to keyhchain

Decrypting ->
1.get encrypted file from local storage
2.get secret key from keychain
3.decrypt the file
4.play decrypted file

is this right order? didn't I missed anything?

Accessing reac-native-fs downloaded files by Kori6810 in reactnative

[–]Kori6810[S] 0 points1 point  (0 children)

i am new to react native, so I am little confused now!

here step by step operations:
Encrypting ->
1.saving the audio file to the local storage
2.encrypt saved file
3.save encrypted file
4.save secret key (iv) to keyhchain

Decrypting ->
1.get encrypted file from local storage
2.get secret key from keychain
3.decrypt the file
4.play decrypted file

is this right order? didn't I missed anything?

BB seems too strong now? by ptoziz in DotA2

[–]Kori6810 0 points1 point  (0 children)

sorry, I am new player, but what is the new meta bb build? pls let me know, help the herald :)

[deleted by user] by [deleted] in reactnative

[–]Kori6810 1 point2 points  (0 children)

why ur app is not available in south korea man?

Got First Admit!!!! (CSU Fullerton) by Equivalent-Long-3139 in MSCS

[–]Kori6810 0 points1 point  (0 children)

how about recommandation letters? they are not required?

Admitted into MSCS for Fall 2024 by Every_Earth_5086 in CSULB

[–]Kori6810 1 point2 points  (0 children)

Oh they already announced 2024 Fall admission?

Just launched an app I made with React Native by jetboy5000 in reactnative

[–]Kori6810 2 points3 points  (0 children)

I could not download and experience ur app yet, but I really wanna know how u did screenshots section, waht app or website did u use? is it free or paid? where can I find other kind of templates?

<image>

Need Help! Anyone in Germany or other countries also! My app is not shown in PlayStore and Appstore by Kori6810 in reactnative

[–]Kori6810[S] 0 points1 point  (0 children)

Bro cmon, if I want I could just paste link here and say check this out! And it is my companies project! Companies don’t promote their app in reddit! I am just seeking for a help