build tiktok

This commit is contained in:
j-hc 2022-08-15 21:07:27 +03:00
parent 3aaafd94c7
commit 66b402b81f
No known key found for this signature in database
GPG Key ID: 242B44D16774A2ED
4 changed files with 20 additions and 2 deletions

View File

@ -9,7 +9,9 @@ BUILD_MUSIC_ARM64_V8A=true
BUILD_MUSIC_ARM_V7A=false
BUILD_TWITTER=true
BUILD_REDDIT=true
BUILD_WARN_WETTER=false
BUILD_TIKTOK=false
BUILD_MINDETACH_MODULE=true
MOUNT_DELAY=1 # some low-end phones cannot mount apks on boot without a delay. increase if needed.

View File

@ -41,6 +41,7 @@ if [ "$BUILD_MUSIC_ARM_V7A" = true ]; then build_music $ARM_V7A; fi
if [ "$BUILD_TWITTER" = true ]; then build_twitter; fi
if [ "$BUILD_REDDIT" = true ]; then build_reddit; fi
if [ "$BUILD_WARN_WETTER" = true ]; then build_warn_wetter; fi
if [ "$BUILD_TIKTOK" = true ]; then build_tiktok; fi
if [ "$BUILD_MINDETACH_MODULE" = true ]; then
echo "Building mindetach module"
cd mindetach-magisk/mindetach/

@ -1 +1 @@
Subproject commit d86f7c3335cd7f512be7e6d37ea99d678a52ecc2
Subproject commit 9cd5b8eea9ea754d70e0693cb0c1aac72a7bf618

View File

@ -89,7 +89,7 @@ reset_template() {
req() { wget -nv -O "$2" --header="$WGET_HEADER" "$1"; }
log() { echo -e "$1 " >>build.log; }
get_apk_vers() { req "$1" - | sed -n 's;.*Version:</span><span class="infoSlide-value">\(.*\) </span>.*;\1;p'; }
get_largest_ver() {
get_largest_ver() { # fix this later to properly support semver
local max=0
while read -r v || [ -n "$v" ]; do
if [[ ${v//[!0-9]/} -gt ${max//[!0-9]/} ]]; then max=$v; fi
@ -193,6 +193,21 @@ build_warn_wetter() {
patch_apk "$stock_apk" "$patched_apk" "-r"
}
build_tiktok() {
echo "Building TikTok"
declare -r last_ver="${last_ver:-$(get_apk_vers "https://www.apkmirror.com/uploads/?appcategory=tik-tok" | head -1)}"
echo "Choosing version '${last_ver}'"
local stock_apk="${TEMP_DIR}/tiktok-stock-v${last_ver}.apk" patched_apk="${BUILD_DIR}/tiktok-revanced-v${last_ver}.apk"
if [ ! -f "$stock_apk" ]; then
declare -r dl_url=$(dl_apk "https://www.apkmirror.com/apk/tiktok-pte-ltd/tik-tok/tik-tok-${last_ver//./-}-release/" \
"APK</span>[^@]*@\([^#]*\)" \
"$stock_apk")
log "\nTikTok version: ${last_ver}"
log "downloaded from: [APKMirror - TikTok]($dl_url)"
fi
patch_apk "$stock_apk" "$patched_apk" "-r"
}
build_yt() {
echo "Building YouTube"
reset_template