mirror of
https://github.com/Nezumi-2711/revanced-apk-build.git
synced 2026-09-22 13:38:52 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a7d8890aa | ||
|
|
57d950f57f | ||
|
|
e0a5116d13 | ||
|
|
6e4565bc1b | ||
|
|
f6d783c176 | ||
|
|
2da4a7c7cd | ||
|
|
11af439fd5 | ||
|
|
1adcc80512 | ||
|
|
596241c5d7 | ||
|
|
26540719e9 | ||
|
|
fbf816533d | ||
|
|
d6582d2d63 | ||
|
|
1a2af75601 | ||
|
|
6b33d5841d | ||
|
|
9f6f043d9a | ||
|
|
88ea74d38f | ||
|
|
ea7dd1d777 | ||
|
|
39e551c73c | ||
|
|
b5aac3781a | ||
|
|
9ff2c72375 | ||
|
|
e65dfdaa1b | ||
|
|
b2312718f9 | ||
|
|
f1e8080202 | ||
|
|
f428ad0cfe | ||
|
|
d28118c98c | ||
|
|
edfe08657a | ||
|
|
03352030a1 | ||
|
|
c57014a391 | ||
|
|
1167a7c636 | ||
|
|
fb7222a28f | ||
|
|
8e8c8634ef | ||
|
|
7deb883720 | ||
|
|
be1c20bb87 | ||
|
|
88a00ca413 | ||
|
|
788b36f083 | ||
|
|
ae43197aa0 | ||
|
|
c2fe93675e | ||
|
|
aee01f1ca5 | ||
|
|
679631315e | ||
|
|
a2ca664121 | ||
|
|
94c8ce77a9 | ||
|
|
aece463380 |
+105
-1
@@ -114,7 +114,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd build || { echo "build folder not found"; exit 1; }
|
cd build || { echo "build folder not found"; exit 1; }
|
||||||
|
|
||||||
TG_CHAT="@rvc_magisk"
|
TG_CHAT="-1002417137882"
|
||||||
NL=$'\n'
|
NL=$'\n'
|
||||||
APKS=""
|
APKS=""
|
||||||
MODULES=""
|
MODULES=""
|
||||||
@@ -145,3 +145,107 @@ jobs:
|
|||||||
MSG=${MSG:0:9450}
|
MSG=${MSG:0:9450}
|
||||||
POST="https://api.telegram.org/bot${TG_TOKEN}/sendMessage"
|
POST="https://api.telegram.org/bot${TG_TOKEN}/sendMessage"
|
||||||
curl -X POST --data-urlencode "parse_mode=Markdown" --data-urlencode "disable_web_page_preview=true" --data-urlencode "text=${MSG}" --data-urlencode "chat_id=${TG_CHAT}" "$POST"
|
curl -X POST --data-urlencode "parse_mode=Markdown" --data-urlencode "disable_web_page_preview=true" --data-urlencode "text=${MSG}" --data-urlencode "chat_id=${TG_CHAT}" "$POST"
|
||||||
|
|
||||||
|
- name: Report to Discord
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
|
if: env.DISCORD_WEBHOOK_URL != null
|
||||||
|
run: |
|
||||||
|
cd build || { echo "build folder not found"; exit 1; }
|
||||||
|
|
||||||
|
NL=$'\n'
|
||||||
|
APKS=""
|
||||||
|
MODULES=""
|
||||||
|
for OUTPUT in *; do
|
||||||
|
DL_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}/${OUTPUT}"
|
||||||
|
if [[ $OUTPUT = *.apk ]]; then
|
||||||
|
APKS+="${NL}- [${OUTPUT}](${DL_URL})"
|
||||||
|
elif [[ $OUTPUT = *.zip ]]; then
|
||||||
|
MODULES+="${NL}- [${OUTPUT}](${DL_URL})"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
MODULES=${MODULES#"$NL"}
|
||||||
|
APKS=${APKS#"$NL"}
|
||||||
|
|
||||||
|
BODY="$(sed 's/^\* \*\*/- \*\*/g; s/^\* `/- \*\*/g; s/`/\*/g; s/^\* /\-/g; s/\*\*/\*/g; s/###//g; s/^- /- /g; /^==/d;' ../build.md)"
|
||||||
|
MSG="**New build is ready!**
|
||||||
|
|
||||||
|
${BODY}
|
||||||
|
|
||||||
|
**Download Links:**
|
||||||
|
"
|
||||||
|
|
||||||
|
MODULES_MSG="
|
||||||
|
**Modules:**
|
||||||
|
${MODULES}
|
||||||
|
"
|
||||||
|
|
||||||
|
APKS_MSG="
|
||||||
|
**APKs:**
|
||||||
|
${APKS}
|
||||||
|
"
|
||||||
|
|
||||||
|
curl -X POST -H "Content-Type: application/json" \
|
||||||
|
-d "$(jq -n --arg content "$MSG" '{content: $content}')" \
|
||||||
|
"$DISCORD_WEBHOOK_URL"
|
||||||
|
|
||||||
|
# curl -X POST -H "Content-Type: application/json" \
|
||||||
|
# -d "$(jq -n --arg content "$MODULES_MSG" '{content: $content}')" \
|
||||||
|
# "$DISCORD_WEBHOOK_URL"
|
||||||
|
|
||||||
|
curl -X POST -H "Content-Type: application/json" \
|
||||||
|
-d "$(jq -n --arg content "$APKS_MSG" '{content: $content}')" \
|
||||||
|
"$DISCORD_WEBHOOK_URL"
|
||||||
|
|
||||||
|
- name: Report to Noob Discord
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK_NOOB_URL: ${{ secrets.DISCORD_WEBHOOK_NOOB_URL }}
|
||||||
|
if: env.DISCORD_WEBHOOK_NOOB_URL != null
|
||||||
|
run: |
|
||||||
|
cd build || { echo "build folder not found"; exit 1; }
|
||||||
|
|
||||||
|
NL=$'\n'
|
||||||
|
APKS=""
|
||||||
|
MODULES=""
|
||||||
|
for OUTPUT in *; do
|
||||||
|
DL_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}/${OUTPUT}"
|
||||||
|
if [[ $OUTPUT = *.apk ]]; then
|
||||||
|
APKS+="${NL}- [${OUTPUT}](${DL_URL})"
|
||||||
|
elif [[ $OUTPUT = *.zip ]]; then
|
||||||
|
MODULES+="${NL}- [${OUTPUT}](${DL_URL})"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
MODULES=${MODULES#"$NL"}
|
||||||
|
APKS=${APKS#"$NL"}
|
||||||
|
|
||||||
|
BODY="$(sed 's/^\* \*\*/- \*\*/g; s/^\* `/- \*\*/g; s/`/\*/g; s/^\* /\-/g; s/\*\*/\*/g; s/###//g; s/^- /- /g; /^==/d;' ../build.md)"
|
||||||
|
MSG="**New build is ready!**
|
||||||
|
|
||||||
|
${BODY}
|
||||||
|
|
||||||
|
**Download Links:**
|
||||||
|
"
|
||||||
|
|
||||||
|
MODULES_MSG="
|
||||||
|
**Modules:**
|
||||||
|
${MODULES}
|
||||||
|
"
|
||||||
|
|
||||||
|
APKS_MSG="
|
||||||
|
**APKs:**
|
||||||
|
${APKS}
|
||||||
|
"
|
||||||
|
|
||||||
|
curl -X POST -H "Content-Type: application/json" \
|
||||||
|
-d "$(jq -n --arg content "$MSG" '{content: $content}')" \
|
||||||
|
"$DISCORD_WEBHOOK_NOOB_URL"
|
||||||
|
|
||||||
|
# curl -X POST -H "Content-Type: application/json" \
|
||||||
|
# -d "$(jq -n --arg content "$MODULES_MSG" '{content: $content}')" \
|
||||||
|
# "$DISCORD_WEBHOOK_NOOB_URL"
|
||||||
|
|
||||||
|
curl -X POST -H "Content-Type: application/json" \
|
||||||
|
-d "$(jq -n --arg content "$APKS_MSG" '{content: $content}')" \
|
||||||
|
"$DISCORD_WEBHOOK_NOOB_URL"
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ until
|
|||||||
do sleep 1; done
|
do sleep 1; done
|
||||||
if [ ! -f ~/.rvmm_"$(date '+%Y%m')" ]; then
|
if [ ! -f ~/.rvmm_"$(date '+%Y%m')" ]; then
|
||||||
pr "Setting up environment..."
|
pr "Setting up environment..."
|
||||||
yes "" | pkg update -y && pkg install -y git curl jq openjdk-17 zip
|
yes "" | pkg update -y && pkg upgrade -y && pkg install -y git curl jq openjdk-17 zip
|
||||||
: >~/.rvmm_"$(date '+%Y%m')"
|
: >~/.rvmm_"$(date '+%Y%m')"
|
||||||
fi
|
fi
|
||||||
mkdir -p /sdcard/Download/revanced-magisk-module/
|
mkdir -p /sdcard/Download/revanced-magisk-module/
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ if [ "${1-}" = "clean" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
source utils.sh
|
source utils.sh
|
||||||
|
|
||||||
|
jq --version >/dev/null || abort "\`jq\` is not installed. install it with 'apt install jq' or equivalent"
|
||||||
|
java --version >/dev/null || abort "\`openjdk 17\` is not installed. install it with 'apt install openjdk-17-jre' or equivalent"
|
||||||
|
zip --version >/dev/null || abort "\`zip\` is not installed. install it with 'apt install zip' or equivalent"
|
||||||
|
|
||||||
set_prebuilts
|
set_prebuilts
|
||||||
|
|
||||||
vtf() { if ! isoneof "${1}" "true" "false"; then abort "ERROR: '${1}' is not a valid option for '${2}': only true or false is allowed"; fi; }
|
vtf() { if ! isoneof "${1}" "true" "false"; then abort "ERROR: '${1}' is not a valid option for '${2}': only true or false is allowed"; fi; }
|
||||||
@@ -42,10 +47,6 @@ if [ "$ENABLE_MAGISK_UPDATE" = true ] && [ -z "${GITHUB_REPOSITORY-}" ]; then
|
|||||||
fi
|
fi
|
||||||
if ((COMPRESSION_LEVEL > 9)) || ((COMPRESSION_LEVEL < 0)); then abort "compression-level must be within 0-9"; fi
|
if ((COMPRESSION_LEVEL > 9)) || ((COMPRESSION_LEVEL < 0)); then abort "compression-level must be within 0-9"; fi
|
||||||
|
|
||||||
jq --version >/dev/null || abort "\`jq\` is not installed. install it with 'apt install jq' or equivalent"
|
|
||||||
java --version >/dev/null || abort "\`openjdk 17\` is not installed. install it with 'apt install openjdk-17-jre' or equivalent"
|
|
||||||
zip --version >/dev/null || abort "\`zip\` is not installed. install it with 'apt install zip' or equivalent"
|
|
||||||
|
|
||||||
rm -rf revanced-magisk/bin/*/tmp.*
|
rm -rf revanced-magisk/bin/*/tmp.*
|
||||||
if [ "$(echo "$TEMP_DIR"/*-rv/changelog.md)" ]; then
|
if [ "$(echo "$TEMP_DIR"/*-rv/changelog.md)" ]; then
|
||||||
: >"$TEMP_DIR"/*-rv/changelog.md || :
|
: >"$TEMP_DIR"/*-rv/changelog.md || :
|
||||||
@@ -132,24 +133,18 @@ for table_name in $(toml_get_table_names); do
|
|||||||
app_args[dpi]=$(toml_get "$t" apkmirror-dpi) || app_args[dpi]="nodpi"
|
app_args[dpi]=$(toml_get "$t" apkmirror-dpi) || app_args[dpi]="nodpi"
|
||||||
table_name_f=${table_name,,}
|
table_name_f=${table_name,,}
|
||||||
table_name_f=${table_name_f// /-}
|
table_name_f=${table_name_f// /-}
|
||||||
app_args[module_prop_name]=$(toml_get "$t" module-prop-name) || {
|
app_args[module_prop_name]=$(toml_get "$t" module-prop-name) || app_args[module_prop_name]="${table_name_f}-jhc"
|
||||||
app_args[module_prop_name]="${table_name_f}-jhc"
|
|
||||||
if [ "${app_args[arch]}" = "arm64-v8a" ]; then
|
|
||||||
app_args[module_prop_name]="${app_args[module_prop_name]}-arm64"
|
|
||||||
elif [ "${app_args[arch]}" = "arm-v7a" ]; then
|
|
||||||
app_args[module_prop_name]="${app_args[module_prop_name]}-arm"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "${app_args[arch]}" = both ]; then
|
if [ "${app_args[arch]}" = both ]; then
|
||||||
app_args[table]="$table_name (arm64-v8a)"
|
app_args[table]="$table_name (arm64-v8a)"
|
||||||
app_args[arch]="arm64-v8a"
|
app_args[arch]="arm64-v8a"
|
||||||
app_args[module_prop_name]="${app_args[module_prop_name]}-arm64"
|
module_prop_name_b=${app_args[module_prop_name]}
|
||||||
|
app_args[module_prop_name]="${module_prop_name_b}-arm64"
|
||||||
idx=$((idx + 1))
|
idx=$((idx + 1))
|
||||||
build_rv "$(declare -p app_args)" &
|
build_rv "$(declare -p app_args)" &
|
||||||
app_args[table]="$table_name (arm-v7a)"
|
app_args[table]="$table_name (arm-v7a)"
|
||||||
app_args[arch]="arm-v7a"
|
app_args[arch]="arm-v7a"
|
||||||
app_args[module_prop_name]="${app_args[module_prop_name]}-arm"
|
app_args[module_prop_name]="${module_prop_name_b}-arm"
|
||||||
if ((idx >= PARALLEL_JOBS)); then
|
if ((idx >= PARALLEL_JOBS)); then
|
||||||
wait -n
|
wait -n
|
||||||
idx=$((idx - 1))
|
idx=$((idx - 1))
|
||||||
@@ -157,6 +152,11 @@ for table_name in $(toml_get_table_names); do
|
|||||||
idx=$((idx + 1))
|
idx=$((idx + 1))
|
||||||
build_rv "$(declare -p app_args)" &
|
build_rv "$(declare -p app_args)" &
|
||||||
else
|
else
|
||||||
|
if [ "${app_args[arch]}" = "arm64-v8a" ]; then
|
||||||
|
app_args[module_prop_name]="${app_args[module_prop_name]}-arm64"
|
||||||
|
elif [ "${app_args[arch]}" = "arm-v7a" ]; then
|
||||||
|
app_args[module_prop_name]="${app_args[module_prop_name]}-arm"
|
||||||
|
fi
|
||||||
idx=$((idx + 1))
|
idx=$((idx + 1))
|
||||||
build_rv "$(declare -p app_args)" &
|
build_rv "$(declare -p app_args)" &
|
||||||
fi
|
fi
|
||||||
|
|||||||
+10
-22
@@ -8,7 +8,7 @@ parallel-jobs = 1
|
|||||||
|
|
||||||
[YouTube]
|
[YouTube]
|
||||||
build-mode = "both"
|
build-mode = "both"
|
||||||
excluded-patches = "'Hide timestamp'"
|
excluded-patches = ""
|
||||||
included-patches = ""
|
included-patches = ""
|
||||||
version = "auto"
|
version = "auto"
|
||||||
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/youtube"
|
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/youtube"
|
||||||
@@ -29,32 +29,20 @@ version = "auto"
|
|||||||
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/photos/"
|
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/photos/"
|
||||||
uptodown-dlurl = "https://google-photos.en.uptodown.com/android"
|
uptodown-dlurl = "https://google-photos.en.uptodown.com/android"
|
||||||
|
|
||||||
[Music-Extended]
|
[Spotify]
|
||||||
app-name = "Music"
|
uptodown-dlurl = "https://spotify.en.uptodown.com/android"
|
||||||
patches-source = "inotia00/revanced-patches"
|
|
||||||
cli-source = "inotia00/revanced-cli"
|
|
||||||
rv-brand = "ReVanced Extended"
|
|
||||||
build-mode = "both"
|
|
||||||
arch = "both"
|
|
||||||
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/youtube-music"
|
|
||||||
# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.google.android.apps.youtube.music"
|
|
||||||
|
|
||||||
[YouTube-Extended]
|
[YouTube-Extended]
|
||||||
app-name = "YouTube"
|
app-name = "YouTube"
|
||||||
patches-source = "inotia00/revanced-patches"
|
patches-source = "inotia00/revanced-patches"
|
||||||
cli-source = "inotia00/revanced-cli"
|
cli-source = "inotia00/revanced-cli"
|
||||||
rv-brand = "ReVanced Extended"
|
rv-brand = "ReVanced Extended"
|
||||||
build-mode = "both"
|
build-mode = "apk"
|
||||||
|
version = "auto"
|
||||||
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/youtube"
|
apkmirror-dlurl = "https://www.apkmirror.com/apk/google-inc/youtube"
|
||||||
# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.google.android.youtube"
|
uptodown-dlurl = "https://youtube.en.uptodown.com/android"
|
||||||
|
included-patches = "'Custom header for YouTube' 'MaterialYou' 'Hide Shorts dimming'"
|
||||||
[Reddit-Extended]
|
excluded-patches = "'Custom branding icon for YouTube' 'Custom branding name for YouTube' 'Disable splash animation'"
|
||||||
patches-source = "inotia00/revanced-patches"
|
|
||||||
cli-source = "inotia00/revanced-cli"
|
|
||||||
rv-brand = "ReVanced Extended"
|
|
||||||
apkmirror-dlurl = "https://www.apkmirror.com/apk/redditinc/reddit/"
|
|
||||||
# archive-dlurl = "https://archive.org/download/jhc-apks/apks/com.reddit.frontpage"
|
|
||||||
|
|
||||||
|
|
||||||
[TikTok]
|
[TikTok]
|
||||||
enabled = false
|
enabled = false
|
||||||
@@ -66,6 +54,6 @@ enabled = false
|
|||||||
apkmirror-dlurl = "https://www.apkmirror.com/apk/facebook-2/messenger/"
|
apkmirror-dlurl = "https://www.apkmirror.com/apk/facebook-2/messenger/"
|
||||||
arch = "arm64-v8a"
|
arch = "arm64-v8a"
|
||||||
|
|
||||||
[Spotify]
|
[IconPackStudio]
|
||||||
enabled = false
|
enabled = false
|
||||||
uptodown-dlurl = "https://spotify.en.uptodown.com/android"
|
apkmirror-dlurl = "https://www.apkmirror.com/apk/smart-launcher-team/icon-pack-studio/"
|
||||||
|
|||||||
@@ -84,21 +84,24 @@ install() {
|
|||||||
abort "ERROR: Stock $PKG_NAME apk was not found"
|
abort "ERROR: Stock $PKG_NAME apk was not found"
|
||||||
fi
|
fi
|
||||||
ui_print "* Updating $PKG_NAME to $PKG_VER"
|
ui_print "* Updating $PKG_NAME to $PKG_VER"
|
||||||
VERIF_ADB=$(settings get global verifier_verify_adb_installs)
|
install_err=""
|
||||||
|
VERIF1=$(settings get global verifier_verify_adb_installs)
|
||||||
|
VERIF2=$(settings get global package_verifier_enable)
|
||||||
settings put global verifier_verify_adb_installs 0
|
settings put global verifier_verify_adb_installs 0
|
||||||
|
settings put global package_verifier_enable 0
|
||||||
SZ=$(stat -c "%s" "$MODPATH/$PKG_NAME.apk")
|
SZ=$(stat -c "%s" "$MODPATH/$PKG_NAME.apk")
|
||||||
for IT in 1 2; do
|
for IT in 1 2; do
|
||||||
if ! SES=$(pmex install-create --user 0 -i com.android.vending -r -d -S "$SZ"); then
|
if ! SES=$(pmex install-create --user 0 -i com.android.vending -r -d -S "$SZ"); then
|
||||||
ui_print "ERROR: install-create failed"
|
ui_print "ERROR: install-create failed"
|
||||||
settings put global verifier_verify_adb_installs "$VERIF_ADB"
|
install_err="$SES"
|
||||||
abort "$SES"
|
break
|
||||||
fi
|
fi
|
||||||
SES=${SES#*[} SES=${SES%]*}
|
SES=${SES#*[} SES=${SES%]*}
|
||||||
set_perm "$MODPATH/$PKG_NAME.apk" 1000 1000 644 u:object_r:apk_data_file:s0
|
set_perm "$MODPATH/$PKG_NAME.apk" 1000 1000 644 u:object_r:apk_data_file:s0
|
||||||
if ! op=$(pmex install-write -S "$SZ" "$SES" "$PKG_NAME.apk" "$MODPATH/$PKG_NAME.apk"); then
|
if ! op=$(pmex install-write -S "$SZ" "$SES" "$PKG_NAME.apk" "$MODPATH/$PKG_NAME.apk"); then
|
||||||
ui_print "ERROR: install-write failed"
|
ui_print "ERROR: install-write failed"
|
||||||
settings put global verifier_verify_adb_installs "$VERIF_ADB"
|
install_err="$op"
|
||||||
abort "$op"
|
break
|
||||||
fi
|
fi
|
||||||
if ! op=$(pmex install-commit "$SES"); then
|
if ! op=$(pmex install-commit "$SES"); then
|
||||||
if echo "$op" | grep -q INSTALL_FAILED_VERSION_DOWNGRADE; then
|
if echo "$op" | grep -q INSTALL_FAILED_VERSION_DOWNGRADE; then
|
||||||
@@ -111,29 +114,35 @@ install() {
|
|||||||
ui_print "* Created the uninstall script."
|
ui_print "* Created the uninstall script."
|
||||||
ui_print ""
|
ui_print ""
|
||||||
ui_print "* Reboot and reflash the module!"
|
ui_print "* Reboot and reflash the module!"
|
||||||
abort
|
install_err=" "
|
||||||
|
break
|
||||||
else
|
else
|
||||||
ui_print "* Uninstalling..."
|
ui_print "* Uninstalling..."
|
||||||
if ! op=$(pmex uninstall -k --user 0 "$PKG_NAME"); then
|
if ! op=$(pmex uninstall -k --user 0 "$PKG_NAME"); then
|
||||||
ui_print "$op"
|
ui_print "$op"
|
||||||
if [ $IT = 2 ]; then abort "ERROR: pm uninstall failed."; fi
|
if [ $IT = 2 ]; then
|
||||||
|
install_err="ERROR: pm uninstall failed."
|
||||||
|
break
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
ui_print "ERROR: install-commit failed"
|
ui_print "ERROR: install-commit failed"
|
||||||
settings put global verifier_verify_adb_installs "$VERIF_ADB"
|
install_err="$op"
|
||||||
abort "$op"
|
break
|
||||||
fi
|
fi
|
||||||
if BASEPATH=$(pmex path "$PKG_NAME"); then
|
if BASEPATH=$(pmex path "$PKG_NAME"); then
|
||||||
BASEPATH=${BASEPATH##*:} BASEPATH=${BASEPATH%/*}
|
BASEPATH=${BASEPATH##*:} BASEPATH=${BASEPATH%/*}
|
||||||
else
|
else
|
||||||
settings put global verifier_verify_adb_installs "$VERIF_ADB"
|
install_err="ERROR: install $PKG_NAME manually and reflash the module"
|
||||||
abort "ERROR: install $PKG_NAME manually and reflash the module"
|
break
|
||||||
fi
|
fi
|
||||||
break
|
break
|
||||||
done
|
done
|
||||||
settings put global verifier_verify_adb_installs "$VERIF_ADB"
|
settings put global verifier_verify_adb_installs "$VERIF1"
|
||||||
|
settings put global package_verifier_enable "$VERIF2"
|
||||||
|
if [ "$install_err" ]; then abort "$install_err"; fi
|
||||||
}
|
}
|
||||||
if [ $INS = true ] && ! install; then abort; fi
|
if [ $INS = true ] && ! install; then abort; fi
|
||||||
BASEPATHLIB=${BASEPATH}/lib/${ARCH}
|
BASEPATHLIB=${BASEPATH}/lib/${ARCH}
|
||||||
|
|||||||
@@ -122,16 +122,12 @@ get_rv_prebuilts() {
|
|||||||
|
|
||||||
set_prebuilts() {
|
set_prebuilts() {
|
||||||
APKSIGNER="${BIN_DIR}/apksigner.jar"
|
APKSIGNER="${BIN_DIR}/apksigner.jar"
|
||||||
if [ "$OS" = Android ]; then
|
|
||||||
local arch
|
local arch
|
||||||
if [ "$(uname -m)" = aarch64 ]; then arch=arm64; else arch=arm; fi
|
arch=$(uname -m)
|
||||||
|
if [ "$arch" = aarch64 ]; then arch=arm64; elif [ "${arch:0:5}" = "armv7" ]; then arch=arm; fi
|
||||||
HTMLQ="${BIN_DIR}/htmlq/htmlq-${arch}"
|
HTMLQ="${BIN_DIR}/htmlq/htmlq-${arch}"
|
||||||
AAPT2="${BIN_DIR}/aapt2/aapt2-${arch}"
|
AAPT2="${BIN_DIR}/aapt2/aapt2-${arch}"
|
||||||
TOML="${BIN_DIR}/toml/tq-${arch}"
|
TOML="${BIN_DIR}/toml/tq-${arch}"
|
||||||
else
|
|
||||||
HTMLQ="${BIN_DIR}/htmlq/htmlq-x86_64"
|
|
||||||
TOML="${BIN_DIR}/toml/tq-x86_64"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
config_update() {
|
config_update() {
|
||||||
@@ -187,7 +183,10 @@ _req() {
|
|||||||
local ip="$1" op="$2"
|
local ip="$1" op="$2"
|
||||||
shift 2
|
shift 2
|
||||||
if [ "$op" = - ]; then
|
if [ "$op" = - ]; then
|
||||||
curl -L -c "$TEMP_DIR/cookie.txt" -b "$TEMP_DIR/cookie.txt" --connect-timeout 5 --retry 0 --fail -s -S "$@" "$ip"
|
if ! curl -L -c "$TEMP_DIR/cookie.txt" -b "$TEMP_DIR/cookie.txt" --connect-timeout 5 --retry 0 --fail -s -S "$@" "$ip"; then
|
||||||
|
epr "Request failed: $ip"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
if [ -f "$op" ]; then return; fi
|
if [ -f "$op" ]; then return; fi
|
||||||
local dlp
|
local dlp
|
||||||
@@ -196,7 +195,10 @@ _req() {
|
|||||||
while [ -f "$dlp" ]; do sleep 1; done
|
while [ -f "$dlp" ]; do sleep 1; done
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
curl -L -c "$TEMP_DIR/cookie.txt" -b "$TEMP_DIR/cookie.txt" --connect-timeout 5 --retry 0 --fail -s -S "$@" "$ip" -o "$dlp" || return 1
|
if ! curl -L -c "$TEMP_DIR/cookie.txt" -b "$TEMP_DIR/cookie.txt" --connect-timeout 5 --retry 0 --fail -s -S "$@" "$ip" -o "$dlp"; then
|
||||||
|
epr "Request failed: $ip"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
mv -f "$dlp" "$op"
|
mv -f "$dlp" "$op"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -261,17 +263,18 @@ isoneof() {
|
|||||||
merge_splits() {
|
merge_splits() {
|
||||||
local bundle=$1 output=$2
|
local bundle=$1 output=$2
|
||||||
pr "Merging splits"
|
pr "Merging splits"
|
||||||
gh_dl "$TEMP_DIR/apkeditor.jar" "https://github.com/REAndroid/APKEditor/releases/download/V1.3.9/APKEditor-1.3.9.jar" >/dev/null || return 1
|
gh_dl "$TEMP_DIR/apkeditor.jar" "https://github.com/REAndroid/APKEditor/releases/download/V1.4.2/APKEditor-1.4.2.jar" >/dev/null || return 1
|
||||||
if ! OP=$(java -jar "$TEMP_DIR/apkeditor.jar" merge -i "${bundle}" -o "${bundle}.mzip" -clean-meta -f 2>&1); then
|
if ! OP=$(java -jar "$TEMP_DIR/apkeditor.jar" merge -i "${bundle}" -o "${bundle}.mzip" -clean-meta -f 2>&1); then
|
||||||
epr "$OP"
|
epr "Apkeditor ERROR: $OP"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
# this is required because of apksig
|
# this is required because of apksig
|
||||||
mkdir "${bundle}-zip"
|
mkdir "${bundle}-zip"
|
||||||
unzip -qo "${bundle}.mzip" -d "${bundle}-zip"
|
unzip -qo "${bundle}.mzip" -d "${bundle}-zip"
|
||||||
pushd "${bundle}-zip" || abort
|
(
|
||||||
|
cd "${bundle}-zip" || abort
|
||||||
zip -0rq "${CWD}/${bundle}.zip" .
|
zip -0rq "${CWD}/${bundle}.zip" .
|
||||||
popd || abort
|
)
|
||||||
# if building module, sign the merged apk properly
|
# if building module, sign the merged apk properly
|
||||||
if isoneof "module" "${build_mode_arr[@]}"; then
|
if isoneof "module" "${build_mode_arr[@]}"; then
|
||||||
patch_apk "${bundle}.zip" "${output}" "--exclusive" "${args[cli]}" "${args[ptjar]}"
|
patch_apk "${bundle}.zip" "${output}" "--exclusive" "${args[cli]}" "${args[ptjar]}"
|
||||||
@@ -310,8 +313,10 @@ dl_apkmirror() {
|
|||||||
is_bundle=true
|
is_bundle=true
|
||||||
else
|
else
|
||||||
if [ "$arch" = "arm-v7a" ]; then arch="armeabi-v7a"; fi
|
if [ "$arch" = "arm-v7a" ]; then arch="armeabi-v7a"; fi
|
||||||
local resp node app_table dlurl=""
|
local resp node app_table uurl dlurl=""
|
||||||
url="${url}/${url##*/}-${version//./-}-release/"
|
uurl=$(grep -F "downloadLink" <<<"$__APKMIRROR_RESP__" | grep -F "${version//./-}-release/" | head -1 |
|
||||||
|
sed -n 's;.*href="\(.*-release\).*;\1;p')
|
||||||
|
if [ -z "$uurl" ]; then url="${url}/${url##*/}-${version//./-}-release/"; else url=https://www.apkmirror.com$uurl; fi
|
||||||
resp=$(req "$url" -) || return 1
|
resp=$(req "$url" -) || return 1
|
||||||
node=$($HTMLQ "div.table-row.headerFont:nth-last-child(1)" -r "span:nth-child(n+3)" <<<"$resp")
|
node=$($HTMLQ "div.table-row.headerFont:nth-last-child(1)" -r "span:nth-child(n+3)" <<<"$resp")
|
||||||
if [ "$node" ]; then
|
if [ "$node" ]; then
|
||||||
@@ -328,10 +333,10 @@ dl_apkmirror() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$is_bundle" = true ]; then
|
if [ "$is_bundle" = true ]; then
|
||||||
req "$url" "${output}.apkm"
|
req "$url" "${output}.apkm" || return 1
|
||||||
merge_splits "${output}.apkm" "${output}"
|
merge_splits "${output}.apkm" "${output}"
|
||||||
else
|
else
|
||||||
req "$url" "${output}"
|
req "$url" "${output}" || return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
get_apkmirror_vers() {
|
get_apkmirror_vers() {
|
||||||
@@ -364,35 +369,47 @@ get_uptodown_resp() {
|
|||||||
get_uptodown_vers() { $HTMLQ --text ".version" <<<"$__UPTODOWN_RESP__"; }
|
get_uptodown_vers() { $HTMLQ --text ".version" <<<"$__UPTODOWN_RESP__"; }
|
||||||
dl_uptodown() {
|
dl_uptodown() {
|
||||||
local uptodown_dlurl=$1 version=$2 output=$3 arch=$4 _dpi=$5
|
local uptodown_dlurl=$1 version=$2 output=$3 arch=$4 _dpi=$5
|
||||||
|
local apparch
|
||||||
if [ "$arch" = "arm-v7a" ]; then arch="armeabi-v7a"; fi
|
if [ "$arch" = "arm-v7a" ]; then arch="armeabi-v7a"; fi
|
||||||
|
if [ "$arch" = all ]; then
|
||||||
|
apparch=('arm64-v8a, armeabi-v7a, x86, x86_64' 'arm64-v8a, armeabi-v7a')
|
||||||
|
else apparch=("$arch" 'arm64-v8a, armeabi-v7a, x86, x86_64' 'arm64-v8a, armeabi-v7a'); fi
|
||||||
|
|
||||||
local op resp data_code
|
local op resp data_code
|
||||||
data_code=$($HTMLQ "#detail-app-name" --attribute data-code <<<"$__UPTODOWN_RESP__")
|
data_code=$($HTMLQ "#detail-app-name" --attribute data-code <<<"$__UPTODOWN_RESP__")
|
||||||
local versionURL=""
|
local versionURL=""
|
||||||
|
local is_bundle=false
|
||||||
for i in {1..5}; do
|
for i in {1..5}; do
|
||||||
resp=$(req "${uptodown_dlurl}/apps/${data_code}/versions/${i}" -)
|
resp=$(req "${uptodown_dlurl}/apps/${data_code}/versions/${i}" -)
|
||||||
if ! op=$(jq -e -r ".data | map(select(.version == \"${version}\" and .kindFile == \"apk\")) | .[0]" <<<"$resp"); then
|
if ! op=$(jq -e -r ".data | map(select(.version == \"${version}\")) | .[0]" <<<"$resp"); then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
if [ "$(jq -e -r ".kindFile" <<<"$op")" = "xapk" ]; then is_bundle=true; fi
|
||||||
if versionURL=$(jq -e -r '.versionURL' <<<"$op"); then break; else return 1; fi
|
if versionURL=$(jq -e -r '.versionURL' <<<"$op"); then break; else return 1; fi
|
||||||
done
|
done
|
||||||
if [ -z "$versionURL" ]; then return 1; fi
|
if [ -z "$versionURL" ]; then return 1; fi
|
||||||
resp=$(req "$versionURL" -) || return 1
|
resp=$(req "$versionURL" -) || return 1
|
||||||
if [ "$arch" != all ]; then
|
|
||||||
local data_version files node_arch data_file_id
|
local data_version files node_arch data_file_id
|
||||||
data_version=$($HTMLQ '.button.variants' --attribute data-version <<<"$resp") || return 1
|
data_version=$($HTMLQ '.button.variants' --attribute data-version <<<"$resp") || return 1
|
||||||
files=$(req "${uptodown_dlurl%/*}/app/${data_code}/version/${data_version}/files" - | jq -e -r .content) || return 1
|
files=$(req "${uptodown_dlurl%/*}/app/${data_code}/version/${data_version}/files" - | jq -e -r .content) || return 1
|
||||||
for ((n = 1; n < 12; n += 2)); do
|
for ((n = 1; n < 12; n += 2)); do
|
||||||
node_arch=$($HTMLQ ".content > p:nth-child($n)" --text <<<"$files" | xargs) || return 1
|
node_arch=$($HTMLQ ".content > p:nth-child($n)" --text <<<"$files" | xargs) || return 1
|
||||||
if [ -z "$node_arch" ]; then return 1; fi
|
if [ -z "$node_arch" ]; then return 1; fi
|
||||||
if [ "$node_arch" != "$arch" ]; then continue; fi
|
if ! isoneof "$node_arch" "${apparch[@]}"; then continue; fi
|
||||||
data_file_id=$($HTMLQ "div.variant:nth-child($((n + 1))) > .v-report" --attribute data-file-id <<<"$files") || return 1
|
data_file_id=$($HTMLQ "div.variant:nth-child($((n + 1))) > .v-report" --attribute data-file-id <<<"$files") || return 1
|
||||||
resp=$(req "${uptodown_dlurl}/download/${data_file_id}" -)
|
resp=$(req "${uptodown_dlurl}/download/${data_file_id}-x" -)
|
||||||
break
|
break
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
local data_url
|
local data_url
|
||||||
data_url=$($HTMLQ "#detail-download-button" --attribute data-url <<<"$resp") || return 1
|
data_url=$($HTMLQ "#detail-download-button" --attribute data-url <<<"$resp") || return 1
|
||||||
|
if [ $is_bundle = true ]; then
|
||||||
|
req "https://dw.uptodown.com/dwn/${data_url}" "$output.apkm" || return 1
|
||||||
|
merge_splits "${output}.apkm" "${output}"
|
||||||
|
else
|
||||||
req "https://dw.uptodown.com/dwn/${data_url}" "$output"
|
req "https://dw.uptodown.com/dwn/${data_url}" "$output"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
get_uptodown_pkg_name() { $HTMLQ --text "tr.full:nth-child(1) > td:nth-child(3)" <<<"$__UPTODOWN_RESP_PKG__"; }
|
get_uptodown_pkg_name() { $HTMLQ --text "tr.full:nth-child(1) > td:nth-child(3)" <<<"$__UPTODOWN_RESP_PKG__"; }
|
||||||
|
|
||||||
@@ -518,8 +535,8 @@ build_rv() {
|
|||||||
done
|
done
|
||||||
if [ ! -f "$stock_apk" ]; then return 0; fi
|
if [ ! -f "$stock_apk" ]; then return 0; fi
|
||||||
fi
|
fi
|
||||||
if ! check_sig "$stock_apk" "$pkg_name"; then
|
if ! OP=$(check_sig "$stock_apk" "$pkg_name" 2>&1) && ! grep -qFx "ERROR: Missing META-INF/MANIFEST.MF" <<<"$OP"; then
|
||||||
abort "apk signature mismatch '$stock_apk'"
|
abort "apk signature mismatch '$stock_apk': $OP"
|
||||||
fi
|
fi
|
||||||
log "${table}: ${version}"
|
log "${table}: ${version}"
|
||||||
|
|
||||||
@@ -529,12 +546,6 @@ build_rv() {
|
|||||||
epr "You cant include/exclude microg patch as that's done by rvmm builder automatically."
|
epr "You cant include/exclude microg patch as that's done by rvmm builder automatically."
|
||||||
p_patcher_args=("${p_patcher_args[@]//-[ei] ${microg_patch}/}")
|
p_patcher_args=("${p_patcher_args[@]//-[ei] ${microg_patch}/}")
|
||||||
fi
|
fi
|
||||||
local spoof_streams_patch
|
|
||||||
spoof_streams_patch=$(grep "^Name: " <<<"$list_patches" | grep -i "spoof" | grep -i "streams" || :) spoof_streams_patch=${spoof_streams_patch#*: }
|
|
||||||
if [ -n "$spoof_streams_patch" ] && [[ ${p_patcher_args[*]} =~ $spoof_streams_patch ]]; then
|
|
||||||
epr "You cant include/exclude spoof stream patch as that's done by rvmm builder automatically."
|
|
||||||
p_patcher_args=("${p_patcher_args[@]//-[ei] ${spoof_streams_patch}/}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
local patcher_args patched_apk build_mode
|
local patcher_args patched_apk build_mode
|
||||||
local rv_brand_f=${args[rv_brand],,}
|
local rv_brand_f=${args[rv_brand],,}
|
||||||
@@ -543,7 +554,7 @@ build_rv() {
|
|||||||
for build_mode in "${build_mode_arr[@]}"; do
|
for build_mode in "${build_mode_arr[@]}"; do
|
||||||
patcher_args=("${p_patcher_args[@]}")
|
patcher_args=("${p_patcher_args[@]}")
|
||||||
pr "Building '${table}' in '$build_mode' mode"
|
pr "Building '${table}' in '$build_mode' mode"
|
||||||
if [ -n "$microg_patch" ] || [ -n "$spoof_streams_patch" ]; then
|
if [ -n "$microg_patch" ]; then
|
||||||
patched_apk="${TEMP_DIR}/${app_name_l}-${rv_brand_f}-${version_f}-${arch_f}-${build_mode}.apk"
|
patched_apk="${TEMP_DIR}/${app_name_l}-${rv_brand_f}-${version_f}-${arch_f}-${build_mode}.apk"
|
||||||
else
|
else
|
||||||
patched_apk="${TEMP_DIR}/${app_name_l}-${rv_brand_f}-${version_f}-${arch_f}.apk"
|
patched_apk="${TEMP_DIR}/${app_name_l}-${rv_brand_f}-${version_f}-${arch_f}.apk"
|
||||||
@@ -555,13 +566,6 @@ build_rv() {
|
|||||||
patcher_args+=("-d \"${microg_patch}\"")
|
patcher_args+=("-d \"${microg_patch}\"")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ -n "$spoof_streams_patch" ]; then
|
|
||||||
if [ "$build_mode" = apk ]; then
|
|
||||||
patcher_args+=("-e \"${spoof_streams_patch}\"")
|
|
||||||
elif [ "$build_mode" = module ]; then
|
|
||||||
patcher_args+=("-d \"${spoof_streams_patch}\"")
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ "${args[riplib]}" = true ]; then
|
if [ "${args[riplib]}" = true ]; then
|
||||||
patcher_args+=("--rip-lib x86_64 --rip-lib x86")
|
patcher_args+=("--rip-lib x86_64 --rip-lib x86")
|
||||||
if [ "$build_mode" = module ]; then
|
if [ "$build_mode" = module ]; then
|
||||||
@@ -592,10 +596,12 @@ build_rv() {
|
|||||||
local upj="${table,,}-update.json"
|
local upj="${table,,}-update.json"
|
||||||
|
|
||||||
module_config "$base_template" "$pkg_name" "$version" "$arch"
|
module_config "$base_template" "$pkg_name" "$version" "$arch"
|
||||||
|
|
||||||
|
local rv_patches_ver="${rv_patches_jar##*-}"
|
||||||
module_prop \
|
module_prop \
|
||||||
"${args[module_prop_name]}" \
|
"${args[module_prop_name]}" \
|
||||||
"${app_name} ${args[rv_brand]}" \
|
"${app_name} ${args[rv_brand]}" \
|
||||||
"$version" \
|
"${version} (patches: ${rv_patches_ver%%.rvp})" \
|
||||||
"${app_name} ${args[rv_brand]} Magisk module" \
|
"${app_name} ${args[rv_brand]} Magisk module" \
|
||||||
"https://raw.githubusercontent.com/${GITHUB_REPOSITORY-}/update/${upj}" \
|
"https://raw.githubusercontent.com/${GITHUB_REPOSITORY-}/update/${upj}" \
|
||||||
"$base_template"
|
"$base_template"
|
||||||
@@ -628,7 +634,7 @@ MODULE_ARCH=$ma" >"$1/config"
|
|||||||
module_prop() {
|
module_prop() {
|
||||||
echo "id=${1}
|
echo "id=${1}
|
||||||
name=${2}
|
name=${2}
|
||||||
version=v${3} (${NEXT_VER_CODE})
|
version=v${3}
|
||||||
versionCode=${NEXT_VER_CODE}
|
versionCode=${NEXT_VER_CODE}
|
||||||
author=j-hc
|
author=j-hc
|
||||||
description=${4}" >"${6}/module.prop"
|
description=${4}" >"${6}/module.prop"
|
||||||
|
|||||||
Reference in New Issue
Block a user