From 143ad34b9ad4d0acad4fc197ccd38953802abb03 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Thu, 5 Mar 2020 15:19:40 +0100 Subject: [PATCH] frida: fix frida-python problem Fix `frida.NotSupportedError: unable to handle 32-bit processes due to build configuration` by making `frida-android-*` instead of `frida_thin-android-*`. --- .../frida-server/0002-Makefile.linux.mk.patch | 13 ----- ...linux.mk.patch => Makefile.linux.mk.patch} | 52 +++++++++++++------ root-packages/frida-server/build.sh | 2 +- 3 files changed, 38 insertions(+), 29 deletions(-) delete mode 100644 root-packages/frida-server/0002-Makefile.linux.mk.patch rename root-packages/frida-server/{0001-Makefile.linux.mk.patch => Makefile.linux.mk.patch} (78%) diff --git a/root-packages/frida-server/0002-Makefile.linux.mk.patch b/root-packages/frida-server/0002-Makefile.linux.mk.patch deleted file mode 100644 index 11b223cb5..000000000 --- a/root-packages/frida-server/0002-Makefile.linux.mk.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../Makefile.linux.mk.orig 2020-02-23 10:58:44.621155388 +0100 -+++ ./Makefile.linux.mk 2020-02-23 11:19:08.482323493 +0100 -@@ -374,8 +378,8 @@ - --prefix $$(FRIDA)/build/$1-$$* \ - --libdir $$(FRIDA)/build/$1-$$*/lib \ - $$$$cross_args \ -- -Dpython=$$(PYTHON) \ -- -Dpython_incdir=$$(PYTHON_INCDIR) \ -+ -Dpython=/usr/bin/python3.8 \ -+ -Dpython_incdir=@TERMUX_PREFIX@/include/python3.8 \ - frida-python $$$$builddir || exit 1; \ - fi; \ - $$(NINJA) -C $$$$builddir install || exit 1 diff --git a/root-packages/frida-server/0001-Makefile.linux.mk.patch b/root-packages/frida-server/Makefile.linux.mk.patch similarity index 78% rename from root-packages/frida-server/0001-Makefile.linux.mk.patch rename to root-packages/frida-server/Makefile.linux.mk.patch index e9fe54fd7..1e0e48194 100644 --- a/root-packages/frida-server/0001-Makefile.linux.mk.patch +++ b/root-packages/frida-server/Makefile.linux.mk.patch @@ -1,17 +1,39 @@ --- ../Makefile.linux.mk.orig 2020-02-23 10:58:44.621155388 +0100 -+++ ./Makefile.linux.mk 2020-02-23 11:19:08.482323493 +0100 -@@ -358,6 +358,10 @@ ++++ ./Makefile.linux.mk 2020-03-05 13:05:54.516984825 +0100 +@@ -236,6 +236,10 @@ + --libdir $(FRIDA)/build/frida-android-x86/lib \ + --cross-file build/frida-android-x86.txt \ + $(frida_core_flags) \ ++ -Dhelper32=$(FRIDA)/build/tmp-android-x86/frida-core/src/frida-helper \ ++ -Dhelper64=$(FRIDA)/build/tmp-android-x86_64/frida-core/src/frida-helper \ ++ -Dagent32=$(FRIDA)/build/tmp-android-x86/frida-core/lib/agent/frida-agent.so \ ++ -Dagent64=$(FRIDA)/build/tmp-android-x86_64/frida-core/lib/agent/frida-agent.so \ + frida-core $$builddir || exit 1; \ + fi + @touch $@ +@@ -266,6 +270,10 @@ + --libdir $(FRIDA)/build/frida-android-arm/lib \ + --cross-file build/frida-android-arm.txt \ + $(frida_core_flags) \ ++ -Dhelper32=$(FRIDA)/build/tmp-android-arm/frida-core/src/frida-helper \ ++ -Dhelper64=$(FRIDA)/build/tmp-android-arm64/frida-core/src/frida-helper \ ++ -Dagent32=$(FRIDA)/build/tmp-android-arm/frida-core/lib/agent/frida-agent.so \ ++ -Dagent64=$(FRIDA)/build/tmp-android-arm64/frida-core/lib/agent/frida-agent.so \ + frida-core $$builddir || exit 1; \ + fi + @touch $@ +@@ -358,6 +366,10 @@ python-linux-x86-thin: build/tmp_thin-linux-x86/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Linux/x86 without cross-arch support python-linux-x86_64-thin: build/tmp_thin-linux-x86_64/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Linux/x86-64 without cross-arch support python-linux-arm64: build/tmp_thin-linux-arm64/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Linux/ARM64 -+python-android-x86: build/tmp_thin-android-x86/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Android/x86 -+python-android-x86_64: build/tmp_thin-android-x86_64/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Android/x86_64 -+python-android-arm: build/tmp_thin-android-arm/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Android/ARM -+python-android-arm64: build/tmp_thin-android-arm64/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Android/ARM64 ++python-android-x86: build/tmp-android-x86/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Android/x86 ++python-android-x86_64: build/tmp-android-x86_64/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Android/x86_64 ++python-android-arm: build/tmp-android-arm/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Android/ARM ++python-android-arm64: build/tmp-android-arm64/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Android/ARM64 define make-python-rule build/$2-%/frida-$$(PYTHON_NAME)/.frida-stamp: build/.frida-python-submodule-stamp build/$1-%/lib/pkgconfig/frida-core-1.0.pc -@@ -404,13 +408,32 @@ +@@ -404,13 +416,32 @@ export PYTHONPATH="$(shell pwd)/build/frida_thin-linux-arm64/lib/$(PYTHON_NAME)/site-packages" \ && cd frida-python \ && ${PYTHON} -m unittest discover @@ -45,7 +67,7 @@ define make-node-rule build/$1-%/lib/node_modules/frida: build/$1-%/lib/pkgconfig/frida-core-1.0.pc build/.frida-node-submodule-stamp -@@ -455,6 +478,14 @@ +@@ -455,6 +486,14 @@ $(call run-node-tests,frida_thin-linux-x86_64,$(FRIDA),$(NODE_BIN_DIR),$(NODE),$(NPM)) check-node-linux-arm64: node-linux-arm64 ##@node Test Node.js bindings for Linux/ARM64 $(call run-node-tests,frida_thin-linux-arm64,$(FRIDA),$(NODE_BIN_DIR),$(NODE),$(NPM)) @@ -60,18 +82,18 @@ tools-linux-x86: build/tmp-linux-x86/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Linux/x86 -@@ -462,6 +493,10 @@ +@@ -462,6 +501,10 @@ tools-linux-x86-thin: build/tmp_thin-linux-x86/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Linux/x86 without cross-arch support tools-linux-x86_64-thin: build/tmp_thin-linux-x86_64/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Linux/x86-64 without cross-arch support tools-linux-arm64: build/tmp_thin-linux-arm64/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Linux/ARM64 -+tools-android-x86: build/tmp_thin-android-x86/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Android/x86 -+tools-android-x86_64: build/tmp_thin-android-x86_64/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Android/x86_64 -+tools-android-arm: build/tmp_thin-android-arm/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Android/ARM -+tools-android-arm64: build/tmp_thin-android-arm64/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Android/ARM64 ++tools-android-x86: build/tmp-android-x86/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Android/x86 ++tools-android-x86_64: build/tmp-android-x86_64/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Android/x86_64 ++tools-android-arm: build/tmp-android-arm/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Android/ARM ++tools-android-arm64: build/tmp-android-arm64/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Android/ARM64 define make-tools-rule build/$2-%/frida-tools-$$(PYTHON_NAME)/.frida-stamp: build/.frida-tools-submodule-stamp build/$2-%/frida-$$(PYTHON_NAME)/.frida-stamp -@@ -507,6 +542,23 @@ +@@ -507,6 +550,23 @@ export PYTHONPATH="$(shell pwd)/build/frida_thin-linux-arm64/lib/$(PYTHON_NAME)/site-packages" \ && cd frida-tools \ && ${PYTHON} -m unittest discover @@ -95,7 +117,7 @@ .PHONY: \ -@@ -536,27 +588,41 @@ +@@ -536,27 +596,41 @@ check-core-linux-x86 check-core-linux-x86_64 \ check-core-linux-x86-thin check-core-linux-x86_64-thin \ check-core-linux-arm64 \ diff --git a/root-packages/frida-server/build.sh b/root-packages/frida-server/build.sh index 073ff3ad5..d994da6be 100644 --- a/root-packages/frida-server/build.sh +++ b/root-packages/frida-server/build.sh @@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="wxWindows" TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91" _MAJOR_VERSION=12 _MINOR_VERSION=8 -_MICRO_VERSION=11 +_MICRO_VERSION=13 TERMUX_PKG_VERSION=${_MAJOR_VERSION}.${_MINOR_VERSION}.${_MICRO_VERSION} TERMUX_PKG_SRCURL=https://github.com/frida/frida.git TERMUX_PKG_DEPENDS="libiconv, python"