forkato da yaypixxo/SquareSwitcherX
add stuff
This commit is contained in:
14
Makefile
Normal file
14
Makefile
Normal file
@ -0,0 +1,14 @@
|
||||
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
|
2
README.md
Normal file
2
README.md
Normal file
@ -0,0 +1,2 @@
|
||||
# SquareSwitcherX
|
||||
Reduce corner radius on iPhone X app switcher cards
|
1
SquareSwitcherX.plist
Normal file
1
SquareSwitcherX.plist
Normal file
@ -0,0 +1 @@
|
||||
{ Filter = { Bundles = ( "com.apple.springboard" ); }; }
|
32
Tweak.xm
Normal file
32
Tweak.xm
Normal file
@ -0,0 +1,32 @@
|
||||
// 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
|
10
control
Normal file
10
control
Normal file
@ -0,0 +1,10 @@
|
||||
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
|
16
squareswitcherxprefs/Makefile
Normal file
16
squareswitcherxprefs/Makefile
Normal 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)
|
24
squareswitcherxprefs/Resources/Info.plist
Normal file
24
squareswitcherxprefs/Resources/Info.plist
Normal 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>
|
39
squareswitcherxprefs/Resources/Root.plist
Normal file
39
squareswitcherxprefs/Resources/Root.plist
Normal 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>
|
7
squareswitcherxprefs/SSXRootListController.h
Normal file
7
squareswitcherxprefs/SSXRootListController.h
Normal file
@ -0,0 +1,7 @@
|
||||
#import <Preferences/PSListController.h>
|
||||
#import <Preferences/PSSpecifier.h>
|
||||
#import <spawn.h>
|
||||
|
||||
@interface SSXRootListController : PSListController
|
||||
|
||||
@end
|
20
squareswitcherxprefs/SSXRootListController.m
Normal file
20
squareswitcherxprefs/SSXRootListController.m
Normal 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
|
21
squareswitcherxprefs/entry.plist
Normal file
21
squareswitcherxprefs/entry.plist
Normal 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>
|
Fai riferimento in un nuovo problema
Block a user