updpkg(root/frida): update to 16.0.2

With this update frida is pretty much fully functional again.

Fixes termux/termux-packages#11415
Fixes termux/termux-packages#11113
Fixes termux/termux-packages#12632

frida-discover, which was reported broken in
termux/termux-packages#10170 still does not seem to work (though error
is different than in linked issue):

$ frida-discover -p 9102
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/frida-discover", line 7, in <module>
    import frida_tools.discover
ModuleNotFoundError: No module named 'frida_tools.discover'
This commit is contained in:
Henrik Grimler 2022-10-30 13:10:31 +01:00
parent fde0c2c2ab
commit 8ae810cb43
No known key found for this signature in database
GPG Key ID: B0076E490B71616B
8 changed files with 40 additions and 149 deletions

View File

@ -2,11 +2,10 @@ TERMUX_PKG_HOMEPAGE=https://www.frida.re/
TERMUX_PKG_DESCRIPTION="Dynamic instrumentation toolkit for developers, reverse-engineers, and security researchers"
TERMUX_PKG_LICENSE="wxWindows"
TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91"
_MAJOR_VERSION=15
_MINOR_VERSION=2
_MAJOR_VERSION=16
_MINOR_VERSION=0
_MICRO_VERSION=2
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.${_MINOR_VERSION}.${_MICRO_VERSION}
TERMUX_PKG_REVISION=1
TERMUX_PKG_GIT_BRANCH=$TERMUX_PKG_VERSION
TERMUX_PKG_SRCURL=https://github.com/frida/frida.git
TERMUX_PKG_DEPENDS="libiconv"
@ -15,25 +14,10 @@ TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true
TERMUX_PKG_EXTRA_MAKE_ARGS="ANDROID_NDK_ROOT=$NDK"
TERMUX_PKG_CONFFILES="var/service/frida-server/run var/service/frida-server/down"
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_CONFLICTS="frida-tools (<< 15.1.24-1)"
TERMUX_PKG_BREAKS="frida-server (<< 15.1.24)"
TERMUX_PKG_REPLACES="frida-tools (<< 15.1.24-1), frida-server (<< 15.1.24)"
termux_step_host_build() {
termux_setup_nodejs
# make and save frida-resource-compiler in hostbuild step,
# otherwise the one that is compiled in termux_step_make
# segfaults (seem to be some tool in termux's toolchain bin
# dir that causes it, removing our bin/ dir from PATH fixes
# the issue)
cd $TERMUX_PKG_SRCDIR
make core-linux-x86_64 ${TERMUX_PKG_EXTRA_MAKE_ARGS}
cp build/tmp-linux-x86_64/frida-core/tools/frida-resource-compiler \
$TERMUX_PKG_HOSTBUILD_DIR/
}
termux_step_pre_configure () {
termux_setup_nodejs
@ -53,8 +37,6 @@ termux_step_make () {
arch=${TERMUX_ARCH}
fi
export PATH=$TERMUX_PKG_HOSTBUILD_DIR:$PATH
CC=gcc CXX=g++ make python-android-${arch} ${TERMUX_PKG_EXTRA_MAKE_ARGS}
CC=gcc CXX=g++ make tools-android-${arch} ${TERMUX_PKG_EXTRA_MAKE_ARGS}
}

View File

@ -1,35 +0,0 @@
--- ../setup-env.sh.orig 2022-06-09 20:08:37.737613041 +0000
+++ ./releng/setup-env.sh 2022-06-09 20:08:51.947604601 +0000
@@ -789,19 +789,19 @@
"$FRIDA_RELENG/driver-wrapper-android.sh.in" > "$cxx_wrapper"
chmod +x "$cxx_wrapper"
- CPP="$cc_wrapper -E"
- CC="$cc_wrapper"
- CXX="$cxx_wrapper"
- LD="${android_toolroot}/bin/ld"
-
- AR="${android_toolroot}/bin/llvm-ar"
- NM="${android_toolroot}/bin/llvm-nm"
- RANLIB="${android_toolroot}/bin/llvm-ranlib"
- STRIP="${android_toolroot}/bin/llvm-strip"
- STRIP_FLAGS="--strip-all"
- READELF="${android_toolroot}/bin/llvm-readelf"
- OBJCOPY="${android_toolroot}/bin/llvm-objcopy"
- OBJDUMP="${android_toolroot}/bin/llvm-objdump"
+ CPP="${host_compiler_prefix}cpp"
+ CC="${host_compiler_prefix}clang"
+ CXX="${host_compiler_prefix}clang++"
+ LD="ld.lld"
+
+ AR="llvm-ar"
+ NM="llvm-nm"
+ RANLIB="llvm-ranlib"
+ STRIP="llvm-strip"
+ STRIP_FLAGS="--strip-unneeded --preserve-dates"
+ READELF="llvm-readelf"
+ OBJCOPY="llvm-objcopy"
+ OBJDUMP="llvm-objdump"
CFLAGS="$base_compiler_flags"
LDFLAGS="$base_linker_flags"

View File

@ -0,0 +1,13 @@
--- ./releng/driver-wrapper-android.sh.in.orig 2022-10-30 12:52:48.190659491 +0100
+++ ./releng/driver-wrapper-android.sh.in 2022-10-30 12:52:56.173992267 +0100
@@ -69,10 +69,4 @@
"@driver@" "${base_argv[@]}" "${argv[@]}" || exit $?
-case $output_type in
- executable|shlib)
- "@elf_cleaner@" "$output_path" || exit $?
- ;;
-esac
-
exit 0

View File

@ -1,21 +1,21 @@
--- ./frida-python/src/_frida.c.orig 2022-03-13 17:50:17.883223968 +0100
+++ ./frida-python/src/_frida.c 2022-03-13 17:51:27.582892972 +0100
@@ -45,6 +45,8 @@
--- ./frida-python/src/_frida.c.orig 2022-10-30 12:17:34.324226166 +0100
+++ ./frida-python/src/_frida.c 2022-10-30 12:19:10.690889989 +0100
@@ -46,6 +46,8 @@
# include <crt_externs.h>
#endif
+#include <frida-selinux.h>
+
#define PyUnicode_FromUTF8String(str) PyUnicode_DecodeUTF8 (str, strlen (str), "strict")
#if PY_MAJOR_VERSION >= 3
# define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name (void)
@@ -2412,6 +2414,9 @@
#define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name (void)
#define MOD_DEF(ob, name, doc, methods) \
@@ -1856,6 +1858,9 @@
static int
PyDeviceManager_init (PyDeviceManager * self, PyObject * args, PyObject * kw)
{
+ printf ("patching selinux policy\n");
+ frida_selinux_patch_policy ();
+
if (PyGObjectType.tp_init ((PyObject *) self, args, kw) < 0)
if (PyGObject_tp_init ((PyObject *) self, args, kw) < 0)
return -1;

View File

@ -1,5 +1,5 @@
--- ../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
--- ./frida-python/src/meson.build.orig 2022-10-30 12:19:58.354222018 +0100
+++ ./frida-python/src/meson.build 2022-10-30 12:20:52.214220615 +0100
@@ -9,8 +9,8 @@
name_prefix: '',
name_suffix: 'so',
@ -8,6 +8,6 @@
- link_args: extra_link_args,
+ include_directories: include_directories('@TERMUX_PREFIX@/include', python_incdir),
+ link_args: extra_link_args + ['../frida-core/lib/selinux/libfrida-selinux.a'],
dependencies: [frida_core_dep],
dependencies: [frida_core_dep] + os_deps,
install: true,
install_dir: python_site_packages,

View File

@ -1,58 +0,0 @@
--- ./frida-core/src/meson.build.orig 2022-06-10 09:09:38.955317481 +0200
+++ ./frida-core/src/meson.build 2022-06-10 09:09:54.362354379 +0200
@@ -49,7 +49,7 @@
'frida-data-darwin-blob.S',
],
command: [
- resource_compiler,
+ 'frida-resource-compiler',
'--toolchain=apple',
'-c', '@INPUT0@',
'-o', join_paths(meson.current_build_dir(), 'frida-data-darwin'),
@@ -150,7 +150,7 @@
helper_legacy,
meson.current_build_dir(),
host_os,
- resource_compiler,
+ 'frida-resource-compiler',
'@INPUT0@',
],
)
@@ -187,7 +187,7 @@
'frida-data-android-blob.S',
],
command: [
- resource_compiler,
+ 'frida-resource-compiler',
'--toolchain=gnu',
'-c', '@INPUT0@',
'-o', join_paths(meson.current_build_dir(), 'frida-data-android'),
@@ -266,7 +266,7 @@
helper_legacy,
meson.current_build_dir(),
host_os,
- resource_compiler,
+ 'frida-resource-compiler',
'@INPUT@',
],
)
@@ -324,7 +324,7 @@
get_option('agent_emulated_legacy'),
meson.current_build_dir(),
host_os,
- resource_compiler,
+ 'frida-resource-compiler',
'@INPUT0@',
],
)
--- ./frida-core/src/compiler/meson.build.orig 2022-08-01 10:35:13.873653522 +0200
+++ ./frida-core/src/compiler/meson.build 2022-08-01 10:35:25.233946292 +0200
@@ -34,7 +34,7 @@
'frida-data-compiler-blob.S',
],
command: [
- resource_compiler,
+ 'frida-resource-compiler',
'--toolchain=' + toolchain,
'-c', '@INPUT0@',
'-o', join_paths(meson.current_build_dir(), 'frida-data-compiler'),

View File

@ -1,11 +0,0 @@
--- ./releng/setup-env.sh.orig 2021-12-05 13:14:56.373457925 +0100
+++ ./releng/setup-env.sh 2021-12-05 13:16:27.716458982 +0100
@@ -123,7 +123,7 @@
fi
if [ "$host_os" == "android" ]; then
- ndk_required=24
+ ndk_required=23
if [ -n "$ANDROID_NDK_ROOT" ]; then
if [ -f "$ANDROID_NDK_ROOT/source.properties" ]; then
ndk_installed_version=$(grep Pkg.Revision "$ANDROID_NDK_ROOT/source.properties" | awk '{ split($NF, v, "."); print v[1]; }')

View File

@ -1,15 +1,6 @@
--- ./releng/setup-env.sh.orig 2021-12-05 14:17:02.109846250 +0100
+++ ./releng/setup-env.sh 2021-12-05 14:21:05.179490094 +0100
@@ -458,7 +458,7 @@
NM="${NM:-${host_toolprefix}nm}"
RANLIB="${RANLIB:-${host_toolprefix}ranlib}"
STRIP="${STRIP:-${host_toolprefix}strip}"
- STRIP_FLAGS="--strip-all"
+ STRIP_FLAGS="--strip-unneeded --preserve-dates"
READELF="${READELF:-${host_toolprefix}readelf}"
OBJCOPY="${OBJCOPY:-${host_toolprefix}objcopy}"
OBJDUMP="${OBJDUMP:-${host_toolprefix}objdump}"
@@ -695,7 +695,7 @@
--- ./releng/setup-env.sh.orig 2022-10-30 12:24:03.607549465 +0100
+++ ./releng/setup-env.sh 2022-10-30 12:25:00.977548248 +0100
@@ -703,7 +703,7 @@
host_cxxlibs="c++_static c++abi"
case $host_arch in
x86)
@ -18,7 +9,7 @@
android_abi="x86"
android_target="i686-none-linux-android${android_api}"
android_clang_arch="i386"
@@ -706,7 +706,7 @@
@@ -714,7 +714,7 @@
host_cxxlibs="$host_cxxlibs android_support"
;;
x86_64)
@ -27,7 +18,7 @@
android_abi="x86_64"
android_target="x86_64-none-linux-android${android_api}"
android_clang_arch="x86_64"
@@ -714,7 +714,7 @@
@@ -722,7 +722,7 @@
host_ldflags=""
;;
arm)
@ -36,7 +27,7 @@
android_abi="armeabi-v7a"
android_target="armv7-none-linux-androideabi${android_api}"
android_clang_arch="arm"
@@ -725,7 +725,7 @@
@@ -733,7 +733,7 @@
host_cxxlibs="$host_cxxlibs android_support"
;;
arm64)
@ -45,3 +36,12 @@
android_abi="arm64-v8a"
android_target="aarch64-none-linux-android${android_api}"
android_clang_arch="aarch64"
@@ -805,7 +805,7 @@
selected_nm="${android_toolroot}/bin/llvm-nm"
selected_ranlib="${android_toolroot}/bin/llvm-ranlib"
selected_strip="${android_toolroot}/bin/llvm-strip"
- strip_flags="--strip-all"
+ strip_flags="--strip-unneeded --preserve-dates"
selected_readelf="${android_toolroot}/bin/llvm-readelf"
selected_objcopy="${android_toolroot}/bin/llvm-objcopy"
selected_objdump="${android_toolroot}/bin/llvm-objdump"