| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -299,6 +299,11 @@ class Device(Object): | |||
| 299 | 299 | Open a device-specific communication channel. | |
| 300 | 300 | """ | |
| 301 | 301 | ... | |
| 302 | + def unpair(self) -> None: | ||
| 303 | + """ | ||
| 304 | + Unpair device. | ||
| 305 | + """ | ||
| 306 | + ... | ||
| 302 | 307 | def query_system_parameters(self) -> Dict[str, Any]: | |
| 303 | 308 | """ | |
| 304 | 309 | Returns a dictionary of information about the host system. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,4 @@ | |||
| 1 | + import frida | ||
| 2 | + | ||
| 3 | + device = frida.get_usb_device() | ||
| 4 | + device.unpair() | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1035,6 +1035,14 @@ def open_channel(self, address: str) -> IOStream: | |||
| 1035 | 1035 | ||
| 1036 | 1036 | return IOStream(self._impl.open_channel(address)) | |
| 1037 | 1037 | ||
| 1038 | + @cancellable | ||
| 1039 | + def unpair(self) -> None: | ||
| 1040 | + """ | ||
| 1041 | + Unpair device | ||
| 1042 | + """ | ||
| 1043 | + | ||
| 1044 | + self._impl.unpair() | ||
| 1045 | + | ||
| 1038 | 1046 | @cancellable | |
| 1039 | 1047 | def get_bus(self) -> Bus: | |
| 1040 | 1048 | """ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | /* | |
| 2 | - * Copyright (C) 2013-2022 Ole André Vadla Ravnås <oleavr@nowsecure.com> | ||
| 2 | + * Copyright (C) 2013-2023 Ole André Vadla Ravnås <oleavr@nowsecure.com> | ||
| 3 | 3 | * | |
| 4 | 4 | * Licence: wxWindows Library Licence, Version 3.1 | |
| 5 | 5 | */ | |
@@ -389,6 +389,7 @@ static FridaSessionOptions * PyDevice_parse_session_options (const gchar * realm | |||
| 389 | 389 | static PyObject * PyDevice_inject_library_file (PyDevice * self, PyObject * args); | |
| 390 | 390 | static PyObject * PyDevice_inject_library_blob (PyDevice * self, PyObject * args); | |
| 391 | 391 | static PyObject * PyDevice_open_channel (PyDevice * self, PyObject * args); | |
| 392 | + static PyObject * PyDevice_unpair (PyDevice * self); | ||
| 392 | 393 | ||
| 393 | 394 | static PyObject * PyApplication_new_take_handle (FridaApplication * handle); | |
| 394 | 395 | static int PyApplication_init (PyApplication * self, PyObject * args, PyObject * kw); | |
@@ -565,6 +566,7 @@ static PyMethodDef PyDevice_methods[] = | |||
| 565 | 566 | { "inject_library_file", (PyCFunction) PyDevice_inject_library_file, METH_VARARGS, "Inject a library file to a PID." }, | |
| 566 | 567 | { "inject_library_blob", (PyCFunction) PyDevice_inject_library_blob, METH_VARARGS, "Inject a library blob to a PID." }, | |
| 567 | 568 | { "open_channel", (PyCFunction) PyDevice_open_channel, METH_VARARGS, "Open a device-specific communication channel." }, | |
| 569 | + { "unpair", (PyCFunction) PyDevice_unpair, METH_NOARGS, "Unpair device." }, | ||
| 568 | 570 | { NULL } | |
| 569 | 571 | }; | |
| 570 | 572 | ||
@@ -2835,6 +2837,20 @@ PyDevice_open_channel (PyDevice * self, PyObject * args) | |||
| 2835 | 2837 | return PyIOStream_new_take_handle (stream); | |
| 2836 | 2838 | } | |
| 2837 | 2839 | ||
| 2840 | + static PyObject * | ||
| 2841 | + PyDevice_unpair (PyDevice * self) | ||
| 2842 | + { | ||
| 2843 | + GError * error = NULL; | ||
| 2844 | + | ||
| 2845 | + Py_BEGIN_ALLOW_THREADS | ||
| 2846 | + frida_device_unpair_sync (PY_GOBJECT_HANDLE (self), g_cancellable_get_current (), &error); | ||
| 2847 | + Py_END_ALLOW_THREADS | ||
| 2848 | + if (error != NULL) | ||
| 2849 | + return PyFrida_raise (error); | ||
| 2850 | + | ||
| 2851 | + Py_RETURN_NONE; | ||
| 2852 | + } | ||
| 2853 | + | ||
| 2838 | 2854 | ||
| 2839 | 2855 | static PyObject * | |
| 2840 | 2856 | PyApplication_new_take_handle (FridaApplication * handle) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments