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

Commit

Permalink
tashki i iOS support
Browse files Browse the repository at this point in the history
  • Loading branch information
Al4ise authored Jul 20, 2021
1 parent 09b69cd commit b8730f3
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions azule
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ case $(uname) in
install_name_tool="install_name_tool"
ldid="$AZULE/usr/bin/ldid"
azule="$AZULE"

ExtractPlistValue () {
"$plutil" -extract "$1" xml1 -o - "$2" | sed -n "s/.*<"$3">\(.*\)<\/"$3">.*/\1/p"
}
else
jq="jq"
insert_dylib="insert_dylib"
Expand All @@ -25,6 +29,13 @@ case $(uname) in
install_name_tool="install_name_tool"
ldid="ldid"
azule="/var/mobile/Documents/Azule"

ExtractPlistValue () {
"$plutil" -key "$1" "$2" >> tmp.plist
"$plutil" -convert xml1 tmp.plist &>/dev/null
cat tmp.plist | sed -n "s/.*<"$3">\(.*\)<\/"$3">.*/\1/p"
rm tmp.plist
}
fi
;;

Expand All @@ -37,6 +48,10 @@ case $(uname) in
install_name_tool="$AZULE/toolchain/usr/bin/install_name_tool"
ldid="$AZULE/toolchain/usr/bin/ldid"
azule="$AZULE"

ExtractPlistValue () {
"$plutil" -extract "$1" xml1 -o - "$2" | sed -n "s/.*<"$3">\(.*\)<\/"$3">.*/\1/p"
}
;;
esac

Expand Down Expand Up @@ -251,8 +266,7 @@ if [ -n "$e" ]; then
echo "Couldn't Remove Extensions"
fi
fi

executable="Payload/$(basename Payload/*.app)/$("$plutil" -extract CFBundleExecutable xml1 -o - Payload/*.app/Info.plist | sed -n "s/.*<string>\(.*\)<\/string>.*/\1/p")"
executable="Payload/$(basename Payload/*.app)/$(ExtractPlistValue CFBundleExecutable Payload/*.app/Info.plist string)"

# VERBOSE
if [ -n "$v" ]; then
Expand Down Expand Up @@ -308,7 +322,8 @@ for i in "${files[@]}"; do
echo "Couldn't Move $i to app directory"
fi

inject+=( "$(basename "$i")/$("$plutil" -extract CFBundleExecutable xml1 -o - "$i"/Info.plist | sed -n "s/.*<string>\(.*\)<\/string>.*/\1/p")" )

inject+=( "$(basename "$i")/$(ExtractPlistValue CFBundleExecutable "$i"/Info.plist string)" )
;;

*) rsync -a "$i" Payload/*.app
Expand Down Expand Up @@ -377,13 +392,14 @@ else
if [[ "$i" =~ "$dir/$tweakid/Tweak/usr/lib/" ]]; then
inject+=( "$(basename "$i")" )
else
identifier="$("$plutil" -extract Filter xml1 -o - "${i%.*}.plist" | sed -n "s/.*<string>\(.*\)<\/string>.*/\1/p")"
idtype="$("$plutil" -extract Filter xml1 -o - "${i%.*}.plist" | sed -n "s/.*<key>\(.*\)<\/key>.*/\1/p")"
identifier="$(ExtractPlistValue Filter ${i%.*}.plist string)"
idtype="$(ExtractPlistValue Filter ${i%.*}.plist key)"

case "$idtype" in
Bundles)
ipabundleid="$("$plutil" -extract CFBundleIdentifier xml1 -o - Payload/*.app/Info.plist | sed -n "s/.*<string>\(.*\)<\/string>.*/\1/p")"
ipabundleid="$(ExtractPlistValue CFBundleIdentifier Payload/*.app/Info.plist string)"


if [[ "$identifier" =~ "$ipabundleid" ]]; then
inject+=( "$(basename "$i")" )
fi
Expand Down Expand Up @@ -452,7 +468,7 @@ while read i; do
else
echo "$(basename "$i") couldn't be copied to app directory"
fi
inject+=( "$(basename "$i")/$("$plutil" -extract CFBundleExecutable xml1 -o - "$i/Info.plist" | sed -n "s/.*<string>\(.*\)<\/string>.*/\1/p")" )
inject+=( "$(basename "$i")/$(ExtractPlistValue CFBundleExecutable "$i/Info.plist" string)" )
done < <(find "$dir/$tweakid/Tweak" -iname '*.framework')

for i in "${inject[@]}"; do
Expand Down Expand Up @@ -486,20 +502,20 @@ for i in "${inject[@]}"; do
done
done

if [ "$tid" = 0 ]; then
if [[ "$tid" = 0 || -z "$tid" ]]; then
echo "ID Successful"
else
echo "$tid files failed to ID"
fi

if [ "$tlnk" = 0 ]; then
if [[ "$tlnk" = 0 || -z "$tlnk" ]]; then
echo "Re-Link Successful"
else
echo "$tlnk Re-Links failed"
fi

if [ -n "$u" ]; then
UISupportedDevices="$("$plutil" -extract CFBundleIdentifier xml1 -o - Payload/*.app/Info.plist | sed -n "s/.*<string>\(.*\)<\/string>.*/\1/p")"
UISupportedDevices="$(ExtractPlistValue UISupportedDevices Payload/*.app/Info.plist string &>/dev/null)"

if [ -n "$UISupportedDevices" ]; then
"$plutil" -remove UISupportedDevices Payload/*.app/Info.plist
Expand Down

0 comments on commit b8730f3

Please sign in to comment.