# HWID (Hardware ID)

### Format

HWID — a SHA-256 hash hex string derived from the device’s hardware characteristics with a salt `incy_hwid_`.

### Generation by platform

#### Android

**Components** (combined using `|`):

| Component    | Source                       |
| ------------ | ---------------------------- |
| Android ID   | `Settings.Secure.ANDROID_ID` |
| Manufacturer | `Build.MANUFACTURER`         |
| Model        | `Build.MODEL`                |
| Brand        | `Build.BRAND`                |
| Device       | `Build.DEVICE`               |
| Product      | `Build.PRODUCT`              |
| Board        | `Build.BOARD`                |
| Hardware     | `Build.HARDWARE`             |

**Algorithm:**

```
deviceId = SHA256("androidId|manufacturer|model|brand|device|product|board|hardware")
hwid = SHA256("incy_hwid_" + deviceId)
```

**Result:** 64 characters (hex) **Storage:** EncryptedSharedPreferences (persisted across reinstalls)

#### Desktop (Linux)

**Components** (combined using `|`):

| Component    | Source                                |
| ------------ | ------------------------------------- |
| Machine ID   | `/etc/machine-id`                     |
| Hostname     | `InetAddress.getLocalHost().hostName` |
| OS           | `System.getProperty("os.name")`       |
| Architecture | `System.getProperty("os.arch")`       |
| User         | `System.getProperty("user.name")`     |

#### Desktop (Windows)

**Components** (combined using `|`):

| Component    | Source                                             |
| ------------ | -------------------------------------------------- |
| Machine GUID | `HKLM\SOFTWARE\Microsoft\Cryptography\MachineGuid` |
| Hostname     | `InetAddress.getLocalHost().hostName`              |
| OS           | `System.getProperty("os.name")`                    |
| Architecture | `System.getProperty("os.arch")`                    |
| User         | `System.getProperty("user.name")`                  |

**Algorithm (Linux/Windows):**

```
deviceId = SHA256("machineId|hostname|os|arch|user")
hwid = SHA256("incy_hwid_" + deviceId)
```

**Result:** 64 characters (hex) **Storage:** file `{configDir}/device_id`

#### iOS

**Components:**

| Component   | Source                                 |
| ----------- | -------------------------------------- |
| Vendor ID   | `UIDevice.current.identifierForVendor` |
| Device name | Device model                           |

**Algorithm:**

```
raw = "{vendorID}-{deviceName}"
deviceId = first 16 characters of the hex representation
```

**Result:** 16 characters (hex) **Storage:** Keychain (persists even when the app is deleted)

> iOS uses a shortened format (16 characters) unlike Android/Desktop (64 characters).

### Usage

#### HTTP request headers

When HWID sending is enabled, the app adds headers to subscription requests:

```http
x-hwid: <hwid>
x-device-os: <platform>
x-ver-os: <os_version>
x-device-model: <model>
```

#### Premium API — device limit check

When requesting the provider configuration, the client sends the HWID hash:

```http
GET /api/subscription/config?h=<domainHash>&hwid=<sha256(hwid)>
```

The server uses `hwidHash` to check whether the device is registered with this provider and decide whether to grant premium status within the device limit.

#### Field `hwidHash` in registration

When registering a device in Firestore, in addition to the raw `hwid` the field is written `hwidHash = SHA256(hwid)`. This allows the server to find the device by hash without knowing the original identifier.

#### Forced sending

The provider can enable forced HWID sending via the Premium API:

```json
{
    "settings": {
        "alwaysHwidEnable": true
    }
}
```

In this case, the user cannot disable HWID sending for this subscription.

### Short HWID

The first 8 characters of the HWID are used for display in the UI.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://incy.gitbook.io/docs/docs-en/developer-documentation/hwid-hardware-id.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
