Skip to content

Commit

Permalink
Bump
Browse files Browse the repository at this point in the history
  • Loading branch information
VendorAttestation committed Aug 28, 2024
1 parent 2233c6f commit 2a748ba
Show file tree
Hide file tree
Showing 6 changed files with 363 additions and 37 deletions.
79 changes: 53 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ jobs:
- create
if: needs.check.outputs.RELEASE_EXISTS == '0'
strategy:
fail-fast: false
matrix:
arch:
- arm64
Expand Down Expand Up @@ -97,20 +96,24 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install -y build-essential tree ninja-build gcc-multilib g++-multilib lib32stdc++-9-dev flex bison libc6-dev libc6-dev-i386 upx xz-utils plzip zstd pigz
sudo /opt/hostedtoolcache/Python/3.12.*/x64/bin/pip3 install -U lief setuptools
sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install -y build-essential ninja-build gcc-multilib g++-multilib lib32stdc++-9-dev flex bison libc6-dev libc6-dev-i386 xz-utils plzip zstd pigz gettext-base # upx tree
sudo /opt/hostedtoolcache/Python/3.12.*/x64/bin/pip3 install -U setuptools lief
_CARCH="${{ matrix.arch }}"; if [ "${_CARCH%64}" = "${_CARCH}" ]; then # && bit_width=32 || bit_width=64 # not an exact science, but honk it, good enough™
_CARCH="${{ matrix.arch }}"; if [ "${_CARCH%64}" = "${_CARCH}" ]; then # && bit_width=32 || bit_width=64
pushd /opt/hostedtoolcache/Python/3.12.*/x64/include/python3.12; patch -Rp1 <${{ github.workspace }}/pyconfig.h-i686-x86_64.patch; popd
fi
- name: Build Frida
run: |
export ANDROID_NDK="${ANDROID_NDK%/*}/25.2.9519653"; export ANDROID_NDK_HOME="${ANDROID_NDK}" ANDROID_NDK_ROOT="${ANDROID_NDK}" ANDROID_NDK_LATEST_HOME="${ANDROID_NDK}"
git clone --recurse-submodules https://github.com/frida/frida -b "${{ needs.check.outputs.FRIDA_VERSION }}"; pushd frida
FRIDA_VERSION="${{ needs.check.outputs.FRIDA_VERSION }}"
git clone --recurse-submodules https://github.com/frida/frida -b "${FRIDA_VERSION}"; pushd frida
set +e
FRIDA_PREFIX="$(tr -cd 'a-z0-9' </dev/urandom | head -c32)" SESSION_SERVICE="$(tr -cd 'a-f0-9' </dev/urandom | head -c32)"
for k in strongR-frida florida asenosen fridare; do for i in "../${k}/"*; do pushd "subprojects/${i##*/}"; for j in "../../../${k}/${i##*/}/"*.patch; do FRIDA_PREFIX="${FRIDA_PREFIX}" SESSION_SERVICE="${SESSION_SERVICE}" envsubst <"${j}" | patch -p1; done; popd; done; done
set -e
for k in strongR-frida florida zer0def; do for i in "../${k}/"*; do pushd "subprojects/${i##*/}"; for j in "../../../${k}/${i##*/}/"*.patch; do FRIDA_PREFIX="${FRIDA_PREFIX}" SESSION_SERVICE="${SESSION_SERVICE}" envsubst <"${j}" | patch -Np1; done; popd; done; done
#for j in core gum; do make "${j}-${{ matrix.os }}-${{ matrix.arch }}"; done # target
#for j in core gum gumjs; do python releng/mkdevkit.py "frida-${j}" "${{ matrix.os }}-${{ matrix.arch }}" "build/devkits/${{ matrix.os }}/${{ matrix.arch }}/${j}"; done # devkit
Expand All @@ -123,6 +126,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
FRIDA_VERSION="${{ needs.check.outputs.FRIDA_VERSION }}"
gh_release_put(){ curl -fs -H "Authorization: token ${GITHUB_TOKEN}" -H "Content-Type: application/octet-stream" -o /dev/null --data-binary "@${1}" "https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ needs.create.outputs.RELEASE_ID }}/assets?name=${2}"; }
export XZ_OPT="-9e -T0" ZSTD_NBTHREADS=0 ZSTD_CLEVEL=19
Expand All @@ -139,7 +143,7 @@ jobs:
#_src="build/frida-${{ matrix.os }}-${{ matrix.arch }}/bin/frida-${j}"
_src="build/subprojects/frida-core/${j}/frida-${j}"
${compr%:*} -k "${_src}"
gh_release_put "${_src}.${compr#*:}" "${GITHUB_REPOSITORY##*/}-${j}-${{ needs.check.outputs.FRIDA_VERSION }}-${{ matrix.os }}-${{ matrix.arch }}.${compr#*:}"
gh_release_put "${_src}.${compr#*:}" "${GITHUB_REPOSITORY##*/}-${j}-${FRIDA_VERSION}-${{ matrix.os }}-${{ matrix.arch }}.${compr#*:}"
done
python subprojects/frida-core/src/anti-anti-frida.py build/subprojects/frida-core/server/frida-server
mv build/subprojects/frida-core/server/frida-server ../frida-server-${{ matrix.arch }}
Expand All @@ -149,14 +153,18 @@ jobs:
#_src="build/frida-${{ matrix.os }}-${{ matrix.arch }}/lib/frida/${bit_width}/frida-gadget.so"
_src="build/subprojects/frida-core/lib/gadget/frida-gadget.so"
${compr#*:} -k "${_src}"
gh_release_put "${_src}.${compr#*:}" "${GITHUB_REPOSITORY##*/}-gadget-${{ needs.check.outputs.FRIDA_VERSION }}-${{ matrix.os }}-${{ matrix.arch }}.so.${compr#*:}"
${compr%:*} -k "${_src}"
gh_release_put "${_src}.${compr#*:}" "${GITHUB_REPOSITORY##*/}-gadget-${FRIDA_VERSION}-${{ matrix.os }}-${{ matrix.arch }}.so.${compr#*:}"
#python subprojects/frida-core/src/anti-anti-frida.py "${_src}"
rm "${_src}.${compr#*:}"; ${compr%:*} -k "${_src}"
mv "${_src}.${compr#*:}" "../libgadget-${{ matrix.arch }}.so.${compr#*:}"
for j in $(find build/subprojects -iname '*-example.c'); do # devkit
_j="${j##*/}"
_tar="build/${_j%-example.c}-devkit-${{ matrix.os }}-${{ matrix.arch }}.tar"
#_tgt="${GITHUB_REPOSITORY##*/}-${j}-devkit-${{ needs.check.outputs.FRIDA_VERSION }}-${{ matrix.os }}-${{ matrix.arch }}.tar.${compr#*:}"
_tgt="undetected-${_j%-example.c}-devkit-${{ needs.check.outputs.FRIDA_VERSION }}-${{ matrix.os }}-${{ matrix.arch }}.tar.${compr#*:}"
#_tgt="${GITHUB_REPOSITORY##*/}-${j}-devkit-${FRIDA_VERSION}-${{ matrix.os }}-${{ matrix.arch }}.tar.${compr#*:}"
_tgt="undetected-${_j%-example.c}-devkit-${FRIDA_VERSION}-${{ matrix.os }}-${{ matrix.arch }}.tar.${compr#*:}"
tar -cf "${_tar}" -C "${j%/*}" .
Expand All @@ -165,11 +173,13 @@ jobs:
done
popd
- name: Pass servers for Magisk module
- name: Pass artifacts for modules
uses: actions/upload-artifact@v4
with:
name: frida-server-${{ matrix.arch }}
path: frida-server-${{ matrix.arch }}
name: frida-artifacts-${{ matrix.arch }}
path: |
frida-server-${{ matrix.arch }}
libgadget-${{ matrix.arch }}.so*
if-no-files-found: warn
retention-days: 1
compression-level: 9
Expand All @@ -183,25 +193,42 @@ jobs:
if: needs.check.outputs.RELEASE_EXISTS == '0'
steps:
- uses: actions/checkout@v4
- name: Pass servers for Magisk module
- name: Pass artifacts for Magisk module
uses: actions/download-artifact@v4
with:
path: frida-servers
pattern: frida-server-*
path: frida-artifacts
pattern: '*'
merge-multiple: true
- name: Assemble Magisk module and publish release
- name: Assemble modules and publish release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
FRIDA_VERSION="${{ needs.check.outputs.FRIDA_VERSION }}"
gh_release_put(){ curl -fs -H "Authorization: token ${GITHUB_TOKEN}" -H "Content-Type: application/octet-stream" -o /dev/null --data-binary "@${1}" "https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ needs.create.outputs.RELEASE_ID }}/assets?name=${2}"; }
MAGISK_DIR="$(mktemp -d)"; mkdir "${MAGISK_DIR}/files"
zy_dir="$(mktemp -d)"
zy_ver="$(curl -fs https://api.github.com/repos/lico-n/ZygiskFrida/releases/latest | jq -r .tag_name)"
for j in zygisk- riru-; do
curl -sSLo "${j%-}.zip" "https://github.com/lico-n/ZygiskFrida/releases/download/${zy_ver}/ZygiskFrida-${zy_ver}-${j%zygisk-}release.zip"
pushd "${zy_dir}"; unzip -qo "${OLDPWD}/${j%-}.zip"
for i in "${OLDPWD}/frida-artifacts/libgadget"*.so*; do
_target="gadget/$(basename "${i/86_/}")"
cp "${i}" "${_target}"
sha256sum "${_target}" | awk '{print $1}' > "${_target}.sha256sum"
done
zip -9qr "${OLDPWD}/u-${j%-}.zip" *
#gh_release_put "${OLDPWD}/u-${j%-}.zip" "${GITHUB_REPOSITORY##*/}-${j}${FRIDA_VERSION}-${zy_ver}.zip"
rm -rf *
popd
done
MAGISK_DIR="$(mktemp -d)"; mkdir -p "${MAGISK_DIR}/files"
cat <<EOF >feed.json
{
"version": "${{ needs.check.outputs.FRIDA_VERSION }}",
"versionCode": "$(echo -n ${{ needs.check.outputs.FRIDA_VERSION }} | xargs -d. -n1 -- printf '%02d')",
"zipUrl": "https://github.com/${GITHUB_REPOSITORY}/releases/download/${{ needs.check.outputs.FRIDA_VERSION }}/${GITHUB_REPOSITORY##*/}-magisk-${{ needs.check.outputs.FRIDA_VERSION }}.zip",
"version": "${FRIDA_VERSION}",
"versionCode": "$(echo -n "${FRIDA_VERSION}" | xargs -d. -n1 -- printf '%02d')",
"zipUrl": "https://github.com/${GITHUB_REPOSITORY}/releases/download/${FRIDA_VERSION}/${GITHUB_REPOSITORY##*/}-magisk-${FRIDA_VERSION}.zip",
"changelog": "https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/master/CHANGELOG.md"
}
EOF
Expand All @@ -210,18 +237,18 @@ jobs:
cat <<EOF >"${MAGISK_DIR}/module.prop"
id=${GITHUB_REPOSITORY##*/}
name=Undetected F(lo)rida
version=${{ needs.check.outputs.FRIDA_VERSION }}
versionCode=$(echo -n ${{ needs.check.outputs.FRIDA_VERSION }} | xargs -d. -n1 -- printf '%02d')
version=${FRIDA_VERSION}
versionCode=$(echo -n "${FRIDA_VERSION}" | xargs -d. -n1 -- printf '%02d')
author=too many to list, ask for shoutout in repo
description=Run ${GITHUB_REPOSITORY##*/}-server on boot
updateJson=https://github.com/${GITHUB_REPOSITORY}/releases/latest/download/feed.json
EOF
cp -r magisk/* "${MAGISK_DIR}"
mv frida-servers/* "${MAGISK_DIR}/files/"
mv frida-artifacts/frida-server-* "${MAGISK_DIR}/files/"
pushd "${MAGISK_DIR}"
zip -9qr "${OLDPWD}/magisk.zip" *
gh_release_put "${OLDPWD}/magisk.zip" "${GITHUB_REPOSITORY##*/}-magisk-${{ needs.check.outputs.FRIDA_VERSION }}.zip"
gh_release_put "${OLDPWD}/magisk.zip" "${GITHUB_REPOSITORY##*/}-magisk-${FRIDA_VERSION}.zip"
popd
echo '{"draft":false}' | curl -fs -H "Authorization: token ${GITHUB_TOKEN}" -H "Content-Type: application/json" -d@- -o /dev/null -XPATCH "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ needs.create.outputs.RELEASE_ID }}"
3 changes: 2 additions & 1 deletion magisk/common/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ sleep 5

# restart on crash
while true; do
com.android.systemui
com.android.systemui &
kill -INT "${!}"; wait
sleep 1
done
1 change: 1 addition & 0 deletions magisk/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ REPLACE="

# Set what you want to display when installing your module

[ "${MODPATH#/data/adb}" != "${MODPATH}" ] || MODPATH="/data/adb${MODPATH}"
_TARGETDIR="${MODPATH}/system/bin"
print_modname() {
ui_print " "
Expand Down
Loading

0 comments on commit 2a748ba

Please sign in to comment.