|
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) |
|
0 commit comments