keep binaries local

This commit is contained in:
j-hc 2024-03-31 01:44:46 +03:00
parent 64accee8d5
commit 50ac511d95
No known key found for this signature in database
GPG Key ID: CDF97F1DBFE904CD
8 changed files with 7 additions and 23 deletions

2
.gitignore vendored
View File

@ -1,7 +1,5 @@
*.jar
*.apk *.apk
*.zip *.zip
/revanced-cache
/temp /temp
/build /build
test* test*

BIN
bin/aapt2/aapt2-arm Executable file

Binary file not shown.

BIN
bin/aapt2/aapt2-arm64 Executable file

Binary file not shown.

BIN
bin/apksigner.jar Normal file

Binary file not shown.

BIN
bin/htmlq/htmlq-arm Normal file

Binary file not shown.

BIN
bin/htmlq/htmlq-arm64 Normal file

Binary file not shown.

BIN
bin/htmlq/htmlq-x86_64 Executable file

Binary file not shown.

View File

@ -2,6 +2,7 @@
MODULE_TEMPLATE_DIR="revanced-magisk" MODULE_TEMPLATE_DIR="revanced-magisk"
TEMP_DIR="temp" TEMP_DIR="temp"
BIN_DIR="bin"
BUILD_DIR="build" BUILD_DIR="build"
if [ "${GITHUB_TOKEN:-}" ]; then GH_HEADER="Authorization: token ${GITHUB_TOKEN}"; else GH_HEADER=; fi if [ "${GITHUB_TOKEN:-}" ]; then GH_HEADER="Authorization: token ${GITHUB_TOKEN}"; else GH_HEADER=; fi
@ -91,35 +92,20 @@ get_rv_prebuilts() {
} }
get_prebuilts() { get_prebuilts() {
APKSIGNER="${BIN_DIR}/apksigner.jar"
if [ "$OS" = Android ]; then if [ "$OS" = Android ]; then
local arch local arch
if [ "$(uname -m)" = aarch64 ]; then arch=arm64; else arch=arm; fi if [ "$(uname -m)" = aarch64 ]; then arch=arm64; else arch=arm; fi
dl_if_dne ${TEMP_DIR}/aapt2 https://github.com/rendiix/termux-aapt/raw/d7d4b4a344cc52b94bcdab3500be244151261d8e/prebuilt-binary/${arch}/aapt2 HTMLQ="${BIN_DIR}/htmlq-${arch}"
chmod +x "${TEMP_DIR}/aapt2" AAPT2="${BIN_DIR}/aapt2-${arch}"
else
HTMLQ="${BIN_DIR}/htmlq-x86_64"
fi fi
mkdir -p ${MODULE_TEMPLATE_DIR}/bin/arm64 ${MODULE_TEMPLATE_DIR}/bin/arm ${MODULE_TEMPLATE_DIR}/bin/x86 ${MODULE_TEMPLATE_DIR}/bin/x64 mkdir -p ${MODULE_TEMPLATE_DIR}/bin/arm64 ${MODULE_TEMPLATE_DIR}/bin/arm ${MODULE_TEMPLATE_DIR}/bin/x86 ${MODULE_TEMPLATE_DIR}/bin/x64
dl_if_dne "${MODULE_TEMPLATE_DIR}/bin/arm64/cmpr" "https://github.com/j-hc/cmpr/releases/latest/download/cmpr-arm64-v8a" dl_if_dne "${MODULE_TEMPLATE_DIR}/bin/arm64/cmpr" "https://github.com/j-hc/cmpr/releases/latest/download/cmpr-arm64-v8a"
dl_if_dne "${MODULE_TEMPLATE_DIR}/bin/arm/cmpr" "https://github.com/j-hc/cmpr/releases/latest/download/cmpr-armeabi-v7a" dl_if_dne "${MODULE_TEMPLATE_DIR}/bin/arm/cmpr" "https://github.com/j-hc/cmpr/releases/latest/download/cmpr-armeabi-v7a"
dl_if_dne "${MODULE_TEMPLATE_DIR}/bin/x86/cmpr" "https://github.com/j-hc/cmpr/releases/latest/download/cmpr-x86" dl_if_dne "${MODULE_TEMPLATE_DIR}/bin/x86/cmpr" "https://github.com/j-hc/cmpr/releases/latest/download/cmpr-x86"
dl_if_dne "${MODULE_TEMPLATE_DIR}/bin/x64/cmpr" "https://github.com/j-hc/cmpr/releases/latest/download/cmpr-x86_64" dl_if_dne "${MODULE_TEMPLATE_DIR}/bin/x64/cmpr" "https://github.com/j-hc/cmpr/releases/latest/download/cmpr-x86_64"
HTMLQ="${TEMP_DIR}/htmlq"
if [ ! -f "$HTMLQ" ]; then
if [ "$OS" = Android ]; then
if [ "$arch" = arm64 ]; then arch=arm64-v8a; else arch=armeabi-v7a; fi
dl_if_dne ${TEMP_DIR}/htmlq https://github.com/j-hc/htmlq-ndk/releases/latest/download/htmlq-${arch}
chmod +x $HTMLQ
else
if [ "${DRYRUN:-}" ]; then
: >"$HTMLQ"
else
req "https://github.com/mgdm/htmlq/releases/latest/download/htmlq-x86_64-linux.tar.gz" "${TEMP_DIR}/htmlq.tar.gz"
tar -xf "${TEMP_DIR}/htmlq.tar.gz" -C "$TEMP_DIR"
rm "${TEMP_DIR}/htmlq.tar.gz"
fi
fi
fi
} }
config_update() { config_update() {
@ -330,7 +316,7 @@ patch_apk() {
local stock_input=$1 patched_apk=$2 patcher_args=$3 rv_cli_jar=$4 rv_patches_jar=$5 local stock_input=$1 patched_apk=$2 patcher_args=$3 rv_cli_jar=$4 rv_patches_jar=$5
local cmd="java -jar $rv_cli_jar patch $stock_input -p -o $patched_apk -b $rv_patches_jar \ local cmd="java -jar $rv_cli_jar patch $stock_input -p -o $patched_apk -b $rv_patches_jar \
--keystore=ks.keystore --keystore-entry-password=123456789 --keystore-password=123456789 --signer=jhc --alias=jhc $patcher_args --options=options.json" --keystore=ks.keystore --keystore-entry-password=123456789 --keystore-password=123456789 --signer=jhc --alias=jhc $patcher_args --options=options.json"
if [ "$OS" = Android ]; then cmd+=" --custom-aapt2-binary=${TEMP_DIR}/aapt2"; fi if [ "$OS" = Android ]; then cmd+=" --custom-aapt2-binary=${AAPT2}"; fi
pr "$cmd" pr "$cmd"
if [ "${DRYRUN:-}" = true ]; then if [ "${DRYRUN:-}" = true ]; then
cp -f "$stock_input" "$patched_apk" cp -f "$stock_input" "$patched_apk"