Coder Social home page Coder Social logo

After that an user upload the data , how to retrieve the uid or phone number of the user who upload and uid or phone number of other users who is in upload data of this user . about opentrace-android HOT 11 CLOSED

opentrace-community avatar opentrace-community commented on August 11, 2024
After that an user upload the data , how to retrieve the uid or phone number of the user who upload and uid or phone number of other users who is in upload data of this user .

from opentrace-android.

Comments (11)

russellmoya avatar russellmoya commented on August 11, 2024 1

thanks

from opentrace-android.

esQmo avatar esQmo commented on August 11, 2024

Can you please use a valid title and explain your issue in the "description" section?

from opentrace-android.

russellmoya avatar russellmoya commented on August 11, 2024

ok

from opentrace-android.

russellmoya avatar russellmoya commented on August 11, 2024

how to know the phone number or the uid of the users in this data uploaded

from opentrace-android.

esQmo avatar esQmo commented on August 11, 2024

How did you manage to get the upload PIN? @russellmoya

from opentrace-android.

rinekri avatar rinekri commented on August 11, 2024

@russellmoya you can download uploaded file by ObjectMetadata and decode msg (where contains encoded contacted user id) from the records list and token (where contains encoded user id who uploaded data). But your token is empty and it seems you are avoided getToken process.

from opentrace-android.

russellmoya avatar russellmoya commented on August 11, 2024

Thanks a lot @rinekri for answer me.
i remove the token , but in the original code , i have the token . @rinekri .
i have Encryption secret key , that i store in google cloud secret manager .
but i want know how to decode msg and token

@russellmoya you can download uploaded file by ObjectMetadata and decode msg (where contains encoded contacted user id) from the records list and token (where contains encoded user id who uploaded data). But your token is empty and it seems you are avoided getToken process.

from opentrace-android.

rinekri avatar rinekri commented on August 11, 2024

@russellmoya you can use decryptTempID and validateToken functions to do this. You can find them in the existing files: first / second. For encryptionKey parameter use await getEncryptionKey()

from opentrace-android.

russellmoya avatar russellmoya commented on August 11, 2024

How did you manage to get the upload PIN? @russellmoya

i modify getUploadToken.ts file .
in the getUploadToken.ts , i change if (data) code .
the new code :

if (data) {
//const uploadCodes = await retrieveUploadCodes();
const uploadCodes = uid.substring(0, 6).toUpperCase();
console.log('getUploadToken:', obtained ${uploadCodes.length} upload codes);
console.log("voici le code de retrive",uploadCodes);

if(uploadCodes.length >0){
    if(uploadCodes === data.toUpperCase()){
      valid = true ;
    } else {
        valid = false ;
    }
}

// valid = uploadCodes.find(x => x === data) !== undefined;
console.log('getUploadToken:', data is ${valid ? 'valid' : 'not valid'} code);
}

from opentrace-android.

russellmoya avatar russellmoya commented on August 11, 2024

@russellmoya you can use decryptTempID and validateToken functions to do this. You can find them in the existing files: first / second. For encryptionKey parameter use await getEncryptionKey()

for msg i use descyptTempID and for token i use validateToken ? ... @rinekri

from opentrace-android.

rinekri avatar rinekri commented on August 11, 2024

@rinekri yeah. This is an example how you can download uploaded data to decrypt it:

async function getCurrentUploadedData(event: ObjectMetadata): Promise<UploadedData> {
  return admin.storage().bucket(event.bucket).file(event.name!).download().then(file => {
    const uploadedData = JSON.parse(file[0].toString())
    console.log('getUploadedData:', `Uploaded data token: ${uploadedData.token}`);
    return uploadedData
  }).catch(function (error) {
    console.log("getUploadedData", error);
    return null
  })
}

interface UploadedData {
  records: Record[];
  token: string
}

interface Record {
  id: string,
  msg: string,
  timestamp: string
}

from opentrace-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.