Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
fix for ytminiplayerenabler (requires reinstall on iOS and running up…
Browse files Browse the repository at this point in the history
…date-azule -f on macos/linux)
  • Loading branch information
Al4ise committed Jan 18, 2022
1 parent 88ac6b9 commit 9c822a8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 27 deletions.
28 changes: 19 additions & 9 deletions azule
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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 ;;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -753,15 +763,15 @@ 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
done
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

Expand Down
31 changes: 13 additions & 18 deletions azule-functions
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand Down Expand Up @@ -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
}

0 comments on commit 9c822a8

Please sign in to comment.