Skip to content

Commit

Permalink
docs: add docs to device manager
Browse files Browse the repository at this point in the history
Add docs describing that in order to get usb devices
the caller must first enumerate devices
  • Loading branch information
dylanhitt committed Jan 24, 2024
1 parent d6a7447 commit dfbc52b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions frida/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ func (d *deviceManager) RemoteDevice() (*Device, error) {
}

// DeviceByID will return device with id passed or an error if it can't find any.
func (d *deviceManager) DeviceByID(id string) (*Device, error) {
// Note: the caller must call EnumerateDevices() to get devices that are of type usb
func (d *DeviceManager) DeviceByID(id string) (*Device, error) {

Check failure on line 86 in frida/manager.go

View workflow job for this annotation

GitHub Actions / linux (x86_64, linux, 16.0.13)

invalid receiver type DeviceManager (pointer or interface type)

Check failure on line 86 in frida/manager.go

View workflow job for this annotation

GitHub Actions / staticcheck (x86_64, linux, 16.0.13)

invalid receiver type DeviceManager (pointer or interface type)
idC := C.CString(id)
defer C.free(unsafe.Pointer(idC))

Expand All @@ -97,7 +98,8 @@ func (d *deviceManager) DeviceByID(id string) (*Device, error) {
}

// DeviceByType will return device or an error by device type specified.
func (d *deviceManager) DeviceByType(devType DeviceType) (*Device, error) {
// Note: the caller must call EnumerateDevices() to get devices that are of type usb
func (d *DeviceManager) DeviceByType(devType DeviceType) (*Device, error) {

Check failure on line 102 in frida/manager.go

View workflow job for this annotation

GitHub Actions / linux (x86_64, linux, 16.0.13)

invalid receiver type DeviceManager (pointer or interface type)

Check failure on line 102 in frida/manager.go

View workflow job for this annotation

GitHub Actions / staticcheck (x86_64, linux, 16.0.13)

invalid receiver type DeviceManager (pointer or interface type)
var err *C.GError
device := C.frida_device_manager_get_device_by_type_sync(d.manager,

Check failure on line 104 in frida/manager.go

View workflow job for this annotation

GitHub Actions / linux (x86_64, linux, 16.0.13)

d.manager undefined (type *DeviceManager is pointer to interface, not interface)

Check failure on line 104 in frida/manager.go

View workflow job for this annotation

GitHub Actions / staticcheck (x86_64, linux, 16.0.13)

d.manager undefined (type *DeviceManager is pointer to interface, not interface)
C.FridaDeviceType(devType),
Expand All @@ -111,7 +113,8 @@ func (d *deviceManager) DeviceByType(devType DeviceType) (*Device, error) {
}

// FindDeviceByID will try to find the device by id specified
func (d *deviceManager) FindDeviceByID(id string) (*Device, error) {
// Note: the caller must call EnumerateDevices() to get devices that are of type usb
func (d *DeviceManager) FindDeviceByID(id string) (*Device, error) {

Check failure on line 117 in frida/manager.go

View workflow job for this annotation

GitHub Actions / linux (x86_64, linux, 16.0.13)

invalid receiver type DeviceManager (pointer or interface type)

Check failure on line 117 in frida/manager.go

View workflow job for this annotation

GitHub Actions / staticcheck (x86_64, linux, 16.0.13)

invalid receiver type DeviceManager (pointer or interface type)
devID := C.CString(id)
defer C.free(unsafe.Pointer(devID))

Expand All @@ -131,7 +134,8 @@ func (d *deviceManager) FindDeviceByID(id string) (*Device, error) {
}

// FindDeviceByType will try to find the device by device type specified
func (d *deviceManager) FindDeviceByType(devType DeviceType) (*Device, error) {
// Note: the caller must call EnumerateDevices() to get devices that are of type usb
func (d *DeviceManager) FindDeviceByType(devType DeviceType) (*Device, error) {
timeout := C.gint(defaultDeviceTimeout)

var err *C.GError
Expand Down

0 comments on commit dfbc52b

Please sign in to comment.