m (Fix code formatting) |
m (→What's %ctor good for?: block != function) |
||
Line 16: | Line 16: | ||
* hook some example methods to display benefits of dynamic hooking | * hook some example methods to display benefits of dynamic hooking | ||
===What's %ctor good for?=== | === What's %ctor good for? === | ||
%ctor is a logos directive which resolves to __atribute_((constructor)), which is a | |||
%ctor is a logos directive which resolves to <code>static __atribute_((constructor)) void _logosLocalCtor_<8 hex characters>()"</code>, which is a function that runs when your dylib is loaded. | |||
The syntax is similar to that of a function. An example is shown below: | The syntax is similar to that of a function. An example is shown below: | ||
Line 30: | Line 31: | ||
%ctor can be useful for performing any setup, for example, instantiating variables or reading your tweak's preferences. | %ctor can be useful for performing any setup, for example, instantiating variables or reading your tweak's preferences. | ||
However, there are certain things which %ctor is '''not''' | However, there are certain things which %ctor is '''not''' for. Do not use UIKit elements, perform time consuming algorithms or communicate over the network. | ||
It will probably minimize headache if you keep your %ctor use to just the bare minimum, and rather perform any extraneous setup at a | It will probably minimize headache if you keep your %ctor use to just the bare minimum, and rather perform any extraneous setup at a later point. | ||
===Dissecting App Store Apps=== | ===Dissecting App Store Apps=== |
Revision as of 17:27, 27 January 2015
Let's say you've figured out how to set up Theos, you know enough Objective-C to fool around, you know a little about how to use Cydia Substrate, and basically you've read all the beginner tutorials - what do you read next to learn more about jailbroken development as you experiment with building your own project? We should have a set of "next steps" tutorials for you!
These ones haven't been written yet, but it would be pretty cool for somebody to write them...maybe you? Anyone can start a page and begin writing some explanations, or you can just start filling out the sections below with more information. (Also, if you have an idea for a tutorial that you would like to see, feel free to add it to this list - it might inspire somebody to write an explanation of that thing you want to learn about.)
Using Development Tools
Changing System Volume with AVSystemController and Cycript
- assumes the reader has basic Cycript and Objective-C knowledge
- takes the reader on a journey through AVSystemController's methods using cycript
- documents the thought process (ex. "-getVolume:(float*)arg1 forCategory:(id)arg2 indicates that there are different categories of volumes and they each have their own values")
- ends with using the information learned to make a really simple command line utility
Dynamic Method Hooking With Cycript
- assumes the reader has basic Cycript and Objective-C knowledge
- showcases Cycript's ability to hook methods
- hook some example methods to display benefits of dynamic hooking
What's %ctor good for?
%ctor is a logos directive which resolves to static __atribute_((constructor)) void _logosLocalCtor_<8 hex characters>()"
, which is a function that runs when your dylib is loaded.
The syntax is similar to that of a function. An example is shown below:
%ctor {
//This runs when your tweak gets loaded into the target process
NSlog(@"My tweak has loaded!");
}
%ctor can be useful for performing any setup, for example, instantiating variables or reading your tweak's preferences.
However, there are certain things which %ctor is not for. Do not use UIKit elements, perform time consuming algorithms or communicate over the network.
It will probably minimize headache if you keep your %ctor use to just the bare minimum, and rather perform any extraneous setup at a later point.
Dissecting App Store Apps
- shows how to dump headers for an app binary (see also Reverse Engineering Tools)
Integrating with Third Party Frameworks and Libraries
Building Tweak Settings with PreferenceLoader
- goes through the process of building simple tweak preferences that are shown in Settings
- shows the correct way to read/write to those settings in your tweak code
- also shows how to use popular third party additions such as AppList / libcolorpicker / Activator
Your First Flipswitch
- explains the idea behind the Flipswitch framework
- goes through the different methods / objects you'll probably be using
- shows how to build a simple flipswitch (ex. a simple flashlight toggle)
Integrating Your Tweak With Activator
- goes through the Activator library
- dos / don't of the Activator API
- demo a simple Activator event (ex. got a notification from a specific app)
- demo a simple Activator listener (ex. show an alert)