Last active
January 22, 2019 15:41
-
-
Save ericcastro/fb38e33bef98deb86272 to your computer and use it in GitHub Desktop.
handy script for injecting one-line cycript code in a process on your target device and exiting after execution.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: ./cyexec <process> <code> | |
# | |
# Example #1 (Locks device): | |
# | |
# ./cyexec SpringBoard '[[SBUserAgent sharedUserAgent] lockAndDimDevice]' | |
# | |
# Example #2 (Shows an alert message): | |
# | |
# ./cyexec SpringBoard '[[[[UIAlertView alloc] initWithTitle:@"OH HAI" message:@"This is a test message!" delegate:nil cancelButtonTitle:@"Got it" otherButtonTitles:nil] autorelease] show]' | |
# | |
# Useful to automate arbitrary code execution in your theos Makefile (before-install, after-install, etc) | |
# | |
process=$1 | |
shift | |
echo $* > /tmp/die && cycript -p $process /tmp/die; rm /tmp/die |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment