ARCHS = arm64 | |||||
TARGET = iphone:clang:11.2:11.2 | |||||
include $(THEOS)/makefiles/common.mk | |||||
TWEAK_NAME = SquareSwitcherX | |||||
SquareSwitcherX_FILES = Tweak.xm | |||||
include $(THEOS_MAKE_PATH)/tweak.mk | |||||
after-install:: | |||||
install.exec "killall -9 SpringBoard" | |||||
SUBPROJECTS += squareswitcherxprefs | |||||
include $(THEOS_MAKE_PATH)/aggregate.mk |
# SquareSwitcherX | |||||
Reduce corner radius on iPhone X app switcher cards |
{ Filter = { Bundles = ( "com.apple.springboard" ); }; } |
// Define the path to our preference plist | |||||
#define PLIST_PATH @"/var/mobile/Library/Preferences/com.yaypixxo.squareswitcherxprefs.plist" | |||||
// Create a method we'll use to get the bool value of the enable switch | |||||
inline bool GetPrefBool(NSString *key) { | |||||
return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue]; | |||||
} | |||||
// What to modify | |||||
@interface SBAppSwitcherPageView : UIView | |||||
@property (assign,nonatomic) double cornerRadius; | |||||
-(void)_updateCornerRadius; | |||||
@end | |||||
// Hook into header | |||||
%hook SBAppSwitcherPageView | |||||
-(void)_updateCornerRadius { | |||||
// Check if enable switch is on (using the method we created earlier) | |||||
if (GetPrefBool(@"enabled")) { | |||||
// Change corner radius | |||||
%orig; | |||||
self.cornerRadius = 5; | |||||
} | |||||
// If the enable switch is off, don't modify | |||||
else { | |||||
%orig; | |||||
} | |||||
} | |||||
// And cleanup | |||||
%end |
Package: com.yaypixxo.squareswitcherx | |||||
Name: SquareSwitcherX | |||||
Depends: mobilesubstrate, preferenceloader | |||||
Version: 1.1.1 | |||||
Architecture: iphoneos-arm | |||||
Description: Reduce corner radius of iPhone X switcher cards | |||||
Depiction: http://yaypixxo.com/depictions?p=com.yaypixxo.squareswitcherx | |||||
Maintainer: YaYPIXXO <viggo@lekdorf.com> | |||||
Author: YaYPIXXO <viggo@lekdorf.com> | |||||
Section: Tweaks |
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) |
<?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> |
<?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> |
#import <Preferences/PSListController.h> | |||||
#import <Preferences/PSSpecifier.h> | |||||
#import <spawn.h> | |||||
@interface SSXRootListController : PSListController | |||||
@end |
#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 |
<?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> |