Preview TUT
Requirements:
-Theos
-Files (download below)
-Brain
1) DOWNLOAD FILES:
- Download this if you want make an in-app Hack Manager + Alert: https://www.sendspace.com/file/6q63ch
- Download this if you want make just a cool Alert: https://www.sendspace.com/file/7tuii9
Note: if you will use config.h to write your hack in Tweak.xm file, download the first pack.
Then, move the files:
If you downloaded the first pack
-Put "cploaderheader.h", "config.h" and "Tweak.xm" in your project folder.
-Put "libalertview.a" in /var/theos/lib
If you downloaded the second pack:
-Put "cploaderheader.h" and "Tweak.xm" in your project folder.
-Put "libalertview.a" in /var/theos/lib
2) Edit the Makefile
Add these strings in your Makefile under "XXX_FILES = Tweak.xm"
1 | AlertTest_FRAMEWORKS = UIKit OpenGLES QuartzCore CoreGraphics CoreImage |
3) Let's analyze and Edit the code!
Open cploaderheader.h file
This is the list of usable types of buttons (colors)
1 | typedef NS_ENUM(NSInteger, SIAlertViewButtonType) { |
This is the list of usable types of effects to close the alert (popup)
1 | typedef NS_ENUM(NSInteger, SIAlertViewTransitionStyle) { |
This is where you can set all effects, colors, countdown, actions, tags...
1 | void didFinishLaunching2(CFNotificationCenterRef center,void *observer,CFStringRef name, const void *object, CFDictionaryRef info) |
EDIT THE ALERT
What you can edit in the alert:
-backgroundblurRate:1.8f ----> This is used to set blur the background image below the alertWhat you can edit for each button:
-enableCountdown:YES ----> This is used to enable(YES)/disable(NO) the countdown. If enabled, a countdown will appear at the top of alert (it's an animated countdown that each second change color)
-countdown:100 ----> After 100 second the alert will auto hide (Obviously works just if you enabled the countdown)
-alertviewAlpha:0.6F ----> This is the transparency of alert
-AnimationType:SIAlertViewTransitionStyleSlideFromTop ----> This is the effect used to close the popup (you can change it with one of the effects written in the "Let's analyze the code!" part)
-addButtonWithTitle:@"1 Shot Kill" ----> 1 Shot Kill is the title of button
-type:SIAlertViewButtonTypeGreen ----> This is the type (color) of button (you can change it with one of the effects written in the "Let's analyze the code!" part)
-handler:button_call_back ----> We will see later what it's
-id:1 ----> all buttons with the same id (tag) and the same handler will do the same action (a lot of "same" :o). So change the number after "id" if you want use another action
What you can add:
-Before [a show]; you can add some things to customize colors, fonts ecc
-[a setTitleColor:[UIColor redColor]];//don't use it if you are using Countdown because the app will crash
-[a setMessageColor:[UIColor redColor]];
-[a setTitleFont:[UIFont fontWithName:@"Verdana" size:25.0f]]; //Allowed fonts = http://support.apple.com/en-us/ht5878
-[a setMessageFont:[UIFont fontWithName:@"Verdana" size:25.0f]]; //Allowed fonts = http://support.apple.com/en-us/ht5878
-[a setShadowRadius:4];
This is the function to assign to each button an action
1 | bool button_call_back(int Tag,UIButton* a) |
Edit/Add action for button
Some explanations:
-button_call_back ----> you can edit this, but must be the same in "handler"
-if(Tag == 1) ----> check the Tag. The Tag is the id used in the button function. So all buttons with id:1 will do the following action
-return NO; ----> when you click the button, the alert WON'T hide
-return YES; ----> when you click the button, the alert WILL hide
Obviously instead "//here the code for the action" put your action code. Examples:
1 | CNWrite(CNAddr(0xIDAOffset),"HackedHex"); //to use the button to apply an hack |
Obviously2 you can add more "if(Tag == X)":
1 | bool button_call_back(int Tag,UIButton* a) |
ADD THE ALERT IN YOUR TWEAK
Open your Tweak.xm and add this at the top:
1 | #include <Foundation/Foundation.h> |
NOTE: - DON'T include config.h in your Tweak.xm because it's already included in cploaderheader.h file ---> if you download the first pack
- Include config.h in your Tweak.xm if you will need it to code inject or what else ---> if you download the second pack
Some Example Codes:
-AlertExample: https://www.sendspace.com/file/cptewd
-HackManagerExample: https://www.sendspace.com/file/p30qql
Great TUT from Supergiu and caoyin
0 comments:
Post a Comment