mirror of
https://github.com/dualshock-tools/dualshock-tools.github.io.git
synced 2026-03-01 11:19:54 +03:00
Collect DS4 Bluetooth addresses for analysis and clone detection
This commit is contained in:
@@ -167,18 +167,21 @@ class DS4Controller extends BaseController {
|
||||
deviceTypeText = l("clone");
|
||||
}
|
||||
|
||||
const hw_version = `${dec2hex(hw_ver_major)}:${dec2hex(hw_ver_minor)}`;
|
||||
const sw_version = `${dec2hex(sw_ver_major)}:${dec2hex(sw_ver_minor)}`;
|
||||
const infoItems = [
|
||||
{ key: l("Build Date"), value: `${k1} ${k2}`, cat: "fw" },
|
||||
{ key: l("HW Version"), value: `${dec2hex(hw_ver_major)}:${dec2hex(hw_ver_minor)}`, cat: "hw" },
|
||||
{ key: l("SW Version"), value: `${dec2hex32(sw_ver_major)}:${dec2hex(sw_ver_minor)}`, cat: "fw" },
|
||||
{ key: l("HW Version"), value: hw_version, cat: "hw" },
|
||||
{ key: l("SW Version"), value: sw_version, cat: "fw" },
|
||||
{ key: l("Device Type"), value: deviceTypeText, cat: "hw", severity: is_clone ? 'danger' : undefined },
|
||||
];
|
||||
|
||||
const board_model = this.hwToBoardModel(hw_ver_minor);
|
||||
const bd_addr = await this.getBdAddr();
|
||||
|
||||
if(!is_clone) {
|
||||
// Add Board Model (UI will append the info icon)
|
||||
infoItems.push({ key: l("Board Model"), value: this.hwToBoardModel(hw_ver_minor), cat: "hw", addInfoIcon: 'board', copyable: true });
|
||||
|
||||
const bd_addr = await this.getBdAddr();
|
||||
infoItems.push({ key: l("Board Model"), value: board_model, cat: "hw", addInfoIcon: 'board', copyable: true });
|
||||
infoItems.push({ key: l("Bluetooth Address"), value: bd_addr, cat: "hw" });
|
||||
}
|
||||
|
||||
@@ -186,6 +189,8 @@ class DS4Controller extends BaseController {
|
||||
const rare = this.isRare(hw_ver_minor);
|
||||
const disable_bits = is_clone ? 1 : 0; // 1: clone
|
||||
|
||||
la("ds4_get_info", { hw_version, board_model, bd_addr, is_clone }); // Collect Bluetooth address for analytics
|
||||
|
||||
return { ok: true, infoItems, nv, disable_bits, rare };
|
||||
} catch(error) {
|
||||
// Return error but do not touch DOM
|
||||
|
||||
Reference in New Issue
Block a user