Skip to content

Instantly share code, notes, and snippets.

@andrewwiik
Created June 6, 2017 01:27
Show Gist options
  • Save andrewwiik/c79afa6944ba0df87cf01f5bf2a7a8bd to your computer and use it in GitHub Desktop.
Save andrewwiik/c79afa6944ba0df87cf01f5bf2a7a8bd to your computer and use it in GitHub Desktop.
iOS 11 Simulator Hooking Code
%hook SBFloatingApplicationController
+ (BOOL)isFloatingApplicationSupported {
return YES;
}
%end
%hook SBFloatingDockController
+ (BOOL)isFloatingDockSupported {
return YES;
}
%end
%hook SBPlatformController
// - (BOOL)isiPadMini {
// return YES;
// }
- (BOOL)isInternalInstall {
return YES;
}
// - (NSString *)productType {
// return @"iPad6,7";
// }
// - (NSString *)hardwareModel {
// return @"iPad6,7";
// }
// - (NSString *)deviceClass {
// return @"iPad";
// }
%end
%hook SBFloatingDockIconListView
+ (NSUInteger)maxIcons {
return 10;
}
+ (NSUInteger)iconColumnsForInterfaceOrientation:(NSInteger)arg1 {
return 10;
}
+ (NSUInteger)maxVisibleIconRowsInterfaceOrientation:(NSInteger)arg1 {
return 10;
}
%end
%hook SBIconController
- (NSUInteger)maxIconCountForDock {
return 10;
}
%end
static BOOL lie = NO;
%hook BSPlatform
-(int)deviceClass {
if (lie) return 2;
else return %orig;
}
%end
%hook UIDevice
-(long long)userInterfaceIdiom {
if (lie) return 1;
else return %orig;
}
%end
%hook SBMainSwitcherViewController
- (void)_loadContentViewControllerIfNecessary {
lie = YES;
%orig;
lie = NO;
}
%end
%hook UIKeyboardPreferencesController
- (BOOL)boolForPreferenceKey:(id)arg1 {
return YES;
}
%end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment