9 icons per page aren't enough for me!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
3.3KB

  1. //I needed more room in my folders so here it is...
  2. //piracy protection
  3. @interface SBCoverSheetPrimarySlidingViewController : UIViewController
  4. - (void)viewDidDisappear:(BOOL)arg1;
  5. - (void)viewDidAppear:(BOOL)arg1;
  6. @end
  7. BOOL dpkgInvalid = NO;
  8. %hook SBCoverSheetPrimarySlidingViewController
  9. - (void)viewDidDisappear:(BOOL)arg1 {
  10. %orig; // Thanks to Nepeta for the DRM
  11. if (!dpkgInvalid) return;
  12. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Pirate Detected!"
  13. message:@"Seriously? Pirating a free Tweak is awful!\nPiracy repo's Tweaks could contain Malware if you didn't know that, so go ahead and get 4x3Folders from the official Source https://Burrit0z.github.io/repo/.\nIf you're seeing this but you got it from the official source then make sure to add https://Burrit0z.github.io/repo to Cydia or Sileo."
  14. preferredStyle:UIAlertControllerStyleAlert];
  15. UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * action) {
  16. UIApplication *application = [UIApplication sharedApplication];
  17. [application openURL:[NSURL URLWithString:@"https://Burrit0z.github.io/repo"] options:@{} completionHandler:nil];
  18. }];
  19. [alertController addAction:cancelAction];
  20. [self presentViewController:alertController animated:YES completion:nil];
  21. }
  22. %end
  23. //ios 13
  24. %hook SBIconListFlowLayout
  25. - (NSUInteger)numberOfColumnsForOrientation:(NSInteger)arg1 {
  26. return 4;
  27. }
  28. %end
  29. //ios 12 and lower
  30. %hook SBFolderIconListView
  31. +(unsigned long long)iconColumnsForInterfaceOrientation:(long long)arg1 {
  32. return (4);
  33. }
  34. %end
  35. %ctor {
  36. if (![NSProcessInfo processInfo]) return;
  37. NSString *processName = [NSProcessInfo processInfo].processName;
  38. bool isSpringboard = [@"SpringBoard" isEqualToString:processName];
  39. // Someone smarter than Nepeta invented this.
  40. // https://www.reddit.com/r/jailbreak/comments/4yz5v5/questionremote_messages_not_enabling/d6rlh88/
  41. bool shouldLoad = NO;
  42. NSArray *args = [[NSClassFromString(@"NSProcessInfo") processInfo] arguments];
  43. NSUInteger count = args.count;
  44. if (count != 0) {
  45. NSString *executablePath = args[0];
  46. if (executablePath) {
  47. NSString *processName = [executablePath lastPathComponent];
  48. BOOL isApplication = [executablePath rangeOfString:@"/Application/"].location != NSNotFound || [executablePath rangeOfString:@"/Applications/"].location != NSNotFound;
  49. BOOL isFileProvider = [[processName lowercaseString] rangeOfString:@"fileprovider"].location != NSNotFound;
  50. BOOL skip = [processName isEqualToString:@"AdSheet"]
  51. || [processName isEqualToString:@"CoreAuthUI"]
  52. || [processName isEqualToString:@"InCallService"]
  53. || [processName isEqualToString:@"MessagesNotificationViewService"]
  54. || [executablePath rangeOfString:@".appex/"].location != NSNotFound;
  55. if ((!isFileProvider && isApplication && !skip) || isSpringboard) {
  56. shouldLoad = YES;
  57. }
  58. }
  59. }
  60. if (!shouldLoad) return;
  61. dpkgInvalid = ![[NSFileManager defaultManager] fileExistsAtPath:@"/var/lib/dpkg/info/com.burritoz.4x3folders.list"];
  62. if (!dpkgInvalid) dpkgInvalid = ![[NSFileManager defaultManager] fileExistsAtPath:@"/var/lib/dpkg/info/com.burritoz.4x3folders.md5sums"];
  63. }