You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p> Yayyy now that we have theos setup we are now going to develop out first tweak so lets start </br>
39
+
Okay so first go into terminal or cygwin (if you are usign windows) and login as root if we are on IOS and now we want to run the following command which is "$THEOS/bin/nic.pl" and if it doesn't work try running "~/THEOS/bin/nic.pl" and now we will get a list of templates so enter the number "3" because we want to create a tweak and now press enter and eneter the name of the tweak and the tweak that we will be creating will be called welcomeme which will display an alert whenever you respring your phone and now press enter until you see it says done. </br>
40
+
41
+
Before we create ou tweaks we will need header files and header files are basically methods that IOS uses and this will become more clear soon. You can download the headers of <ahref="https://github.com/nst/iOS-Runtime-Headers">Here</a> and it all depends on your IOS version and once you have downloaded your headers you want to paste them in "/var/theos/include" and if you are on mac or windows locate your theos folder and paste them in the include folder which is located in your theos folder.
42
+
43
+
Now once all of this is done we want to go to "/var/mobile/welcomeme" and if you are on windows go to "/C/"cygwin64/home/youruser/welcomeme/" and in these folders we will see many files but don't worry I will be explaing all of these files now.
44
+
45
+
<ol>
46
+
<li> The control file is where dpkg will read all of the informatio about the package </li>
47
+
48
+
<li> The Tweak.xm file is where all of your code will go into </li>
49
+
50
+
51
+
<li> The makefile is basically just some shell commands which will tell the compiler of what to do with your package </li>
52
+
53
+
<li> The theos folder is just path to your normal theos folder and if this is deleted then it means that your tweak would not work and it would not be able to compile </li>
54
+
55
+
Now before we start coding up your tweak you will need to know objective c and logos which are the two main programming languages to develop cydia tweaks but don't worry I will be creating tutorials on objective C :). </br>
56
+
57
+
First we need to know what a header file is so in basic terms a header file is where all of the methods are declared and there is an implementation file in which a person writes what they want to happen when this method is run and I will give an example now.
58
+
59
+
</p>
60
+
61
+
<p> For example if we are creating an app we will have two main files so in our header (.h) file we could create a method called "whenAppLaunches" and this will be the method of when out app launches and in our implementation file we would write "whenAppLaunches {
62
+
"Display a photo" } so when we open our app it will display a photo. The header file is where we declare and define out methods and the implemnetation file is where we write down what our method is going to do so in out example we just declared the method of the app launching but in the implementation file we wrote what we want to happen when that method is ran. </p>
63
+
64
+
<p> Hopefully that explains it all and if it doesn't message me on twitter and I will explain it all to you to the best I can. So now we will open our tweak.xm file in which we are going to write the code of what happens when the springboard launches. We need to go back to our header folders and find the header file which contains all of the springboard methods and this file is called springboard.h which is obvious. We need to find the method of when the springboard launches so that we can write out own alert in there, and to make things easier the method of springboard launching is "-(void)applicationDidFinishLaunching:(id)fp8". The "-(void)" means its a method so anything that starts with -(void) is a method in objective C. So now lets head back to out tweak.xm file and lets start out code.
65
+
66
+
</p>
67
+
68
+
<ol>
69
+
70
+
<li> On the first line we want to write "%hook SpringBoard" which basically hooks into the springboard.h file which allows us the methods that are delcared in that file. </li>
71
+
72
+
<li> On the next line we want to write the method that we want to change so our method will be "-(void)applicationDidFinishLaunching:(id)application { }" and we want to add two curly braces there so whatever code we put into that method it will eun that code. So in this method we want to display an alert so we would have to display code for an alert in those curly braces.
73
+
74
+
</li>
75
+
76
+
<li> In those curly braces we want to write out the code for an alert but before this we want to write out "%orig;" which means that It will run the original code of what it was going to do and the original code was to launch the springboard so if we never wrote "%orig;" then the springboard would not launch as it would be trying to run our code and we would then be stuck in a bootloop and would have to restore so remember to include "%orig;" if you want the original code to run and the semi-colon is like a full stop in coding as it shows us that we are done with that line of code.
77
+
78
+
<li>
79
+
80
+
<li> Now below the %orig; line we want to write out alert code and the code for this is </br>
so let me expalin to you what this code means so the "UIAlertView " means that we are showing that we want to display an alert, the "*alert" is just something for us to remember as we can call this anything we want and now the "UIAlertView alloc" means that it is allocaing our alert in the memory and we don't need to know abot memory now. The "initWithTitle" means that we want our alert to initilise with a title and the title for this is hello as we can write anything here. The "message" code just bascially means what message we want to display in our alert code and we can write any message we want and the "cancelButtonTitle" just basically tells us what we want out cancel button to be in our alert and I have wrote okay. "otherButtonTitles" just wants to know if we want to add anymore buttons to out alert and the nil code means that we don't want to display anything and just think of nil as 0.
<p> Just to point out the "alert show" code will just show the alert and the alert release will give back memory that it has borrowed but we don't need to know about this :) and now in out makefile right at the top we want to add these lines depending if you're on IOS or windows.
113
+
114
+
</br>
115
+
116
+
If you're on IOS right at the top add the line "ARCHS = armv7 arm64" and under WelcomeMe_files= Tweak.xm add this line which is "WelcomeMe_FRAMEWORKS = UIKit" which shows us that we are using the UIKit framework and we are using a UIAlertView. If your're on windows do the same as iPhone but right at the top add this line "export THEOS_DEVICE_IP = YOURIP" and replace "YOURIP" with your actual ip address and you can get this by going into settings>wifi and clicking that little i.
117
+
118
+
</br>
119
+
120
+
Now your makefile should look like this for IOS
121
+
</br>
122
+
<b>ARCHS = armv7 arm64
123
+
SDK = iPhoneOS8.1
124
+
include theos/makefiles/common.mk
125
+
126
+
TWEAK_NAME = WelcomeMe
127
+
WelcomeMe_FILES = Tweak.xm
128
+
129
+
WelcomeMe_FRAMEWORKS = UIKit
130
+
include $(THEOS_MAKE_PATH)/tweak.mk
131
+
132
+
after-install::
133
+
install.exec "killall -9 SpringBoard"
134
+
135
+
</b>
136
+
137
+
</br>
138
+
139
+
and for windows your makefile should look like this
140
+
</br>
141
+
142
+
<b>
143
+
ARCHS = armv7 arm64
144
+
export THEOS_DEVICE_IP = 192.132.9.0
145
+
SDK = iPhoneOS8.1
146
+
include theos/makefiles/common.mk
147
+
148
+
TWEAK_NAME = WelcomeMe
149
+
WelcomeMe_FILES = Tweak.xm
150
+
151
+
WelcomeMe_FRAMEWORKS = UIKit
152
+
include $(THEOS_MAKE_PATH)/tweak.mk
153
+
154
+
after-install::
155
+
install.exec "killall -9 SpringBoard"
156
+
</b>
157
+
158
+
</br>
159
+
160
+
but remeber to use your own ip and not the same as mine if you are developing on windows.
161
+
162
+
</br>
163
+
164
+
</p>
165
+
166
+
<p>
167
+
168
+
Now we have built are tweak we must install this so lets install this bad boy.
169
+
170
+
</br>
171
+
172
+
</p>
173
+
174
+
<h4>IOS</h4>
175
+
176
+
<p>To install on IOS open up mobile terminal and login as root (if you don't know refer back as I have talked about this before) and once you have logged in as root type in this command "cd /var/mobile/welcomeme" and press enter and your device should respring and you should see an alert :)
177
+
178
+
</p>
179
+
180
+
</br>
181
+
182
+
<h4>Windows</h4>
183
+
184
+
To install on windows you must ssh into your device so download winscp and on your device make sure you have openssh installed from cydia. On your PC open up winscp and make sure your phone and your PC are connected to the same wifi network and in Winscp enter your ip address and leave it as port 22 and enter in root as the username and alpine as the password (unless you have changed this). Once connected open up cygwin and enter in this command "cd ~/welcomeme" and then hit enter and now enter in this command "make package install" and it should insall to your device and it may ask for your password a few times (which is alpine unless you have changed this) and once done your device should respring and your tweak should work </p>
185
+
186
+
</br>
187
+
188
+
<p>Thanks for reading my tutorail on your first tweak and if you are confused or face any error message me and I will always be helping you guys and I will be making many more tutorials on tweaks and I will be making a lot on objective c so don't worry if you are confused right now :P ></p>
<p>Okay I do not want to overload all of this with information but I will be explaining the best to my ability and yes these tutrials are intended to help everyone become a developer. So now lets just begin so you may know or may not know that in order to create an IOS app a person must have a Mac with xcode installed but the beauty of creating cydia tweaks is that you can create them on your iPhone, Windows PC and a Mac. </br>
39
+
To setup the development environment we must use theos and I will be exaplaining how to install theos on a mobile phone and this may not yet fully work on IOS 9 but this is how you do it. </p>
40
+
41
+
<h4>On iPhone, iPad and iPod Touch</h4>
42
+
43
+
<p><ol>
44
+
<li> First add these sources in Cydia which are: </br>
45
+
http://coolstar.org/publicrepo/ </br>
46
+
http://nix.howett.net/theos/ </li>
47
+
48
+
<li> Next install these packages from cydia which are </br>
49
+
<br>theos</br>
50
+
<br>Perl</br>
51
+
<br>Git</br>
52
+
<br>Darwin CC Tools (By Coolstar)</br>
53
+
<br>IOS Toolchain</br>
54
+
<br>BigBoss Reccomended Tools</br>
55
+
<br>Mobile Terminal</br>
56
+
<br>iFile</br>
57
+
</li>
58
+
59
+
<li> Next you want to download the IOS SDK and you can get this from <ahref="http://iphone.howett.net/sdks">Here</a> and once the sdk has been downloaded you want to proceed to the next step</li>
60
+
61
+
<li> Now you want to open up iFile and navigate to "/var/theos" and in "var/theos" you want to create a new folder called "sdks" and once you have done this you then find your sdk file and copy that file and paste it in "/var/theos/sdks" and once this is done you would need to extract the file and this may take a few mins and once this is done you should have the SDK</li>
62
+
63
+
<li> Now open up Mobile Terminal and login as root as you can do this by entering "su" followed by the password "alpine" (if you have not changed the pasword) and after you are logged in as root you may enter the command "$THEOS/bin/nic.pl" and it should display all of the templates and if this is done then congrats you have theos setup on your device </li>
64
+
65
+
</ol>
66
+
67
+
<h4>For Windows</h4>
68
+
69
+
<p><ahref="https://coolstar.org/theos.pdf">Please refer to thsi website in order to install theos on windows and if you have any questions message me and I will be more than happy to help</a></p>
70
+
71
+
<h4>For Mac</h4>
72
+
73
+
<p> Please use this <ahref="http://iphonedevwiki.net/index.php/Theos/Setup">Website</a> in order to install theos</p>
74
+
75
+
76
+
<p> We are now done for the getting started and remeber if you have any problems please do message me as I really want to help everyone</p>
0 commit comments