From 0db663ac0d6a30b4ed1ae7e79e14ccc15b54aedd Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Wed, 25 Mar 2020 09:43:49 +0100 Subject: [PATCH] frida-python: patch selinux policy in PyDeviceManager_init --- .../frida-server/frida-python-src-_frida.c.patch | 12 ++++++++++++ .../frida-server/frida-python-src-meson.build.patch | 10 ++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 root-packages/frida-server/frida-python-src-_frida.c.patch diff --git a/root-packages/frida-server/frida-python-src-_frida.c.patch b/root-packages/frida-server/frida-python-src-_frida.c.patch new file mode 100644 index 000000000..aef6fef47 --- /dev/null +++ b/root-packages/frida-server/frida-python-src-_frida.c.patch @@ -0,0 +1,12 @@ +--- ../frida-python-src-_frida.c.orig 2020-03-25 09:09:39.556304220 +0100 ++++ ./frida-python/src/_frida.c 2020-03-25 09:27:46.744314351 +0100 +@@ -1879,6 +1879,9 @@ + static int + PyDeviceManager_init (PyDeviceManager * self, PyObject * args, PyObject * kw) + { ++ printf ("patching selinux policy\n"); ++ frida_selinux_apply_policy_patch (); ++ + if (PyGObjectType.tp_init ((PyObject *) self, args, kw) < 0) + return -1; + diff --git a/root-packages/frida-server/frida-python-src-meson.build.patch b/root-packages/frida-server/frida-python-src-meson.build.patch index 6fdace3a4..f63459c5f 100644 --- a/root-packages/frida-server/frida-python-src-meson.build.patch +++ b/root-packages/frida-server/frida-python-src-meson.build.patch @@ -1,17 +1,19 @@ ---- ../frida-python-src-meson.build.orig 2020-02-23 12:56:01.181265200 +0100 -+++ ./frida-python/src/meson.build 2020-02-23 16:08:00.390756673 +0100 +--- ../frida-python-src-meson.build.orig 2020-03-25 07:54:47.948054199 +0100 ++++ ./frida-python/src/meson.build 2020-03-25 08:44:34.189059770 +0100 @@ -1,4 +1,4 @@ -extra_link_args = [] +extra_link_args = ['-L@TERMUX_PREFIX@/lib', '-lpython3.8'] if host_os_family == 'darwin' extra_link_args += ['-Wl,-exported_symbol,_' + python_plugin_export_name] elif host_os_family != 'windows' -@@ -9,7 +9,7 @@ +@@ -9,8 +9,8 @@ name_prefix: '', name_suffix: 'so', c_args: frida_component_cflags, - include_directories: include_directories(python_incdir), +- link_args: extra_link_args, + include_directories: include_directories('@TERMUX_PREFIX@/include', python_incdir), - link_args: extra_link_args, ++ link_args: extra_link_args + ['../frida-core/lib/selinux/libfrida-selinux.a'], dependencies: [frida_core_dep], install: true, + install_dir: python_site_packages,