Skip to content

Instantly share code, notes, and snippets.

@steventroughtonsmith
Created October 14, 2015 06:33
Show Gist options
  • Save steventroughtonsmith/5e9656c0ce56bb60abf1 to your computer and use it in GitHub Desktop.
Save steventroughtonsmith/5e9656c0ce56bb60abf1 to your computer and use it in GitHub Desktop.
iOS 9 Enable Splitscreen Jailbreak Tweak (Theos)
/* How to Hook with Logos
Hooks are written with syntax similar to that of an Objective-C @implementation.
You don't need to #include <substrate.h>, it will be done automatically, as will
the generation of a class list and an automatic constructor.
%hook ClassName
// Hooking a class method
+ (id)sharedInstance {
return %orig;
}
// Hooking an instance method with an argument.
- (void)messageName:(int)argument {
%log; // Write a message about this call, including its class, name and arguments, to the system log.
%orig; // Call through to the original function with its original arguments.
%orig(nil); // Call through to the original function with a custom argument.
// If you use %orig(), you MUST supply all arguments (except for self and _cmd, the automatically generated ones.)
}
// Hooking an instance method with no arguments.
- (id)noArguments {
%log;
id awesome = %orig;
[awesome doSomethingElse];
return awesome;
}
// Always make sure you clean up after yourself; Not doing so could have grave consequences!
%end
*/
@class NSDictionary, NSLock, NSOrderedSet, NSSet, NSString;
@interface SBPlatformController : NSObject
{
long long _defaultIconInfoOnce;
NSDictionary *_defaultStarkIconState;
NSDictionary *_defaultIconState;
NSOrderedSet *_defaultIconStateDisplayIdentifiers;
NSLock *_iconStateDisplayIdentifiersLock;
NSSet *_iconStateDisplayIdentifiers;
NSString *_localizedDeviceName;
_Bool _hasGasGauge;
_Bool _supportsOpenGLES2;
_Bool _internalInstall;
_Bool _carrierInstall;
_Bool _singleCoreDevice;
_Bool _isH4Device;
_Bool _starkDevice;
_Bool _medusaDevice;
_Bool _supportsAllMedusaFeatures;
}
+ (id)uniqueDeviceIdentifier;
+ (id)deviceClass;
+ (id)productType;
+ (id)hardwareModel;
+ (id)systemBuildVersion;
+ (id)sharedInstance;
- (void)_visibleIdentifiersChanged:(id)arg1;
- (void)_loadDefaultIconInfoIfNecessary;
- (_Bool)supportsAllMedusaFeatures;
- (_Bool)isMedusaDevice;
- (_Bool)isStarkDevice;
- (_Bool)isH4Device;
- (_Bool)isSingleCoreDevice;
- (_Bool)isDeveloperInstall;
- (_Bool)isCarrierInstall;
- (_Bool)isInternalInstall;
- (_Bool)supportsOpenGLES2;
- (_Bool)hasGasGauge;
- (id)localizedPlatformName;
- (id)iconStateDisplayIdentifiers;
- (void)registerForIconVisibilityChanges;
- (id)defaultIconStateDisplayIdentifiers;
- (id)defaultStarkIconState;
- (id)defaultIconState;
- (void)dealloc;
- (id)init;
@end
%hook SBPlatformController
- (id)init
{
SBPlatformController *r = %orig();
[r setValue:[NSNumber numberWithBool:YES] forKey:@"_supportsAllMedusaFeatures"];
return r;
}
%end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment