mirror of
https://github.com/frida/frida-python
synced 2026-06-08 14:16:17 +00:00
Compare commits
256 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f50b58a04 | |||
| f63ea5903f | |||
| a99767e501 | |||
| 07bbd3d488 | |||
| 81403cf383 | |||
| 2ea0b944a2 | |||
| 35c412c6cf | |||
| ec4524d155 | |||
| d9d53a89cc | |||
| dfb002de49 | |||
| 0f56e44abd | |||
| d28a2a4988 | |||
| 1fc39289ef | |||
| 2c757a08f3 | |||
| fc735c048f | |||
| 4d84536160 | |||
| 9e51c78c5c | |||
| a6d51e8384 | |||
| 3e80ed726d | |||
| 985410b6ff | |||
| 21c7b9ee6a | |||
| 7fba1cdc67 | |||
| a709856e2a | |||
| c3afe6089d | |||
| 6435a78d13 | |||
| 09175036ea | |||
| e0c90c5203 | |||
| 9f463fb602 | |||
| 9fdee2270f | |||
| 6e536a56b1 | |||
| 74925d082e | |||
| bf1245ddb0 | |||
| 0f247e9439 | |||
| 17aae5fe5c | |||
| 477a90534e | |||
| c87cdca293 | |||
| 30968b3805 | |||
| 5e3f27d0cb | |||
| 904461eb01 | |||
| dc652faa90 | |||
| f5ba22ad36 | |||
| dccb6810ca | |||
| 82441c6d61 | |||
| 323dca48c2 | |||
| ef71f0fa92 | |||
| e92e829f6d | |||
| 5793fb5528 | |||
| cac6993d87 | |||
| 714b7f8626 | |||
| ab0b9e98ae | |||
| 19a7fa4f45 | |||
| 38552a368a | |||
| 38724cab58 | |||
| b60d085ad9 | |||
| 1a4afbcc62 | |||
| 9e15cab647 | |||
| 9ef1c9c1f7 | |||
| 3da6af4759 | |||
| a9075822b1 | |||
| 2e61509c04 | |||
| aa9396c6b0 | |||
| 6530b2a7d4 | |||
| 2d833af062 | |||
| 9f6ab2d384 | |||
| a005f1bf4c | |||
| 59a24aa48f | |||
| 782d626419 | |||
| 3aa122f4fd | |||
| ef315fc0ad | |||
| daf93eea54 | |||
| 5d02a36906 | |||
| ba8daa423d | |||
| afb27bfa7c | |||
| 93a201acf2 | |||
| ca1cdad96a | |||
| fbc83cc9bf | |||
| b838e1df9a | |||
| e2409be987 | |||
| b061ea43d2 | |||
| a50a62999a | |||
| 3a47d33ee8 | |||
| ea93d827bb | |||
| 8d4c05f664 | |||
| 2f78c96622 | |||
| 4b5aa28119 | |||
| 4f87afa0f1 | |||
| 82272945ac | |||
| bf496a81d9 | |||
| c2dcae3ff4 | |||
| 0cb42c47dc | |||
| 0e3a9fb551 | |||
| 4e16e5c667 | |||
| 09d6c7b044 | |||
| e11efce5c2 | |||
| e174be9998 | |||
| eae3d1dc65 | |||
| 2d26b94c7d | |||
| f396958dfe | |||
| 93fb33206f | |||
| aed3c1b7bf | |||
| 690da0652d | |||
| bec6221c02 | |||
| 53479e1814 | |||
| 68bc65ecd4 | |||
| 6492081c92 | |||
| 262b984e23 | |||
| 730ec03652 | |||
| 25f96f92d3 | |||
| dec23f9ef5 | |||
| 906d27bcb7 | |||
| b0018c9812 | |||
| 5e011e6d64 | |||
| b68dda4eb5 | |||
| 6fbe238c1a | |||
| 4d750dfe58 | |||
| fe1c61ce5d | |||
| ea91df0d77 | |||
| b78ae7555f | |||
| b456683f2d | |||
| ddfe2b1a3b | |||
| 329795dbfc | |||
| e9c62fd581 | |||
| 40e945107d | |||
| 6c27bf0da7 | |||
| d37451f3bc | |||
| 6d4e4e27ee | |||
| 33a9c51387 | |||
| 4344eb9220 | |||
| 3a94e642d7 | |||
| 7a5948a95a | |||
| bbe926c606 | |||
| b653958fa4 | |||
| bca5146b74 | |||
| 2bd254702c | |||
| 82ee16d299 | |||
| 51501ceacb | |||
| ef45347385 | |||
| 0024f6719a | |||
| 87de091250 | |||
| cf4870e13d | |||
| 2ac00cb1e2 | |||
| dd94c73d4f | |||
| 40eb2dae38 | |||
| 73004f9598 | |||
| a0e9e64346 | |||
| 2706e19615 | |||
| 6edaf679ac | |||
| c2c45ce231 | |||
| 0180450178 | |||
| e07370158d | |||
| f73fdff4ee | |||
| b565fa19dc | |||
| 58d5ea9e2f | |||
| 91826487e1 | |||
| b1abfd53fa | |||
| 1afde6cb34 | |||
| 6bee5f45f3 | |||
| efc1009ece | |||
| 3def865cf8 | |||
| 3c41862ac5 | |||
| 4bd11602d7 | |||
| d07c8a16cd | |||
| 4e6d28cba7 | |||
| e0562ed0bc | |||
| 9dc17772cd | |||
| 0f9f4a5da8 | |||
| 4a9fb75adf | |||
| c37ef15695 | |||
| f6ad8a504d | |||
| 808e4ab6b5 | |||
| 50ee91f63f | |||
| 56dc49b5fb | |||
| 4cbb5881bd | |||
| 6ff0e34ca3 | |||
| 4df903dca5 | |||
| 6ed81cbfb6 | |||
| 98cc4c44bc | |||
| 6190b3c57b | |||
| 212973bbc1 | |||
| 79f7ae1deb | |||
| 522366a55e | |||
| 8017d10e3e | |||
| e78a5fd3b3 | |||
| 5cbef2fb1f | |||
| 8694918de7 | |||
| ab16fe04c5 | |||
| a1d1740541 | |||
| 09d2a1aa54 | |||
| 215669c151 | |||
| f7b08f8375 | |||
| 133687aafc | |||
| 06130770e1 | |||
| 2d72d0be57 | |||
| d463d7f2f2 | |||
| 11613adee6 | |||
| 8dc6509929 | |||
| 3f8b122ce7 | |||
| 29abf88e31 | |||
| 5370147e85 | |||
| 507917744d | |||
| 8f2858fd8d | |||
| c2cf7fa951 | |||
| 9ff0651481 | |||
| 2674d6ef7d | |||
| 5d65919693 | |||
| d453cdd5ba | |||
| e8fd88f3d4 | |||
| 414cf0e029 | |||
| 76825537e8 | |||
| 2ab18cf80f | |||
| aaa703436b | |||
| 387962ab9d | |||
| 97f4c236a6 | |||
| 88cb2c97b8 | |||
| ec5035fd96 | |||
| bd883147ed | |||
| f7c32b2772 | |||
| 68009a8df9 | |||
| 85d56a0e45 | |||
| 228610a79c | |||
| d4b1b6aa8b | |||
| 29661c6b3b | |||
| d5b2a6fd18 | |||
| b862e9ae82 | |||
| 6e6f84969d | |||
| d6933eccf3 | |||
| 3bee61ffdb | |||
| 647e45f8bf | |||
| 5b6cfeba8b | |||
| c2b8043d8d | |||
| 69a4fa2ad2 | |||
| 546f65f25b | |||
| 168fcd5fe6 | |||
| 2ae7df42d0 | |||
| e8eff270ce | |||
| 62b6839d12 | |||
| d83456efe7 | |||
| fa62593fed | |||
| 305d2c1360 | |||
| 67b563a72c | |||
| d988aa2920 | |||
| d346babcf9 | |||
| 96a3777eb0 | |||
| 6c4ad9bf98 | |||
| 0490814f79 | |||
| 3c21f23327 | |||
| fe24ef56d1 | |||
| 2d8dca8d53 | |||
| 77f7d0f3c3 | |||
| c8f3b40aad | |||
| 7416839ae5 | |||
| 5c782dcc1c | |||
| de4f0e906d | |||
| 623cb160f8 | |||
| 3c265a483d | |||
| f43a1ed12c |
@@ -0,0 +1 @@
|
||||
github: frida
|
||||
@@ -23,6 +23,7 @@ Relay = _frida.Relay
|
||||
PortalService = core.PortalService
|
||||
EndpointParameters = core.EndpointParameters
|
||||
Compiler = core.Compiler
|
||||
PackageManager = core.PackageManager
|
||||
FileMonitor = _frida.FileMonitor
|
||||
Cancellable = core.Cancellable
|
||||
|
||||
|
||||
@@ -754,8 +754,13 @@ class Compiler(Object):
|
||||
self,
|
||||
entrypoint: str,
|
||||
project_root: Optional[str] = None,
|
||||
output_format: Optional[str] = None,
|
||||
bundle_format: Optional[str] = None,
|
||||
type_check: Optional[str] = None,
|
||||
source_maps: Optional[str] = None,
|
||||
compression: Optional[str] = None,
|
||||
platform: Optional[str] = None,
|
||||
externals: Optional[Sequence[str]] = None,
|
||||
) -> str:
|
||||
"""
|
||||
Build an agent.
|
||||
@@ -766,12 +771,107 @@ class Compiler(Object):
|
||||
self,
|
||||
entrypoint: str,
|
||||
project_root: Optional[str] = None,
|
||||
output_format: Optional[str] = None,
|
||||
bundle_format: Optional[str] = None,
|
||||
type_check: Optional[str] = None,
|
||||
source_maps: Optional[str] = None,
|
||||
compression: Optional[str] = None,
|
||||
platform: Optional[str] = None,
|
||||
externals: Optional[Sequence[str]] = None,
|
||||
) -> None:
|
||||
"""
|
||||
Continuously build an agent.
|
||||
"""
|
||||
...
|
||||
|
||||
class PackageManager(Object):
|
||||
@property
|
||||
def registry(self) -> str:
|
||||
"""
|
||||
The registry being used.
|
||||
"""
|
||||
...
|
||||
|
||||
@registry.setter
|
||||
def registry(self, value: str) -> None:
|
||||
"""
|
||||
Change the registry to use.
|
||||
"""
|
||||
...
|
||||
|
||||
def search(
|
||||
self,
|
||||
query: str,
|
||||
offset: Optional[int] = None,
|
||||
limit: Optional[int] = None,
|
||||
) -> PackageSearchResult:
|
||||
"""
|
||||
Search for packages to install.
|
||||
"""
|
||||
...
|
||||
|
||||
def install(
|
||||
self,
|
||||
project_root: Optional[str] = None,
|
||||
role: Optional[str] = None,
|
||||
specs: Optional[Sequence[str]] = None,
|
||||
omits: Optional[Sequence[str]] = None,
|
||||
) -> PackageInstallResult:
|
||||
"""
|
||||
Install one or more packages.
|
||||
"""
|
||||
...
|
||||
|
||||
class Package(Object):
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""
|
||||
Package name.
|
||||
"""
|
||||
...
|
||||
|
||||
@property
|
||||
def version(self) -> str:
|
||||
"""
|
||||
Package version.
|
||||
"""
|
||||
...
|
||||
|
||||
@property
|
||||
def description(self) -> Optional[str]:
|
||||
"""
|
||||
Package description.
|
||||
"""
|
||||
...
|
||||
|
||||
@property
|
||||
def url(self) -> Optional[str]:
|
||||
"""
|
||||
Package URL.
|
||||
"""
|
||||
...
|
||||
|
||||
class PackageSearchResult(Object):
|
||||
@property
|
||||
def packages(self) -> List[Package]:
|
||||
"""
|
||||
Batch of matching packages.
|
||||
"""
|
||||
...
|
||||
|
||||
@property
|
||||
def total(self) -> int:
|
||||
"""
|
||||
Total matching packages.
|
||||
"""
|
||||
...
|
||||
|
||||
class PackageInstallResult(Object):
|
||||
@property
|
||||
def packages(self) -> List[Package]:
|
||||
"""
|
||||
The toplevel packages that are installed.
|
||||
"""
|
||||
...
|
||||
|
||||
__version__: str
|
||||
|
||||
+725
-33
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2013-2023 Ole André Vadla Ravnås <oleavr@nowsecure.com>
|
||||
* Copyright (C) 2013-2026 Ole André Vadla Ravnås <oleavr@nowsecure.com>
|
||||
* Copyright (C) 2024 Håvard Sørbø <havard@hsorbo.no>
|
||||
*
|
||||
* Licence: wxWindows Library Licence, Version 3.1
|
||||
@@ -145,6 +145,10 @@ typedef struct _PyPortalMembership PyPortalMembership;
|
||||
typedef struct _PyPortalService PyPortalService;
|
||||
typedef struct _PyEndpointParameters PyEndpointParameters;
|
||||
typedef struct _PyCompiler PyCompiler;
|
||||
typedef struct _PyPackageManager PyPackageManager;
|
||||
typedef struct _PyPackage PyPackage;
|
||||
typedef struct _PyPackageSearchResult PyPackageSearchResult;
|
||||
typedef struct _PyPackageInstallResult PyPackageInstallResult;
|
||||
typedef struct _PyFileMonitor PyFileMonitor;
|
||||
typedef struct _PyIOStream PyIOStream;
|
||||
typedef struct _PyCancellable PyCancellable;
|
||||
@@ -298,6 +302,33 @@ struct _PyCompiler
|
||||
PyGObject parent;
|
||||
};
|
||||
|
||||
struct _PyPackageManager
|
||||
{
|
||||
PyGObject parent;
|
||||
};
|
||||
|
||||
struct _PyPackage
|
||||
{
|
||||
PyGObject parent;
|
||||
PyObject * name;
|
||||
PyObject * version;
|
||||
PyObject * description;
|
||||
PyObject * url;
|
||||
};
|
||||
|
||||
struct _PyPackageSearchResult
|
||||
{
|
||||
PyGObject parent;
|
||||
PyObject * packages;
|
||||
guint total;
|
||||
};
|
||||
|
||||
struct _PyPackageInstallResult
|
||||
{
|
||||
PyGObject parent;
|
||||
PyObject * packages;
|
||||
};
|
||||
|
||||
struct _PyFileMonitor
|
||||
{
|
||||
PyGObject parent;
|
||||
@@ -347,6 +378,7 @@ static PyObject * PyGObject_marshal_variant (GVariant * variant);
|
||||
static PyObject * PyGObject_marshal_variant_byte_array (GVariant * variant);
|
||||
static PyObject * PyGObject_marshal_variant_dict (GVariant * variant);
|
||||
static PyObject * PyGObject_marshal_variant_array (GVariant * variant);
|
||||
static PyObject * PyGObject_marshal_variant_tuple (GVariant * variant);
|
||||
static gboolean PyGObject_unmarshal_variant (PyObject * value, GVariant ** variant);
|
||||
static gboolean PyGObject_unmarshal_variant_from_mapping (PyObject * mapping, GVariant ** variant);
|
||||
static gboolean PyGObject_unmarshal_variant_from_sequence (PyObject * sequence, GVariant ** variant);
|
||||
@@ -498,12 +530,43 @@ static gchar * frida_python_authentication_service_authenticate_finish (FridaAut
|
||||
static void frida_python_authentication_service_do_authenticate (GTask * task, FridaPythonAuthenticationService * self);
|
||||
|
||||
static int PyCompiler_init (PyCompiler * self, PyObject * args, PyObject * kw);
|
||||
static void PyCompiler_dealloc (PyCompiler * self);
|
||||
static PyObject * PyCompiler_build (PyCompiler * self, PyObject * args, PyObject * kw);
|
||||
static PyObject * PyCompiler_watch (PyCompiler * self, PyObject * args, PyObject * kw);
|
||||
static gboolean PyCompiler_set_options (FridaCompilerOptions * options, const gchar * project_root_value, const gchar * source_maps_value,
|
||||
const gchar * compression_value);
|
||||
static gboolean PyCompiler_set_options (FridaCompilerOptions * options, const gchar * project_root_value, const gchar * output_format_value,
|
||||
const gchar * bundle_format_value, const gchar * type_check_value, const gchar * source_maps_value, const gchar * compression_value,
|
||||
const gchar * platform_value, PyObject * externals_value);
|
||||
|
||||
static int PyPackageManager_init (PyPackageManager * self, PyObject * args, PyObject * kw);
|
||||
static void PyPackageManager_dealloc (PyPackageManager * self);
|
||||
static PyObject * PyPackageManager_repr (PyPackageManager * self);
|
||||
static PyObject * PyPackageManager_get_registry (PyPackageManager * self, void * closure);
|
||||
static int PyPackageManager_set_registry (PyPackageManager * self, PyObject * val, void * closure);
|
||||
static PyObject * PyPackageManager_search (PyPackageManager * self, PyObject * args, PyObject * kw);
|
||||
static PyObject * PyPackageManager_install (PyPackageManager * self, PyObject * args, PyObject * kw);
|
||||
static FridaPackageInstallOptions * PyPackageManager_parse_install_options (const gchar * project_root, const char * role_value,
|
||||
PyObject * specs_value, PyObject * omits_value);
|
||||
|
||||
static PyObject * PyPackage_new_take_handle (FridaPackage * handle);
|
||||
static int PyPackage_init (PyPackage * self, PyObject * args, PyObject * kw);
|
||||
static void PyPackage_init_from_handle (PyPackage * self, FridaPackage * handle);
|
||||
static void PyPackage_dealloc (PyPackage * self);
|
||||
static PyObject * PyPackage_repr (PyPackage * self);
|
||||
|
||||
static PyObject * PyPackageSearchResult_new_take_handle (FridaPackageSearchResult * handle);
|
||||
static int PyPackageSearchResult_init (PyPackageSearchResult * self, PyObject * args, PyObject * kw);
|
||||
static void PyPackageSearchResult_init_from_handle (PyPackageSearchResult * self, FridaPackageSearchResult * handle);
|
||||
static void PyPackageSearchResult_dealloc (PyPackageSearchResult * self);
|
||||
static PyObject * PyPackageSearchResult_repr (PyPackageSearchResult * self);
|
||||
|
||||
static PyObject * PyPackageInstallResult_new_take_handle (FridaPackageInstallResult * handle);
|
||||
static int PyPackageInstallResult_init (PyPackageInstallResult * self, PyObject * args, PyObject * kw);
|
||||
static void PyPackageInstallResult_init_from_handle (PyPackageInstallResult * self, FridaPackageInstallResult * handle);
|
||||
static void PyPackageInstallResult_dealloc (PyPackageInstallResult * self);
|
||||
static PyObject * PyPackageInstallResult_repr (PyPackageInstallResult * self);
|
||||
|
||||
static int PyFileMonitor_init (PyFileMonitor * self, PyObject * args, PyObject * kw);
|
||||
static void PyFileMonitor_dealloc (PyFileMonitor * self);
|
||||
static PyObject * PyFileMonitor_enable (PyFileMonitor * self);
|
||||
static PyObject * PyFileMonitor_disable (PyFileMonitor * self);
|
||||
|
||||
@@ -725,6 +788,41 @@ static PyMethodDef PyCompiler_methods[] =
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static PyGetSetDef PyPackageManager_getset[] =
|
||||
{
|
||||
{ "registry", (getter) PyPackageManager_get_registry, (setter) PyPackageManager_set_registry, "The registry to use.", NULL },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static PyMethodDef PyPackageManager_methods[] =
|
||||
{
|
||||
{ "search", (PyCFunction) PyPackageManager_search, METH_VARARGS | METH_KEYWORDS, "Search for packages to install." },
|
||||
{ "install", (PyCFunction) PyPackageManager_install, METH_VARARGS | METH_KEYWORDS, "Install one or more packages." },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static PyMemberDef PyPackage_members[] =
|
||||
{
|
||||
{ "name", T_OBJECT_EX, G_STRUCT_OFFSET (PyPackage, name), READONLY, "Package name." },
|
||||
{ "version", T_OBJECT_EX, G_STRUCT_OFFSET (PyPackage, version), READONLY, "Package version." },
|
||||
{ "description", T_OBJECT_EX, G_STRUCT_OFFSET (PyPackage, description), READONLY, "Package description." },
|
||||
{ "url", T_OBJECT_EX, G_STRUCT_OFFSET (PyPackage, url), READONLY, "Package URL." },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static PyMemberDef PyPackageSearchResult_members[] =
|
||||
{
|
||||
{ "packages", T_OBJECT_EX, G_STRUCT_OFFSET (PyPackageSearchResult, packages), READONLY, "Batch of matching packages." },
|
||||
{ "total", T_UINT, G_STRUCT_OFFSET (PyPackageSearchResult, total), READONLY, "Total matching packages." },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static PyMemberDef PyPackageInstallResult_members[] =
|
||||
{
|
||||
{ "packages", T_OBJECT_EX, G_STRUCT_OFFSET (PyPackageInstallResult, packages), READONLY, "The toplevel packages that are installed." },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static PyMethodDef PyFileMonitor_methods[] =
|
||||
{
|
||||
{ "enable", (PyCFunction) PyFileMonitor_enable, METH_NOARGS, "Enable the file monitor." },
|
||||
@@ -871,14 +969,49 @@ PYFRIDA_DEFINE_TYPE ("_frida.EndpointParameters", EndpointParameters, GObject, N
|
||||
);
|
||||
|
||||
PYFRIDA_DEFINE_TYPE ("_frida.Compiler", Compiler, GObject, NULL, frida_unref,
|
||||
{ Py_tp_doc, "Frida File Monitor" },
|
||||
{ Py_tp_doc, "Frida Compiler" },
|
||||
{ Py_tp_init, PyCompiler_init },
|
||||
{ Py_tp_dealloc, PyCompiler_dealloc },
|
||||
{ Py_tp_methods, PyCompiler_methods },
|
||||
);
|
||||
|
||||
PYFRIDA_DEFINE_TYPE ("_frida.PackageManager", PackageManager, GObject, NULL, frida_unref,
|
||||
{ Py_tp_doc, "Frida Package Manager" },
|
||||
{ Py_tp_init, PyPackageManager_init },
|
||||
{ Py_tp_dealloc, PyPackageManager_dealloc },
|
||||
{ Py_tp_repr, PyPackageManager_repr },
|
||||
{ Py_tp_getset, PyPackageManager_getset },
|
||||
{ Py_tp_methods, PyPackageManager_methods },
|
||||
);
|
||||
|
||||
PYFRIDA_DEFINE_TYPE ("_frida.Package", Package, GObject, PyPackage_init_from_handle, g_object_unref,
|
||||
{ Py_tp_doc, "Frida Package" },
|
||||
{ Py_tp_init, PyPackage_init },
|
||||
{ Py_tp_dealloc, PyPackage_dealloc },
|
||||
{ Py_tp_repr, PyPackage_repr },
|
||||
{ Py_tp_members, PyPackage_members },
|
||||
);
|
||||
|
||||
PYFRIDA_DEFINE_TYPE ("_frida.PackageSearchResult", PackageSearchResult, GObject, PyPackageSearchResult_init_from_handle, g_object_unref,
|
||||
{ Py_tp_doc, "Frida Package Search Result" },
|
||||
{ Py_tp_init, PyPackageSearchResult_init },
|
||||
{ Py_tp_dealloc, PyPackageSearchResult_dealloc },
|
||||
{ Py_tp_repr, PyPackageSearchResult_repr },
|
||||
{ Py_tp_members, PyPackageSearchResult_members },
|
||||
);
|
||||
|
||||
PYFRIDA_DEFINE_TYPE ("_frida.PackageInstallResult", PackageInstallResult, GObject, PyPackageInstallResult_init_from_handle, g_object_unref,
|
||||
{ Py_tp_doc, "Frida Package Install Result" },
|
||||
{ Py_tp_init, PyPackageInstallResult_init },
|
||||
{ Py_tp_dealloc, PyPackageInstallResult_dealloc },
|
||||
{ Py_tp_repr, PyPackageInstallResult_repr },
|
||||
{ Py_tp_members, PyPackageInstallResult_members },
|
||||
);
|
||||
|
||||
PYFRIDA_DEFINE_TYPE ("_frida.FileMonitor", FileMonitor, GObject, NULL, frida_unref,
|
||||
{ Py_tp_doc, "Frida File Monitor" },
|
||||
{ Py_tp_init, PyFileMonitor_init },
|
||||
{ Py_tp_dealloc, PyFileMonitor_dealloc },
|
||||
{ Py_tp_methods, PyFileMonitor_methods },
|
||||
);
|
||||
|
||||
@@ -1617,10 +1750,20 @@ PyGObject_marshal_variant (GVariant * variant)
|
||||
{
|
||||
case G_VARIANT_CLASS_STRING:
|
||||
return PyGObject_marshal_string (g_variant_get_string (variant, NULL));
|
||||
case G_VARIANT_CLASS_BYTE:
|
||||
return PyLong_FromLong (g_variant_get_byte (variant));
|
||||
case G_VARIANT_CLASS_INT16:
|
||||
return PyLong_FromLong (g_variant_get_int16 (variant));
|
||||
case G_VARIANT_CLASS_UINT16:
|
||||
return PyLong_FromUnsignedLong (g_variant_get_uint16 (variant));
|
||||
case G_VARIANT_CLASS_INT32:
|
||||
return PyLong_FromLong (g_variant_get_int32 (variant));
|
||||
case G_VARIANT_CLASS_UINT32:
|
||||
return PyLong_FromUnsignedLong (g_variant_get_uint32 (variant));
|
||||
case G_VARIANT_CLASS_INT64:
|
||||
return PyLong_FromLongLong (g_variant_get_int64 (variant));
|
||||
case G_VARIANT_CLASS_UINT64:
|
||||
return PyLong_FromLongLong (g_variant_get_uint64 (variant));
|
||||
return PyLong_FromUnsignedLongLong (g_variant_get_uint64 (variant));
|
||||
case G_VARIANT_CLASS_DOUBLE:
|
||||
return PyFloat_FromDouble (g_variant_get_double (variant));
|
||||
case G_VARIANT_CLASS_BOOLEAN:
|
||||
@@ -1633,6 +1776,19 @@ PyGObject_marshal_variant (GVariant * variant)
|
||||
return PyGObject_marshal_variant_dict (variant);
|
||||
|
||||
return PyGObject_marshal_variant_array (variant);
|
||||
case G_VARIANT_CLASS_TUPLE:
|
||||
return PyGObject_marshal_variant_tuple (variant);
|
||||
case G_VARIANT_CLASS_VARIANT:
|
||||
{
|
||||
GVariant * inner;
|
||||
PyObject * result;
|
||||
|
||||
inner = g_variant_get_variant (variant);
|
||||
result = PyGObject_marshal_variant (inner);
|
||||
g_variant_unref (inner);
|
||||
|
||||
return result;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1691,13 +1847,6 @@ PyGObject_marshal_variant_array (GVariant * variant)
|
||||
|
||||
for (i = 0; (child = g_variant_iter_next_value (&iter)) != NULL; i++)
|
||||
{
|
||||
if (g_variant_is_of_type (child, G_VARIANT_TYPE_VARIANT))
|
||||
{
|
||||
GVariant * inner = g_variant_get_variant (child);
|
||||
g_variant_unref (child);
|
||||
child = inner;
|
||||
}
|
||||
|
||||
PyList_SetItem (list, i, PyGObject_marshal_variant (child));
|
||||
|
||||
g_variant_unref (child);
|
||||
@@ -1706,6 +1855,28 @@ PyGObject_marshal_variant_array (GVariant * variant)
|
||||
return list;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
PyGObject_marshal_variant_tuple (GVariant * variant)
|
||||
{
|
||||
GVariantIter iter;
|
||||
PyObject * tuple;
|
||||
guint i;
|
||||
GVariant * child;
|
||||
|
||||
g_variant_iter_init (&iter, variant);
|
||||
|
||||
tuple = PyTuple_New (g_variant_iter_n_children (&iter));
|
||||
|
||||
for (i = 0; (child = g_variant_iter_next_value (&iter)) != NULL; i++)
|
||||
{
|
||||
PyTuple_SetItem (tuple, i, PyGObject_marshal_variant (child));
|
||||
|
||||
g_variant_unref (child);
|
||||
}
|
||||
|
||||
return tuple;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
PyGObject_unmarshal_variant (PyObject * value, GVariant ** variant)
|
||||
{
|
||||
@@ -1715,14 +1886,14 @@ PyGObject_unmarshal_variant (PyObject * value, GVariant ** variant)
|
||||
|
||||
PyGObject_unmarshal_string (value, &str);
|
||||
|
||||
*variant = g_variant_new_take_string (str);
|
||||
*variant = g_variant_ref_sink (g_variant_new_take_string (str));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (PyBool_Check (value))
|
||||
{
|
||||
*variant = g_variant_new_boolean (value == Py_True);
|
||||
*variant = g_variant_ref_sink (g_variant_new_boolean (value == Py_True));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1735,14 +1906,14 @@ PyGObject_unmarshal_variant (PyObject * value, GVariant ** variant)
|
||||
if (l == -1 && PyErr_Occurred ())
|
||||
return FALSE;
|
||||
|
||||
*variant = g_variant_new_int64 (l);
|
||||
*variant = g_variant_ref_sink (g_variant_new_int64 (l));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (PyFloat_Check (value))
|
||||
{
|
||||
*variant = g_variant_new_double (PyFloat_AsDouble (value));
|
||||
*variant = g_variant_ref_sink (g_variant_new_double (PyFloat_AsDouble (value)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1756,7 +1927,7 @@ PyGObject_unmarshal_variant (PyObject * value, GVariant ** variant)
|
||||
PyBytes_AsStringAndSize (value, &buffer, &length);
|
||||
|
||||
copy = g_memdup2 (buffer, length);
|
||||
*variant = g_variant_new_from_data (G_VARIANT_TYPE_BYTESTRING, copy, length, TRUE, g_free, copy);
|
||||
*variant = g_variant_ref_sink (g_variant_new_from_data (G_VARIANT_TYPE_BYTESTRING, copy, length, TRUE, g_free, copy));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1802,12 +1973,13 @@ PyGObject_unmarshal_variant_from_mapping (PyObject * mapping, GVariant ** varian
|
||||
|
||||
g_variant_builder_add (&builder, "{sv}", PyBytes_AsString (key_bytes), raw_value);
|
||||
|
||||
g_variant_unref (raw_value);
|
||||
Py_DecRef (key_bytes);
|
||||
}
|
||||
|
||||
Py_DecRef (items);
|
||||
|
||||
*variant = g_variant_builder_end (&builder);
|
||||
*variant = g_variant_ref_sink (g_variant_builder_end (&builder));
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -1852,10 +2024,11 @@ PyGObject_unmarshal_variant_from_sequence (PyObject * sequence, GVariant ** vari
|
||||
else
|
||||
g_variant_builder_add (&builder, "v", raw_value);
|
||||
|
||||
g_variant_unref (raw_value);
|
||||
Py_DecRef (val);
|
||||
}
|
||||
|
||||
*variant = g_variant_builder_end (&builder);
|
||||
*variant = g_variant_ref_sink (g_variant_builder_end (&builder));
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -2755,7 +2928,7 @@ PyDevice_spawn (PyDevice * self, PyObject * args, PyObject * kw)
|
||||
goto invalid_dict_value;
|
||||
}
|
||||
|
||||
g_hash_table_insert (aux, raw_key, g_variant_ref_sink (raw_value));
|
||||
g_hash_table_insert (aux, raw_key, raw_value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4751,37 +4924,50 @@ frida_python_authentication_service_do_authenticate (GTask * task, FridaPythonAu
|
||||
static int
|
||||
PyCompiler_init (PyCompiler * self, PyObject * args, PyObject * kw)
|
||||
{
|
||||
PyDeviceManager * manager;
|
||||
|
||||
if (PyGObject_tp_init ((PyObject *) self, args, kw) < 0)
|
||||
return -1;
|
||||
|
||||
if (!PyArg_ParseTuple (args, "O!", PYFRIDA_TYPE_OBJECT (DeviceManager), &manager))
|
||||
return -1;
|
||||
g_atomic_int_inc (&toplevel_objects_alive);
|
||||
|
||||
PyGObject_take_handle (&self->parent, frida_compiler_new (PY_GOBJECT_HANDLE (manager)), PYFRIDA_TYPE (Compiler));
|
||||
PyGObject_take_handle (&self->parent, frida_compiler_new (NULL), PYFRIDA_TYPE (Compiler));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
PyCompiler_dealloc (PyCompiler * self)
|
||||
{
|
||||
g_atomic_int_dec_and_test (&toplevel_objects_alive);
|
||||
|
||||
PyGObject_tp_dealloc ((PyObject *) self);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
PyCompiler_build (PyCompiler * self, PyObject * args, PyObject * kw)
|
||||
{
|
||||
PyObject * result;
|
||||
static char * keywords[] = { "entrypoint", "project_root", "source_maps", "compression", NULL };
|
||||
static char * keywords[] = { "entrypoint", "project_root", "output_format", "bundle_format", "type_check", "source_maps", "compression",
|
||||
"platform", "externals", NULL };
|
||||
const char * entrypoint;
|
||||
const char * project_root = NULL;
|
||||
const char * output_format = NULL;
|
||||
const char * bundle_format = NULL;
|
||||
const char * type_check = NULL;
|
||||
const char * source_maps = NULL;
|
||||
const char * compression = NULL;
|
||||
const char * platform = NULL;
|
||||
PyObject * externals = NULL;
|
||||
FridaBuildOptions * options;
|
||||
GError * error = NULL;
|
||||
gchar * bundle;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords (args, kw, "s|sss", keywords, &entrypoint, &project_root, &source_maps, &compression))
|
||||
if (!PyArg_ParseTupleAndKeywords (args, kw, "s|sssssssO", keywords, &entrypoint, &project_root, &output_format, &bundle_format,
|
||||
&type_check, &source_maps, &compression, &platform, &externals))
|
||||
return NULL;
|
||||
|
||||
options = frida_build_options_new ();
|
||||
if (!PyCompiler_set_options (FRIDA_COMPILER_OPTIONS (options), project_root, source_maps, compression))
|
||||
if (!PyCompiler_set_options (FRIDA_COMPILER_OPTIONS (options), project_root, output_format, bundle_format, type_check, source_maps,
|
||||
compression, platform, externals))
|
||||
goto invalid_option_value;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
@@ -4808,19 +4994,27 @@ invalid_option_value:
|
||||
static PyObject *
|
||||
PyCompiler_watch (PyCompiler * self, PyObject * args, PyObject * kw)
|
||||
{
|
||||
static char * keywords[] = { "entrypoint", "project_root", "source_maps", "compression", NULL };
|
||||
static char * keywords[] = { "entrypoint", "project_root", "output_format", "bundle_format", "type_check", "source_maps", "compression",
|
||||
"platform", "externals", NULL };
|
||||
const char * entrypoint;
|
||||
const char * project_root = NULL;
|
||||
const char * output_format = NULL;
|
||||
const char * bundle_format = NULL;
|
||||
const char * type_check = NULL;
|
||||
const char * source_maps = NULL;
|
||||
const char * compression = NULL;
|
||||
const char * platform = NULL;
|
||||
PyObject * externals = NULL;
|
||||
FridaWatchOptions * options;
|
||||
GError * error = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords (args, kw, "s|sss", keywords, &entrypoint, &project_root, &source_maps, &compression))
|
||||
if (!PyArg_ParseTupleAndKeywords (args, kw, "s|sssssssO", keywords, &entrypoint, &project_root, &output_format, &bundle_format,
|
||||
&type_check, &source_maps, &compression, &platform, &externals))
|
||||
return NULL;
|
||||
|
||||
options = frida_watch_options_new ();
|
||||
if (!PyCompiler_set_options (FRIDA_COMPILER_OPTIONS (options), project_root, source_maps, compression))
|
||||
if (!PyCompiler_set_options (FRIDA_COMPILER_OPTIONS (options), project_root, output_format, bundle_format, type_check, source_maps,
|
||||
compression, platform, externals))
|
||||
goto invalid_option_value;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
@@ -4842,12 +5036,43 @@ invalid_option_value:
|
||||
}
|
||||
|
||||
static gboolean
|
||||
PyCompiler_set_options (FridaCompilerOptions * options, const gchar * project_root_value, const gchar * source_maps_value,
|
||||
const gchar * compression_value)
|
||||
PyCompiler_set_options (FridaCompilerOptions * options, const gchar * project_root_value, const gchar * output_format_value,
|
||||
const gchar * bundle_format_value, const gchar * type_check_value, const gchar * source_maps_value, const gchar * compression_value,
|
||||
const gchar * platform_value, PyObject * externals_value)
|
||||
{
|
||||
if (project_root_value != NULL)
|
||||
frida_compiler_options_set_project_root (options, project_root_value);
|
||||
|
||||
if (output_format_value != NULL)
|
||||
{
|
||||
FridaOutputFormat output_format;
|
||||
|
||||
if (!PyGObject_unmarshal_enum (output_format_value, FRIDA_TYPE_OUTPUT_FORMAT, &output_format))
|
||||
return FALSE;
|
||||
|
||||
frida_compiler_options_set_output_format (options, output_format);
|
||||
}
|
||||
|
||||
if (bundle_format_value != NULL)
|
||||
{
|
||||
FridaBundleFormat bundle_format;
|
||||
|
||||
if (!PyGObject_unmarshal_enum (bundle_format_value, FRIDA_TYPE_BUNDLE_FORMAT, &bundle_format))
|
||||
return FALSE;
|
||||
|
||||
frida_compiler_options_set_bundle_format (options, bundle_format);
|
||||
}
|
||||
|
||||
if (type_check_value != NULL)
|
||||
{
|
||||
FridaTypeCheckMode type_check;
|
||||
|
||||
if (!PyGObject_unmarshal_enum (type_check_value, FRIDA_TYPE_TYPE_CHECK_MODE, &type_check))
|
||||
return FALSE;
|
||||
|
||||
frida_compiler_options_set_type_check (options, type_check);
|
||||
}
|
||||
|
||||
if (source_maps_value != NULL)
|
||||
{
|
||||
FridaSourceMaps source_maps;
|
||||
@@ -4868,10 +5093,457 @@ PyCompiler_set_options (FridaCompilerOptions * options, const gchar * project_ro
|
||||
frida_compiler_options_set_compression (options, compression);
|
||||
}
|
||||
|
||||
if (platform_value != NULL)
|
||||
{
|
||||
FridaJsPlatform platform;
|
||||
|
||||
if (!PyGObject_unmarshal_enum (platform_value, FRIDA_TYPE_JS_PLATFORM, &platform))
|
||||
return FALSE;
|
||||
|
||||
frida_compiler_options_set_platform (options, platform);
|
||||
}
|
||||
|
||||
if (externals_value != NULL)
|
||||
{
|
||||
gint n, i;
|
||||
|
||||
n = PySequence_Size (externals_value);
|
||||
if (n == -1)
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i != n; i++)
|
||||
{
|
||||
PyObject * element;
|
||||
gchar * external = NULL;
|
||||
|
||||
element = PySequence_GetItem (externals_value, i);
|
||||
if (element == NULL)
|
||||
return FALSE;
|
||||
PyGObject_unmarshal_string (element, &external);
|
||||
Py_DecRef (element);
|
||||
if (external == NULL)
|
||||
return FALSE;
|
||||
|
||||
frida_compiler_options_add_external (options, external);
|
||||
|
||||
g_free (external);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
PyPackageManager_init (PyPackageManager * self, PyObject * args, PyObject * kw)
|
||||
{
|
||||
if (PyGObject_tp_init ((PyObject *) self, args, kw) < 0)
|
||||
return -1;
|
||||
|
||||
g_atomic_int_inc (&toplevel_objects_alive);
|
||||
|
||||
PyGObject_take_handle (&self->parent, frida_package_manager_new (), PYFRIDA_TYPE (PackageManager));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
PyPackageManager_dealloc (PyPackageManager * self)
|
||||
{
|
||||
g_atomic_int_dec_and_test (&toplevel_objects_alive);
|
||||
|
||||
PyGObject_tp_dealloc ((PyObject *) self);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
PyPackageManager_repr (PyPackageManager * self)
|
||||
{
|
||||
PyObject * result;
|
||||
gchar * repr;
|
||||
|
||||
repr = g_strdup_printf ("PackageManager(registry=\"%s\")", frida_package_manager_get_registry (PY_GOBJECT_HANDLE (self)));
|
||||
result = PyUnicode_FromString (repr);
|
||||
g_free (repr);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
PyPackageManager_get_registry (PyPackageManager * self, void * closure)
|
||||
{
|
||||
return PyUnicode_FromString (frida_package_manager_get_registry (PY_GOBJECT_HANDLE (self)));
|
||||
}
|
||||
|
||||
static int
|
||||
PyPackageManager_set_registry (PyPackageManager * self, PyObject * val, void * closure)
|
||||
{
|
||||
gchar * registry;
|
||||
|
||||
if (!PyGObject_unmarshal_string (val, ®istry))
|
||||
return -1;
|
||||
frida_package_manager_set_registry (PY_GOBJECT_HANDLE (self), registry);
|
||||
g_free (registry);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
PyPackageManager_search (PyPackageManager * self, PyObject * args, PyObject * kw)
|
||||
{
|
||||
FridaPackageSearchResult * result;
|
||||
static char * keywords[] = { "query", "offset", "limit", NULL };
|
||||
const char * query;
|
||||
guint offset = G_MAXUINT;
|
||||
guint limit = G_MAXUINT;
|
||||
FridaPackageSearchOptions * options;
|
||||
GError * error = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords (args, kw, "s|II", keywords, &query, &offset, &limit))
|
||||
return NULL;
|
||||
|
||||
options = frida_package_search_options_new ();
|
||||
|
||||
if (offset != G_MAXUINT)
|
||||
frida_package_search_options_set_offset (options, offset);
|
||||
|
||||
if (limit != G_MAXUINT)
|
||||
frida_package_search_options_set_limit (options, limit);
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
result = frida_package_manager_search_sync (PY_GOBJECT_HANDLE (self), query, options, g_cancellable_get_current (), &error);
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
g_object_unref (options);
|
||||
|
||||
if (error != NULL)
|
||||
return PyFrida_raise (error);
|
||||
|
||||
return PyPackageSearchResult_new_take_handle (result);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
PyPackageManager_install (PyPackageManager * self, PyObject * args, PyObject * kw)
|
||||
{
|
||||
FridaPackageInstallResult * result;
|
||||
static char * keywords[] = { "project_root", "role", "specs", "omits", NULL };
|
||||
const char * project_root = NULL;
|
||||
const char * role_value = NULL;
|
||||
PyObject * specs = NULL;
|
||||
PyObject * omits = NULL;
|
||||
FridaPackageInstallOptions * options;
|
||||
GError * error = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords (args, kw, "|ssOO", keywords, &project_root, &role_value, &specs, &omits))
|
||||
return NULL;
|
||||
|
||||
options = PyPackageManager_parse_install_options (project_root, role_value, specs, omits);
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
result = frida_package_manager_install_sync (PY_GOBJECT_HANDLE (self), options, g_cancellable_get_current (), &error);
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
g_object_unref (options);
|
||||
|
||||
if (error != NULL)
|
||||
return PyFrida_raise (error);
|
||||
|
||||
return PyPackageInstallResult_new_take_handle (result);
|
||||
}
|
||||
|
||||
static FridaPackageInstallOptions *
|
||||
PyPackageManager_parse_install_options (const gchar * project_root, const char * role_value, PyObject * specs_value, PyObject * omits_value)
|
||||
{
|
||||
FridaPackageInstallOptions * options;
|
||||
|
||||
options = frida_package_install_options_new ();
|
||||
|
||||
if (project_root != NULL)
|
||||
frida_package_install_options_set_project_root (options, project_root);
|
||||
|
||||
if (role_value != NULL)
|
||||
{
|
||||
FridaPackageRole role;
|
||||
|
||||
if (!PyGObject_unmarshal_enum (role_value, FRIDA_TYPE_PACKAGE_ROLE, &role))
|
||||
goto propagate_error;
|
||||
|
||||
frida_package_install_options_set_role (options, role);
|
||||
}
|
||||
|
||||
if (specs_value != NULL)
|
||||
{
|
||||
gint n, i;
|
||||
|
||||
n = PySequence_Size (specs_value);
|
||||
if (n == -1)
|
||||
goto propagate_error;
|
||||
|
||||
for (i = 0; i != n; i++)
|
||||
{
|
||||
PyObject * element;
|
||||
gchar * spec = NULL;
|
||||
|
||||
element = PySequence_GetItem (specs_value, i);
|
||||
if (element == NULL)
|
||||
goto propagate_error;
|
||||
PyGObject_unmarshal_string (element, &spec);
|
||||
Py_DecRef (element);
|
||||
if (spec == NULL)
|
||||
goto propagate_error;
|
||||
|
||||
frida_package_install_options_add_spec (options, spec);
|
||||
|
||||
g_free (spec);
|
||||
}
|
||||
}
|
||||
|
||||
if (omits_value != NULL)
|
||||
{
|
||||
gint n, i;
|
||||
|
||||
n = PySequence_Size (omits_value);
|
||||
if (n == -1)
|
||||
goto propagate_error;
|
||||
|
||||
for (i = 0; i != n; i++)
|
||||
{
|
||||
PyObject * element;
|
||||
gchar * str = NULL;
|
||||
FridaPackageRole role;
|
||||
|
||||
element = PySequence_GetItem (omits_value, i);
|
||||
if (element == NULL)
|
||||
goto propagate_error;
|
||||
PyGObject_unmarshal_string (element, &str);
|
||||
Py_DecRef (element);
|
||||
if (str == NULL)
|
||||
goto propagate_error;
|
||||
|
||||
if (!PyGObject_unmarshal_enum (str, FRIDA_TYPE_PACKAGE_ROLE, &role))
|
||||
goto propagate_error;
|
||||
|
||||
frida_package_install_options_add_omit (options, role);
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
|
||||
propagate_error:
|
||||
{
|
||||
g_object_unref (options);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static PyObject *
|
||||
PyPackage_new_take_handle (FridaPackage * handle)
|
||||
{
|
||||
return PyGObject_new_take_handle (handle, PYFRIDA_TYPE (Package));
|
||||
}
|
||||
|
||||
static int
|
||||
PyPackage_init (PyPackage * self, PyObject * args, PyObject * kw)
|
||||
{
|
||||
if (PyGObject_tp_init ((PyObject *) self, args, kw) < 0)
|
||||
return -1;
|
||||
|
||||
self->name = NULL;
|
||||
self->version = NULL;
|
||||
self->description = NULL;
|
||||
self->url = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
PyPackage_init_from_handle (PyPackage * self, FridaPackage * handle)
|
||||
{
|
||||
self->name = PyUnicode_FromString (frida_package_get_name (handle));
|
||||
self->version = PyUnicode_FromString (frida_package_get_version (handle));
|
||||
self->description = PyGObject_marshal_string (frida_package_get_description (handle));
|
||||
self->url = PyGObject_marshal_string (frida_package_get_url (handle));
|
||||
}
|
||||
|
||||
static void
|
||||
PyPackage_dealloc (PyPackage * self)
|
||||
{
|
||||
Py_DecRef (self->url);
|
||||
Py_DecRef (self->description);
|
||||
Py_DecRef (self->version);
|
||||
Py_DecRef (self->name);
|
||||
|
||||
PyGObject_tp_dealloc ((PyObject *) self);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
PyPackage_repr (PyPackage * self)
|
||||
{
|
||||
PyObject * result;
|
||||
FridaPackage * handle;
|
||||
GString * repr;
|
||||
const gchar * description, * url;
|
||||
|
||||
handle = PY_GOBJECT_HANDLE (self);
|
||||
|
||||
repr = g_string_sized_new (256);
|
||||
|
||||
g_string_append_printf (repr, "Package(name=\"%s\", version=\"%s\"",
|
||||
frida_package_get_name (handle),
|
||||
frida_package_get_version (handle));
|
||||
|
||||
description = frida_package_get_description (handle);
|
||||
if (description != NULL)
|
||||
{
|
||||
gchar * escaped = g_strescape (description, NULL);
|
||||
g_string_append_printf (repr, ", description=\"%s\"", escaped);
|
||||
g_free (escaped);
|
||||
}
|
||||
|
||||
url = frida_package_get_url (handle);
|
||||
if (url != NULL)
|
||||
g_string_append_printf (repr, ", url=\"%s\"", url);
|
||||
|
||||
g_string_append (repr, ")");
|
||||
|
||||
result = PyUnicode_FromString (repr->str);
|
||||
|
||||
g_string_free (repr, TRUE);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static PyObject *
|
||||
PyPackageList_marshal (FridaPackageList * list)
|
||||
{
|
||||
PyObject * result;
|
||||
gint n, i;
|
||||
|
||||
n = frida_package_list_size (list);
|
||||
result = PyList_New (n);
|
||||
for (i = 0; i != n; i++)
|
||||
PyList_SetItem (result, i, PyPackage_new_take_handle (frida_package_list_get (list, i)));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static PyObject *
|
||||
PyPackageSearchResult_new_take_handle (FridaPackageSearchResult * handle)
|
||||
{
|
||||
return PyGObject_new_take_handle (handle, PYFRIDA_TYPE (PackageSearchResult));
|
||||
}
|
||||
|
||||
static int
|
||||
PyPackageSearchResult_init (PyPackageSearchResult * self, PyObject * args, PyObject * kw)
|
||||
{
|
||||
if (PyGObject_tp_init ((PyObject *) self, args, kw) < 0)
|
||||
return -1;
|
||||
|
||||
self->packages = NULL;
|
||||
self->total = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
PyPackageSearchResult_init_from_handle (PyPackageSearchResult * self, FridaPackageSearchResult * handle)
|
||||
{
|
||||
self->packages = PyPackageList_marshal (frida_package_search_result_get_packages (handle));
|
||||
self->total = frida_package_search_result_get_total (handle);
|
||||
}
|
||||
|
||||
static void
|
||||
PyPackageSearchResult_dealloc (PyPackageSearchResult * self)
|
||||
{
|
||||
Py_DecRef (self->packages);
|
||||
|
||||
PyGObject_tp_dealloc ((PyObject *) self);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
PyPackageSearchResult_repr (PyPackageSearchResult * self)
|
||||
{
|
||||
PyObject * result;
|
||||
GString * repr;
|
||||
gint num_packages;
|
||||
|
||||
repr = g_string_new ("PackageSearchResult(packages=");
|
||||
|
||||
num_packages = frida_package_list_size (frida_package_search_result_get_packages (PY_GOBJECT_HANDLE (self)));
|
||||
if (num_packages != 0)
|
||||
g_string_append_printf (repr, "[<%u package%s>]", num_packages, (num_packages == 1) ? "" : "s");
|
||||
else
|
||||
g_string_append (repr, "[]");
|
||||
|
||||
g_string_append_printf (repr, ", total=%u)", self->total);
|
||||
|
||||
result = PyUnicode_FromString (repr->str);
|
||||
|
||||
g_string_free (repr, TRUE);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static PyObject *
|
||||
PyPackageInstallResult_new_take_handle (FridaPackageInstallResult * handle)
|
||||
{
|
||||
return PyGObject_new_take_handle (handle, PYFRIDA_TYPE (PackageInstallResult));
|
||||
}
|
||||
|
||||
static int
|
||||
PyPackageInstallResult_init (PyPackageInstallResult * self, PyObject * args, PyObject * kw)
|
||||
{
|
||||
if (PyGObject_tp_init ((PyObject *) self, args, kw) < 0)
|
||||
return -1;
|
||||
|
||||
self->packages = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
PyPackageInstallResult_init_from_handle (PyPackageInstallResult * self, FridaPackageInstallResult * handle)
|
||||
{
|
||||
self->packages = PyPackageList_marshal (frida_package_install_result_get_packages (handle));
|
||||
}
|
||||
|
||||
static void
|
||||
PyPackageInstallResult_dealloc (PyPackageInstallResult * self)
|
||||
{
|
||||
Py_DecRef (self->packages);
|
||||
|
||||
PyGObject_tp_dealloc ((PyObject *) self);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
PyPackageInstallResult_repr (PyPackageInstallResult * self)
|
||||
{
|
||||
PyObject * result;
|
||||
GString * repr;
|
||||
gint num_packages;
|
||||
|
||||
repr = g_string_new ("PackageInstallResult(packages=");
|
||||
|
||||
num_packages = frida_package_list_size (frida_package_install_result_get_packages (PY_GOBJECT_HANDLE (self)));
|
||||
if (num_packages != 0)
|
||||
g_string_append_printf (repr, "[<%u package%s>]", num_packages, (num_packages == 1) ? "" : "s");
|
||||
else
|
||||
g_string_append (repr, "[]");
|
||||
|
||||
g_string_append (repr, ")");
|
||||
|
||||
result = PyUnicode_FromString (repr->str);
|
||||
|
||||
g_string_free (repr, TRUE);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
PyFileMonitor_init (PyFileMonitor * self, PyObject * args, PyObject * kw)
|
||||
{
|
||||
@@ -4883,11 +5555,21 @@ PyFileMonitor_init (PyFileMonitor * self, PyObject * args, PyObject * kw)
|
||||
if (!PyArg_ParseTuple (args, "s", &path))
|
||||
return -1;
|
||||
|
||||
g_atomic_int_inc (&toplevel_objects_alive);
|
||||
|
||||
PyGObject_take_handle (&self->parent, frida_file_monitor_new (path), PYFRIDA_TYPE (FileMonitor));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
PyFileMonitor_dealloc (PyFileMonitor * self)
|
||||
{
|
||||
g_atomic_int_dec_and_test (&toplevel_objects_alive);
|
||||
|
||||
PyGObject_tp_dealloc ((PyObject *) self);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
PyFileMonitor_enable (PyFileMonitor * self)
|
||||
{
|
||||
@@ -5037,6 +5719,12 @@ PyIOStream_read_all (PyIOStream * self, PyObject * args)
|
||||
|
||||
if (error == NULL)
|
||||
{
|
||||
if ((unsigned long) bytes_read != count)
|
||||
{
|
||||
Py_DecRef (buffer);
|
||||
buffer = PyBytes_FromString ("");
|
||||
}
|
||||
|
||||
result = buffer;
|
||||
}
|
||||
else
|
||||
@@ -5438,6 +6126,10 @@ PyInit__frida (void)
|
||||
PYFRIDA_REGISTER_TYPE (PortalService, FRIDA_TYPE_PORTAL_SERVICE);
|
||||
PYFRIDA_REGISTER_TYPE (EndpointParameters, FRIDA_TYPE_ENDPOINT_PARAMETERS);
|
||||
PYFRIDA_REGISTER_TYPE (Compiler, FRIDA_TYPE_COMPILER);
|
||||
PYFRIDA_REGISTER_TYPE (PackageManager, FRIDA_TYPE_PACKAGE_MANAGER);
|
||||
PYFRIDA_REGISTER_TYPE (Package, FRIDA_TYPE_PACKAGE);
|
||||
PYFRIDA_REGISTER_TYPE (PackageSearchResult, FRIDA_TYPE_PACKAGE_SEARCH_RESULT);
|
||||
PYFRIDA_REGISTER_TYPE (PackageInstallResult, FRIDA_TYPE_PACKAGE_INSTALL_RESULT);
|
||||
PYFRIDA_REGISTER_TYPE (FileMonitor, FRIDA_TYPE_FILE_MONITOR);
|
||||
PYFRIDA_REGISTER_TYPE (IOStream, G_TYPE_IO_STREAM);
|
||||
PYFRIDA_REGISTER_TYPE (Cancellable, G_TYPE_CANCELLABLE);
|
||||
|
||||
+142
-67
@@ -33,10 +33,15 @@ if sys.version_info >= (3, 8):
|
||||
else:
|
||||
from typing_extensions import Literal, TypedDict
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
from typing import NotRequired
|
||||
if sys.version_info >= (3, 10):
|
||||
from typing import ParamSpec
|
||||
else:
|
||||
from typing_extensions import NotRequired
|
||||
from typing_extensions import ParamSpec
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
from typing import NotRequired, cast
|
||||
else:
|
||||
from typing_extensions import NotRequired, cast
|
||||
|
||||
from . import _frida
|
||||
|
||||
@@ -72,15 +77,18 @@ def _filter_missing_kwargs(d: MutableMapping[Any, Any]) -> None:
|
||||
d.pop(key)
|
||||
|
||||
|
||||
R = TypeVar("R")
|
||||
P = ParamSpec("P")
|
||||
R = TypeVar("R", covariant=True)
|
||||
|
||||
|
||||
def cancellable(f: Callable[..., R]) -> Callable[..., R]:
|
||||
def cancellable(f: Callable[P, R]) -> Callable[P, R]:
|
||||
# currently there is no way to type properly the extended callable with optional cancellable parameter
|
||||
# ref: https://github.com/python/typing/discussions/1905#discussioncomment-11696995
|
||||
@functools.wraps(f)
|
||||
def wrapper(*args: Any, **kwargs: Any) -> R:
|
||||
def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
|
||||
cancellable = kwargs.pop("cancellable", None)
|
||||
if cancellable is not None:
|
||||
with cancellable:
|
||||
with cast(Cancellable, cancellable):
|
||||
return f(*args, **kwargs)
|
||||
|
||||
return f(*args, **kwargs)
|
||||
@@ -351,9 +359,6 @@ class Script:
|
||||
@overload
|
||||
def on(self, signal: Literal["message"], callback: ScriptMessageCallback) -> None: ...
|
||||
|
||||
@overload
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
"""
|
||||
Add a signal handler
|
||||
@@ -370,9 +375,6 @@ class Script:
|
||||
@overload
|
||||
def off(self, signal: Literal["message"], callback: ScriptMessageCallback) -> None: ...
|
||||
|
||||
@overload
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
"""
|
||||
Remove a signal handler
|
||||
@@ -693,34 +695,22 @@ class Session:
|
||||
_filter_missing_kwargs(kwargs)
|
||||
return PortalMembership(self._impl.join_portal(address, **kwargs))
|
||||
|
||||
@overload
|
||||
def on(
|
||||
self,
|
||||
signal: Literal["detached"],
|
||||
callback: SessionDetachedCallback,
|
||||
) -> None: ...
|
||||
|
||||
@overload
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
) -> None:
|
||||
"""
|
||||
Add a signal handler
|
||||
"""
|
||||
|
||||
self._impl.on(signal, callback)
|
||||
|
||||
@overload
|
||||
def off(
|
||||
self,
|
||||
signal: Literal["detached"],
|
||||
callback: SessionDetachedCallback,
|
||||
) -> None: ...
|
||||
|
||||
@overload
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
) -> None:
|
||||
"""
|
||||
Remove a signal handler
|
||||
"""
|
||||
@@ -763,9 +753,6 @@ class Bus:
|
||||
@overload
|
||||
def on(self, signal: Literal["message"], callback: BusMessageCallback) -> None: ...
|
||||
|
||||
@overload
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
"""
|
||||
Add a signal handler
|
||||
@@ -782,9 +769,6 @@ class Bus:
|
||||
@overload
|
||||
def off(self, signal: Literal["message"], callback: BusMessageCallback) -> None: ...
|
||||
|
||||
@overload
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
"""
|
||||
Remove a signal handler
|
||||
@@ -842,9 +826,6 @@ class Service:
|
||||
@overload
|
||||
def on(self, signal: Literal["message"], callback: ServiceMessageCallback) -> None: ...
|
||||
|
||||
@overload
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
"""
|
||||
Add a signal handler
|
||||
@@ -858,9 +839,6 @@ class Service:
|
||||
@overload
|
||||
def off(self, signal: Literal["message"], callback: ServiceMessageCallback) -> None: ...
|
||||
|
||||
@overload
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
"""
|
||||
Remove a signal handler
|
||||
@@ -1144,9 +1122,6 @@ class Device:
|
||||
@overload
|
||||
def on(self, signal: Literal["lost"], callback: DeviceLostCallback) -> None: ...
|
||||
|
||||
@overload
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
"""
|
||||
Add a signal handler
|
||||
@@ -1178,9 +1153,6 @@ class Device:
|
||||
@overload
|
||||
def off(self, signal: Literal["lost"], callback: DeviceLostCallback) -> None: ...
|
||||
|
||||
@overload
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
"""
|
||||
Remove a signal handler
|
||||
@@ -1298,9 +1270,6 @@ class DeviceManager:
|
||||
@overload
|
||||
def on(self, signal: Literal["changed"], callback: DeviceManagerChangedCallback) -> None: ...
|
||||
|
||||
@overload
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
"""
|
||||
Add a signal handler
|
||||
@@ -1317,9 +1286,6 @@ class DeviceManager:
|
||||
@overload
|
||||
def off(self, signal: Literal["changed"], callback: DeviceManagerChangedCallback) -> None: ...
|
||||
|
||||
@overload
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
"""
|
||||
Remove a signal handler
|
||||
@@ -1490,9 +1456,6 @@ class PortalService:
|
||||
@overload
|
||||
def on(self, signal: Literal["message"], callback: PortalServiceMessageCallback) -> None: ...
|
||||
|
||||
@overload
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
"""
|
||||
Add a signal handler
|
||||
@@ -1554,10 +1517,17 @@ CompilerFinishedCallback = Callable[[], None]
|
||||
CompilerOutputCallback = Callable[[str], None]
|
||||
CompilerDiagnosticsCallback = Callable[[List[CompilerDiagnostic]], None]
|
||||
|
||||
CompilerOutputFormat = Literal["unescaped", "hex-bytes", "c-string"]
|
||||
CompilerBundleFormat = Literal["esm", "iife"]
|
||||
CompilerTypeCheck = Literal["full", "none"]
|
||||
CompilerSourceMaps = Literal["included", "omitted"]
|
||||
CompilerCompression = Literal["none", "terser"]
|
||||
CompilerPlatform = Literal["neutral", "gum", "browser"]
|
||||
|
||||
|
||||
class Compiler:
|
||||
def __init__(self) -> None:
|
||||
self._impl = _frida.Compiler(get_device_manager()._impl)
|
||||
self._impl = _frida.Compiler()
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return repr(self._impl)
|
||||
@@ -1567,10 +1537,24 @@ class Compiler:
|
||||
self,
|
||||
entrypoint: str,
|
||||
project_root: Optional[str] = None,
|
||||
source_maps: Optional[str] = None,
|
||||
compression: Optional[str] = None,
|
||||
output_format: Optional[CompilerOutputFormat] = None,
|
||||
bundle_format: Optional[CompilerBundleFormat] = None,
|
||||
type_check: Optional[CompilerTypeCheck] = None,
|
||||
source_maps: Optional[CompilerSourceMaps] = None,
|
||||
compression: Optional[CompilerCompression] = None,
|
||||
platform: Optional[CompilerPlatform] = None,
|
||||
externals: Optional[Sequence[str]] = None,
|
||||
) -> str:
|
||||
kwargs = {"project_root": project_root, "source_maps": source_maps, "compression": compression}
|
||||
kwargs: dict[str, Any] = {
|
||||
"project_root": project_root,
|
||||
"output_format": output_format,
|
||||
"bundle_format": bundle_format,
|
||||
"type_check": type_check,
|
||||
"source_maps": source_maps,
|
||||
"compression": compression,
|
||||
"platform": platform,
|
||||
"externals": externals,
|
||||
}
|
||||
_filter_missing_kwargs(kwargs)
|
||||
return self._impl.build(entrypoint, **kwargs)
|
||||
|
||||
@@ -1579,10 +1563,24 @@ class Compiler:
|
||||
self,
|
||||
entrypoint: str,
|
||||
project_root: Optional[str] = None,
|
||||
source_maps: Optional[str] = None,
|
||||
compression: Optional[str] = None,
|
||||
output_format: Optional[CompilerOutputFormat] = None,
|
||||
bundle_format: Optional[CompilerBundleFormat] = None,
|
||||
type_check: Optional[CompilerTypeCheck] = None,
|
||||
source_maps: Optional[CompilerSourceMaps] = None,
|
||||
compression: Optional[CompilerCompression] = None,
|
||||
platform: Optional[CompilerPlatform] = None,
|
||||
externals: Optional[Sequence[str]] = None,
|
||||
) -> None:
|
||||
kwargs = {"project_root": project_root, "source_maps": source_maps, "compression": compression}
|
||||
kwargs: dict[str, Any] = {
|
||||
"project_root": project_root,
|
||||
"output_format": output_format,
|
||||
"bundle_format": bundle_format,
|
||||
"type_check": type_check,
|
||||
"source_maps": source_maps,
|
||||
"compression": compression,
|
||||
"platform": platform,
|
||||
"externals": externals,
|
||||
}
|
||||
_filter_missing_kwargs(kwargs)
|
||||
return self._impl.watch(entrypoint, **kwargs)
|
||||
|
||||
@@ -1598,10 +1596,11 @@ class Compiler:
|
||||
@overload
|
||||
def on(self, signal: Literal["diagnostics"], callback: CompilerDiagnosticsCallback) -> None: ...
|
||||
|
||||
@overload
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def on(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
"""
|
||||
Add a signal handler
|
||||
"""
|
||||
|
||||
self._impl.on(signal, callback)
|
||||
|
||||
@overload
|
||||
@@ -1616,10 +1615,86 @@ class Compiler:
|
||||
@overload
|
||||
def off(self, signal: Literal["diagnostics"], callback: CompilerDiagnosticsCallback) -> None: ...
|
||||
|
||||
@overload
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None: ...
|
||||
|
||||
def off(self, signal: str, callback: Callable[..., Any]) -> None:
|
||||
"""
|
||||
Remove a signal handler
|
||||
"""
|
||||
|
||||
self._impl.off(signal, callback)
|
||||
|
||||
|
||||
PackageManagerInstallProgressCallback = Callable[
|
||||
[
|
||||
Literal[
|
||||
"initializing",
|
||||
"preparing-dependencies",
|
||||
"resolving-package",
|
||||
"fetching-resource",
|
||||
"package-already-installed",
|
||||
"downloading-package",
|
||||
"package-installed",
|
||||
"resolving-and-installing-all",
|
||||
"complete",
|
||||
],
|
||||
float,
|
||||
Optional[str],
|
||||
],
|
||||
None,
|
||||
]
|
||||
|
||||
PackageRole = Literal["runtime", "development", "optional", "peer"]
|
||||
|
||||
|
||||
class PackageManager:
|
||||
def __init__(self) -> None:
|
||||
self._impl = _frida.PackageManager()
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return repr(self._impl)
|
||||
|
||||
@property
|
||||
def registry(self):
|
||||
return self._impl.registry
|
||||
|
||||
@registry.setter
|
||||
def registry(self, value):
|
||||
self._impl.registry = value
|
||||
|
||||
@cancellable
|
||||
def search(
|
||||
self,
|
||||
query: str,
|
||||
offset: Optional[int] = None,
|
||||
limit: Optional[int] = None,
|
||||
) -> _frida.PackageSearchResult:
|
||||
kwargs = {
|
||||
"offset": offset,
|
||||
"limit": limit,
|
||||
}
|
||||
_filter_missing_kwargs(kwargs)
|
||||
return self._impl.search(query, **kwargs)
|
||||
|
||||
@cancellable
|
||||
def install(
|
||||
self,
|
||||
project_root: Optional[str] = None,
|
||||
role: Optional[PackageRole] = None,
|
||||
specs: Optional[Sequence[str]] = None,
|
||||
omits: Optional[Sequence[PackageRole]] = None,
|
||||
) -> _frida.PackageInstallResult:
|
||||
kwargs: Dict[str, Any] = {
|
||||
"project_root": project_root,
|
||||
"role": role,
|
||||
"specs": specs,
|
||||
"omits": omits,
|
||||
}
|
||||
_filter_missing_kwargs(kwargs)
|
||||
return self._impl.install(**kwargs)
|
||||
|
||||
def on(self, signal: Literal["install-progress"], callback: PackageManagerInstallProgressCallback) -> None:
|
||||
self._impl.on(signal, callback)
|
||||
|
||||
def off(self, signal: Literal["install-progress"], callback: PackageManagerInstallProgressCallback) -> None:
|
||||
self._impl.off(signal, callback)
|
||||
|
||||
|
||||
|
||||
+1
-1
Submodule releng updated: 4622f5c4c4...7ed66fe687
@@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/frida/frida-core.git
|
||||
revision = 16.5.3
|
||||
revision = 17.7.1
|
||||
depth = 1
|
||||
|
||||
[provide]
|
||||
|
||||
Reference in New Issue
Block a user