commit 6bfe68108280f5b92f83d343990aca67a9d1dd8a Author: lillian rose winter Date: Tue Sep 10 23:47:37 2019 -0500 :tada: init diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..b8fdb1b Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d8ca9e5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.theos/ +packages/ \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..29d4b55 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +INSTALL_TARGET_PROCESSES = SpringBoard + +THEOS_DEVICE_IP = 192.168.1.182 + +include $(THEOS)/makefiles/common.mk + +TWEAK_NAME = borders + +borders_FILES = Tweak.x +borders_CFLAGS = -fobjc-arc +borders_FRAMEWORKS = UIKit +borders_EXTRA_FRAMEWORKS += Cephei + +include $(THEOS_MAKE_PATH)/tweak.mk + +SUBPROJECTS += bordersprefs +include $(THEOS_MAKE_PATH)/aggregate.mk diff --git a/Tweak.x b/Tweak.x new file mode 100644 index 0000000..f2a50a7 --- /dev/null +++ b/Tweak.x @@ -0,0 +1,34 @@ +#import +#import + +static bool enabled = true; +static int prefsCornerRadius = 10; + +@interface _UIRootWindow : UIView + @property (setter=_setContinuousCornerRadius:, nonatomic) double _continuousCornerRadius; + - (double)_continuousCornerRadius; + - (void)_setContinuousCornerRadius:(double)arg1; +@end + +%hook _UIRootWindow + - (void)layoutSubviews { + %orig; + if (enabled) { + self._continuousCornerRadius = prefsCornerRadius; + self.clipsToBounds = YES; + } + return; + } +%end + +void reloadPrefs() { + HBPreferences *file = [[HBPreferences alloc] initWithIdentifier:@"toys.lily.borderprefs"]; + + enabled = [([file objectForKey:@"enabled"] ?: @(YES)) boolValue]; + // prefsCornerRadius = [([file objectForKey:@"borderradius"] ? : @(10)) intValue]; +} + +%ctor { + reloadPrefs(); + CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)reloadPrefs, CFSTR("toys.lily.borderprefs/ReloadPrefs"), NULL, kNilOptions); +} \ No newline at end of file diff --git a/borders.plist b/borders.plist new file mode 100644 index 0000000..5f7f0ef --- /dev/null +++ b/borders.plist @@ -0,0 +1,5 @@ +{ + Filter = { + Bundles = ( "com.apple.UIKit" ); + }; +} \ No newline at end of file diff --git a/bordersprefs/.DS_Store b/bordersprefs/.DS_Store new file mode 100644 index 0000000..248127e Binary files /dev/null and b/bordersprefs/.DS_Store differ diff --git a/bordersprefs/BRDRootListController.h b/bordersprefs/BRDRootListController.h new file mode 100644 index 0000000..413e475 --- /dev/null +++ b/bordersprefs/BRDRootListController.h @@ -0,0 +1,7 @@ +#import +#import +#import + +@interface BRDRootListController : PSListController + +@end diff --git a/bordersprefs/BRDRootListController.m b/bordersprefs/BRDRootListController.m new file mode 100644 index 0000000..d0cf8a0 --- /dev/null +++ b/bordersprefs/BRDRootListController.m @@ -0,0 +1,26 @@ +#include "BRDRootListController.h" + +@implementation BRDRootListController + +- (instancetype)init { + self = [super init]; + + if (self) { + HBAppearanceSettings *appearanceSettings = [[HBAppearanceSettings alloc] init]; + appearanceSettings.tintColor = [UIColor colorWithRed:0.4f green:0.0f blue:0.3f alpha:1]; + appearanceSettings.tableViewCellSeparatorColor = [UIColor colorWithWhite:0 alpha:0]; + self.hb_appearanceSettings = appearanceSettings; + } + + return self; +} + +- (NSArray *)specifiers { + if (!_specifiers) { + _specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self]; + } + + return _specifiers; +} + +@end diff --git a/bordersprefs/Makefile b/bordersprefs/Makefile new file mode 100644 index 0000000..32c6791 --- /dev/null +++ b/bordersprefs/Makefile @@ -0,0 +1,16 @@ +include $(THEOS)/makefiles/common.mk + +BUNDLE_NAME = bordersprefs + +bordersprefs_FILES = BRDRootListController.m +bordersprefs_INSTALL_PATH = /Library/PreferenceBundles +bordersprefs_FRAMEWORKS = UIKit +bordersprefs_PRIVATE_FRAMEWORKS = Preferences +bordersprefs_CFLAGS = -fobjc-arc +bordersprefs_EXTRA_FRAMEWORKS = Cephei CepheiPrefs + +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/bordersprefs.plist$(ECHO_END) diff --git a/bordersprefs/Resources/.DS_Store b/bordersprefs/Resources/.DS_Store new file mode 100644 index 0000000..7fdb9f0 Binary files /dev/null and b/bordersprefs/Resources/.DS_Store differ diff --git a/bordersprefs/Resources/Info.plist b/bordersprefs/Resources/Info.plist new file mode 100644 index 0000000..32ebf81 --- /dev/null +++ b/bordersprefs/Resources/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + bordersprefs + CFBundleIdentifier + toys.lily.bordersprefs + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSPrincipalClass + BRDRootListController + + diff --git a/bordersprefs/Resources/Root.plist b/bordersprefs/Resources/Root.plist new file mode 100644 index 0000000..b0b6635 --- /dev/null +++ b/bordersprefs/Resources/Root.plist @@ -0,0 +1,63 @@ + + + + + items + + + cellClass + HBTwitterCell + label + lily + user + lilyshibe + + + cell + PSSwitchCell + default + + defaults + toys.lily.borderprefs + label + enabled + key + enabled + alternateColors + + PostNotification + toys.lily.borderprefs/ReloadPrefs + + + + title + borders + + diff --git a/bordersprefs/Resources/icon.png b/bordersprefs/Resources/icon.png new file mode 100644 index 0000000..921ea18 Binary files /dev/null and b/bordersprefs/Resources/icon.png differ diff --git a/bordersprefs/Resources/icon@2x.png b/bordersprefs/Resources/icon@2x.png new file mode 100644 index 0000000..bcddb33 Binary files /dev/null and b/bordersprefs/Resources/icon@2x.png differ diff --git a/bordersprefs/Resources/icon@3x.png b/bordersprefs/Resources/icon@3x.png new file mode 100644 index 0000000..5dae552 Binary files /dev/null and b/bordersprefs/Resources/icon@3x.png differ diff --git a/bordersprefs/entry.plist b/bordersprefs/entry.plist new file mode 100644 index 0000000..4439fc6 --- /dev/null +++ b/bordersprefs/entry.plist @@ -0,0 +1,21 @@ + + + + + entry + + bundle + bordersprefs + cell + PSLinkCell + detail + BRDRootListController + icon + icon.png + isController + + label + borders + + + diff --git a/control b/control new file mode 100644 index 0000000..33076e7 --- /dev/null +++ b/control @@ -0,0 +1,9 @@ +Package: toys.lily.borders +Name: borders +Depends: mobilesubstrate, ws.hbang.common +Version: 0.0.1 +Architecture: iphoneos-arm +Description: adds screen border radius +Maintainer: lillian rose winter +Author: lillian rose winter +Section: Tweaks