@@ -8539,7 +8539,7 @@ menu_ipa() {
85398539 print " * Your Apple ID and password will only be sent to Apple servers."
85408540 print " * Make sure that your iOS device is connected to the Internet."
85418541 if [[ $platform == " linux" ]] && (( device_vers_maj >= 9 )) ; then
8542- print " * There are 2 options for sideloading, \" using Sideloader \" is recommended."
8542+ print " * There are 2 options for sideloading, \" using Plumesign \" is recommended."
85438543 fi
85448544 print " * If you have AppSync installed, or are installing an app with a valid"
85458545 print " signature, go to App Management -> Install IPA (ideviceinstaller) or (appinst) instead."
@@ -8554,11 +8554,9 @@ menu_ipa() {
85548554 if [[ -n $ipa_path ]]; then
85558555 print " * Selected IPA: $ipa_path "
85568556 if [[ $1 == " Sideload" * ]]; then
8557- if [[ $platform == " linux" ]]; then
8558- menu_items+=(" Install IPA using Sideloader" )
8559- if (( device_vers_maj >= 9 )) ; then
8560- menu_items+=(" Install IPA using AltServer" )
8561- fi
8557+ menu_items+=(" Install IPA using Plumesign" )
8558+ if [[ $platform == " linux" ]] && (( device_vers_maj >= 9 )) ; then
8559+ menu_items+=(" Install IPA using AltServer" )
85628560 fi
85638561 else
85648562 menu_items+=(" Install IPA" )
@@ -8569,7 +8567,7 @@ menu_ipa() {
85698567 print " * Select IPA file to install"
85708568 fi
85718569 if [[ $1 == " Sideload" * ]]; then
8572- menu_items+=(" List and Revoke Certificate " )
8570+ menu_items+=(" Manage Plumesign Accounts " )
85738571 fi
85748572 menu_items+=(" Go Back" )
85758573 echo
@@ -8591,111 +8589,123 @@ menu_ipa() {
85918589 device_altserver
85928590 pause
85938591 ;;
8594- " Install IPA using Sideloader" )
8595- device_sideloader
8596- log " Checking for any existing certificates..."
8597- local temp=$( mktemp)
8598- $sideloader cert list | tee /dev/tty > " $temp "
8599- local check=${PIPESTATUS[0]}
8600- local revoke=$( grep -m1 " serial number" " $temp " | sed -E ' s/.*number `//' | cut -c -32 | tr -dc ' [:alnum:]' )
8601- if [[ $check != 0 ]]; then
8602- warn " Sideloader returned an error. Incorrect Apple ID credentials?"
8592+ " Install IPA using Plumesign" )
8593+ local config_file=" $HOME /.config/PlumeImpactor/accounts.json"
8594+ local selected_account=" $( $jq -r ' .selected_account' " $config_file " ) "
8595+ if [[ -z $selected_account ]]; then
8596+ warn " No selected account. Cannot continue. Please add and select the account to use in Manage Plumesign Accounts."
86038597 pause
86048598 continue
86058599 fi
8606- if [[ -n $revoke ]]; then
8607- log " Revoking existing certificate: $revoke "
8608- $sideloader cert revoke $revoke
8609- fi
8610- log " Installing IPA using Sideloader..."
8611- $sideloader install " $ipa_path "
8612- local ret=$?
8613- local ipa_base=" $( basename " $ipa_path " ) "
8614- local ipa_check=" $( ls " /tmp/$ipa_base /Payload/" * " .app/embedded.mobileprovision" 2> /dev/null) "
8615- if [[ -s " $ipa_check " && $platform == " linux" && $ret != 0 ]]; then
8616- log " Attempting Linux workaround..."
8617- pushd " /tmp/$ipa_base "
8618- zip -r0 Payload.ipa Payload
8619- popd
8620- device_pair
8621- $ideviceinstaller install " /tmp/$ipa_base /Payload.ipa"
8622- fi
8623- print " * If you see an error but the app is in the home screen, the installation is most likely successful and the error can be safely ignored."
8624- print " * If you see an error regarding certificate, you may need to revoke an existing certificate in your account."
8625- print " * If you see an error regarding verification, make sure that your iOS device is connected to the Internet."
8626- pause
8627- ;;
8628- " List and Revoke Certificate" )
8629- device_sideloader
8630- log " Checking for any existing certificates..."
8631- $sideloader cert list
8632- if [[ $? != 0 ]]; then
8633- warn " Sideloader returned an error. Incorrect Apple ID credentials?"
8600+ log " Using the selected account: $selected_account "
8601+
8602+ device_pair
8603+ device_udid=$( $ideviceinfo -s -k UniqueDeviceID)
8604+ [[ -z $device_udid ]] && device_udid=$( $ideviceinfo -k UniqueDeviceID)
8605+ if [[ -z $device_udid ]]; then
8606+ warn " Unable to get device UDID. Cannot continue."
86348607 pause
86358608 continue
86368609 fi
8637- print " * Take note of the certificate serial number that you want to revoke."
8638- local revoke
8639- revoke=
8640- while [[ -z $revoke ]]; do
8641- read -p " $( input ' Certificate Serial Number: ' ) " revoke
8642- done
8643- $sideloader cert revoke $revoke
8644- print " * If you see no error, the certificate should be revoked successfully."
8610+ log " Registering device..."
8611+ device_plumesign account register-device --udid $device_udid --name $device_type
8612+
8613+ log " Extracting IPA..."
8614+ mkdir -p temp_ipa
8615+ file_extract " $ipa_path " temp_ipa
8616+
8617+ log " Signing using Plumesign..."
8618+ device_plumesign sign -p temp_ipa/Payload/* .app --apple-id --udid $device_udid
8619+
8620+ log " Creating signed IPA..."
8621+ pushd temp_ipa > /dev/null
8622+ zip -r0 ../temp.ipa *
8623+ popd > /dev/null
8624+ rm -rf temp_ipa
8625+
8626+ device_pair
8627+ log " Installing IPA using ideviceinstaller..."
8628+ $ideviceinstaller install temp.ipa
8629+ rm -f temp.ipa
8630+ print " * If you see an error regarding verification, make sure that your iOS device is connected to the Internet."
86458631 pause
86468632 ;;
8633+ " Manage Plumesign Accounts" ) menu_plumesign_accounts;;
86478634 " Go Back" ) back=1;;
86488635 esac
86498636 done
86508637}
86518638
8652- device_sideloader () {
8653- local arch=" $platform_arch "
8654- sideloader=" sideloader-cli-"
8655- if [[ $platform == " macos" && $arch == " arm64" ]]; then
8656- arch=" arm64-apple-macos"
8657- elif [[ $platform == " macos" ]]; then
8658- arch=" x86_64-apple-darwin"
8659- elif [[ $arch == " arm64" ]]; then
8660- arch=" aarch64-linux-gnu"
8661- else
8662- arch=" x86_64-linux-gnu"
8663- fi
8664- sideloader+=" $arch "
8665- log " Checking for latest Sideloader"
8666- download_from_url " https://api.github.com/repos/LukeZGD/Sideloader/releases/latest" latest
8667- local latest=" $( cat latest | $jq -r " .tag_name" ) "
8668- local current=" $( cat ../saved/Sideloader_version 2> /dev/null || echo " none" ) "
8669- log " Latest version: $latest , current version: $current "
8670- if [[ $current != " $latest " ]]; then
8671- rm -f ../saved/$sideloader
8672- fi
8673- if [[ ! -e ../saved/$sideloader ]]; then
8674- file_download https://github.com/LukeZGD/Sideloader/releases/download/$latest /$sideloader .zip $sideloader .zip
8675- file_extract_from_archive $sideloader .zip $sideloader
8676- mv $sideloader ../saved
8677- fi
8678- echo " $latest " > ../saved/Sideloader_version
8679- device_pair
8680- log " Launching Dadoum Sideloader"
8681- local apple_id=" $APPLE_ID_USER "
8682- local apple_pass=" $APPLE_ID_PWD "
8683- if [[ -z $apple_id || -z $apple_pass ]]; then
8684- log " Enter Apple ID details to continue."
8685- print " * Your Apple ID and password will only be sent to Apple servers."
8686- fi
8687- while [[ -z $apple_id ]]; do
8688- read -p " $( input ' Apple ID: ' ) " apple_id
8689- done
8690- export APPLE_ID_USER=" $apple_id "
8691- print " * Your password input may not be visible, but it is still being entered."
8692- while [[ -z $apple_pass ]]; do
8693- read -s -p " $( input ' Password: ' ) " apple_pass
8639+ menu_plumesign_accounts () {
8640+ local config_file=" $HOME /.config/PlumeImpactor/accounts.json"
8641+ local accounts
8642+ local selected_account
8643+ local menu_items
8644+ local selected
8645+ local back
8646+
8647+ while [[ -z " $mode " && -z " $back " ]]; do
8648+ accounts=($( $jq -r ' .accounts | keys[]' " $config_file " ) )
8649+ selected_account=" $( $jq -r ' .selected_account' " $config_file " ) "
8650+ menu_items=(" Select Account" " Add Account" " Remove Account" " Go Back" )
8651+ menu_print_info
8652+ print " * Selected Account: $selected_account "
8653+ echo
8654+ print " > Main Menu > Sideload IPA > Manage Plumesign Accounts"
8655+ input " Select an option:"
8656+ select_option " ${menu_items[@]} "
8657+ selected=" ${menu_items[$?]} "
8658+ case $selected in
8659+ " Select Account" )
8660+ menu_items=()
8661+ for a in " ${accounts[@]} " ; do
8662+ menu_items+=(" $a " )
8663+ done
8664+ menu_items+=(" Go Back" )
8665+ print " * Select account to use:"
8666+ select_option " ${menu_items[@]} "
8667+ selected=" ${menu_items[$?]} "
8668+ case $selected in
8669+ " Go Back" ) continue ;;
8670+ * ) device_plumesign account switch " $selected " ;;
8671+ esac
8672+ ;;
8673+ " Add Account" )
8674+ log " Enter Apple ID details to continue."
8675+ print " * Your Apple ID and password will only be sent to Apple servers."
8676+ while [[ -z $apple_id ]]; do
8677+ read -p " $( input ' Apple ID: ' ) " apple_id
8678+ done
8679+ print " * Your password input will not be visible, but it is still being entered."
8680+ while [[ -z $apple_pass ]]; do
8681+ read -s -p " $( input ' Password: ' ) " apple_pass
8682+ done
8683+ echo
8684+ log " Adding account using Plumesign..."
8685+ device_plumesign account login -u " $apple_id " -p " $apple_pass "
8686+ pause
8687+ ;;
8688+ " Remove Account" )
8689+ menu_items=()
8690+ for a in " ${accounts[@]} " ; do
8691+ menu_items+=(" $a " )
8692+ done
8693+ menu_items+=(" Go Back" )
8694+ print " * Select account to remove:"
8695+ select_option " ${menu_items[@]} "
8696+ selected=" ${menu_items[$?]} "
8697+ case $selected in
8698+ " Go Back" ) continue ;;
8699+ * )
8700+ device_plumesign account switch " $selected "
8701+ device_plumesign account logout
8702+ pause
8703+ ;;
8704+ esac
8705+ ;;
8706+ " Go Back" ) back=1;;
8707+ esac
86948708 done
8695- echo
8696- export APPLE_ID_PWD=" $apple_pass "
8697- chmod +x ../saved/$sideloader
8698- sideloader=" ../saved/$sideloader "
86998709}
87008710
87018711menu_zenity_check () {
@@ -11623,24 +11633,54 @@ device_altserver() {
1162311633 export ALTSERVER_ANISETTE_SERVER=http://127.0.0.1:6969
1162411634 altserver=" env ALTSERVER_ANISETTE_SERVER=$ALTSERVER_ANISETTE_SERVER $altserver "
1162511635 device_pair
11626- log " Enter Apple ID details to continue."
11627- print " * Your Apple ID and password will only be sent to Apple servers."
11628- local apple_id
11629- local apple_pass
11636+ local apple_id=" $APPLE_ID_USER "
11637+ local apple_pass=" $APPLE_ID_PWD "
11638+ if [[ -z $apple_id || -z $apple_pass ]]; then
11639+ log " Enter Apple ID details to continue."
11640+ print " * Your Apple ID and password will only be sent to Apple servers."
11641+ fi
1163011642 while [[ -z $apple_id ]]; do
1163111643 read -p " $( input ' Apple ID: ' ) " apple_id
1163211644 done
11645+ export APPLE_ID_USER=" $apple_id "
1163311646 print " * Your password input may not be visible, but it is still being entered."
1163411647 while [[ -z $apple_pass ]]; do
1163511648 read -s -p " $( input ' Password: ' ) " apple_pass
1163611649 done
11650+ export APPLE_ID_PWD=" $apple_pass "
1163711651 echo
1163811652 log " Running AltServer-Linux with given Apple ID details..."
1163911653 pushd ../saved > /dev/null
1164011654 $altserver -u $device_udid -a " $apple_id " -p " $apple_pass " " $ipa_path "
1164111655 popd > /dev/null
1164211656}
1164311657
11658+ device_plumesign () {
11659+ local plumesign=" plumesign-linux-$( uname -m) "
11660+ [[ $platform == " macos" ]] && plumesign=" plumesign-macos-universal"
11661+
11662+ if [[ $plumesign_check_once != 1 ]]; then
11663+ log " Checking for latest plumesign"
11664+ download_from_url " https://api.github.com/repos/claration/Impactor/releases/latest" latest
11665+ local latest=" $( cat latest | $jq -r " .tag_name" ) "
11666+ local current=" $( cat ../saved/${plumesign} _version 2> /dev/null || echo " none" ) "
11667+ log " Latest version: $latest , current version: $current "
11668+ if [[ $current != " $latest " ]]; then
11669+ rm -f ../saved/$plumesign
11670+ fi
11671+ if [[ ! -e ../saved/$plumesign ]]; then
11672+ file_download https://github.com/claration/Impactor/releases/download/$latest /$plumesign $plumesign
11673+ mv $plumesign ../saved
11674+ fi
11675+ echo " $latest " > ../saved/${plumesign} _version
11676+ plumesign_check_once=1
11677+ fi
11678+
11679+ log " Running plumesign $1 $2 "
11680+ chmod +x ../saved/$plumesign
11681+ ../saved/$plumesign " $@ "
11682+ }
11683+
1164411684device_dumpapp () {
1164511685 device_iproxy
1164611686 device_ssh_message
0 commit comments