Skip to content

Instantly share code, notes, and snippets.

View 0cyn's full-sized avatar
🐉

cynder 0cyn

🐉
View GitHub Profile
@0cyn
0cyn / InitialLoad.xm
Last active April 29, 2021 12:21
Layout Code for iOS 13/14
%hook SpringBoard
// Honestly this is a bad hack just to get it functional (with not too much overhead).
// This could be done with a notification listener instead.
- (BOOL)isShowingHomescreen
{
[HPManager updateCacheForLocation:@"SBIconLocationRoot"];
[HPManager updateCacheForLocation:@"SBIconLocationDock"];
return %orig;
}
@0cyn
0cyn / vector-dark.css
Created June 13, 2020 18:30
Independent applied override stylesheet generated using https://css.github.io/csso/csso.html from vector-dark.css and vector.css by manually applying override rules and merging stylesheets
@-webkit-keyframes rotate{0%{-webkit-transform:rotate(0deg)!important;-moz-transform:rotate(0deg)!important;transform:rotate(0deg)!important}to{-webkit-transform:rotate(360deg)!important;-moz-transform:rotate(360deg)!important;transform:rotate(360deg)!important}}@-moz-keyframes rotate{0%{-webkit-transform:rotate(0deg)!important;-moz-transform:rotate(0deg)!important;transform:rotate(0deg)!important}to{-webkit-transform:rotate(360deg)!important;-moz-transform:rotate(360deg)!important;transform:rotate(360deg)!important}}@-o-keyframes rotate{0%{-webkit-transform:rotate(0deg)!important;-moz-transform:rotate(0deg)!important;transform:rotate(0deg)!important}to{-webkit-transform:rotate(360deg)!important;-moz-transform:rotate(360deg)!important;transform:rotate(360deg)!important}}@keyframes rotate{0%{-webkit-transform:rotate(0deg)!important;-moz-transform:rotate(0deg)!important;transform:rotate(0deg)!important}to{-webkit-transform:rotate(360deg)!important;-moz-transform:rotate(360deg)!important;transform:rotate(360deg)
//
// HPConfiguration.m
// HomePlus
//
// This class should serve as a paste-in for NSUserDefaults
// Which is why some of these methods may seem completely unneeded.
//
//
#include "HPConfiguration.h"
#include "../Utility/HPUtility.h"
#include "HomePlus.h"
#include "HomePlusEditor.h"
@interface SBIconListView (MainLayout13)
@property (nonatomic, assign) NSInteger iconsInRowForSpacingCalculation;
@property (nonatomic, assign) CGSize alignmentIconSize;
@property (nonatomic, assign) NSInteger firstFreeSlotIndex;
@property (nonatomic, retain) SBIconListFlowLayout *homeplus_layout;
- (NSUInteger)iconRowsForCurrentOrientation;
@0cyn
0cyn / DragonGen.py
Last active March 26, 2020 04:27
Create a build.ninja file using entirely python processing, no templates.
import string
import re
import os
import sys
import ninja_syntax
logos = ['boof.xm', 'Blah.x']
files = ['foo.mm', 'de.m']
static BOOL _pfTweakEnabled = YES;
NSDictionary *prefs = nil;
< Your Tweak Code Here >
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//
//
// iOS 13 Code to Modify HomeScreen layout without performance/api overhead
#include "HomePlus.h"
#include "HomePlusEditor.h"
@interface SBIconListView (MainLayout13)
- (NSUInteger)iconRowsForCurrentOrientation;
@end
@interface SBIconListFlowLayout (MainLayout)
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/xpc
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/launch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/launch.h
static UIView *debugView;
static UILabel *debugLabel;
void KRSLog(NSString *log)
{
if (debugLabel) [debugLabel setText:log];
}
%hook UISystemGestureView
-(void)layoutSubviews
{
@0cyn
0cyn / Central.xm
Last active February 19, 2020 14:07
%hook SBIconListView
- (struct CGPoint)originForIconAtCoordinate:(SBIconCoordinate)arg1 metrics:(struct SBIconListLayoutMetrics)arg2
{
// Get our original point for the current icon
CGPoint o = %orig(arg1, arg2);
if (!([self.iconLocation containsString:@"Root"]) && !_pfChangeFolderLayout) return o;
// Get ourselves the info on the first icon for maths
struct SBIconCoordinate first;