Skip to content

Commit

Permalink
fruity: Use USB product string as transport name
Browse files Browse the repository at this point in the history
  • Loading branch information
oleavr authored and hsorbo committed Oct 5, 2024
1 parent e5eaeda commit 1c4902e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/fruity/device-monitor.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ namespace Frida.Fruity {

public string? name {
get {
return null;
return _name;
}
}

Expand Down Expand Up @@ -1168,6 +1168,7 @@ namespace Frida.Fruity {
private weak PortableCoreDeviceBackend parent;
private LibUSB.Device _raw_device;
private string _udid;
private string? _name;

private Promise<UsbDevice>? device_request;
private Promise<LibUSB.Device>? modeswitch_request;
Expand All @@ -1181,6 +1182,13 @@ namespace Frida.Fruity {
this.parent = parent;
_raw_device = raw_device;
_udid = udid;

char product[LibUSB.DEVICE_STRING_BYTES_MAX + 1];
var res = raw_device.get_device_string (PRODUCT, product);
if (res >= LibUSB.Error.SUCCESS) {
product[res] = '\0';
_name = (string) product;
}
}

public async UsbDevice open (Cancellable? cancellable) throws Error, IOError {
Expand Down

0 comments on commit 1c4902e

Please sign in to comment.