Skip to content

Commit

Permalink
1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pookjw committed Jul 12, 2024
1 parent 953f4fe commit b15ff32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
FINALPACKAGE=1
TARGET := iphone:clang:latest
THEOS_PACKAGE_SCHEME = rootless

Expand Down
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: com.pookjw.actionbuttonenabler
Name: ActionButtonEnabler
Version: 1.0.1
Version: 1.1
Architecture: iphoneos-arm64
Description: Hello World!
Maintainer: pookjw
Expand Down
10 changes: 5 additions & 5 deletions modules/ActionButtonEnablerPreferences/init.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#import <substrate.h>
#import <cstdint>

namespace AE_PSUIPrefsListController {
namespace AE_PSGGeneralController {
namespace viewDidLoad {
void (*original)(__kindof UIViewController *self, SEL _cmd);
void custom(__kindof UIViewController *self, SEL _cmd) {
Expand All @@ -16,7 +16,7 @@ void custom(__kindof UIViewController *self, SEL _cmd) {
__block auto retainedSelf = self;
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithPrimaryAction:[UIAction actionWithTitle:[NSString string] image:[UIImage systemImageNamed:@"button.programmable"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) {
__kindof UIViewController *actionButtonSettings = [NSClassFromString(@"ActionButtonSettings") new];
[retainedSelf presentViewController:actionButtonSettings animated:YES completion:nil];
[retainedSelf.navigationController pushViewController:actionButtonSettings animated:YES];
[actionButtonSettings release];
}]];

Expand Down Expand Up @@ -57,10 +57,10 @@ void custom(__kindof UIViewController *self, SEL _cmd) {
dlopen("/System/Library/PreferenceBundles/ActionButtonSettings.bundle/ActionButtonSettings", RTLD_NOW);

MSHookMessageEx(
NSClassFromString(@"PSUIPrefsListController"),
NSClassFromString(@"PSGGeneralController"),
@selector(viewDidLoad),
reinterpret_cast<IMP>(&AE_PSUIPrefsListController::viewDidLoad::custom),
reinterpret_cast<IMP *>(&AE_PSUIPrefsListController::viewDidLoad::original)
reinterpret_cast<IMP>(&AE_PSGGeneralController::viewDidLoad::custom),
reinterpret_cast<IMP *>(&AE_PSGGeneralController::viewDidLoad::original)
);

MSHookMessageEx(
Expand Down

0 comments on commit b15ff32

Please sign in to comment.