Skip to content

Commit

Permalink
Merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
tgw314 committed Aug 16, 2022
2 parents 90fe5fa + 66b402b commit 1a58661
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions build.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ BUILD_MUSIC_ARM64_V8A=true
BUILD_MUSIC_ARM_V7A=false
BUILD_TWITTER=true
BUILD_REDDIT=false

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.
Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
17 changes: 16 additions & 1 deletion utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1a58661

Please sign in to comment.