-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import frida | ||
|
||
device = frida.get_usb_device() | ||
device.unpair() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (C) 2013-2022 Ole André Vadla Ravnås <[email protected]> | ||
* Copyright (C) 2013-2023 Ole André Vadla Ravnås <[email protected]> | ||
* | ||
* Licence: wxWindows Library Licence, Version 3.1 | ||
*/ | ||
|
@@ -389,6 +389,7 @@ static FridaSessionOptions * PyDevice_parse_session_options (const gchar * realm | |
static PyObject * PyDevice_inject_library_file (PyDevice * self, PyObject * args); | ||
static PyObject * PyDevice_inject_library_blob (PyDevice * self, PyObject * args); | ||
static PyObject * PyDevice_open_channel (PyDevice * self, PyObject * args); | ||
static PyObject * PyDevice_unpair (PyDevice * self); | ||
|
||
static PyObject * PyApplication_new_take_handle (FridaApplication * handle); | ||
static int PyApplication_init (PyApplication * self, PyObject * args, PyObject * kw); | ||
|
@@ -565,6 +566,7 @@ static PyMethodDef PyDevice_methods[] = | |
{ "inject_library_file", (PyCFunction) PyDevice_inject_library_file, METH_VARARGS, "Inject a library file to a PID." }, | ||
{ "inject_library_blob", (PyCFunction) PyDevice_inject_library_blob, METH_VARARGS, "Inject a library blob to a PID." }, | ||
{ "open_channel", (PyCFunction) PyDevice_open_channel, METH_VARARGS, "Open a device-specific communication channel." }, | ||
{ "unpair", (PyCFunction) PyDevice_unpair, METH_NOARGS, "Unpair device." }, | ||
{ NULL } | ||
}; | ||
|
||
|
@@ -2835,6 +2837,20 @@ PyDevice_open_channel (PyDevice * self, PyObject * args) | |
return PyIOStream_new_take_handle (stream); | ||
} | ||
|
||
static PyObject * | ||
PyDevice_unpair (PyDevice * self) | ||
{ | ||
GError * error = NULL; | ||
|
||
Py_BEGIN_ALLOW_THREADS | ||
frida_device_unpair_sync (PY_GOBJECT_HANDLE (self), g_cancellable_get_current (), &error); | ||
Py_END_ALLOW_THREADS | ||
if (error != NULL) | ||
return PyFrida_raise (error); | ||
|
||
Py_RETURN_NONE; | ||
} | ||
|
||
|
||
static PyObject * | ||
PyApplication_new_take_handle (FridaApplication * handle) | ||
|