From 1fdb527b85da27eb351a317c97b8789a2fd592e0 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Mon, 25 Apr 2022 02:34:17 -0400 Subject: [PATCH] [F] Fix ldid command detection on iOS --- fakesigner.sh | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/fakesigner.sh b/fakesigner.sh index 188f7b2..a58041f 100644 --- a/fakesigner.sh +++ b/fakesigner.sh @@ -1,30 +1,35 @@ #!/bin/bash echo "[*] Welcome to basti564's automatic fakesigner" + +# Ensure this command is not run from root if [[ $EUID -eq 0 ]]; then echo "[!] Please don't run this script as root!" exit fi -if [[ $(command -v sudo -u brew) == "" ]]; then - echo "[!] Hombrew not installed!" - echo "[!] Please run the following command!" - echo '[!] /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"' - exit -else - echo "[§] Found Homebrew" - if brew ls --versions ldid > /dev/null; then - echo "[§] Found ldid" + +# Ensure ldid command exists +if ! [ -x "$(command -v ldid)" ]; then + echo "[!] ldid not found!" + + if [[ $(command -v sudo -u brew) == "" ]]; then + echo "[!] Hombrew not installed!" + echo "[!] Please run the following command!" + echo '[!] /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"' + exit else - echo "[!] ldid not found!" - echo "[!] Please install ldid with the following command" - echo "[!] brew install ldid" + echo "[+] Found Homebrew, installing ldid" + brew install ldid fi fi + +# Ensure an ipa file is supplied if [ -z "$1" ] then echo "[!] No .ipa file supplied!" exit fi +# Start processing ipa=$1 echo [*] unpacking.. cd $(dirname $ipa)