https://github.com/icrazeios/runeapi
Developer API documentation for creating Rune plugins
https://github.com/icrazeios/runeapi
Last synced: 8 months ago
JSON representation
Developer API documentation for creating Rune plugins
- Host: GitHub
- URL: https://github.com/icrazeios/runeapi
- Owner: iCrazeiOS
- Created: 2024-06-02T03:03:54.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-02T04:50:07.000Z (about 2 years ago)
- Last Synced: 2024-06-03T05:41:19.611Z (about 2 years ago)
- Language: Shell
- Homepage: https://havoc.app/package/rune
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rune Developer API
#### For extending the functionality of [Rune](https://havoc.app/package/rune)
Requirements: [Theos](https://theos.dev/docs/installation)
## Getting Started
1. Start by cloning this repo to your machine
2. Run `plugin-gen.sh` to create a new plugin. It will ask you for some details before setting up the project.

3. `cd` into the newly created directory and compile the plugin using `make package`. If you are compiling for a rootless jailbreak, append `THEOS_PACKAGE_SCHEME=rootless` to the command.
4. If the compilation was successful, you should have a `.deb` file in the `packages` directory. After installing the package and respringing, it should appear within Rune's panel selection.


After enabling the plugin, you should see its panel show up within Rune.

## Programming
Now that you have a plugin set up, you can edit `Tweak.x` to build your UI and add functionality.
The `plugin-gen.sh` script creates a subclass of BBRBasePanelView for you automatically. This is the class that you should use to build your panel.
The `didMoveToWindow` method is called when the panel is (re)loaded by Rune. Use this to set up your panel's UI and any other initialisation code.
As each plugin is a Substrate tweak, you can hook methods just like you would in any other tweak.
## NSNotificationCenter
Rune uses NSNotificationCenter to communicate with plugins. You can listen for notifications by adding an observer in your panel's `didMoveToWindow` method.
Here is an example of how to listen for the `com.icraze.rune-opened` notification, to call a method named `updatePanel` whenever Rune is presented:
```objc
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updatePanel) name:@"com.icraze.rune-opened" object:nil];
```
Available notifications:
`com.icraze.rune-opened` - Fired when Rune is presented
`com.icraze.rune-closed` - Fired when Rune is dismissed
## Other Info
The `icon` field within the plugin's plist must be the name of an [SF Symbol](https://developer.apple.com/design/human-interface-guidelines/sf-symbols). Be sure to choose a symbol that is available on iOS 14 and above, as Rune supports these versions.