opentrace-community / opentrace-android

OpenTrace Android app. Reference implementation of the BlueTrace protocol.
https://bluetrace.io
GNU General Public License v3.0
577 stars 225 forks source link

Decrypt msg to uid #50

Open sudoharish opened 4 years ago

sudoharish commented 4 years ago

We have shared a reference implementation for processUploadedData, you can find the logic to decrypt exchanged messages to uid here:

https://github.com/opentrace-community/opentrace-cloud-functions/blob/master/functions/src/opentrace/processUploadedData.ts#L104

not able to understand how to use logic how to get uid or mobile no. from street past record>msg, or how to decrypt encrypted msg

Sure. There's a file called CustomEncrypter.ts with a decryptTempID, you can find more decryptions. you can look there and i'm sure you are going to find a solution

Originally posted by @ie76 in https://github.com/opentrace-community/opentrace-android/issues/13#issuecomment-620570456

how to call that and put msg argument, do i need to do it from command line from cloud function directory in my local machine or from the firebase test section

Originally posted by @sudoharish in https://github.com/opentrace-community/opentrace-cloud-functions/issues/36#issuecomment-630411761

alexissinglaire commented 4 years ago

@sudoharish : hi, what are you trying to do here? did you encountered error when operating the app? or you want to do some enhancement in the app ?

sudoharish commented 4 years ago

How to trace the mobile no. , I m successful ly able to se .json file in cloud storage, in other bucket getting error file not street pass record, on checking logs of uploaded data function.

alexissinglaire commented 4 years ago

@sudoharish : you can put this code at the beginning of getUploadToken routine , before the await . refer to this link for properties and method that available for admin.auth() .userRecord.

admin.auth().getUser(uid) .then(function(userRecord) { // See the UserRecord reference doc for the contents of userRecord.

console.log('Phone number value =', userRecord.phoneNumber);

}) .catch(function(error) { console.log('Error fetching user data:', error); });

https://firebase.google.com/docs/reference/admin/node/admin.auth.UserRecord

supernovahimura commented 4 years ago

Hello, how do i know that "uid" does my record belong inside the .json file? To later communicate with the user. Selección_001edit