Skip to content

Conversation

ajwerner
Copy link
Contributor

Also introduces an abstraction around GObject to try to more appropriately capture the situation.

Also introduces an abstraction around GObject to try to more
appropriately capture the situation.
}

/// Returns the device's name.
pub fn get_name(&self) -> &str {
let name =
unsafe { CStr::from_ptr(frida_sys::frida_device_get_name(self.device_ptr) as _) };
let name = unsafe { CStr::from_ptr(frida_sys::frida_device_get_name(self.0.ptr()) as _) };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not call the ptr() function above?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for the rest of the self.0.ptr() calls...

pub struct DeviceManager<'a> {
#[derive(Clone)]
pub struct DeviceManager {
frida: Frida,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we call this frida here, but runtime() above... Let's choose one and stick with it.

}
}

static THE_ONE_TRUE_FRIDA: Mutex<Option<Arc<FridaSingleton>>> = Mutex::new(None);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this name is cute and pithy, would be better to call it FRIDA_SINGLETON, I think.

ptr
}

pub(crate) fn new(ptr: *mut T, runtime: RT) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps this should be called from_raw?

@@ -85,7 +72,7 @@ impl<'a> SpawnOptions<'a> {
let mut arg_ptrs: Vec<*mut _> = args.iter().map(|s| s.as_ptr() as *mut _).collect();
unsafe {
frida_sys::frida_spawn_options_set_argv(
self.options_ptr,
self.0.ptr(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.ptr(), no?

@s1341
Copy link
Contributor

s1341 commented Jul 24, 2025

What's happening with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants