You are viewing our Forum Archives. To view or take place in current topics click here.
| Tutorial | Creating Your First Tweak 2 | Easy | iOS |
Posted:

| Tutorial | Creating Your First Tweak 2 | Easy | iOS |Posted:

LacertosusDeus
  • V5 Launch
Status: Offline
Joined: Jan 19, 201311Year Member
Posts: 396
Reputation Power: 17
Status: Offline
Joined: Jan 19, 201311Year Member
Posts: 396
Reputation Power: 17



[ Register or Signin to view external links. ]
Little Coding Experience Required!

This Tutorial Will Show You The Basics To Start Coding Your Own Tweaks!



[ Register or Signin to view external links. ]


A Good Text Editor
[I Recommend [ Register or Signin to view external links. ] ]

A Jailbroken Device
[duh]

Theos
[How To Get In Links Section]

[ Register or Signin to view external links. ]
We Will Be Creating A Tweak Sends An Alert On Screen After Respring. Useless I Know But A Good, Simple Start.

In Case You Get Stuck, You Can Look At The Final Code Here: [ Register or Signin to view external links. ]

STEP ONE:
[Starting Your Tweak]
1. Create A New Tweak Instance in Theos:
Type the command "~/thoes/bin/nic.pl"

2. Select "New Tweak" by typing "5"
[ Register or Signin to view external links. ]

3. Next you will name and add other information, for this example, your Project Name will be PopUpOnStart, Package Name will be com.YourName.popuponstart, here is what it should look like:
[ Register or Signin to view external links. ]


4. You're done with Theos for now!



STEP TWO:
[Begin Coding]
1. Open the folder where you created your tweak
Default location for windows is "C:\cygwin64\home\%YOUR NAME%\popuponstart"

2. Now open the file "tweak.xm"
This is the file where ALMOST ALL of your code goes

3. Delete everything in the file, then type "%hook SpringBoard", type carefully!
What Does This Do You Might Ask:
We are 'hooking' into a header, these headers are where all iOS code is kept. We have to hook into these headers so we can 'edit' their operations!

A little confusing i know.

4. Now go down a couple lines and type "-(void)applicationDidFinishLaunching:(id)application"
We need to tell that when this operation is run after every respring to send a alert, so here is what we are going to type:
-(void)applicationDidFinishLaunching:(id)application {
   %orig;
}


What this does is tell the operation to run like it normally does.


5. We have a couple more lines to type, so here are all rest of the code we have to add, this all goes on a new line below '%orig;'. (it has been annotated so you know what the code does):
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hello"  //Title of your popup message
            message:@"Insert Text Here"                          //Message of your popup message
            delegate:self
            cancelButtonTitle:@"Okay"                          //Cancel button text on your popup message
            otherButtonTitles:nil];

         
         [alert show];
         [alert release];                                   //Keeps your alert from having memory leaks
}


6. If you have any questions about what is happening, feel free to message me!

7. Check your code, and make sure it matches: [ Register or Signin to view external links. ]



STEP THREE:
[The Makefile]
1. Open the file called 'Makefile' with Notepad++ (or your alternative)

2. Make some space at the top and add these lines:
a. This code will allow you to make your tweak work for new and old devices
export ARCHS = armv7 arm64


b. This code will make thoes use the iOS Files of choice, for us it will be iOS 8.1
(This does not restrict your tweak to iOS 8! Our tweak WILL work on iOS9 and possibly iOS7)
SDK = iPhoneOS8.1


c.This code allows your tweak to work at all! We have to use parts of a library called 'UIKit'. Place this code on a new line after the line "PopUpOnStart_FILES = Tweak.xm":
PopUpOnStart_FRAMEWORKS = UIKit


d. This code is for installing our tweak over wifi
THEOS_DEVICE_IP = PUT YOUR iDEVICE'S IP HERE




STEP FOUR:
[Installing/Testing]
1. On your jailbroken iDevice, install "OpenSSH"

2. Back on your computer, in the command prompt type "cd ~/popuponstart"

3. Next Type "SDKVERSION=8.1 make", if you get errors, then look at the completed version

Heres what it looks like with no errors:
[ Register or Signin to view external links. ]


4. Finally, type "SDKVERSION=8.1 make package", if you want to install it to your device over wifi, continue to step, if not move that .deb file to your phone and install it with iFile or Filza!

[Installing Over Wifi]
This is quite faster than manually transferring

5. Download "WinSCP" if you're on windows or just open the terminal for mac, click the correct system to continue:

Windows:
1. Open WinSCP

2. In 'Host Name' type your iDevice's IP address

3. Leave 'Port Number' at "22", and change 'User name' to "root"

4. Change 'Password' to "alpine"

5. Click Login!

6. Open cygwin and type "SDKVERSION=8.1 make package install"

7. Type 'alpine' whenever it asks for your passcode

8. And now your brand new tweak is installed to your device, and you cannot rotate your springboard!


Mac:
1. Open the native terminal and type "ssh root@%YOUR DEVICE IP HERE"

2. When it asks for your password, type "alpine"

3. Now type "SDKVERSION=8.1 make package install"

4. And now your brand new tweak is installed to your device, and you cannot rotate your springboard!


[ Register or Signin to view external links. ]
*If you have any questions about this tutorial or about development at all, message me!

*Tutorials on how to prepair your computer for development are evrywhere, for the windows version, look into the Links section

*Want more examples? Go to [ Register or Signin to view external links. ] for more open source tweaks!

*Want a specific tweak made? Message me!

*Add my repo to Cydia! Repo: LacertosusRepo.github.io

[ Register or Signin to view external links. ]
Notepad++ <> [ Register or Signin to view external links. ]

My Website <> [ Register or Signin to view external links. ]

Reddit <> [ Register or Signin to view external links. ]

Install Theos [Windows] <> Link

Iphone Dev Wiki <> [ Register or Signin to view external links. ]

iPhone Headers [For Making Tweaks] <> [ Register or Signin to view external links. ]
[ Register or Signin to view external links. ]
Just Me <> Link

The following 3 users thanked LacertosusDeus for this useful post:

SlurpJuice (01-11-2016), Ghost (01-11-2016), TTG_GYPSY (01-11-2016)
#2. Posted:
TTG_GYPSY
  • Gold Gifter
Status: Offline
Joined: Jul 11, 201014Year Member
Posts: 4,188
Reputation Power: 229
Status: Offline
Joined: Jul 11, 201014Year Member
Posts: 4,188
Reputation Power: 229
This looks like a helpful post im going to look into it more later.

Sounds fun making my own tweak i can think of a couple right now lol.
#3. Posted:
Ghost
  • Graphics King
Status: Offline
Joined: Jun 15, 201410Year Member
Posts: 13,770
Reputation Power: 15675
Motto: Did somebody say "Just Eat"
Motto: Did somebody say "Just Eat"
Status: Offline
Joined: Jun 15, 201410Year Member
Posts: 13,770
Reputation Power: 15675
Motto: Did somebody say "Just Eat"
I am terrible at coding, literally know nothing whatsoever, more of a 'do it now' kinda guy so the likelihood of me learning is like... zero.

Looks good though man, nice detail to it.
#4. Posted:
SlurpJuice
  • Ladder Climber
Status: Offline
Joined: Aug 28, 20159Year Member
Posts: 354
Reputation Power: 28
Status: Offline
Joined: Aug 28, 20159Year Member
Posts: 354
Reputation Power: 28
Thanks for creating this it sure will assist others in tweak making, Thanking the topic and +REP to you!
#5. Posted:
LacertosusDeus
  • Ladder Climber
Status: Offline
Joined: Jan 19, 201311Year Member
Posts: 396
Reputation Power: 17
Status: Offline
Joined: Jan 19, 201311Year Member
Posts: 396
Reputation Power: 17
TTG_GYPSY wrote This looks like a helpful post im going to look into it more later.

Sounds fun making my own tweak i can think of a couple right now lol.


Good! In the links section check out more tweaks ive made open source.


Zill wrote I am terrible at coding, literally know nothing whatsoever, more of a 'do it now' kinda guy so the likelihood of me learning is like... zero.

Looks good though man, nice detail to it.


Hah, yes it can be hard to get into but is good to know.


Kuruh wrote
Thanks for creating this it sure will assist others in tweak making, Thanking the topic and +REP to you!


Thanks for the rep!
#6. Posted:
IBM
  • V5 Launch
Status: Offline
Joined: May 27, 201212Year Member
Posts: 496
Reputation Power: 23
Status: Offline
Joined: May 27, 201212Year Member
Posts: 496
Reputation Power: 23
How good are you with header files and such?
#7. Posted:
LacertosusDeus
  • V5 Launch
Status: Offline
Joined: Jan 19, 201311Year Member
Posts: 396
Reputation Power: 17
Status: Offline
Joined: Jan 19, 201311Year Member
Posts: 396
Reputation Power: 17
IBM wrote How good are you with header files and such?


Pretty decent, i can find what im looking for using the easy header search by Limineos,
#8. Posted:
IBM
  • V5 Launch
Status: Offline
Joined: May 27, 201212Year Member
Posts: 496
Reputation Power: 23
Status: Offline
Joined: May 27, 201212Year Member
Posts: 496
Reputation Power: 23
LacertosusDeus wrote
IBM wrote How good are you with header files and such?


Pretty decent, i can find what im looking for using the easy header search by Limineos,
You think you could help with RaisinToast? [ Register or Signin to view external links. ]

It's basically an alternative UIAlertView that I was wanting to use for a credit popup, but no matter what I did, I'd get a few errors. I eventually gave up on it, but I'd like to try again.
#9. Posted:
LacertosusDeus
  • Christmas!
Status: Offline
Joined: Jan 19, 201311Year Member
Posts: 396
Reputation Power: 17
Status: Offline
Joined: Jan 19, 201311Year Member
Posts: 396
Reputation Power: 17
IBM wrote
LacertosusDeus wrote
IBM wrote How good are you with header files and such?


Pretty decent, i can find what im looking for using the easy header search by Limineos,
You think you could help with RaisinToast? [ Register or Signin to view external links. ]

It's basically an alternative UIAlertView that I was wanting to use for a credit popup, but no matter what I did, I'd get a few errors. I eventually gave up on it, but I'd like to try again.


Ahh im very sorry but i am not very good when it comes to that type, to show you what i mean, here is what i focus on and some other Objective-C: [ Register or Signin to view external links. ]

Plus, i dont have a Mac making it harder for me to develop in the first place, since i use Cygwin.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.