├── .github └── FUNDING.yml ├── source ├── functions │ ├── includes.h │ ├── colors.h │ ├── 420.h │ └── 420.m ├── Makefile ├── tai.plist └── main.m ├── Makefile ├── layout ├── DEBIAN │ └── postinst ├── Library │ └── Application Support │ │ └── Theos Auto Installer │ │ └── en.lproj │ │ └── tai.strings └── usr │ └── sbin │ ├── fixTheos │ └── tai-depends ├── README.md ├── control └── LICENSE.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: https://paypal.me/4Randy420, https://linktree.com/Randy-420 2 | -------------------------------------------------------------------------------- /source/functions/includes.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #include "colors.h" -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SUBPROJECTS += source 2 | 3 | include $(THEOS)/makefiles/common.mk 4 | include $(THEOS_MAKE_PATH)/aggregate.mk -------------------------------------------------------------------------------- /layout/DEBIAN/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | chown 0:0 /usr/sbin/fixTheos 3 | chmod +srx /usr/sbin/fixTheos 4 | chown 0:0 /usr/sbin/tai-depends 5 | chmod +srx /usr/sbin/tai-depends -------------------------------------------------------------------------------- /layout/Library/Application Support/Theos Auto Installer/en.lproj/tai.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Randy-420/Theos-Auto-Installer-u0-Checkra1n-odyssey/HEAD/layout/Library/Application Support/Theos Auto Installer/en.lproj/tai.strings -------------------------------------------------------------------------------- /source/Makefile: -------------------------------------------------------------------------------- 1 | include $(THEOS)/makefiles/common.mk 2 | 3 | TOOL_NAME = tai 4 | tai_FILES = main.m $(wildcard functions/*.m) 5 | tai_FRAMEWORKS = UIKit 6 | tai_CFLAGS = -fobjc-arc 7 | 8 | include $(THEOS_MAKE_PATH)/tool.mk 9 | include $(THEOS_MAKE_PATH)/aggregate.mk 10 | -------------------------------------------------------------------------------- /source/tai.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /source/functions/colors.h: -------------------------------------------------------------------------------- 1 | //standard colors 2 | static const char* c_black = "\x1B[30m"; 3 | static const char* c_red = "\x1B[31m"; 4 | static const char* c_green = "\x1B[32m"; 5 | static const char* c_yellow = "\x1B[33m"; 6 | static const char* c_blue = "\x1B[34m"; 7 | static const char* c_magenta = "\x1B[35m"; 8 | static const char* c_cyan = "\x1B[36m"; 9 | static const char* c_white = "\x1B[37m"; 10 | static const char* c_reset = "\x1B[0m"; 11 | 12 | //casing 13 | static const char* c_bold = "\x1B[1m"; //bold 14 | static const char* c_ul = "\x1B[4m"; //underline 15 | static const char* c_reverse = "\x1B[7m"; //invert -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Theos-Auto-Installer-u0-Checkra1n-odyssey 2 | Should work on iOS 5++ any jailbreak. Please report any bugs you may encounter, but I believe they're all squashed. 3 | 4 | 5 | Description: Install theos and setup everything you need with 1 simple command. Works on iOS 11, 12, 13 and 14 unc0ver, checkra1n & odyssey. Supports compiling armv7, armv7s, arm64, arm64e. Mterminal only! Don't use NewTerm as it crashes. Usage: 'tai' will download and install theos & sdks files if it's not already. 'tai -r' will download and re-install theos and all the required sdks files. 'tai -u' will uninstall theos & sdks files. 'tai -s' will download sdks only. 6 | 7 | https://github.com/theos/theos/wiki 8 | 9 | -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Package: com.randy420.tai 2 | Name: Theos Auto Installer 3 | Depends: com.randy420.tools (>= 2.3), clang, curl, git, grep, perl, rsync, unzip, make, ldid, com.opa334.ccsupport, xar 4 | Conflicts: net.howett.theos 5 | Architecture: iphoneos-arm 6 | Description: Install Theos from terminal using a simple terminal command (CONFIGURE FROM SETTINGS AND CONNECT TO WIFI) 7 | - tai 8 | UNINSTALL THEOS 9 | - tai -u 10 | REINSTALL THEOS 11 | - tai -r 12 | Depiction: https://Randy-420.GitHub.io/depic/tai.html 13 | Homepage: https://theemeraldisle.family 14 | Maintainer: Randy420 15 | Author: Randy420 16 | Version: 5.2.2 17 | Section: System 18 | Tag: role::hacker -------------------------------------------------------------------------------- /layout/usr/sbin/fixTheos: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #REPLACE="\$fakeroot \$cmd" 3 | 4 | FILE="/theos/bin" 5 | FILE1="/var$FILE" 6 | 7 | if [ -d "$FILE" ]; then 8 | FAKEROOT=$FILE 9 | # FIX="\$fakeroot perl $FILE/\$cmd" 10 | elif [ -d "$FILE1" ]; then 11 | FAKEROOT=$FILE1 12 | # FIX="\$fakeroot perl $FILE1/\$cmd" 13 | else 14 | echo "Theos isnt installed... and thats probably you're issue. Please install Theos." 15 | exit 1; 16 | fi 17 | 18 | cp -f "/Library/Application Support/Theos Auto Installer/fakeroot.sh" $FAKEROOT 19 | 20 | #n=1 21 | 22 | #IFS=$'\n' 23 | 24 | #while read LINE; do 25 | # reading each line 26 | # if [ "$LINE" != "$REPLACE" ]; then 27 | # if [ "$LINE" == "#!/bin/bash" ]; then 28 | # TEXT="${LINE}" 29 | # else 30 | # TEXT="${TEXT} 31 | #${LINE}" 32 | # fi 33 | # else 34 | # TEXT="${TEXT} 35 | #${LINE} 36 | #${FIX}" 37 | # fi 38 | 39 | # n=$((n+1)) 40 | #done < $FAKEROOT 41 | 42 | #echo "$TEXT" > $FAKEROOT 43 | 44 | echo "Theos should now work as expected!" 45 | exit 0; -------------------------------------------------------------------------------- /source/main.m: -------------------------------------------------------------------------------- 1 | #include "functions/420.h" 2 | 3 | int main(int argc, char* argv[]) { 4 | tai *TAI = [[tai alloc] init]; 5 | /////////////////////////////////////// 6 | //// •Declaration•Handling• //// 7 | /////////////////////////////////////// 8 | NSString * helpme = [NSString stringWithFormat:@"%s%@ '%stai%s' %@.\n" 9 | "%stai -%s[%s%@%s]%s\n" 10 | "-u%s %@.%s\n" 11 | "-r%s %@.%s\n" 12 | "-s%s %@ '%s/theos%s' %@ '%s/var/theos%s').\n%s" 13 | "-v%s %@ Theos.%s\n" 14 | "-.%s %@.\n%s" 15 | "-p update .profile, .zprofile and .zshrc", 16 | c_red, local(@"LAUNCH", @"Please launch"), c_cyan, c_red, local(@"ONE_OPT", @"with one option at a time"), c_cyan, c_red, c_cyan, local(@"OPTION", @"option"), c_red, c_cyan, c_magenta, local(@"-U", @"Uninstall Theos"), c_cyan, c_magenta, local(@"-r", @"Reinstall Theos"), c_cyan, c_magenta, local(@"-S", @"Install enhanced dev tools & SDK files only.(requires theos to be installed already in location"), c_green, c_magenta, local(@"OR", @"or"), c_green, c_magenta, c_cyan, c_magenta, local(@"UPDATE", @"Update"), c_cyan, c_magenta, local(@"-.", @"Remove color from the terminal output"), c_reset]; 17 | /////////////////////////////////////// 18 | //// •Options• //// 19 | /////////////////////////////////////// 20 | [TAI startup]; 21 | 22 | TAI.PoPuP = NO; 23 | 24 | int opts = 0; 25 | int c; 26 | while ((c = getopt(argc, argv, ":. :~ :.~psfurv")) != -1) { 27 | switch (c) { 28 | case '~': 29 | TAI.abyss = YES; 30 | TAI.PoPuP = YES; 31 | case '.': 32 | TAI.useColor = NO; 33 | break; 34 | case 'p': 35 | for (NSString *profile in TAI.profiles) { 36 | [TAI addToProfile:YES profile:profile]; 37 | } 38 | exit(0); 39 | case 's': 40 | [TAI enhancer]; 41 | [TAI DoWnLoAd]; 42 | [TAI popup]; 43 | exit (0); 44 | case 'u': 45 | opts += 1; 46 | break; 47 | case 'v': 48 | if (TAI.previousInstall) { 49 | [TAI depends]; 50 | [TAI upDateTheos]; 51 | [TAI popup]; 52 | }else{ 53 | [TAI Print:local(@"INSTALL_FIRST", @"Theos is NOT installed, install theos before proceeding")]; 54 | } 55 | exit(0); 56 | case 'r': 57 | opts += 2; 58 | break; 59 | case 'f': 60 | [TAI header]; 61 | [TAI fixTheos]; 62 | exit (0); 63 | case '?': 64 | [TAI header]; 65 | [TAI Print:helpme]; 66 | exit (1); 67 | } 68 | } 69 | /////////////////////////////////////// 70 | //// •Option•Handling• //// 71 | /////////////////////////////////////// 72 | if ((opts==2) || (opts==1)){ 73 | if (TAI.previousInstall){ 74 | [TAI dTheos:true]; 75 | } else { 76 | [TAI Print:[NSString stringWithFormat:@"%stheos%s %@.\nಠ_ಠ\n%s", c_cyan, c_red, local(@"NOT_INSTALLED", @"isn't installed, run the installer again. Please install Theos before trying to reinstall or delete it"), c_reset]]; 77 | exit (1); 78 | } 79 | if (opts==1){ 80 | for (NSString *profile in TAI.profiles) { 81 | [TAI addToProfile:NO profile:profile]; 82 | } 83 | [TAI popup]; 84 | exit(0); 85 | } 86 | } 87 | 88 | if (TAI.installedTheos || TAI.installedVarTheos || TAI.installedOptTheos) { 89 | [TAI header]; 90 | [TAI Print:[NSString stringWithFormat:@"%sTheos%s %@ '%stai -r%s' %@ '%stai -u%s' %@%s\n", c_cyan, c_green, local(@"ALREADY", @"already installed, run"), c_cyan, c_green, local(@"TO_REINSTALL", @"to reinstall or"), c_cyan, c_red, local(@"UNINSTALL", @"uninstall"), c_reset]]; 91 | exit(1); 92 | } 93 | //////////////////////////////////////// 94 | //// •Theos•Dependencies• //// 95 | //////////////////////////////////////// 96 | [TAI depends]; 97 | //////////////////////////////////////// 98 | //// •git•Theos• //// 99 | //////////////////////////////////////// 100 | if ([TAI theosInstall]) { 101 | /////////////////////////////////////// 102 | //// .profile•Handling //// 103 | /////////////////////////////////////// 104 | for (NSString *profile in TAI.profiles) { 105 | [TAI addToProfile:YES profile:profile]; 106 | } 107 | /////////////////////////////////////// 108 | //// Folder•Handling //// 109 | /////////////////////////////////////// 110 | [TAI makeTweaksFolder]; 111 | /////////////////////////////////////// 112 | //// Enhancer•Handling //// 113 | /////////////////////////////////////// 114 | [TAI enhancer]; 115 | /////////////////////////////////////// 116 | //// SDK•Handling //// 117 | /////////////////////////////////////// 118 | [TAI DoWnLoAd]; 119 | } 120 | /////////////////////////////////////// 121 | //// MSG•Handling //// 122 | /////////////////////////////////////// 123 | [TAI popup]; 124 | exit(0); 125 | } -------------------------------------------------------------------------------- /layout/usr/sbin/tai-depends: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | #Unused variable. 4 | B='\x1B[30m' #Black 5 | LG='\033[1;32m' #Green 6 | P='\033[0;35m' #Purple 7 | NC='\033[0m' #Default shell colour 8 | settings=0 9 | 10 | uncoolstarDepends="com.randy420.taidependscoolstar" 11 | uncoolstarVersion=0.4 12 | otherDepends="com.randy420.taidependsother" 13 | otherVersion=0.3 14 | 15 | checkRoot(){ 16 | if [[ "$EUID" -ne 0 ]]; then 17 | echo "$(tput setaf 1;)TAI Installer needs to be run with root privileges." 18 | exit 19 | fi 20 | } 21 | 22 | checkInstall(){ 23 | Depends="$1" 24 | shift 1 25 | Version="$1" 26 | 27 | installedVersion=$(apt list --installed 2>/dev/null | grep -w $Depends | sed 's/randy420//g' | sed 's/[^0-9]*//g' | sed -r 's/(.{1})/\1./g' | sed 's/.$//') 28 | 29 | if [[ "$installedVersion" == "$Version" ]]; then 30 | echo -e "${LG}Dependencies up to date${NC}\n" 31 | return 0 32 | elif [[ "$installedVersion" == "" ]]; then 33 | echo -e "${P}Should install dependencies${NC}\n" 34 | return 1 35 | else 36 | echo -e "${P}Should upgrade dependencies${NC}\n" 37 | return 2 38 | fi 39 | } 40 | 41 | whatsHappening(){ 42 | wagwan=$1 43 | shift 1 44 | installType=$1 45 | shift 1 46 | package=$1 47 | 48 | if [ "$settings" -eq 0 ]; then 49 | (tput setaf 6) 50 | fi 51 | echo -e "${wagwan}\n" 52 | if [ "$settings" -eq 0 ]; then 53 | (tput setaf 2) 54 | echo -e "I suggest you connect to Wi-Fi network before proceeding.\n" 55 | sleep 3 56 | 57 | echo -e "Hey seriously, if you don't want mobile data (less than ~300MB) to be used.\n" 58 | sleep 5 59 | fi 60 | 61 | apt-get ${installType} ${package} -y --allow-unauthenticated 62 | } 63 | while getopts ":~" opt; do 64 | case ${opt} in 65 | "~") # process option h 66 | B='' #Black 67 | LG='' #Green 68 | P='' #Purple 69 | NC='' #Default shell colour 70 | settings=1 71 | ;; 72 | esac 73 | done 74 | 75 | procursus=(/.procursus_strapped) 76 | 77 | if [ "$settings" -eq 0 ]; then 78 | #======================================== 79 | iosv="$(sw_vers -productVersion)" 80 | 81 | jbd=/private/var/jb/cheyote 82 | if test -d "$jbd"; then 83 | jb=$(tput setaf 5;)"Cheyote" 84 | else 85 | jbd=/taurine 86 | if test -d "$jbd"; then 87 | jb=$(tput setaf 5;)"Taurine" 88 | else 89 | jbd=/odyssey 90 | if test -d "$jbd";then 91 | jb="$(tput setaf 5;)Odyssey" 92 | else 93 | jbd=/.installed_odyssey 94 | if test -f "$jbd"; then 95 | jb="$(tput setab 0;)$(tput setaf 5;)Odysseyra1n" 96 | else 97 | jbd=/.installed_unc0ver 98 | if test -f "$jbd"; then 99 | jb="$(tput setaf 0;)$(tput setab 7;)unc0ver" 100 | else 101 | jbd=/.bootstrapped 102 | if test -f "$jbd"; then 103 | jb="$(tput setaf 7;)$(tput setab 0;)checkra1n" 104 | else 105 | jb="$(tput setaf 1;)Unknown Jailbreak?" 106 | fi 107 | fi 108 | fi 109 | fi 110 | fi 111 | fi 112 | #======================================== 113 | if [[ $iosv -eq 15 ]]; then 114 | echo "$(tput setaf 1;) iOS 15 not supported at this moment " 115 | exit 116 | fi 117 | #======================================== 118 | 119 | (tput setab 0) 120 | (tput setaf 2) 121 | clear 122 | 123 | cat << EOF 124 | _____ _ ___ 125 | |_ _|/ \ |_ _| 126 | | | / _ \ | | 127 | | |/ ___ \ | | 128 | |_/_/ \_\____| 129 | 130 | ___ _ _ _ 131 | |_ _|_ __ ___| |_ __ _| | | ___ _ __ 132 | | || _ \/ __| __/ _ | | |/ _ \ __| 133 | | || | | \__ \ || (_| | | | __/ | 134 | |___|_| |_|___/\__\__ _|_|_|\___|_| 135 | 136 | EOF 137 | 138 | echo -e "\nTheos Dependency Installer:\nWritten by: Turann and Randy420\n" 139 | 140 | #======================================== 141 | echo "iOS Version: $iosv" 142 | echo "Jailbreak: $jb" 143 | (tput setab 0) 144 | (tput setaf 2) 145 | #======================================== 146 | echo "" 147 | echo "" 148 | fi 149 | 150 | checkRoot 151 | 152 | if test -f "$procursus" ; then 153 | checkInstall "${uncoolstarDepends}" "${uncoolstarVersion}" 154 | whatToDo="$?" 155 | 156 | if [[ "$whatToDo" == "0" ]]; then 157 | echo -e "\n" 158 | elif [[ "$whatToDo" == "1" ]]; then 159 | whatsHappening "Should install from Procursus" "install" "${uncoolstarDepends}" 160 | else 161 | whatsHappening "Should update from Procursus" "upgrade" "${uncoolstarDepends}" 162 | fi 163 | else 164 | checkInstall "${otherDepends}" "${otherVersion}" 165 | whatToDo="$?" 166 | 167 | if [[ "$whatToDo" == "0" ]]; then 168 | echo -e "\n" 169 | elif [[ "$whatToDo" == "1" ]]; then 170 | whatsHappening "Should install from Bingner" "install" "${otherDepends}" 171 | else 172 | whatsHappening "Should update from Bingner" "upgrade" "${otherDepends}" 173 | fi 174 | fi 175 | 176 | echo "" 177 | 178 | #To install TAI. 179 | #apt install com.randy420.tai -y --allow-unauthenticated 180 | dpkg --configure -a 181 | #Just to make sure everything is configured. 182 | echo "" 183 | echo "We are done." 184 | exit 0 -------------------------------------------------------------------------------- /source/functions/420.h: -------------------------------------------------------------------------------- 1 | #pragma GCC diagnostic ignored "-Wunused-function" 2 | #import 3 | #include 4 | #include "includes.h" 5 | #import 6 | 7 | static NSString *local(NSString *local, NSString *def){ 8 | NSString *path = @"/Library/Application Support/Theos Auto Installer"; 9 | NSString *tPath; 10 | NSArray *languages = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil]; 11 | NSArray *preferredLanguages = [NSLocale preferredLanguages]; 12 | 13 | for (NSString *preferredLanguage in preferredLanguages){ 14 | for (NSString *language in languages){ 15 | if ([preferredLanguage hasPrefix:[language stringByReplacingOccurrencesOfString:@".lproj" withString:@""]]){ 16 | tPath = [path stringByAppendingPathComponent:language]; 17 | if ([[NSFileManager defaultManager] fileExistsAtPath:tPath]){ 18 | path = tPath; 19 | return [[NSBundle bundleWithPath:path] localizedStringForKey:local value:def table:@"tai"]; 20 | } 21 | } 22 | } 23 | } 24 | 25 | return def;//[[NSBundle bundleWithPath:path] localizedStringForKey:local value:def table:@"tai"]; 26 | } 27 | 28 | static NSString *GetNSString(NSString *pkey, NSString *defaultValue, NSString *plst){ 29 | NSDictionary *Dict = [NSDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"/var/mobile/Library/Preferences/%@.plist",plst]]; 30 | 31 | return [Dict objectForKey:pkey] ? [Dict objectForKey:pkey] : defaultValue; 32 | } 33 | 34 | static BOOL GetBool(NSString *pkey, BOOL defaultValue, NSString *plst) { 35 | NSDictionary *Dict = [NSDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"/var/mobile/Library/Preferences/%@.plist",plst]]; 36 | 37 | return [Dict objectForKey:pkey] ? [[Dict objectForKey:pkey] boolValue] : defaultValue; 38 | } 39 | 40 | @interface UIDevice () 41 | - (id)_deviceInfoForKey:(NSString *)key; 42 | @end 43 | 44 | @interface tai : NSObject{ 45 | /* VARIABLES */ 46 | NSString *runCode; 47 | NSString *tFolderSuc; 48 | NSString *tFolderFail; 49 | NSString *previousInstallMsg; 50 | NSString *theosSuccessMessage; 51 | NSString *theosFailureMessage; 52 | NSString *successfulSdk; 53 | NSString *failedSdk; 54 | NSString *ignored; 55 | NSString *enhanceMsg; 56 | NSString *updated; 57 | NSString *updateFail; 58 | NSString *Loc; 59 | NSString *msg; 60 | NSString *dlLinK; 61 | NSString *installHere; 62 | NSString *checkInstall; 63 | NSString *fixApplied; 64 | NSString *failedRm; 65 | NSString *successfulRm; 66 | NSString *leaf; 67 | NSMutableDictionary *preferences; 68 | NSFileManager *fm; 69 | } 70 | 71 | /* ENHANCEMENTS */ 72 | @property (nonatomic, assign) BOOL enhance; 73 | /* SDKS */ 74 | @property (nonatomic, copy) NSArray *profiles; 75 | @property (nonatomic, assign) BOOL all; 76 | @property (nonatomic, assign) BOOL eightFour; 77 | @property (nonatomic, assign) BOOL nineThree; 78 | @property (nonatomic, assign) BOOL ten; 79 | @property (nonatomic, assign) BOOL tenThree; 80 | @property (nonatomic, assign) BOOL eleven; 81 | @property (nonatomic, assign) BOOL elevenOne; 82 | @property (nonatomic, assign) BOOL elevenTwo; 83 | @property (nonatomic, assign) BOOL elevenThree; 84 | @property (nonatomic, assign) BOOL elevenFour; 85 | @property (nonatomic, assign) BOOL twelveOneTwo; 86 | @property (nonatomic, assign) BOOL twelveTwo; 87 | @property (nonatomic, assign) BOOL twelveFour; 88 | @property (nonatomic, assign) BOOL thirteen; 89 | @property (nonatomic, assign) BOOL thirteenTwo; 90 | @property (nonatomic, assign) BOOL thirteenFour; 91 | @property (nonatomic, assign) BOOL thirteenFive; 92 | @property (nonatomic, assign) BOOL fourteen; 93 | @property (nonatomic, assign) BOOL fourteenOne; 94 | @property (nonatomic, assign) BOOL fourteenTwo; 95 | @property (nonatomic, assign) BOOL fourteenThree; 96 | @property (nonatomic, assign) BOOL fourteenFour; 97 | @property (nonatomic, assign) BOOL fourteenFive; 98 | /* CHECKS */ 99 | @property (nonatomic, assign) BOOL failure; 100 | @property (nonatomic, assign) BOOL alreadyHas; 101 | @property (nonatomic, assign) BOOL enhanced; 102 | @property (nonatomic, assign) BOOL installSuccess; 103 | @property (nonatomic, assign) BOOL previousInstall; 104 | @property (nonatomic, assign) BOOL tweaksMade; 105 | @property (nonatomic, assign) BOOL tweaksExists; 106 | @property (nonatomic, assign) BOOL folderFailed; 107 | @property (nonatomic, assign) BOOL theosUpdate; 108 | @property (nonatomic, assign) BOOL theosUpdateFail; 109 | @property (nonatomic, assign) BOOL attempted; 110 | @property (nonatomic, assign) BOOL failed; 111 | @property (nonatomic, assign) BOOL PoPuP; 112 | @property (nonatomic, assign) BOOL useColor; 113 | @property (nonatomic, assign) BOOL installedTheos; 114 | @property (nonatomic, assign) BOOL installedVarTheos; 115 | @property (nonatomic, assign) BOOL installedOptTheos; 116 | @property (nonatomic, assign) BOOL installFirst; 117 | @property (nonatomic, assign) BOOL abyss; 118 | @property (nonatomic, assign) BOOL rmFailure; 119 | @property (nonatomic, assign) BOOL autoRm; 120 | /* COUNTER */ 121 | @property (nonatomic, assign) int totalDownloaded; 122 | @property (nonatomic, assign) int totalRemoved; 123 | 124 | -(void) RunCMD:(NSString *)RunCMD WaitUntilExit:(BOOL)WaitUntilExit; 125 | -(void) fixTheos; 126 | -(void) makeTweaksFolder; 127 | -(BOOL) theosInstall; 128 | -(void) loader; 129 | -(void)remove:(NSString *)sdk; 130 | -(bool) sdk:(NSString*)sdk Link:(NSString*)Link; 131 | -(void) DoWnLoAd; 132 | -(void) upDateTheos; 133 | -(void) enhancer; 134 | -(void) addMsg:(NSString *)mSg; 135 | -(void) popup; 136 | -(void) updateInstall; 137 | -(void)checkTerm; 138 | -(BOOL)dTheos:(BOOL)dTheos; 139 | -(void)header; 140 | -(void)startup; 141 | -(void)depends; 142 | -(void)Print:(NSString *)Print; 143 | -(void) addToProfile:(BOOL)addToProfile profile:(NSString *)profile; 144 | @end 145 | 146 | // NSTask.h 147 | #import 148 | 149 | @class NSString, NSArray, NSDictionary; 150 | 151 | @interface NSTask : NSObject 152 | 153 | // Create an NSTask which can be run at a later time 154 | // An NSTask can only be run once. Subsequent attempts to 155 | // run an NSTask will raise. 156 | // Upon task death a notification will be sent 157 | // { Name = NSTaskDidTerminateNotification; object = task; } 158 | // 159 | 160 | - (instancetype)init; 161 | 162 | // set parameters 163 | // these methods can only be done before a launch 164 | - (void)setLaunchPath:(NSString *)path; 165 | - (void)setArguments:(NSArray *)arguments; 166 | - (void)setEnvironment:(NSDictionary *)dict; 167 | // if not set, use current 168 | - (void)setCurrentDirectoryPath:(NSString *)path; 169 | // if not set, use current 170 | 171 | // set standard I/O channels; may be either an NSFileHandle or an NSPipe 172 | - (void)setStandardInput:(id)input; 173 | - (void)setStandardOutput:(id)output; 174 | - (void)setStandardError:(id)error; 175 | 176 | // get parameters 177 | - (NSString *)launchPath; 178 | - (NSArray *)arguments; 179 | - (NSDictionary *)environment; 180 | - (NSString *)currentDirectoryPath; 181 | 182 | // get standard I/O channels; could be either an NSFileHandle or an NSPipe 183 | - (id)standardInput; 184 | - (id)standardOutput; 185 | - (id)standardError; 186 | 187 | // actions 188 | - (void)launch; 189 | 190 | - (void)interrupt; // Not always possible. Sends SIGINT. 191 | - (void)terminate; // Not always possible. Sends SIGTERM. 192 | 193 | - (BOOL)suspend; 194 | - (BOOL)resume; 195 | 196 | // status 197 | - (int)processIdentifier; 198 | - (BOOL)isRunning; 199 | 200 | - (int)terminationStatus; 201 | 202 | @end 203 | 204 | @interface NSTask (NSTaskConveniences) 205 | 206 | + (NSTask *)launchedTaskWithLaunchPath:(NSString *)path arguments:(NSArray *)arguments; 207 | // convenience; create and launch 208 | 209 | - (void)waitUntilExit; 210 | // poll the runLoop in defaultMode until task completes 211 | 212 | @end 213 | 214 | FOUNDATION_EXPORT NSString * const NSTaskDidTerminateNotification; -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Attribution 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More_considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution 4.0 International Public License 58 | 59 | By exercising the Licensed Rights (defined below), You accept and agree 60 | to be bound by the terms and conditions of this Creative Commons 61 | Attribution 4.0 International Public License ("Public License"). To the 62 | extent this Public License may be interpreted as a contract, You are 63 | granted the Licensed Rights in consideration of Your acceptance of 64 | these terms and conditions, and the Licensor grants You such rights in 65 | consideration of benefits the Licensor receives from making the 66 | Licensed Material available under these terms and conditions. 67 | 68 | 69 | Section 1 -- Definitions. 70 | 71 | a. Adapted Material means material subject to Copyright and Similar 72 | Rights that is derived from or based upon the Licensed Material 73 | and in which the Licensed Material is translated, altered, 74 | arranged, transformed, or otherwise modified in a manner requiring 75 | permission under the Copyright and Similar Rights held by the 76 | Licensor. For purposes of this Public License, where the Licensed 77 | Material is a musical work, performance, or sound recording, 78 | Adapted Material is always produced where the Licensed Material is 79 | synched in timed relation with a moving image. 80 | 81 | b. Adapter's License means the license You apply to Your Copyright 82 | and Similar Rights in Your contributions to Adapted Material in 83 | accordance with the terms and conditions of this Public License. 84 | 85 | c. Copyright and Similar Rights means copyright and/or similar rights 86 | closely related to copyright including, without limitation, 87 | performance, broadcast, sound recording, and Sui Generis Database 88 | Rights, without regard to how the rights are labeled or 89 | categorized. For purposes of this Public License, the rights 90 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 91 | Rights. 92 | 93 | d. Effective Technological Measures means those measures that, in the 94 | absence of proper authority, may not be circumvented under laws 95 | fulfilling obligations under Article 11 of the WIPO Copyright 96 | Treaty adopted on December 20, 1996, and/or similar international 97 | agreements. 98 | 99 | e. Exceptions and Limitations means fair use, fair dealing, and/or 100 | any other exception or limitation to Copyright and Similar Rights 101 | that applies to Your use of the Licensed Material. 102 | 103 | f. Licensed Material means the artistic or literary work, database, 104 | or other material to which the Licensor applied this Public 105 | License. 106 | 107 | g. Licensed Rights means the rights granted to You subject to the 108 | terms and conditions of this Public License, which are limited to 109 | all Copyright and Similar Rights that apply to Your use of the 110 | Licensed Material and that the Licensor has authority to license. 111 | 112 | h. Licensor means the individual(s) or entity(ies) granting rights 113 | under this Public License. 114 | 115 | i. Share means to provide material to the public by any means or 116 | process that requires permission under the Licensed Rights, such 117 | as reproduction, public display, public performance, distribution, 118 | dissemination, communication, or importation, and to make material 119 | available to the public including in ways that members of the 120 | public may access the material from a place and at a time 121 | individually chosen by them. 122 | 123 | j. Sui Generis Database Rights means rights other than copyright 124 | resulting from Directive 96/9/EC of the European Parliament and of 125 | the Council of 11 March 1996 on the legal protection of databases, 126 | as amended and/or succeeded, as well as other essentially 127 | equivalent rights anywhere in the world. 128 | 129 | k. You means the individual or entity exercising the Licensed Rights 130 | under this Public License. Your has a corresponding meaning. 131 | 132 | 133 | Section 2 -- Scope. 134 | 135 | a. License grant. 136 | 137 | 1. Subject to the terms and conditions of this Public License, 138 | the Licensor hereby grants You a worldwide, royalty-free, 139 | non-sublicensable, non-exclusive, irrevocable license to 140 | exercise the Licensed Rights in the Licensed Material to: 141 | 142 | a. reproduce and Share the Licensed Material, in whole or 143 | in part; and 144 | 145 | b. produce, reproduce, and Share Adapted Material. 146 | 147 | 2. Exceptions and Limitations. For the avoidance of doubt, where 148 | Exceptions and Limitations apply to Your use, this Public 149 | License does not apply, and You do not need to comply with 150 | its terms and conditions. 151 | 152 | 3. Term. The term of this Public License is specified in Section 153 | 6(a). 154 | 155 | 4. Media and formats; technical modifications allowed. The 156 | Licensor authorizes You to exercise the Licensed Rights in 157 | all media and formats whether now known or hereafter created, 158 | and to make technical modifications necessary to do so. The 159 | Licensor waives and/or agrees not to assert any right or 160 | authority to forbid You from making technical modifications 161 | necessary to exercise the Licensed Rights, including 162 | technical modifications necessary to circumvent Effective 163 | Technological Measures. For purposes of this Public License, 164 | simply making modifications authorized by this Section 2(a) 165 | (4) never produces Adapted Material. 166 | 167 | 5. Downstream recipients. 168 | 169 | a. Offer from the Licensor -- Licensed Material. Every 170 | recipient of the Licensed Material automatically 171 | receives an offer from the Licensor to exercise the 172 | Licensed Rights under the terms and conditions of this 173 | Public License. 174 | 175 | b. No downstream restrictions. You may not offer or impose 176 | any additional or different terms or conditions on, or 177 | apply any Effective Technological Measures to, the 178 | Licensed Material if doing so restricts exercise of the 179 | Licensed Rights by any recipient of the Licensed 180 | Material. 181 | 182 | 6. No endorsement. Nothing in this Public License constitutes or 183 | may be construed as permission to assert or imply that You 184 | are, or that Your use of the Licensed Material is, connected 185 | with, or sponsored, endorsed, or granted official status by, 186 | the Licensor or others designated to receive attribution as 187 | provided in Section 3(a)(1)(A)(i). 188 | 189 | b. Other rights. 190 | 191 | 1. Moral rights, such as the right of integrity, are not 192 | licensed under this Public License, nor are publicity, 193 | privacy, and/or other similar personality rights; however, to 194 | the extent possible, the Licensor waives and/or agrees not to 195 | assert any such rights held by the Licensor to the limited 196 | extent necessary to allow You to exercise the Licensed 197 | Rights, but not otherwise. 198 | 199 | 2. Patent and trademark rights are not licensed under this 200 | Public License. 201 | 202 | 3. To the extent possible, the Licensor waives any right to 203 | collect royalties from You for the exercise of the Licensed 204 | Rights, whether directly or through a collecting society 205 | under any voluntary or waivable statutory or compulsory 206 | licensing scheme. In all other cases the Licensor expressly 207 | reserves any right to collect such royalties. 208 | 209 | 210 | Section 3 -- License Conditions. 211 | 212 | Your exercise of the Licensed Rights is expressly made subject to the 213 | following conditions. 214 | 215 | a. Attribution. 216 | 217 | 1. If You Share the Licensed Material (including in modified 218 | form), You must: 219 | 220 | a. retain the following if it is supplied by the Licensor 221 | with the Licensed Material: 222 | 223 | i. identification of the creator(s) of the Licensed 224 | Material and any others designated to receive 225 | attribution, in any reasonable manner requested by 226 | the Licensor (including by pseudonym if 227 | designated); 228 | 229 | ii. a copyright notice; 230 | 231 | iii. a notice that refers to this Public License; 232 | 233 | iv. a notice that refers to the disclaimer of 234 | warranties; 235 | 236 | v. a URI or hyperlink to the Licensed Material to the 237 | extent reasonably practicable; 238 | 239 | b. indicate if You modified the Licensed Material and 240 | retain an indication of any previous modifications; and 241 | 242 | c. indicate the Licensed Material is licensed under this 243 | Public License, and include the text of, or the URI or 244 | hyperlink to, this Public License. 245 | 246 | 2. You may satisfy the conditions in Section 3(a)(1) in any 247 | reasonable manner based on the medium, means, and context in 248 | which You Share the Licensed Material. For example, it may be 249 | reasonable to satisfy the conditions by providing a URI or 250 | hyperlink to a resource that includes the required 251 | information. 252 | 253 | 3. If requested by the Licensor, You must remove any of the 254 | information required by Section 3(a)(1)(A) to the extent 255 | reasonably practicable. 256 | 257 | 4. If You Share Adapted Material You produce, the Adapter's 258 | License You apply must not prevent recipients of the Adapted 259 | Material from complying with this Public License. 260 | 261 | 262 | Section 4 -- Sui Generis Database Rights. 263 | 264 | Where the Licensed Rights include Sui Generis Database Rights that 265 | apply to Your use of the Licensed Material: 266 | 267 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 268 | to extract, reuse, reproduce, and Share all or a substantial 269 | portion of the contents of the database; 270 | 271 | b. if You include all or a substantial portion of the database 272 | contents in a database in which You have Sui Generis Database 273 | Rights, then the database in which You have Sui Generis Database 274 | Rights (but not its individual contents) is Adapted Material; and 275 | 276 | c. You must comply with the conditions in Section 3(a) if You Share 277 | all or a substantial portion of the contents of the database. 278 | 279 | For the avoidance of doubt, this Section 4 supplements and does not 280 | replace Your obligations under this Public License where the Licensed 281 | Rights include other Copyright and Similar Rights. 282 | 283 | 284 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 285 | 286 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 287 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 288 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 289 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 290 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 291 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 292 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 293 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 294 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 295 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 296 | 297 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 298 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 299 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 300 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 301 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 302 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 303 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 304 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 305 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 306 | 307 | c. The disclaimer of warranties and limitation of liability provided 308 | above shall be interpreted in a manner that, to the extent 309 | possible, most closely approximates an absolute disclaimer and 310 | waiver of all liability. 311 | 312 | 313 | Section 6 -- Term and Termination. 314 | 315 | a. This Public License applies for the term of the Copyright and 316 | Similar Rights licensed here. However, if You fail to comply with 317 | this Public License, then Your rights under this Public License 318 | terminate automatically. 319 | 320 | b. Where Your right to use the Licensed Material has terminated under 321 | Section 6(a), it reinstates: 322 | 323 | 1. automatically as of the date the violation is cured, provided 324 | it is cured within 30 days of Your discovery of the 325 | violation; or 326 | 327 | 2. upon express reinstatement by the Licensor. 328 | 329 | For the avoidance of doubt, this Section 6(b) does not affect any 330 | right the Licensor may have to seek remedies for Your violations 331 | of this Public License. 332 | 333 | c. For the avoidance of doubt, the Licensor may also offer the 334 | Licensed Material under separate terms or conditions or stop 335 | distributing the Licensed Material at any time; however, doing so 336 | will not terminate this Public License. 337 | 338 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 339 | License. 340 | 341 | 342 | Section 7 -- Other Terms and Conditions. 343 | 344 | a. The Licensor shall not be bound by any additional or different 345 | terms or conditions communicated by You unless expressly agreed. 346 | 347 | b. Any arrangements, understandings, or agreements regarding the 348 | Licensed Material not stated herein are separate from and 349 | independent of the terms and conditions of this Public License. 350 | 351 | 352 | Section 8 -- Interpretation. 353 | 354 | a. For the avoidance of doubt, this Public License does not, and 355 | shall not be interpreted to, reduce, limit, restrict, or impose 356 | conditions on any use of the Licensed Material that could lawfully 357 | be made without permission under this Public License. 358 | 359 | b. To the extent possible, if any provision of this Public License is 360 | deemed unenforceable, it shall be automatically reformed to the 361 | minimum extent necessary to make it enforceable. If the provision 362 | cannot be reformed, it shall be severed from this Public License 363 | without affecting the enforceability of the remaining terms and 364 | conditions. 365 | 366 | c. No term or condition of this Public License will be waived and no 367 | failure to comply consented to unless expressly agreed to by the 368 | Licensor. 369 | 370 | d. Nothing in this Public License constitutes or may be interpreted 371 | as a limitation upon, or waiver of, any privileges and immunities 372 | that apply to the Licensor or You, including from the legal 373 | processes of any jurisdiction or authority. 374 | 375 | 376 | ======================================================================= 377 | 378 | Creative Commons is not a party to its public 379 | licenses. Notwithstanding, Creative Commons may elect to apply one of 380 | its public licenses to material it publishes and in those instances 381 | will be considered the “Licensor.” The text of the Creative Commons 382 | public licenses is dedicated to the public domain under the CC0 Public 383 | Domain Dedication. Except for the limited purpose of indicating that 384 | material is shared under a Creative Commons public license or as 385 | otherwise permitted by the Creative Commons policies published at 386 | creativecommons.org/policies, Creative Commons does not authorize the 387 | use of the trademark "Creative Commons" or any other trademark or logo 388 | of Creative Commons without its prior written consent including, 389 | without limitation, in connection with any unauthorized modifications 390 | to any of its public licenses or any other arrangements, 391 | understandings, or agreements concerning use of licensed material. For 392 | the avoidance of doubt, this paragraph does not form part of the 393 | public licenses. 394 | 395 | Creative Commons may be contacted at creativecommons.org. -------------------------------------------------------------------------------- /source/functions/420.m: -------------------------------------------------------------------------------- 1 | #include "420.h" 2 | #define _POSIX_SPAWN_DISABLE_ASLR 0x0100 3 | #define _POSIX_SPAWN_ALLOW_DATA_EXEC 0x2000 4 | extern char **environ; 5 | 6 | @implementation tai 7 | -(void) RunCMD:(NSString *)RunCMD WaitUntilExit:(BOOL)WaitUntilExit { 8 | if (self.abyss) 9 | RunCMD = [RunCMD stringByReplacingOccurrencesOfString: @"\" | gap" withString:@">/dev/null 2>&1\" | gap"]; 10 | 11 | NSString *SSHGetFlex = [NSString stringWithFormat:@"%@",RunCMD]; 12 | 13 | NSTask *task = [[NSTask alloc] init]; 14 | NSMutableArray *args = [NSMutableArray array]; 15 | 16 | [args addObject:@"-c"]; 17 | [args addObject:SSHGetFlex]; 18 | 19 | [task setLaunchPath:@"/bin/bash"]; 20 | [task setArguments:args]; 21 | [task launch]; 22 | 23 | if (WaitUntilExit) 24 | [task waitUntilExit]; 25 | } 26 | 27 | -(void)fixTheos{ 28 | if (!self.previousInstall){ 29 | [self Print:checkInstall]; 30 | return; 31 | } 32 | runCode = @"echo \"fixTheos\" | gap"; 33 | [self RunCMD:runCode WaitUntilExit:YES]; 34 | [self Print:fixApplied]; 35 | } 36 | 37 | -(void)makeTweaksFolder { 38 | if (!self.tweaksExists) { 39 | runCode = [NSString stringWithFormat:@"echo \"mkdir /var/mobile/tweaks\" | gap"]; 40 | [self RunCMD:runCode WaitUntilExit: YES]; 41 | 42 | self.tweaksMade = [fm fileExistsAtPath:@"/var/mobile/tweaks"]; 43 | self.folderFailed = !self.tweaksMade; 44 | } 45 | } 46 | 47 | -(void)depends{ 48 | runCode = [NSString stringWithFormat:@"echo \"tai-depends\" | gap"]; 49 | [self RunCMD:runCode WaitUntilExit: YES]; 50 | } 51 | 52 | -(BOOL)theosInstall { 53 | self.attempted = YES; 54 | 55 | if (!(self.installedTheos || self.installedVarTheos)) { 56 | runCode = [NSString stringWithFormat:@"echo \"git clone --recursive https://github.com/theos/theos.git %@\" | gap", installHere]; 57 | [self RunCMD:runCode WaitUntilExit: YES]; 58 | [self updateInstall]; 59 | self.installSuccess = [fm fileExistsAtPath:installHere]; 60 | 61 | if (self.installSuccess) 62 | return YES; 63 | 64 | self.failed = YES; 65 | } 66 | return NO; 67 | } 68 | 69 | -(void)updateInstall{ 70 | self.installedTheos = [fm fileExistsAtPath:@"/theos"]; 71 | self.installedVarTheos = [fm fileExistsAtPath:@"/var/theos"]; 72 | self.installedOptTheos = [fm fileExistsAtPath:@"/opt/theos"]; 73 | } 74 | 75 | -(void)loader{ 76 | fm = NSFileManager.defaultManager; 77 | leaf = @"\n . \n M \n dM \n MMr \n 4MMML . \n MMMMM. xf \n . \"MMMMM .MM- \n Mh.. +MMMMMM .MMMM \n .MMM. .MMMMML. MMMMMh \n )MMMh. MMMMMM MMMMMMM \n 3MMMMx. \'MMMMMMf xnMMMMMM\" \n \'*MMMMM MMMMMM. nMMMMMMP\" \n *MMMMMx \"MMMMM\\ .MMMMMMM= \n *MMMMMh \"MMMMM\" JMMMMMMP \n MMMMMM 3MMMM. dMMMMMM .\n MMMMMM \"MMMM .MMMMM( .nnMP\"\n=.. *MMMMx MMM\" dMMMM\" .nnMMMMM* \n \"MMn... \'MMMMr \'MM MMM\" .nMMMMMMM*\" \n \"4MMMMnn.. *MMM MM MMP\" .dMMMMMMM\"\" \n ^MMMMMMMMx. *ML \"M .M* .MMMMMM**\" \n *PMMMMMMhn. *x > M .MMMM**\"\" \n \"\"**MMMMhx/.h/ .=*\" \n .3P\"%...."; 78 | 79 | self.profiles = @[@".profile", @".zprofile", @".zshrc", @".bash_profile"]; 80 | leaf = [NSString stringWithFormat:@"%s%@%s\n", c_green, leaf, c_reset]; 81 | leaf = [NSString stringWithFormat:@"%@\t %sT%sheos %sA%suto %sI%snstaller%s\n", leaf, c_red, c_cyan, c_red, c_cyan, c_red, c_cyan, c_reset]; 82 | leaf = [NSString stringWithFormat:@"%@%s Randy420%s\n\n", leaf, c_red, c_reset]; 83 | installHere = @"/opt/theos"; 84 | 85 | self.autoRm = GetBool(@"autoRm", YES, @"com.randy420.tai"); 86 | self.enhance = GetBool(@"enhance", NO, @"com.randy420.tai"); 87 | self.all = GetBool(@"sdks-master", NO, @"com.randy420.tai"); 88 | self.eightFour = GetBool(@"8.4", NO, @"com.randy420.tai"); 89 | self.nineThree = GetBool(@"9.3", NO, @"com.randy420.tai"); 90 | self.ten = GetBool(@"10.0", NO, @"com.randy420.tai"); 91 | self.tenThree = GetBool(@"10.3", NO, @"com.randy420.tai"); 92 | self.eleven = GetBool(@"11.0", NO, @"com.randy420.tai"); 93 | self.elevenOne = GetBool(@"11.1", YES, @"com.randy420.tai"); 94 | self.elevenTwo = GetBool(@"11.2", YES, @"com.randy420.tai"); 95 | self.elevenThree = GetBool(@"11.3", NO, @"com.randy420.tai"); 96 | self.elevenFour = GetBool(@"11.4", NO, @"com.randy420.tai"); 97 | self.twelveOneTwo = GetBool(@"12.1.2", NO, @"com.randy420.tai"); 98 | self.twelveTwo = GetBool(@"12.2", YES, @"com.randy420.tai"); 99 | self.twelveFour = GetBool(@"12.4", NO, @"com.randy420.tai"); 100 | self.thirteen = GetBool(@"13.0", NO, @"com.randy420.tai"); 101 | self.thirteenTwo = GetBool(@"13.2", NO, @"com.randy420.tai"); 102 | self.thirteenFour = GetBool(@"13.4", NO, @"com.randy420.tai"); 103 | self.thirteenFive = GetBool(@"13.5", NO, @"com.randy420.tai"); 104 | self.fourteen = GetBool(@"14.0", NO, @"com.randy420.tai"); 105 | self.fourteenOne = GetBool(@"14.1", YES, @"com.randy420.tai"); 106 | self.fourteenTwo = GetBool(@"14.2", NO, @"com.randy420.tai"); 107 | self.fourteenThree = GetBool(@"14.3", NO, @"com.randy420.tai"); 108 | self.fourteenFour = GetBool(@"14.4", NO, @"com.randy420.tai"); 109 | //self.fourteenFive = GetBool(@"14.5", NO, @"com.randy420.tai"); 110 | 111 | [self updateInstall]; 112 | self.previousInstall = (self.installedTheos || self.installedVarTheos || self.installedOptTheos); 113 | self.installFirst = NO; 114 | 115 | self.tweaksExists = [fm fileExistsAtPath:@"/var/mobile/tweaks"]; 116 | 117 | self.tweaksMade = NO; 118 | self.folderFailed = NO; 119 | self.enhanced = NO; 120 | self.alreadyHas = NO; 121 | self.failure = NO; 122 | self.theosUpdate = NO; 123 | self.theosUpdateFail = NO; 124 | self.installSuccess = NO; 125 | self.attempted = NO; 126 | self.failed = NO; 127 | self.PoPuP = YES; 128 | self.totalDownloaded = 0; 129 | 130 | fixApplied = [NSString stringWithFormat:@"[%s%@%s]\n", c_green, local(@"FIX_APPLIED", @"Successfully patched fakeroot bug"), c_reset]; 131 | successfulSdk = [NSString stringWithFormat:@"[%s%@ SDKS%s]\n", c_green, local(@"DOWNLOAD_SUCCESS", @"Successfully downloaded"), c_reset]; 132 | failedSdk = [NSString stringWithFormat:@"[%s%@ SDKS%s]\n", c_red, local(@"FAILED_INSTALLING", @"Failed Installing"), c_reset]; 133 | enhanceMsg = [NSString stringWithFormat:@"[%s%@%s]\n", c_green, local(@"DEV_INSTALLED", @"Dev Tools Installed"), c_reset]; 134 | ignored = [NSString stringWithFormat:@"[%s%@ SDKS%s]\n", c_yellow, local(@"PREVIOUS", @"Previously installed"), c_reset]; 135 | tFolderSuc = [NSString stringWithFormat:@"[%s/var/mobile/tweaks/ %@%s]\n", c_green, local(@"FOLDER_SUCCESS", @"folder created successfully"), c_reset]; 136 | tFolderFail = [NSString stringWithFormat:@"[%s%@ /var/mobile/tweaks%s]\n", c_red, local(@"FOLDER_FAIL", @"Failed to create"), c_reset]; 137 | updated = [NSString stringWithFormat:@"[%s%@%s]\n", c_green, local(@"UPDATED", @"Theos is now Up-To-Date"), c_reset]; 138 | updateFail = [NSString stringWithFormat:@"[%s%@%s]\n", c_red, local(@"NOT_INSTALLED_FAIL", @"Theos is not installed. Unable to update Theos"), c_reset]; 139 | theosFailureMessage = [NSString stringWithFormat:@"[%s%@!%s]\n", c_red, local(@"INSTALL_FAIL", @"Theos install FAILED"), c_reset]; 140 | theosSuccessMessage = [NSString stringWithFormat:@"[%s%@ '%@'%s]\n", c_green, local(@"INSTALED_TO", @"Theos installed To"), installHere, c_reset]; 141 | checkInstall = [NSString stringWithFormat:@"[%s!!%@\n%@ '%stai%s'!!%s]\n", c_cyan, local(@"NOT_INSTALLED", @"Theos isn't installed yet."), local(@"PLEASE_INSTALL", @"Please install Theos using"), c_red, c_cyan, c_reset]; 142 | failedRm = [NSString stringWithFormat:@"[%s%@: '%@/SDKS/'%s]\n", c_red, local(@"REMOVE_FAIL", @"Failed To Remove SDKS From"), installHere, c_reset]; 143 | successfulRm = [NSString stringWithFormat:@"[%s%@: '%@/SDKS/'%s]\n", c_green, local(@"REMOVED", @"SDKS Removed From"), installHere, c_reset]; 144 | if (self.installedTheos && self.installedVarTheos) { 145 | previousInstallMsg = [NSString stringWithFormat:@"[%s%@ '%s/theos%s' & '%s/var/theos%s'%s]\n", c_yellow, local(@"PREVIOUSLY_INSTALLED", @"Theos previously installed to"), c_red, c_yellow, c_red, c_yellow, c_reset]; 146 | } else if (self.installedVarTheos) { 147 | previousInstallMsg = [NSString stringWithFormat:@"[%s%@ '%s/var/theos%s'%s]\n", c_yellow, local(@"PREVIOUSLY_INSTALLED", @"Theos previously installed to"), c_red, c_yellow, c_reset]; 148 | } else if (self.installedOptTheos) { 149 | previousInstallMsg = [NSString stringWithFormat:@"[%s%@ '%s/opt/theos%s'%s]\n", c_yellow, local(@"PREVIOUSLY_INSTALLED", @"Theos previously installed to"), c_red, c_yellow, c_reset]; 150 | } else { 151 | previousInstallMsg = [NSString stringWithFormat:@"[%s%@ '%s/theos%s'%s]\n", c_yellow, local(@"PREVIOUSLY_INSTALLED", @"Theos previously installed to"), c_red, c_yellow, c_reset]; 152 | } 153 | msg = @""; 154 | } 155 | 156 | -(bool)sdk:(NSString *)sdk Link:(NSString *)Link { 157 | Link = [NSString stringWithFormat:@"https://dropbox.com/s/%@/%@.zip", Link, sdk]; 158 | Loc = [NSString stringWithFormat:@"%@/sdks/iPhoneOS%@.sdk", installHere, sdk]; 159 | if (![fm fileExistsAtPath:Loc]) { 160 | runCode = [NSString stringWithFormat:@"echo \"curl -LO %@\" | gap;TMP=$(mktemp -d);echo \"unzip %@.zip -d $TMP\" | gap;echo \"mv $TMP/*.sdk %@/sdks\" | gap;echo \"rm -r %@.zip $TMP\" | gap", Link, sdk, installHere, sdk]; 161 | [self RunCMD:runCode WaitUntilExit: YES]; 162 | self.totalDownloaded += 1; 163 | if ([fm fileExistsAtPath: Loc]) { 164 | successfulSdk = [NSString stringWithFormat:@"%@%s ~iPhoneOS %@ SDK%s\n", successfulSdk, c_green, sdk, c_reset]; 165 | return (YES); 166 | } else { 167 | failedSdk = [NSString stringWithFormat:@"%@ ~%siPhoneOS %@ SDK%s\n", failedSdk, c_red, sdk, c_reset]; 168 | self.failure = YES; 169 | return (NO); 170 | } 171 | } else { 172 | self.alreadyHas = YES; 173 | ignored = [NSString stringWithFormat:@"%@%s ~iPhoneOS %@ SDK%s\n", ignored, c_yellow, sdk, c_reset]; 174 | } 175 | return (YES); 176 | } 177 | 178 | -(void)remove:(NSString *)sdk { 179 | Loc = [NSString stringWithFormat:@"%@/sdks/iPhoneOS%@.sdk", installHere, sdk]; 180 | if ([fm fileExistsAtPath:Loc]) { 181 | runCode = [NSString stringWithFormat:@"echo \"rm -r %@\" | gap", Loc]; 182 | [self RunCMD:runCode WaitUntilExit: YES]; 183 | self.totalRemoved += 1; 184 | if (![fm fileExistsAtPath:Loc]) { 185 | successfulRm = [NSString stringWithFormat:@"%@%s ~iPhoneOS %@ SDK%s\n", successfulRm, c_green, sdk, c_reset]; 186 | } else { 187 | failedRm = [NSString stringWithFormat:@"%@ ~%siPhoneOS %@ SDK%s\n", failedRm, c_red, sdk, c_reset]; 188 | self.rmFailure = YES; 189 | } 190 | } 191 | } 192 | 193 | -(void)DoWnLoAd { 194 | if (!(self.installedTheos || self.installedVarTheos || self.installedOptTheos)){ 195 | self.installFirst = YES; 196 | return; 197 | } 198 | if (self.all) { 199 | [self sdk:@"8.4" Link:@"pt9xa1cxf7tbiu5"]; 200 | [self sdk:@"9.3" Link:@"8qhz72yeumz5swy"]; 201 | [self sdk:@"10.0" Link:@"19vezfdtnp074kt"]; 202 | [self sdk:@"10.3" Link:@"fdze31wrnukk3t7"]; 203 | [self sdk:@"11.0" Link:@"hwg97eqgskbyyr1"]; 204 | [self sdk:@"11.1" Link:@"m7n5iflnt2b0a46"]; 205 | [self sdk:@"11.2" Link:@"ak3bjqi4nz0yo0w"]; 206 | [self sdk:@"11.3" Link:@"taxziihftkm1z4d"]; 207 | [self sdk:@"11.4" Link:@"l0r7yz0ggffb0zn"]; 208 | [self sdk:@"12.1.2" Link:@"2zxfr7qk3fcnm8f"]; 209 | [self sdk:@"12.2" Link:@"l85lp0lbrztbdun"]; 210 | [self sdk:@"12.4" Link:@"s3dmz4bqx3ayixm"]; 211 | [self sdk:@"13.0" Link:@"fujs52jmc6vdh37"]; 212 | [self sdk:@"13.2" Link:@"wq1ri0gtxk3ofww"]; 213 | [self sdk:@"13.4" Link:@"hxtkxy9c1fu71nq"]; 214 | [self sdk:@"13.5" Link:@"ztqcfo7okv6276p"]; 215 | [self sdk:@"14.0" Link:@"ly8627ncpaiv6ji"]; 216 | [self sdk:@"14.1" Link:@"jvonok3de24ibsz"]; 217 | [self sdk:@"14.2" Link:@"71n5fslaz5uiwc3"]; 218 | [self sdk:@"14.3" Link:@"ggydf4vh3kwafdi"]; 219 | [self sdk:@"14.4" Link:@"d47tnjb1cfizj61"]; 220 | // [self sdk:@"14.5" Link:@"t10nazl6vo20ya7"]; 221 | [self remove:@"14.5"]; 222 | return; 223 | } 224 | self.eightFour ? [self sdk:@"8.4" Link:@"pt9xa1cxf7tbiu5"] :self.autoRm ? [self remove:@"8.4"] : 0; 225 | self.nineThree ? [self sdk:@"9.3" Link:@"8qhz72yeumz5swy"] : self.autoRm ? [self remove:@"9.3"] : 0; 226 | self.ten ? [self sdk:@"10.0" Link:@"19vezfdtnp074kt"] : self.autoRm ? [self remove:@"10.0"] : 0; 227 | self.tenThree ? [self sdk:@"10.3" Link:@"fdze31wrnukk3t7"] : self.autoRm ? [self remove:@""] : 0; 228 | self.eleven ? [self sdk:@"11.0" Link:@"hwg97eqgskbyyr1"] : self.autoRm ? [self remove:@"11.0"] : 0; 229 | self.elevenOne ? [self sdk:@"11.1" Link:@"m7n5iflnt2b0a46"] : self.autoRm ? [self remove:@"11.1"] : 0; 230 | self.elevenTwo ? [self sdk:@"11.2" Link:@"ak3bjqi4nz0yo0w"] : self.autoRm ? [self remove:@"11.2"] : 0; 231 | self.elevenThree ? [self sdk:@"11.3" Link:@"taxziihftkm1z4d"] : self.autoRm ? [self remove:@"11.3"] : 0; 232 | self.elevenFour ? [self sdk:@"11.4" Link:@"l0r7yz0ggffb0zn"] : self.autoRm ? [self remove:@"11.4"] : 0; 233 | self.twelveOneTwo ? [self sdk:@"12.1.2" Link:@"2zxfr7qk3fcnm8f"] : self.autoRm ? [self remove:@"12.1.2"] : 0; 234 | self.twelveTwo ? [self sdk:@"12.2" Link:@"l85lp0lbrztbdun"] : self.autoRm ? [self remove:@"12.2"] : 0; 235 | self.twelveFour ? [self sdk:@"12.4" Link:@"s3dmz4bqx3ayixm"] : self.autoRm ? [self remove:@"12.4"] : 0; 236 | self.thirteen ? [self sdk:@"13.0" Link:@"fujs52jmc6vdh37"] : self.autoRm ? [self remove:@"13.0"] : 0; 237 | self.thirteenTwo ? [self sdk:@"13.2" Link:@"wq1ri0gtxk3ofww"] : self.autoRm ? [self remove:@"13.2"] : 0; 238 | self.thirteenFour ? [self sdk:@"13.4" Link:@"hxtkxy9c1fu71nq"] : self.autoRm ? [self remove:@"13.4"] : 0; 239 | self.thirteenFive ? [self sdk:@"13.5" Link:@"ztqcfo7okv6276p"] : self.autoRm ? [self remove:@"13.5"] : 0; 240 | self.fourteen ? [self sdk:@"14.0" Link:@"ly8627ncpaiv6ji"] : self.autoRm ? [self remove:@"14.0"] : 0; 241 | self.fourteenOne ? [self sdk:@"14.1" Link:@"jvonok3de24ibsz"] : self.autoRm ? [self remove:@"14.1"] : 0; 242 | self.fourteenTwo ? [self sdk:@"14.2" Link:@"71n5fslaz5uiwc3"] : self.autoRm ? [self remove:@"14.2"] : 0; 243 | self.fourteenThree ? [self sdk:@"14.3" Link:@"ggydf4vh3kwafdi"] : self.autoRm ? [self remove:@"14.3"] : 0; 244 | self.fourteenFour ? [self sdk:@"14.4" Link:@"d47tnjb1cfizj61"] : self.autoRm ? [self remove:@"14.4"] : 0; 245 | [self remove:@"14.5"]; 246 | //self.fourteenFive ? [self sdk:@"14.5" Link:@"t10nazl6vo20ya7"] : 0; 247 | } 248 | 249 | -(void)upDateTheos { 250 | self.theosUpdate = YES; 251 | 252 | if (self.previousInstall){ 253 | [self RunCMD: @"echo \"$THEOS/bin/update-theos\" | gap" WaitUntilExit: YES]; 254 | } else { 255 | self.theosUpdateFail = YES; 256 | } 257 | } 258 | 259 | -(void)checkTerm { 260 | char *cterm = getenv("TERM") ?: ""; 261 | if (!strcmp(cterm, "xterm-color")) { 262 | [self Print:[NSString stringWithFormat:@"%@\n", local(@"TERM", @"PLEASE RUN THEOS AUTO INSTALLER USING MTERMINAL\n-> NewTerm CRASHES")]]; 263 | exit (0); 264 | } 265 | } 266 | 267 | -(BOOL)dTheos:(BOOL)dTheos { 268 | if (dTheos) { 269 | if (self.installedTheos){ 270 | runCode = @"echo \"rm -rf /theos\" | gap"; 271 | [self RunCMD:runCode WaitUntilExit:YES]; 272 | } 273 | if (self.installedOptTheos){ 274 | runCode = @"echo \"rm -rf /opt/theos\" | gap"; 275 | [self RunCMD:runCode WaitUntilExit:YES]; 276 | } 277 | if (self.installedVarTheos){ 278 | runCode = @"echo \"rm -rf /var/theos\" | gap"; 279 | [self RunCMD:runCode WaitUntilExit:YES]; 280 | } 281 | 282 | [self updateInstall]; 283 | self.previousInstall = self.installedTheos || self.installedVarTheos || self.installedOptTheos; 284 | if (!self.previousInstall) { 285 | [self Print:[NSString stringWithFormat:@"[%sTheos %s%@ %s%@!%s]\n", c_cyan, c_red, local(@"UNINSTALLED", @"uninstaled"), c_cyan, local(@"SUCCESSFULLY", @"successfully"), c_reset]]; 286 | } else { 287 | [self Print:[NSString stringWithFormat:@"[%s%@ %sTheos%s]\n", c_red, local(@"UNABLE", @"Unable to uninstall"), c_cyan, c_reset]]; 288 | sleep(3); 289 | return(NO); 290 | } 291 | } 292 | return(YES); 293 | } 294 | 295 | -(void)startup{ 296 | /////////////////////////////////////// 297 | //// •Admin•Handling• //// 298 | /////////////////////////////////////// 299 | self.useColor = YES; 300 | self.abyss = NO; 301 | [self loader]; 302 | // [self checkTerm]; 303 | } 304 | 305 | -(void)enhancer{ 306 | if (self.enhance) { 307 | if ([fm fileExistsAtPath:installHere]) { 308 | runCode = [NSString stringWithFormat:@"echo \"curl -LO https://dropbox.com/s/ya3i2fft4dqvccm/includes.zip\" | gap;TMP=$(mktemp -d);echo \"unzip includes.zip -d $TMP\" | gap;echo \"mv $TMP/include/* %@/include\" | gap;echo \"mv $TMP/lib/* %@/lib\" | gap;echo \"mv $TMP/templates/* %@/templates\" | gap;echo \"mv $TMP/vendor/* %@/vendor\" | gap;echo;echo \"rm -r includes.zip $TMP\" | gap", installHere, installHere, installHere, installHere]; 309 | [self RunCMD:runCode WaitUntilExit: YES]; 310 | } 311 | if ([fm fileExistsAtPath:[NSString stringWithFormat:@"%@/vendor/templates/test.sh", installHere]]) { 312 | self.enhanced = YES; 313 | } 314 | } 315 | } 316 | 317 | -(void)addMsg:(NSString *)addMsg{ 318 | msg = [NSString stringWithFormat:@"%@%@\n", msg, addMsg]; 319 | } 320 | 321 | -(void)popup{ 322 | [self addMsg:leaf]; 323 | 324 | self.theosUpdate ? self.theosUpdateFail ? [self addMsg:updateFail] : [self addMsg:updated] : 0; 325 | 326 | self.installSuccess ? [self addMsg:theosSuccessMessage] : 0; 327 | 328 | if (!self.theosUpdate) 329 | self.tweaksMade ? [self addMsg:tFolderSuc] : (self.folderFailed ? [self addMsg:tFolderFail] : 0); 330 | 331 | (self.attempted && self.failed && (!(self.previousInstall && self.installSuccess))) ? [self addMsg:theosFailureMessage] : 0; 332 | 333 | (self.attempted && self.previousInstall) ? [self addMsg:previousInstallMsg] : 0; 334 | 335 | self.enhanced ? [self addMsg:enhanceMsg] : 0; 336 | 337 | (self.totalDownloaded >= 1) ? [self addMsg:successfulSdk] : 0; 338 | 339 | self.alreadyHas ? [self addMsg:ignored] : 0; 340 | 341 | if (self.failure) 342 | [self addMsg:failedSdk]; 343 | 344 | if (self.failure || self.installFirst) 345 | [self addMsg:checkInstall]; 346 | 347 | self.rmFailure ? [self addMsg:failedRm] : 0; 348 | 349 | self.totalRemoved >= 1 ? [self addMsg:successfulRm] : 0; 350 | 351 | [self Print:msg]; 352 | } 353 | 354 | -(void)header{ 355 | [self Print:leaf]; 356 | } 357 | 358 | -(void)Print:(NSString *)Print{ 359 | if (!self.useColor){ 360 | NSMutableArray *Remove = [NSMutableArray arrayWithObjects:@"\x1B[30m", @"\x1B[31m", @"\x1B[32m", @"\x1B[33m", @"\x1B[34m", @"\x1B[35m", @"\x1B[36m", @"\x1B[37m", @"\x1B[0m", @"\x1B[1m", @"\x1B[3m", @"\x1B[7m", nil]; 361 | if (self.abyss) 362 | [Remove insertObject:leaf atIndex:0]; 363 | 364 | for (unsigned int i = 0; i < [Remove count]; i++) 365 | Print = [Print stringByReplacingOccurrencesOfString:Remove[i] withString:@""]; 366 | } 367 | 368 | printf("%s", Print.UTF8String); 369 | } 370 | 371 | -(void) addToProfile:(BOOL)addToProfile profile:(NSString *)profile{ 372 | NSString *plist = @"com.randy420.tai"; 373 | 374 | NSString *installedHere = [self installedVarTheos] ? @"/var/theos" : [self installedTheos] ? @"/theos" : [self installedOptTheos] ? @"/opt/theos" : @""; 375 | NSString *DIV = @"#######################################\n"; 376 | NSString *DIV1 = @"#######ಠ_ಠ#####( ͠° ͟ʖ ͡°)####(•̀ᴗ•́)و######\n"; 377 | NSString *DIV2 = @"####ADDED#BY#THEOS#AUTO#INSTALLER######\n"; 378 | NSString *NIC = [NSString stringWithFormat:@"export nic=%@/bin/nic.pl\n", installHere]; 379 | NSString *CD = @"export cd=\"cd /var/mobile/tweaks\"\n"; 380 | NSString *T = @"export t=/var/mobile/tweaks\n"; 381 | NSString *MAKEC = @"export make=\"make clean package\"\n"; 382 | NSString *MAKE = @"export m=\"make package\"\n"; 383 | NSString *PACKAGE = [NSString stringWithFormat:@"export THEOS_PACKAGE_DIR_NAME=\"%@\"\n", GetNSString(@"debFolder", @"DEBs", plist)]; 384 | NSString *THEOS = ![installedHere isEqualToString:@""] ? [NSString stringWithFormat:@"export THEOS=%@\n", installedHere] : @""; 385 | NSString *DEBUG = [NSString stringWithFormat:@"export DEBUG=%@\n", GetNSString(@"debug", @"0", plist)]; 386 | NSString *FINAL = [NSString stringWithFormat:@"export FINALPACKAGE=%@\n", GetNSString(@"finalPackage", @"1", plist)]; 387 | NSString *ARCHS = @""; 388 | 389 | static bool armv7, armv7s, arm64, arm64e; 390 | armv7 = GetBool(@"armv7", YES, plist); 391 | armv7s = GetBool(@"armv7s", YES, plist); 392 | arm64 = GetBool(@"arm64", YES, plist); 393 | arm64e = GetBool(@"arm64e", YES, plist); 394 | 395 | NSMutableArray *archs = [NSMutableArray array]; 396 | 397 | if (armv7) 398 | [archs addObject: @"armv7"]; 399 | if (armv7s) 400 | [archs addObject: @"armv7s"]; 401 | if (arm64) 402 | [archs addObject: @"arm64"]; 403 | if (arm64e) 404 | [archs addObject: @"arm64e"]; 405 | 406 | for (NSString *arch in archs) { 407 | if ([ARCHS isEqualToString:@""]){ 408 | ARCHS = arch; 409 | } else { 410 | ARCHS = [NSString stringWithFormat:@"%@ %@", ARCHS, arch]; 411 | } 412 | } 413 | 414 | if ([ARCHS isEqualToString:@""]) 415 | ARCHS = @"arm64 arm64e"; 416 | 417 | ARCHS = [NSString stringWithFormat:@"export ARCHS=\"%@\"\n", ARCHS]; 418 | 419 | NSString *addToFile = [NSString stringWithFormat:@"%@%@%@%@%@%@%@%@%@%@%@%@", DIV, DIV1, DIV2, DIV, THEOS, ARCHS, DEBUG, FINAL, MAKE, MAKEC, NIC, PACKAGE]; 420 | 421 | if ([profile isEqualToString:@".profile"]){ 422 | addToFile = [NSString stringWithFormat:@"%@%@", addToFile, CD]; 423 | }else{ 424 | addToFile = [NSString stringWithFormat:@"%@%@", addToFile, T]; 425 | } 426 | 427 | addToFile = [NSString stringWithFormat:@"%@%@%@%@%@", addToFile, DIV, DIV2, DIV1, DIV]; 428 | 429 | NSString *addMe = @""; 430 | 431 | NSString *contents = [NSString stringWithContentsOfFile:[NSString stringWithFormat:@"/var/mobile/%@", profile] encoding:NSUTF8StringEncoding error:NULL]; 432 | 433 | NSArray *content = [contents componentsSeparatedByString:@"\n"]; 434 | 435 | for (NSString *line in content) { 436 | if ([line hasPrefix:@"\""]) 437 | continue; 438 | 439 | if (!([line hasPrefix:@"##"] || [line hasPrefix:@"export nic="] || [line hasPrefix:@"export m="] || [line hasPrefix:@"export make="] || [line hasPrefix:@"export cd="] || [line hasPrefix:@"export t="] || [line hasPrefix:@"export THEOS="] || [line hasPrefix:@"export THEOS_PACKAGE_DIR_NAME="] || [line hasPrefix:@"export DEBUG="] || [line hasPrefix:@"export ARCHS="] || [line hasPrefix:@"export FINALPACKAGE="])){ 440 | 441 | addMe = [NSString stringWithFormat:@"%@%@\n", addMe, line]; 442 | } 443 | } 444 | 445 | if (addToProfile) 446 | addMe = [NSString stringWithFormat:@"%@%@", addMe, addToFile]; 447 | 448 | [addMe writeToFile:[NSString stringWithFormat:@"/var/mobile/%@", profile] atomically:YES encoding:NSUTF8StringEncoding error:NULL]; 449 | 450 | runCode = [NSString stringWithFormat:@"echo \"chown 501:501 /var/mobile/%@;chmod +r /var/mobile/%@\" | gap", profile, profile]; 451 | [self RunCMD:runCode WaitUntilExit:YES]; 452 | } 453 | @end --------------------------------------------------------------------------------