Skip to content

Commit

Permalink
PINEBOARD IS GARBAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
asdfugil committed Mar 23, 2024
1 parent f744655 commit 16db718
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/universalhooks/hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ void securitydInit(void);
void watchdogdInit(void);
void springboardInit(void);
void cfprefsdInit(void);
void pineboardInit(void);

#endif
4 changes: 4 additions & 0 deletions plooshInit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
017796C82BAED73C00BCC2C3 /* lsd.m in Sources */ = {isa = PBXBuildFile; fileRef = 017796C72BAED73C00BCC2C3 /* lsd.m */; };
017796CA2BAED7ED00BCC2C3 /* springboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 017796C92BAED7ED00BCC2C3 /* springboard.m */; };
017796CC2BAEDA1A00BCC2C3 /* cfprefsd.c in Sources */ = {isa = PBXBuildFile; fileRef = 017796CB2BAEDA1A00BCC2C3 /* cfprefsd.c */; };
017796D32BAEF0AA00BCC2C3 /* pineboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 017796D22BAEF0AA00BCC2C3 /* pineboard.m */; };
01E426E42BA1DF91008BC989 /* start.S in Sources */ = {isa = PBXBuildFile; fileRef = 01D3D6252B5C80DA007845B6 /* start.S */; };
01E426E52BA1DF94008BC989 /* syscall.S in Sources */ = {isa = PBXBuildFile; fileRef = 01D3D6262B5C80DA007845B6 /* syscall.S */; };
01E426E62BA1DF9B008BC989 /* shellcode.c in Sources */ = {isa = PBXBuildFile; fileRef = 01D3D6302B5C80DA007845B6 /* shellcode.c */; };
Expand Down Expand Up @@ -214,6 +215,7 @@
017796C72BAED73C00BCC2C3 /* lsd.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = lsd.m; sourceTree = "<group>"; };
017796C92BAED7ED00BCC2C3 /* springboard.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = springboard.m; sourceTree = "<group>"; };
017796CB2BAEDA1A00BCC2C3 /* cfprefsd.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cfprefsd.c; sourceTree = "<group>"; };
017796D22BAEF0AA00BCC2C3 /* pineboard.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = pineboard.m; sourceTree = "<group>"; };
019B1B452B5CACA800BABAB5 /* load_etc_rc_d.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = load_etc_rc_d.c; sourceTree = "<group>"; };
01B6169C2B720DC70080AB28 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
01B6169F2B720E3F0080AB28 /* hooks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = hooks.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -579,6 +581,7 @@
017796C72BAED73C00BCC2C3 /* lsd.m */,
017796C92BAED7ED00BCC2C3 /* springboard.m */,
017796CB2BAEDA1A00BCC2C3 /* cfprefsd.c */,
017796D22BAEF0AA00BCC2C3 /* pineboard.m */,
);
path = universalhooks;
sourceTree = "<group>";
Expand Down Expand Up @@ -1770,6 +1773,7 @@
017796CC2BAEDA1A00BCC2C3 /* cfprefsd.c in Sources */,
01E427C12BA1EF2B008BC989 /* securityd.c in Sources */,
017796CA2BAED7ED00BCC2C3 /* springboard.m in Sources */,
017796D32BAEF0AA00BCC2C3 /* pineboard.m in Sources */,
01E427C02BA1EF29008BC989 /* main.c in Sources */,
01E427C22BA1EF2E008BC989 /* watchdogd.c in Sources */,
017796C82BAED73C00BCC2C3 /* lsd.m in Sources */,
Expand Down
3 changes: 2 additions & 1 deletion src/systemhook/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,8 @@ __attribute__((constructor)) static void initializer(void)
strcmp(gExecutablePath, "/usr/libexec/watchdogd") == 0 ||
strcmp(gExecutablePath, "/usr/libexec/lsd") == 0 ||
strcmp(gExecutablePath, "/System/Library/CoreServices/SpringBoard.app/SpringBoard") == 0 ||
strcmp(gExecutablePath, "/usr/sbin/cfprefsd") == 0 ) {
strcmp(gExecutablePath, "/usr/sbin/cfprefsd") == 0 ||
strcmp(gExecutablePath, "/Applications/PineBoard.app/PineBoard") == 0) {
dlopen_hook("/cores/binpack/usr/lib/universalhooks.dylib", RTLD_NOW);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/universalhooks/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct hook_info info[] = {
{ "/System/Library/CoreServices/SpringBoard.app/SpringBoard", springboardInit, NULL, NULL },
{ "/usr/libexec/lsd", lsdRootlessInit, lsdRootfulInit, NULL },
{ "/usr/sbin/cfprefsd", cfprefsdInit, NULL, NULL },
{ "/Applications/PineBoard.app/PineBoard", NULL, NULL, pineboardInit },
};

__attribute__((constructor))void universalhooks_main(void) {
Expand Down
65 changes: 65 additions & 0 deletions src/universalhooks/pineboard.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#include <Foundation/Foundation.h>
#include <objc/objc.h>
#include <objc/runtime.h>
#include <substrate.h>

@interface LSApplicationWorkspace: NSObject
- (id)allApplications;
- (void)openApplicationWithBundleID:(NSString *)string;
- (id)defaultWorkspace;
@end

@interface NSDistributedNotificationCenter : NSNotificationCenter

+ (id)defaultCenter;

- (void)addObserver:(id)arg1 selector:(SEL)arg2 name:(id)arg3 object:(id)arg4;
- (void)postNotificationName:(id)arg1 object:(id)arg2 userInfo:(id)arg3;

@end

@interface PBSSystemService : NSObject
+(id)sharedInstance;
-(void)deactivateScreenSaver;
@end

@interface PBSPowerManager : NSObject

+(id)sharedInstance;
+(void)load;
+(void)setupPowerManagement;
-(void)_performUserEventWakeDevice;
-(void)wakeDeviceWithOptions:(id)arg1;
-(void)setNeedsDisplayWakeOnPowerOn:(BOOL)arg1;
- (void)sleepDeviceWithOptions:(id)arg1;
-(void)_registerForPowerNotifications;
-(void)_registerForThermalNotifications;
-(void)_enableIdleSleepAndWatchdog;
-(void)_registerForBackBoardNotifications;
-(void)_updateIdleTimer;
@end

void* PBAppInfo_isEnabled_orig;
void* PBAppState_isEnabledForApplicationWithIdentifier_orig;
void* PBSMutableAppState_isEnabled_orig;
bool returns_true(void) {
return true;
}

void pineboardInit(void) {
Class PBAppInfo = objc_getClass("PBAppInfo");
if (PBAppInfo) {
MSHookMessageEx(PBAppInfo, @selector(isEnabled), (IMP)&returns_true, (IMP*)&PBAppInfo_isEnabled_orig);
}

Class PBAppState = objc_getClass("PBAppState");
if (PBAppState) {
MSHookMessageEx(PBAppState, @selector(isEnabledForApplicationWithIdentifier), (IMP)&returns_true, (IMP*)&PBAppState_isEnabledForApplicationWithIdentifier_orig);

}

Class PBSMutableAppState = objc_getClass("PBSMutableAppState");
if (PBSMutableAppState) {
MSHookMessageEx(PBSMutableAppState, @selector(isEnabled), (IMP)&returns_true, (IMP*)&PBSMutableAppState_isEnabled_orig);
}
}

0 comments on commit 16db718

Please sign in to comment.