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"
|
2018-09-29 18:33:27 +02:00
|
|
|
_MAJOR_VERSION=12
|
|
|
|
_MINOR_VERSION=2
|
2018-12-09 17:39:42 +01:00
|
|
|
_MICRO_VERSION=26
|
2018-06-13 22:44:37 +02:00
|
|
|
TERMUX_PKG_VERSION=()
|
|
|
|
TERMUX_PKG_SHA256=()
|
2018-12-09 17:39:42 +01:00
|
|
|
TERMUX_PKG_VERSION+=(${_MAJOR_VERSION}.$_MINOR_VERSION.$_MICRO_VERSION) # frida
|
2018-06-13 22:44:37 +02:00
|
|
|
# Sort of abusive use of $TERMUX_PKG_VERSION:
|
2018-09-29 18:33:27 +02:00
|
|
|
TERMUX_PKG_VERSION+=(7388bf76dc65d1962d7d514c92de8d6be7555599) # capstone
|
|
|
|
TERMUX_PKG_VERSION+=(7754b239601babc0dcbad4f8ee31681235981adb) # frida-clr
|
2018-12-09 17:39:42 +01:00
|
|
|
TERMUX_PKG_VERSION+=(56b8b55815c67b1fa7b5c483bf92e1724c600175) # frida-core
|
|
|
|
TERMUX_PKG_VERSION+=(a1cdb28e16ff2888c582ddd34b939a6d2b2146d1) # frida-gum
|
|
|
|
TERMUX_PKG_VERSION+=(cb736c69c7d47ee447515f78d476a3e9de525712) # frida-node
|
|
|
|
TERMUX_PKG_VERSION+=(5c2dc4da5549c9c30e7af944281fb3c6033c2c4c) # frida-python
|
2018-10-14 19:39:39 +02:00
|
|
|
TERMUX_PKG_VERSION+=(6e7b9a55b5b59b32e601f6934c2d0a6e3c299161) # frida-qml
|
2018-09-29 18:33:27 +02:00
|
|
|
TERMUX_PKG_VERSION+=(2c9cc1f87b839b8621afdfce43e44da29deaafab) # frida-swift
|
2018-12-09 17:39:42 +01:00
|
|
|
TERMUX_PKG_VERSION+=(cb3df03d31c3f801745485787e5dc9e42809a230) # frida-tools
|
2018-09-29 18:33:27 +02:00
|
|
|
TERMUX_PKG_VERSION+=(931f387786fbc92fa9c678bf72b60fc040ce895a) # releng/meson
|
|
|
|
|
2018-12-09 17:39:42 +01:00
|
|
|
TERMUX_PKG_SHA256+=(c70b70be06c65252c3e5d914101186ade61eb4a6214f4b29e80ad3deecb27557) # frida
|
2018-09-29 18:33:27 +02:00
|
|
|
TERMUX_PKG_SHA256+=(43ef0cc72fc19b72393be94d01dcad48835f98a72475aea8187f47ff8475014d) # capstone
|
2018-12-09 17:39:42 +01:00
|
|
|
TERMUX_PKG_SHA256+=(f5ff752bc03de0c795bc213f04516c6f880a151955bf2b45520b599be472ad56) # frida-clr
|
2018-10-14 19:39:39 +02:00
|
|
|
TERMUX_PKG_SHA256+=(07ee95b8714ab73e66496b27074319c7fa5a4872184a10492ee6b1d387f46dbe) # frida-core
|
2018-12-09 17:39:42 +01:00
|
|
|
TERMUX_PKG_SHA256+=(1d17ffb57936dafd29f4745535a3327af191fcbdc45211fee87abd91662e3ca1) # frida-gum
|
|
|
|
TERMUX_PKG_SHA256+=(fbf0c770d6e38f5cd60b3f0616c495a62da3fd25b5f67b9816ef1024dce82246) # frida-node
|
|
|
|
TERMUX_PKG_SHA256+=(0bffd060a0f8c1bf1ad7b1837c10fc2d39ea2854861b7727f5336bb173e12cea) # frida-python
|
2018-10-14 19:39:39 +02:00
|
|
|
TERMUX_PKG_SHA256+=(c65eb620a879e386268b50e1369c808c0dd92fdcac711b15fb3089b1c1493af9) # frida-qml
|
2018-09-29 18:33:27 +02:00
|
|
|
TERMUX_PKG_SHA256+=(9e5fe8463dfaa829d95787a77f613eef45e15e094e54e7df3c944acedbd76693) # frida-swift
|
2018-12-09 17:39:42 +01:00
|
|
|
TERMUX_PKG_SHA256+=(b5476b10cdc1bc930154c52203a89fae8539432c49575e21551d4e1425252dae) # frida-tools
|
2018-09-29 18:33:27 +02:00
|
|
|
TERMUX_PKG_SHA256+=(42fc33147373f7ee8293486a420d32abc7aea956adfba5c7e98ccdacb1c6cf07) # releng/meson
|
2018-12-09 17:39:42 +01:00
|
|
|
|
|
|
|
_modules=(frida capstone frida-clr frida-core frida-gum frida-node frida-python frida-qml frida-swift frida-tools meson)
|
2018-06-13 22:44:37 +02:00
|
|
|
TERMUX_PKG_SRCURL=(https://github.com/frida/frida/archive/$TERMUX_PKG_VERSION.tar.gz
|
|
|
|
https://github.com/frida/capstone/archive/${TERMUX_PKG_VERSION[1]}.zip
|
2018-12-09 17:39:42 +01:00
|
|
|
https://github.com/frida/frida-clr/archive/${TERMUX_PKG_VERSION[2]}.zip
|
|
|
|
https://github.com/frida/frida-core/archive/${TERMUX_PKG_VERSION[3]}.zip
|
|
|
|
https://github.com/frida/frida-gum/archive/${TERMUX_PKG_VERSION[4]}.zip
|
|
|
|
https://github.com/frida/frida-node/archive/${TERMUX_PKG_VERSION[5]}.zip
|
|
|
|
https://github.com/frida/frida-python/archive/${TERMUX_PKG_VERSION[6]}.zip
|
|
|
|
https://github.com/frida/frida-qml/archive/${TERMUX_PKG_VERSION[7]}.zip
|
|
|
|
https://github.com/frida/frida-swift/archive/${TERMUX_PKG_VERSION[8]}.zip
|
|
|
|
https://github.com/frida/frida-tools/archive/${TERMUX_PKG_VERSION[9]}.zip
|
|
|
|
https://github.com/frida/meson/archive/${TERMUX_PKG_VERSION[10]}.zip)
|
2018-06-13 22:44:37 +02:00
|
|
|
|
2018-03-05 22:15:17 +01:00
|
|
|
TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91"
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2018-06-13 22:44:37 +02:00
|
|
|
termux_step_post_extract_package () {
|
|
|
|
mkdir build
|
|
|
|
for i in $(seq 1 $(( ${#_modules[@]}-1 ))); do
|
|
|
|
rm -rf ${_modules[$i]}
|
|
|
|
mv ${_modules[$i]}-${TERMUX_PKG_VERSION[$i]} ${_modules[$i]}
|
2018-12-09 17:39:42 +01:00
|
|
|
echo ${TERMUX_PKG_VERSION[$i]} > ${TERMUX_PKG_SRCDIR}/build/.${_modules[$i]}-submodule-stamp
|
2018-03-05 22:15:17 +01:00
|
|
|
done
|
2018-06-13 22:44:37 +02:00
|
|
|
mv meson releng/
|
2018-03-05 22:15:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_post_configure () {
|
|
|
|
# frida-version.h is normally generated from git and the commits.
|
2018-12-09 17:39:42 +01:00
|
|
|
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
|
2018-06-12 23:19:03 +02:00
|
|
|
# Build only for desired architecture:
|
2018-12-09 17:39:42 +01:00
|
|
|
sed -i "s/@TERMUX_ARCH@/$arch/g" ${TERMUX_PKG_SRCDIR}/Makefile.linux.mk
|
|
|
|
PATH=${TERMUX_PKG_HOSTBUILD_DIR}/bin:$PATH make server-android ${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
|
|
|
}
|