From 9c822a80133c863e608172ed66f6f188b32ec4cc Mon Sep 17 00:00:00 2001 From: Al4ise Date: Tue, 18 Jan 2022 17:45:44 +0200 Subject: [PATCH] fix for ytminiplayerenabler (requires reinstall on iOS and running update-azule -f on macos/linux) --- azule | 28 +++++++++++++++++++--------- azule-functions | 31 +++++++++++++------------------ 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/azule b/azule index 202c919..a0dd5ff 100755 --- a/azule +++ b/azule @@ -213,6 +213,8 @@ help () { echo " -w Don't Remove Watch App" echo " -r Skip Encryption Check" echo " -q Ignore errors" + echo " -m Force CydiaSubstrate.framework as a hooking library" + echo " -j Force libsubstitute.dylib as a hooking library" echo " -z Don't compress .app file before writing" if [ "$os" == "iOS" ]; then @@ -244,7 +246,7 @@ trap "cleanup" SIGINT trap "cleanup" EXIT # CLI ARGUEMENTS -while getopts an:i:o:c:b:x:f:p:huSewsrqdzgklv args; do +while getopts an:i:o:c:b:x:f:p:huSewsrmjqdzgklv args; do # STUFF WITH PARAMETERS if [[ "$args" == @(x|a|n|b|p|i|o|c|f) ]]; then @@ -256,7 +258,7 @@ while getopts an:i:o:c:b:x:f:p:huSewsrqdzgklv args; do fi # iOS ONLY - if [[ "$args" == @(a|x|l|m|k|d) && "$os" != "iOS" ]]; then + if [[ "$args" == @(a|x|l|k|d|g) && "$os" != "iOS" ]]; then Announce "-$args is not supported on your platform" 6 fi @@ -283,6 +285,8 @@ while getopts an:i:o:c:b:x:f:p:huSewsrqdzgklv args; do s) silent_run=1 ;; q) ignore_errors=1 ;; z) no_zip=1 ;; + j) force_hl="libsubstitute.dylib" ;; + m) force_hl="CydiaSubstrate.framework/CydiaSubstrate" ;; # iOS ONLY SWITCHES d) no_recurse=1 ;; @@ -706,13 +710,13 @@ if [ -n "${files[*]}" ]; then for l in $(otool -L "$i" | cut -d ' ' -f1); do for x in "${inject[@]}"; do - if [[ "$l" =~ $(lib_basename "$x") ]]; then ##! + if [[ "$l" =~ $(lib_basename "$x") ]]; then if [[ "$l" =~ $(lib_basename "$i") ]]; then install_name_tool -id "$(idpath "$i")" "$i" &>/dev/null tid=$(( tid + $? )) break else - install_name_tool -change "$l" "$(idpath "$i")" "$i" &>/dev/null + install_name_tool -change "$l" "$(idpath "$x")" "$i" &>/dev/null tlnk=$(( tlnk + $? )) if ! [[ "${linked[*]}" =~ $x ]]; then linked+=( "$x" ); fi break @@ -740,10 +744,16 @@ if [ -n "${files[*]}" ]; then for l in $(otool -L "$i" | cut -d ' ' -f1); do if [[ "$l" =~ $hookinglibrary ]]; then if [ ! -e "$rpath/$hookinglibrary" ]; then - if [[ "$hookinglibrary" =~ .framework ]]; then - hl_file="$(dirname "$hookinglibrary")" + if [ -n "$force_hl" ]; then + hl="$force_hl" else - hl_file="$hookinglibrary" + hl="$hookinglibrary" + fi + + if [[ "$hl" =~ .framework ]]; then + hl_file="$(dirname "$hl")" + else + hl_file="$hl" fi if [ "$os" == "iOS" ]; then @@ -753,7 +763,7 @@ if [ -n "${files[*]}" ]; then fi fi - install_name_tool -change "$l" @rpath/"$hookinglibrary" "$i" &>/dev/null + install_name_tool -change "$l" @rpath/"$hl" "$i" &>/dev/null status=$(( status + $? )) break fi @@ -761,7 +771,7 @@ if [ -n "${files[*]}" ]; then done done if [ -n "$status" ]; then - Verbose "Linked $hookinglibrary" "Failed injecting $hookinglibrary in $status file(s)" 23 -x + Verbose "Linked $hl" "Failed injecting $hl in $status file(s)" 23 -x fi fi diff --git a/azule-functions b/azule-functions index bd76135..b0d2243 100755 --- a/azule-functions +++ b/azule-functions @@ -22,7 +22,7 @@ function update-azule() { echo echo "Options:" echo " -f Forcefully update Azule, causing all local changes to be lost." - echo " -r Redownload the latest mobilesubstrate and linux toolchains." + echo " -r Redownload the latest hooking libraries and linux toolchains." echo " -h Print this help menu." exit 0 ;; @@ -74,38 +74,33 @@ function setup-azule() { ;; esac - if [ ! -d "$AZULE/lib/CydiaSubstrate.framework" ]; then + if [ ! -d "$AZULE/lib/CydiaSubstrate.framework" ] || [ ! -e "$AZULE/lib/libsubstitute.dylib" ] ; then mkdir -p "$AZULE/lib" - echo "Downloading CydiaSubstrate..." + echo "Downloading Hooking Libraries..." TMP=$(mktemp -d) cd "$TMP" || exit curl -sSL https://apt.bingner.com/debs/1443.00/mobilesubstrate_0.9.7113_iphoneos-arm.deb -o substrate.deb ar -x "substrate.deb" tar --lzma --strip-components 3 -xf data.tar.lzma "./Library/Frameworks/CydiaSubstrate.framework" "./usr/lib" "./usr/include" rm CydiaSubstrate.framework/CydiaSubstrate CydiaSubstrate.framework/Headers/CydiaSubstrate.h - rsync -a "$TMP"/libsubstrate.dylib "$AZULE/lib/libsubstrate.dylib" - echo "Downloaded libsubstrate.dylib" - mv libsubstrate.dylib CydiaSubstrate.framework/CydiaSubstrate mv substrate.h CydiaSubstrate.framework/Headers/CydiaSubstrate.h mv CydiaSubstrate.framework "$AZULE"/lib/CydiaSubstrate.framework cd || exit rm -rf "$TMP" plutil -convert binary1 "$AZULE/lib/CydiaSubstrate.framework/Info.plist" - echo "Downloaded CydiaSubstrate.framework" - fi - if [ ! -e "$AZULE/lib/libsubstitute.dylib" ]; then - TMP="$(mktemp -d)" - cd "$TMP" || exit - echo "Downloading Substitute..." - curl -sS https://apt.bingner.com/debs/1443.00/com.ex.substitute_2.2.3_iphoneos-arm.deb -o substitute.deb - ar -x "substitute.deb" - tar --lzma --strip-components 2 -xf data.tar.lzma "usr/lib" - mv libsubstitute.dylib "$AZULE/lib/libsubstitute.dylib" - echo "Downloaded Substitute" + TMP=$(mktemp -d) + cd "$TMP" || exit + curl -sSL https://repo.theodyssey.dev/debs/org.coolstar.libhooker_1.6.3_iphoneos-arm.deb -o hl.deb + ar -x "hl.deb" + tar -xf data.tar.xz + + mv usr/lib/libsubstrate.dylib "$AZULE"/lib/CydiaSubstrate.framework/CydiaSubstrate + mv usr/lib/libsubstitute.dylib "$AZULE/lib/libsubstitute.dylib" cd || exit rm -rf "$TMP" + echo "Downloaded Hooking Libraries" fi - + cd "$currentdir" || exit }