🎉 first commit

This commit is contained in:
lillian rose winter 2019-11-25 08:53:53 -06:00
commit 2da7325a5d
11 changed files with 274 additions and 0 deletions

16
Headers.h Normal file
View file

@ -0,0 +1,16 @@
#import <UIKit/UIKit.h>
#import <os/log.h>
#import <substrate.h>
@interface _UIBackdropView : UIView {}
@end
@interface SBFloatingDockPlatterView : UIView
@property (nonatomic, retain) _UIBackdropView * backgroundView;
@end
@interface _UIRootWindow : UIView
@property (setter=_setContinuousCornerRadius:, nonatomic) double _continuousCornerRadius;
- (double)_continuousCornerRadius;
- (void)_setContinuousCornerRadius:(double)arg1;
@end

14
Makefile Normal file
View file

@ -0,0 +1,14 @@
INSTALL_TARGET_PROCESSES = SpringBoard
THEOS_DEVICE_IP = 172.20.10.1
include $(THEOS)/makefiles/common.mk
TWEAK_NAME = hanahaki
hanahaki_FILES = Tweak.x
hanahaki_CFLAGS = -fobjc-arc
include $(THEOS_MAKE_PATH)/tweak.mk
SUBPROJECTS += hanahakiprefs
include $(THEOS_MAKE_PATH)/aggregate.mk

84
Tweak.x Normal file
View file

@ -0,0 +1,84 @@
// 888 888 888 d8b
// 888 888 888 Y8P
// 888 888 888
// 88888b. 8888b. 88888b. 8888b. 88888b. 8888b. 888 888 888
// 888 "88b "88b 888 "88b "88b 888 "88b "88b 888 .88P 888
// 888 888 .d888888 888 888 .d888888 888 888 .d888888 888888K 888
// 888 888 888 888 888 888 888 888 888 888 888 888 888 "88b 888
// 888 888 "Y888888 888 888 "Y888888 888 888 "Y888888 888 888 888
//
// (c) lillian rose winter 2019, all rights reserved or whateva
#import "Headers.h"
%hook NSObject
@interface NSObject (customObject)
- (BOOL)isSettingOn:(NSString *)keyStr;
@end
%new
- (BOOL)isSettingOn:(NSString *)keyStr {
const char *keyStrC = [keyStr cStringUsingEncoding:NSUTF8StringEncoding];
CFPreferencesAppSynchronize(CFSTR("toys.lily.hanahakiprefs"));
CFPropertyListRef value = CFPreferencesCopyAppValue(CFStringCreateWithCString(NULL, keyStrC, kCFStringEncodingUTF8), CFSTR("toys.lily.hanahakiprefs"));
NSString *valueString = [NSString stringWithFormat:@"%@", value];
NSString *noVal = @"0";
if ([valueString isEqualToString:noVal]) {
return NO;
}
else {
return YES;
}
}
%end
//DOCK BG
%hook SBDockView
- (void)setBackgroundAlpha:(double)arg1 {
NSObject *object = [[NSObject alloc] init];
BOOL isSettingOn = [object isSettingOn:@"dockbg"];
if (isSettingOn) {
arg1 = 0;
}
else {
arg1 = 1;
}
%orig(arg1);
}
%end
%hook SBFloatingDockPlatterView
- (void)layoutSubviews {
NSObject *object = [[NSObject alloc] init];
BOOL isSettingOn = [object isSettingOn:@"dockbg"];
%orig;
if(isSettingOn) {
self.backgroundView = nil;
}
}
%end
//SCREEN BORDERS
%hook _UIRootWindow
- (void)layoutSubviews {
NSObject *object = [[NSObject alloc] init];
BOOL isSettingOn = [object isSettingOn:@"borders"];
%orig;
if(isSettingOn) {
self._continuousCornerRadius = 10;
self.clipsToBounds = YES;
}
return;
}
%end

9
control Normal file
View file

@ -0,0 +1,9 @@
Package: toys.lily.hanahaki
Name: hanahaki
Depends: mobilesubstrate
Version: 0.0.1
Architecture: iphoneos-arm
Description: An awesome MobileSubstrate tweak!
Maintainer: lillian rose winter
Author: lillian rose winter
Section: Tweaks

1
hanahaki.plist Normal file
View file

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

View file

@ -0,0 +1,9 @@
#import <Preferences/PSListController.h>
#import <Preferences/PSSpecifier.h>
#include <spawn.h>
@interface HANARootListController : PSListController
- (void)respring;
@end

View file

@ -0,0 +1,20 @@
#include "HANARootListController.h"
@implementation HANARootListController
- (NSArray *)specifiers {
if (!_specifiers) {
_specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self];
}
return _specifiers;
}
- (void)respring {
pid_t respringPid;
char *respringArgv[] = {"/usr/bin/killall", (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_6_0) ? "backboardd" : "SpringBoard", NULL};
posix_spawn(&respringPid, respringArgv[0], NULL, NULL, respringArgv, NULL);
waitpid(respringPid, NULL, WEXITED);
}
@end

15
hanahakiprefs/Makefile Normal file
View file

@ -0,0 +1,15 @@
include $(THEOS)/makefiles/common.mk
BUNDLE_NAME = hanahakiprefs
hanahakiprefs_FILES = HANARootListController.m
hanahakiprefs_INSTALL_PATH = /Library/PreferenceBundles
hanahakiprefs_FRAMEWORKS = UIKit
hanahakiprefs_PRIVATE_FRAMEWORKS = Preferences
hanahakiprefs_CFLAGS = -fobjc-arc
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/hanahakiprefs.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>hanahakiprefs</string>
<key>CFBundleIdentifier</key>
<string>toys.lily.hanahakiprefs</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>HANARootListController</string>
</dict>
</plist>

View file

@ -0,0 +1,61 @@
<?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>PSGroupCell</string>
<key>label</key>
<string>respring to apply changes</string>
</dict>
<dict>
<key>cell</key>
<string>PSButtonCell</string>
<key>action</key>
<string>respring</string>
<key>label</key>
<string>respring</string>
</dict>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>global</string>
</dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<true/>
<key>defaults</key>
<string>toys.lily.hanahakiprefs</string>
<key>key</key>
<string>borders</string>
<key>label</key>
<string>rounded screen corners</string>
</dict>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>home screen</string>
</dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<true/>
<key>defaults</key>
<string>toys.lily.hanahakiprefs</string>
<key>key</key>
<string>dockbg</string>
<key>label</key>
<string>remove dock background</string>
</dict>
</array>
<key>title</key>
<string>hanahaki</string>
</dict>
</plist>

21
hanahakiprefs/entry.plist Normal file
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>hanahakiprefs</string>
<key>cell</key>
<string>PSLinkCell</string>
<key>detail</key>
<string>HANARootListController</string>
<key>icon</key>
<string>icon.png</string>
<key>isController</key>
<true/>
<key>label</key>
<string>hanahaki</string>
</dict>
</dict>
</plist>