2018-12-09 17:39:42 +01:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://www.frida.re/
|
2018-03-05 22:15:17 +01:00
|
|
|
TERMUX_PKG_DESCRIPTION="Dynamic instrumentation toolkit for developers, reverse-engineers, and security researchers"
|
2019-01-24 20:15:44 +01:00
|
|
|
TERMUX_PKG_LICENSE="wxWindows"
|
|
|
|
TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91"
|
2019-05-19 09:06:07 +02:00
|
|
|
_MAJOR_VERSION=12
|
2019-07-14 22:41:29 +02:00
|
|
|
_MINOR_VERSION=6
|
|
|
|
_MICRO_VERSION=10
|
2019-05-19 09:06:07 +02:00
|
|
|
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.${_MINOR_VERSION}.${_MICRO_VERSION}
|
2019-01-20 16:36:51 +01:00
|
|
|
TERMUX_PKG_SRCURL=https://github.com/frida/frida.git
|
2019-05-10 08:41:57 +02:00
|
|
|
TERMUX_PKG_DEPENDS="libiconv"
|
2018-03-05 22:15:17 +01:00
|
|
|
TERMUX_PKG_BUILD_IN_SRC=yes
|
|
|
|
TERMUX_PKG_EXTRA_MAKE_ARGS="ANDROID_NDK_ROOT=$HOME/lib/android-ndk"
|
2018-06-13 22:44:37 +02:00
|
|
|
TERMUX_PKG_HOSTBUILD=yes
|
2018-03-05 22:15:17 +01:00
|
|
|
|
2019-01-20 16:36:51 +01:00
|
|
|
termux_step_extract_package() {
|
|
|
|
local CHECKED_OUT_FOLDER=$TERMUX_PKG_CACHEDIR/checkout-$TERMUX_PKG_VERSION
|
|
|
|
if [ ! -d $CHECKED_OUT_FOLDER ]; then
|
|
|
|
local TMP_CHECKOUT=$TERMUX_PKG_TMPDIR/tmp-checkout
|
|
|
|
rm -Rf $TMP_CHECKOUT
|
|
|
|
mkdir -p $TMP_CHECKOUT
|
|
|
|
|
|
|
|
git clone --depth 1 \
|
|
|
|
--branch $TERMUX_PKG_VERSION \
|
|
|
|
$TERMUX_PKG_SRCURL \
|
|
|
|
$TMP_CHECKOUT
|
|
|
|
cd $TMP_CHECKOUT
|
|
|
|
git submodule update --init # --depth 1
|
|
|
|
mv $TMP_CHECKOUT $CHECKED_OUT_FOLDER
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf $TERMUX_PKG_SRCDIR
|
|
|
|
cp -Rf $CHECKED_OUT_FOLDER $TERMUX_PKG_SRCDIR
|
|
|
|
}
|
|
|
|
|
2018-06-13 22:44:37 +02:00
|
|
|
termux_step_host_build () {
|
2018-12-09 17:39:42 +01:00
|
|
|
local node_version=8.14.0 #9.11.2
|
2018-09-29 18:33:27 +02:00
|
|
|
termux_download https://nodejs.org/dist/v${node_version}/node-v${node_version}-linux-x64.tar.xz \
|
2018-12-09 17:39:42 +01:00
|
|
|
${TERMUX_PKG_CACHEDIR}/node-v${node_version}-linux-x64.tar.xz \
|
|
|
|
a56d1af4d7da81504338b09809cf10b3144808d47d4117b9bd9a5a4ec4d5d9b9
|
|
|
|
tar -xf ${TERMUX_PKG_CACHEDIR}/node-v${node_version}-linux-x64.tar.xz --strip-components=1
|
2018-06-13 22:44:37 +02:00
|
|
|
}
|
2018-03-05 22:15:17 +01:00
|
|
|
|
2019-05-19 09:06:07 +02:00
|
|
|
termux_step_post_configure () {
|
|
|
|
# frida-version.h is normally generated from git and the commits.
|
|
|
|
sed -i "s/@TERMUX_PKG_VERSION@/$TERMUX_PKG_VERSION/g" ${TERMUX_PKG_SRCDIR}/build/frida-version.h
|
|
|
|
sed -i "s/@_MAJOR_VERSION@/$_MAJOR_VERSION/g" ${TERMUX_PKG_SRCDIR}/build/frida-version.h
|
|
|
|
sed -i "s/@_MINOR_VERSION@/$_MINOR_VERSION/g" ${TERMUX_PKG_SRCDIR}/build/frida-version.h
|
|
|
|
sed -i "s/@_MICRO_VERSION@/$_MICRO_VERSION/g" ${TERMUX_PKG_SRCDIR}/build/frida-version.h
|
|
|
|
}
|
|
|
|
|
2018-03-05 22:15:17 +01:00
|
|
|
termux_step_make () {
|
2018-12-09 17:39:42 +01:00
|
|
|
if [[ ${TERMUX_ARCH} == "aarch64" ]]; then
|
2018-03-05 22:15:17 +01:00
|
|
|
arch=arm64
|
2018-12-09 17:39:42 +01:00
|
|
|
elif [[ ${TERMUX_ARCH} == "i686" ]]; then
|
2018-06-12 23:19:03 +02:00
|
|
|
arch=x86
|
2018-03-05 22:15:17 +01:00
|
|
|
else
|
2018-12-09 17:39:42 +01:00
|
|
|
arch=${TERMUX_ARCH}
|
2018-03-05 22:15:17 +01:00
|
|
|
fi
|
2019-05-19 09:06:07 +02:00
|
|
|
PATH=${TERMUX_PKG_HOSTBUILD_DIR}/bin:$PATH make core-android-${arch} ${TERMUX_PKG_EXTRA_MAKE_ARGS}
|
2018-06-12 23:19:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_make_install () {
|
2018-06-13 22:44:37 +02:00
|
|
|
# Only include frida-server and frida-inject. Is something else useful?
|
2018-12-09 17:39:42 +01:00
|
|
|
install ${TERMUX_PKG_BUILDDIR}/build/frida-android-${arch}/bin/frida-server ${TERMUX_PREFIX}/bin/
|
|
|
|
install ${TERMUX_PKG_BUILDDIR}/build/frida-android-${arch}/bin/frida-inject ${TERMUX_PREFIX}/bin/
|
2018-03-05 22:15:17 +01:00
|
|
|
}
|