add stuff

This commit is contained in:
2020-01-03 01:00:11 +01:00
commit 998651a333
11 changed files with 186 additions and 0 deletions

View File

@ -0,0 +1,16 @@
ARCHS = arm64
TARGET = iphone:clang:11.2:11.2
include $(THEOS)/makefiles/common.mk
BUNDLE_NAME = SquareSwitcherXPrefs
SquareSwitcherXPrefs_FILES = SSXRootListController.m
SquareSwitcherXPrefs_INSTALL_PATH = /Library/PreferenceBundles
SquareSwitcherXPrefs_FRAMEWORKS = UIKit
SquareSwitcherXPrefs_PRIVATE_FRAMEWORKS = Preferences
include $(THEOS_MAKE_PATH)/bundle.mk
internal-stage::
$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END)
$(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/SquareSwitcherXPrefs.plist$(ECHO_END)

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>SquareSwitcherXPrefs</string>
<key>CFBundleIdentifier</key>
<string>com.yaypixxo.squareswitcherxprefs</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>SSXRootListController</string>
</dict>
</plist>

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<true/>
<key>defaults</key>
<string>com.yaypixxo.squareswitcherxprefs</string>
<key>key</key>
<string>enabled</string>
<key>label</key>
<string>Enable</string>
</dict>
<dict>
<key>action</key>
<string>respring:</string>
<key>cell</key>
<string>PSButtonCell</string>
<key>label</key>
<string>Respring</string>
</dict>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>footerText</key>
<string>SquareSwitcherX by YaYPIXXO</string>
<key>isStaticText</key>
<true/>
</dict>
</array>
<key>title</key>
<string>SquareSwitcherX</string>
</dict>
</plist>

View File

@ -0,0 +1,7 @@
#import <Preferences/PSListController.h>
#import <Preferences/PSSpecifier.h>
#import <spawn.h>
@interface SSXRootListController : PSListController
@end

View File

@ -0,0 +1,20 @@
#include "SSXRootListController.h"
@implementation SSXRootListController
- (NSArray *)specifiers {
if (!_specifiers) {
_specifiers = [[self loadSpecifiersFromPlistName:@"Root" target:self] retain];
}
return _specifiers;
}
// Respring function
- (void)respring:(id)sender {
pid_t pid;
const char* args[] = {"killall", "backboardd", NULL};
posix_spawn(&pid, "/usr/bin/killall", NULL, NULL, (char* const*)args, NULL);
}
@end

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>entry</key>
<dict>
<key>bundle</key>
<string>SquareSwitcherXPrefs</string>
<key>cell</key>
<string>PSLinkCell</string>
<key>detail</key>
<string>SSXRootListController</string>
<key>icon</key>
<string>icon.png</string>
<key>isController</key>
<true/>
<key>label</key>
<string>SquareSwitcherX</string>
</dict>
</dict>
</plist>