bluetoothwifi-directgoogle-nearby

How does nearby share know some user information before making a connection?


So I was messing around with the nearby share feature that google launched last year and I noticed that if you connect your Gmail and have a profile picture , when you try the nearby share feature the other person can see your profile picture. How is this possible if you haven't made a connection between you and the other person yet? Does google save the MAC address of the user and then pulls it off a server or something? I'm pretty confused. I found this post (How is Google's nearby share implemented? ) that is broadly talking about the implementation but only thing mentioned is that they tried to bring more of an identity to this feature. So how does the contact info show without connecting? Is it that when someone is on your contact list google has just saved their device name or MAC address and that's how it knows what profile pic and Gmail to use/show on the nearby devices?


Solution

  • Each device generates a certificate (containing the device's name, photo, etc) and uploads them to a Google server. The device then uploads a list of contacts who are allowed to download that certificate.

    Devices periodically download certificates they have access to. Other than the start/end timestamp, the data in the certificate is encrypted. You need to see the decryption key over Bluetooth in order to parse the certificate, after which you can now attach a name to the Bluetooth advertisement you just saw.