Browse Source

add stuff

tags/v1.1.1
Viggo Lekdorf 4 years ago
commit
998651a333
11 changed files with 186 additions and 0 deletions
  1. +14
    -0
      Makefile
  2. +2
    -0
      README.md
  3. +1
    -0
      SquareSwitcherX.plist
  4. +32
    -0
      Tweak.xm
  5. +10
    -0
      control
  6. +16
    -0
      squareswitcherxprefs/Makefile
  7. +24
    -0
      squareswitcherxprefs/Resources/Info.plist
  8. +39
    -0
      squareswitcherxprefs/Resources/Root.plist
  9. +7
    -0
      squareswitcherxprefs/SSXRootListController.h
  10. +20
    -0
      squareswitcherxprefs/SSXRootListController.m
  11. +21
    -0
      squareswitcherxprefs/entry.plist

+ 14
- 0
Makefile View 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
- 0
README.md View File

@@ -0,0 +1,2 @@
# SquareSwitcherX
Reduce corner radius on iPhone X app switcher cards

+ 1
- 0
SquareSwitcherX.plist View File

@@ -0,0 +1 @@
{ Filter = { Bundles = ( "com.apple.springboard" ); }; }

+ 32
- 0
Tweak.xm View 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
- 0
control View 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
- 0
squareswitcherxprefs/Makefile 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)

+ 24
- 0
squareswitcherxprefs/Resources/Info.plist 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>

+ 39
- 0
squareswitcherxprefs/Resources/Root.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>

+ 7
- 0
squareswitcherxprefs/SSXRootListController.h View File

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

@interface SSXRootListController : PSListController

@end

+ 20
- 0
squareswitcherxprefs/SSXRootListController.m 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

+ 21
- 0
squareswitcherxprefs/entry.plist 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>

Loading…
Cancel
Save