# saya147/-alls-hx2-tpm-bitlocker-restore- architecture

> Architecture diagram of the GitHub repository saya147/-alls-hx2-tpm-bitlocker-restore-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saya147/-alls-hx2-tpm-bitlocker-restore-
- Repository: https://github.com/saya147/-alls-hx2-tpm-bitlocker-restore-
- Video tour (about a minute): https://gitdiagram.com/saya147/-alls-hx2-tpm-bitlocker-restore-/video

## Overview

This repository is a field-maintenance guide and script set for recovering an Alls HX2 GS1 system from repeated BitLocker recovery prompts after a TPM mismatch. The documented workflow unlocks and edits the disk offline, boots to a desktop, obtains an UpdateUser PowerShell session, disables UWF, rebinds the TPM, then restores the original shell and UWF. The graph follows README-described actions; no source excerpts were available, so script internals beyond those descriptions are not inferred.

Main entry points: [`RunPowerShellAsUpdateUser.bat`](https://github.com/saya147/-alls-hx2-tpm-bitlocker-restore-/blob/main/RunPowerShellAsUpdateUser.bat) (UpdateUser Launcher), [`RestoreShellAndEnableUWF.ps1`](https://github.com/saya147/-alls-hx2-tpm-bitlocker-restore-/blob/main/RestoreShellAndEnableUWF.ps1) (Shell And UWF Restore), [`unlockN.ps1`](https://github.com/saya147/-alls-hx2-tpm-bitlocker-restore-/blob/main/unlockN.ps1) (N: Drive Unlock), [`注册表修改器.exe`](https://github.com/saya147/-alls-hx2-tpm-bitlocker-restore-/blob/main/%E6%B3%A8%E5%86%8C%E8%A1%A8%E4%BF%AE%E6%94%B9%E5%99%A8.exe) (Registry Editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_offline["Offline Recovery"]
  node_gs1disk[("GS1 System Disk")]
  node_bitlocker["BitLocker Recovery"]
  node_registrytool["Registry Editor<br/>[注册表修改器.exe]"]
  node_offlinehives[("Offline Registry Hives")]
  node_bootsettings[("Boot Shell Settings")]
  node_keyboardfilter[("Keyboard Filter")]
  node_windowsboot["Windows Boot"]
end

subgraph group_session["Maintenance Session"]
  node_appuser["AppUser Desktop"]
  node_launchscript["UpdateUser Launcher"]
  node_credentials["UpdateUser Password File"]
  node_updateuser["UpdateUser PowerShell"]
end

subgraph group_repair["TPM Repair"]
  node_uwf["UWF Filter"]
  node_bitlockerdrive[("C: BitLocker Volume")]
  node_tpm["Machine TPM"]
  node_restart["System Restart"]
end

subgraph group_restore["System Restore"]
  node_restore["Shell And UWF Restore"]
  node_segaboot["SEGA Boot Shell"]
  node_unlockn["N: Drive Unlock<br/>[unlockN.ps1]"]
  node_systemkey["System Key File"]
end

node_technician(("Technician"))

node_technician -->|"enters recovery key"| node_bitlocker
node_bitlocker -->|"unlocks"| node_gs1disk
node_technician -->|"opens hives"| node_registrytool
node_registrytool -->|"reads and saves"| node_offlinehives
node_technician -->|"sets explorer shell"| node_bootsettings
node_technician -->|"deletes filter key"| node_keyboardfilter
node_offlinehives -->|"contains settings"| node_bootsettings
node_offlinehives -->|"contains key"| node_keyboardfilter
node_bootsettings -->|"selects shell"| node_windowsboot
node_windowsboot -->|"opens desktop"| node_appuser
node_appuser -->|"runs"| node_launchscript
node_launchscript -->|"reads password"| node_credentials
node_launchscript -->|"launches as user"| node_updateuser
node_updateuser -->|"disables filter"| node_uwf
node_updateuser -->|"removes TPM protector"| node_bitlockerdrive
node_updateuser -->|"adds TPM protector"| node_tpm
node_updateuser -->|"restarts system"| node_restart
node_restart -->|"boots again"| node_windowsboot
node_technician -->|"runs after repair"| node_restore
node_restore -->|"restores shell"| node_bootsettings
node_restore -->|"enables filter"| node_uwf
node_bootsettings -->|"starts normally"| node_segaboot
node_technician -.->|"optionally runs"| node_unlockn
node_unlockn -.->|"reads key"| node_systemkey
node_unlockn -.->|"unlocks N drive"| node_gs1disk

click node_registrytool "https://github.com/saya147/-alls-hx2-tpm-bitlocker-restore-/blob/main/%E6%B3%A8%E5%86%8C%E8%A1%A8%E4%BF%AE%E6%94%B9%E5%99%A8.exe"
click node_launchscript "https://github.com/saya147/-alls-hx2-tpm-bitlocker-restore-/blob/main/RunPowerShellAsUpdateUser.bat"
click node_restore "https://github.com/saya147/-alls-hx2-tpm-bitlocker-restore-/blob/main/RestoreShellAndEnableUWF.ps1"
click node_unlockn "https://github.com/saya147/-alls-hx2-tpm-bitlocker-restore-/blob/main/unlockN.ps1"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gs1disk,node_bitlocker,node_registrytool,node_offlinehives,node_bootsettings,node_keyboardfilter,node_windowsboot toneBlue
class node_appuser,node_launchscript,node_credentials,node_updateuser toneAmber
class node_uwf,node_bitlockerdrive,node_tpm,node_restart toneMint
class node_restore,node_segaboot,node_unlockn,node_systemkey toneRose
class node_technician toneIndigo
```

## Components

### Offline Recovery

- **GS1 System Disk**
- **BitLocker Recovery**
- [Registry Editor](https://github.com/saya147/-alls-hx2-tpm-bitlocker-restore-/blob/main/%E6%B3%A8%E5%86%8C%E8%A1%A8%E4%BF%AE%E6%94%B9%E5%99%A8.exe): `注册表修改器.exe`
- **Offline Registry Hives**
- **Boot Shell Settings**
- **Keyboard Filter**
- **Windows Boot**

### Maintenance Session

- **AppUser Desktop**
- [UpdateUser Launcher](https://github.com/saya147/-alls-hx2-tpm-bitlocker-restore-/blob/main/RunPowerShellAsUpdateUser.bat): `RunPowerShellAsUpdateUser.bat`
- **UpdateUser Password File**
- **UpdateUser PowerShell**

### TPM Repair

- **UWF Filter**
- **C: BitLocker Volume**
- **Machine TPM**
- **System Restart**

### System Restore

- [Shell And UWF Restore](https://github.com/saya147/-alls-hx2-tpm-bitlocker-restore-/blob/main/RestoreShellAndEnableUWF.ps1): `RestoreShellAndEnableUWF.ps1`
- **SEGA Boot Shell**
- [N: Drive Unlock](https://github.com/saya147/-alls-hx2-tpm-bitlocker-restore-/blob/main/unlockN.ps1): `unlockN.ps1`
- **System Key File**

### Other components

- **Technician**

## Connections

- Technician → BitLocker Recovery: enters recovery key
- BitLocker Recovery → GS1 System Disk: unlocks
- Technician → Registry Editor: opens hives
- Registry Editor → Offline Registry Hives: reads and saves
- Technician → Boot Shell Settings: sets explorer shell
- Technician → Keyboard Filter: deletes filter key
- Offline Registry Hives → Boot Shell Settings: contains settings
- Offline Registry Hives → Keyboard Filter: contains key
- Boot Shell Settings → Windows Boot: selects shell
- Windows Boot → AppUser Desktop: opens desktop
- AppUser Desktop → UpdateUser Launcher: runs
- UpdateUser Launcher → UpdateUser Password File: reads password
- UpdateUser Launcher → UpdateUser PowerShell: launches as user
- UpdateUser PowerShell → UWF Filter: disables filter
- UpdateUser PowerShell → C: BitLocker Volume: removes TPM protector
- UpdateUser PowerShell → Machine TPM: adds TPM protector
- UpdateUser PowerShell → System Restart: restarts system
- System Restart → Windows Boot: boots again
- Technician → Shell And UWF Restore: runs after repair
- Shell And UWF Restore → Boot Shell Settings: restores shell
- Shell And UWF Restore → UWF Filter: enables filter
- Boot Shell Settings → SEGA Boot Shell: starts normally
- Technician → N: Drive Unlock: optionally runs
- N: Drive Unlock → System Key File: reads key
- N: Drive Unlock → GS1 System Disk: unlocks N drive
