16

I was looking at changing the device name on my phone and the only instructions I found were to either root the device or use adb.

This got me thinking: is changing the device name restricted because the device name is packed with device specific information?

What, if anything, does the android device name reveal and what value does it have for tracking users/devices?

As requested an example device name: android-8ad48b628850044

1
  • 1
    @peterh i agree the question is too broad. As the name of the device is just a tag the subject of how that can be used doesn't fit this question.
    – Robert
    Commented Feb 3, 2017 at 9:13

1 Answer 1

25

The device name is constructed as follows on first use:

    // setup our unique device name
    if (TextUtils.isEmpty(SystemProperties.get("net.hostname"))) {
        String id = Settings.Secure.getString(context.getContentResolver(),
                Settings.Secure.ANDROID_ID);
        if (id != null && id.length() > 0) {
            String name = new String("android-").concat(id);
            SystemProperties.set("net.hostname", name);
        }
    }

Where ANDROID_ID is a random 64-bit number.

So essentially the device name is unique and does not change during the lifetime of the device. While it does not reveal anything about the device itself, it might be used to track the device.

7
  • 3
    It's not clear from that whether a factory reset would clear the device name. That may be interesting if you treat it as identifying then dispose of the phone.
    – Chris H
    Commented Feb 3, 2017 at 10:57
  • 1
    That often depends on the manufacturer (ROM) and the type of reset used. In general a full reset including the system partition will cause it to be regenerated.
    – Rolf ツ
    Commented Feb 3, 2017 at 11:14
  • System apps can change the ANDROID_ID, such apps already exist in Play Store.
    – molnarm
    Commented Feb 3, 2017 at 12:00
  • 1
    Also it isn't unique to the device, different users on the device will have different ids.
    – Malcolm
    Commented Feb 3, 2017 at 14:59
  • Re "it might be used to track the device": ...but one could also use the MAC address for that, which will not be changed even by a full factory reset of the device. (Although it seems that Google has introduced MAC address randomization to Android with version 6.0, following the lead of iOS.) Commented Feb 3, 2017 at 15:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .