Skip to content

Instantly share code, notes, and snippets.

@rooootdev
Created August 9, 2026 22:54
Show Gist options
  • Select an option

  • Save rooootdev/b671e1ec3d23cf777220fcb61aef8db4 to your computer and use it in GitHub Desktop.

Select an option

Save rooootdev/b671e1ec3d23cf777220fcb61aef8db4 to your computer and use it in GitHub Desktop.
Simple test dylib I frequently use. Probably not useful to you.
//
// proof.m
// proof
//
// Created by ruter on 10.08.26.
//
#import <UIKit/UIKit.h>
__attribute__((constructor))
static void entry(void) {
dispatch_async(dispatch_get_main_queue(), ^{
UIWindow *key_win = nil;
for (UIScene *scene in UIApplication.sharedApplication.connectedScenes) {
if ([scene isKindOfClass:[UIWindowScene class]]) {
for (UIWindow *window in ((UIWindowScene *)scene).windows) {
if (window.isKeyWindow) {
key_win = window;
break;
}
}
}
}
if (!key_win) return;
UIViewController *root_vc = key_win.rootViewController;
if (!root_vc) return;
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"ROOOOT.DEV // WE OUT HERE!" message:nil preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"aight" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://roooot.dev/"] options:@{} completionHandler:nil];
}]];
[root_vc presentViewController:alert animated:YES completion:nil];
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment