mirror of
https://github.com/frida/frida-python
synced 2026-06-08 14:16:17 +00:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 |
+57
-12
@@ -533,7 +533,8 @@ 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 * output_format_value,
|
||||
const gchar * bundle_format_value, const gchar * type_check_value, const gchar * source_maps_value, const gchar * compression_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);
|
||||
@@ -4904,8 +4905,8 @@ static PyObject *
|
||||
PyCompiler_build (PyCompiler * self, PyObject * args, PyObject * kw)
|
||||
{
|
||||
PyObject * result;
|
||||
static char * keywords[] =
|
||||
{ "entrypoint", "project_root", "output_format", "bundle_format", "type_check", "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;
|
||||
@@ -4913,17 +4914,19 @@ PyCompiler_build (PyCompiler * self, PyObject * args, PyObject * kw)
|
||||
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|ssssss", keywords, &entrypoint, &project_root, &output_format, &bundle_format, &type_check,
|
||||
&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, output_format, bundle_format, type_check, source_maps,
|
||||
compression))
|
||||
compression, platform, externals))
|
||||
goto invalid_option_value;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
@@ -4950,8 +4953,8 @@ invalid_option_value:
|
||||
static PyObject *
|
||||
PyCompiler_watch (PyCompiler * self, PyObject * args, PyObject * kw)
|
||||
{
|
||||
static char * keywords[] =
|
||||
{ "entrypoint", "project_root", "output_format", "bundle_format", "type_check", "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;
|
||||
@@ -4959,16 +4962,18 @@ PyCompiler_watch (PyCompiler * self, PyObject * args, PyObject * kw)
|
||||
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|ssssss", keywords, &entrypoint, &project_root, &output_format, &bundle_format, &type_check,
|
||||
&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, output_format, bundle_format, type_check, source_maps,
|
||||
compression))
|
||||
compression, platform, externals))
|
||||
goto invalid_option_value;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
@@ -4991,7 +4996,8 @@ invalid_option_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 * 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);
|
||||
@@ -5046,6 +5052,43 @@ 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;
|
||||
}
|
||||
|
||||
@@ -5208,6 +5251,8 @@ PyPackageManager_parse_install_options (const gchar * project_root, const char *
|
||||
goto propagate_error;
|
||||
|
||||
frida_package_install_options_add_spec (options, spec);
|
||||
|
||||
g_free (spec);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1572,6 +1572,8 @@ class Compiler:
|
||||
type_check: Optional[str] = None,
|
||||
source_maps: Optional[str] = None,
|
||||
compression: Optional[str] = None,
|
||||
platform: Optional[str] = None,
|
||||
externals: Optional[Sequence[str]] = None,
|
||||
) -> str:
|
||||
kwargs = {
|
||||
"project_root": project_root,
|
||||
@@ -1580,6 +1582,8 @@ class Compiler:
|
||||
"type_check": type_check,
|
||||
"source_maps": source_maps,
|
||||
"compression": compression,
|
||||
"platform": platform,
|
||||
"externals": externals,
|
||||
}
|
||||
_filter_missing_kwargs(kwargs)
|
||||
return self._impl.build(entrypoint, **kwargs)
|
||||
@@ -1594,6 +1598,8 @@ class Compiler:
|
||||
type_check: Optional[str] = None,
|
||||
source_maps: Optional[str] = None,
|
||||
compression: Optional[str] = None,
|
||||
platform: Optional[str] = None,
|
||||
externals: Optional[Sequence[str]] = None,
|
||||
) -> None:
|
||||
kwargs = {
|
||||
"project_root": project_root,
|
||||
@@ -1602,6 +1608,8 @@ class Compiler:
|
||||
"type_check": type_check,
|
||||
"source_maps": source_maps,
|
||||
"compression": compression,
|
||||
"platform": platform,
|
||||
"externals": externals,
|
||||
}
|
||||
_filter_missing_kwargs(kwargs)
|
||||
return self._impl.watch(entrypoint, **kwargs)
|
||||
|
||||
+1
-1
Submodule releng updated: 2b34e1c008...800f2385c3
@@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/frida/frida-core.git
|
||||
revision = 17.2.17
|
||||
revision = 17.5.0
|
||||
depth = 1
|
||||
|
||||
[provide]
|
||||
|
||||
Reference in New Issue
Block a user