X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/c38e3ce98599a410a47dc10253faa4d5830f13b2..427c49bcad63d042b29ada2ac27e3dfc4845c779:/sec/SOSCircle/CloudKeychainProxy/scripts/install_on_devices diff --git a/sec/SOSCircle/CloudKeychainProxy/scripts/install_on_devices b/sec/SOSCircle/CloudKeychainProxy/scripts/install_on_devices new file mode 100755 index 00000000..53c710af --- /dev/null +++ b/sec/SOSCircle/CloudKeychainProxy/scripts/install_on_devices @@ -0,0 +1,39 @@ +#!/bin/zsh + +roots="/tmp/security.roots.tgz" +syms="/tmp/security.syms.tgz" +srcs="/tmp/security.src.tgz" +sshopts=(-o CheckHostIP=no -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null) + +locations=(`mobdev list | awk '/UDID/ { gsub(/^(.*location ID = )+|(,.*)+$/, ""); print}'`) + +port_offset=20000 + +symdir="/var/mobile/secsyms" + +for location in $locations +do + echo 'Installing to location '"$location" + + tcprelay --portoffset $port_offset --locationid $location ssh >/dev/null 2>&1 & + + (( sshport = $port_offset + 22 )) + + echo "Copying roots to device (via port $sshport)" + scp -P $sshport $sshopts $roots $syms $srcs root@localhost:/var/mobile/ + + echo "SSH to device and do commands" + ssh $sshopts -p $sshport root@localhost << END +/bin/hostname +/sbin/mount -uw / +/usr/local/bin/darwinup install "/var/mobile/`basename $roots`" | grep -v '^ /' +/usr/local/bin/darwinup uninstall superseded > /dev/null 2>&1 || true +touch /System/Library/Caches/com.apple.xpcd/xpcd_cache.dylib +/usr/local/bin/mobile_install rebuild internal +/bin/launchctl stop com.apple.securityd +/bin/launchctl stop com.apple.security.cloudkeychainproxy3 +/bin/launchctl stop com.apple.security.CircleJoinRequest +END + + kill -HUP %% +done