Skip to content

Instantly share code, notes, and snippets.

View 0cyn's full-sized avatar
🐉

cynder 0cyn

🐉
View GitHub Profile
@0cyn
0cyn / build.ninja
Last active February 9, 2020 08:04
A Build.ninja file generated to sign, link, and compile a libsubstrate tweak. Far from good, but. it exists.
target = .dragon/_/Library/MobileSubstrate/DynamicLibraries/Garden.dylib
builddir = .dragon/build
objdir = .dragon/obj
# We use theos for include headers. You can specify any directory that has the /include/ subdirectory we need.
theosdir = ../theos
cc = clang
ll = clang
lf = -lsubstrate
rule compile
@0cyn
0cyn / wtf.md
Last active February 13, 2020 03:41
wtf.md | List of cryptic crashes I've encountered and solutions for them

List of cryptic crashes I've encountered and solutions for them. Feel free to ctrl+f your error and see if it's here.

[ setExtendedLayoutIncludesOpaqueBars:]: unrecognized selector sent to instance

You've likely entered the wrong NSPrincipalClass inside your prefs' Resources/Info.plist folder. Double check this.


Have something to add? Let me know!

@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;
static UIView *debugView;
static UILabel *debugLabel;
void KRSLog(NSString *log)
{
if (debugLabel) [debugLabel setText:log];
}
%hook UISystemGestureView
-(void)layoutSubviews
{
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
// 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)
static BOOL _pfTweakEnabled = YES;
NSDictionary *prefs = nil;
< Your Tweak Code Here >
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//
//
@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']
#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;
//
// 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"