[Tutorial] How to create your first cydia tweak without computer using "Theos"

Hi! Today I'll explain you how to create your first cydia tweak with theos, if you don't have theos installed on you device, i'll write a tutorial about it very soon. 

Ok, now we are going to create a easy/basic substrate tweak that will show a popup after that the Springboard has resprung. 

1) Open the terminal app and type in "su"

2) Put your password (The default password is "alpine")

3) Now we need to run theos's menu so we need to type in "/var/theos/bin/nic.pl". The result will be this [https://postimg.org/image/sjo2oqvtn/]

4) Now we need to choose the number "5" to create your tweak. 

5) Select a name for your tweak in this case "reddittweak" and press return

6) Tap return till "done" will appear 

7) Result should be like this -> https://postimg.org/image/ov8srvct1/ <-

8) Ok, your tweak has been succesfully created. Open up iFile and go to "/var/mobile". Now your tweak's folder shuld be here, look for it and open that folder

9) Your folder should have this files "Makefile, Tweak.xm, Control, RedditTweak.plist and other folders"

10) Now we need to add the support for 64-bit devices so open the "Makefile" file and at the top of the file type "ARCHS = armv7 arm64". Under the line "reddittweak_FILES = Tweak.xm" add this " reddittweak_FRAMEWORKS = UIKit". The result will be this -> https://postimg.org/image/ksk0tn5vf/ <-. Now tap "Save" and than "Done"

11) Open the file "Tweak.xm" and delete all.

12) After that paste this code inside the "Tweak.xm" "//Here, using Logos's 'hook' construct to access the SpringBoard class. 'Hooking' basically means we want to access this class and modify the methods inside it. %hook SpringBoard

//Now that logos knows we want to hook the header SpringBoard, we can directly 'hijack' SpringBoard's methods and modify them to run out own code instead of their original code.

//In this example, we are hijacking the method - (void)applicationDidFinishLaunching and making it run our own code. This method takes an argument, (id)application, however, you can rename the argument anything you'd like, such as (id)testName. -(void)applicationDidFinishLaunching:(id)application {

} //This lets logos know we're done hooking this header. %end". Type "Save" than "Done"

13) Now we need to open the terminal app and than move to the tweak's directory, so type in "cd /var/mobile/reddittweak" than tap return

14) Now type in "make package install" and the result will me something similar to this -> https://postimg.org/image/l5e9p45yj/ <-

15) So now we have finished the tweak, but we still need to install it so go back to iFile and you will see something like this -> https://postimg.org/image/h7rtlrnsr/ <-

16) Open the "_" folder, "Library", "MobileSubstrate", DynamicLibraries", tap edit and copy the two files. 

17) Navigate to "/Library/MobileSubstrate/DynamicLibraries" and paste the files here

18) Now respring your device and the popup will appear! -> https://postimg.org/image/91u3uybyj/ <-

I hope that this tutorial will be useful for evryone. Sorry for my english but it's not my motherlanguage.

猜你喜欢

转载自blog.csdn.net/yvhkyiu/article/details/80257875