TVSettingsTweakViewController.m 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // TVSettingsTweakViewController.m
  3. // nitoTV4
  4. //
  5. // Created by Kevin Bradley on 7/28/18.
  6. // Copyright © 2018 nito. All rights reserved.
  7. //
  8. #import "TVSettingsTweakViewController.h"
  9. @implementation TVSettingsTweakViewController
  10. - (id)loadSettingGroups {
  11. NSMutableArray *_backingArray = [NSMutableArray new];
  12. Class theClass = NSClassFromString(@"DDBSettingsController");
  13. TSKSettingItem *testItem = [TSKSettingItem childPaneItemWithTitle:@"Dales Dead Bug" description:@"You just be careful, Computers have already beaten the Communists at chess. Next thing you know, they'll be beating humans. - Dale Gribble" representedObject:nil keyPath:nil childControllerClass:theClass];
  14. TSKSettingGroup *group = [TSKSettingGroup groupWithTitle:nil settingItems:@[testItem]];
  15. [_backingArray addObject:group];
  16. [self setValue:_backingArray forKey:@"_settingGroups"];
  17. return _backingArray;
  18. }
  19. @end
  20. @interface DDBSettingsController: TSKViewController
  21. @end
  22. @implementation DDBSettingsController
  23. - (id)loadSettingGroups {
  24. /*
  25. +[<TSKSettingItem: 0x1ad71bc88> toggleItemWithTitle:Automatically Update Apps description:(null) representedObject:<TVSettingsPreferenceFacade: 0x1c0438480> keyPath:AutoUpdatesEnabled onTitle:(null) offTitle:(null)]
  26. */
  27. id facade = [[ NSClassFromString(@"TVSettingsPreferenceFacade") alloc] initWithDomain:@"com.nito.dalesdeadbug" notifyChanges:TRUE];
  28. NSMutableArray *_backingArray = [NSMutableArray new];
  29. Class theClass = NSClassFromString(@"TVSettingsGeneralViewController");
  30. TSKSettingItem *toggleItem = [TSKSettingItem toggleItemWithTitle:@"Spoof version" description:@"Enables you to install newer application versions that would normally not be supported on your current tvOS version." representedObject:facade keyPath:@"Enabled" onTitle:nil offTitle:nil];
  31. //TSKSettingItem *textEntryItem = [TSKSettingItem textInputItemWithTitle:@"Tests text entry" description:@"This is a test" representedObject:facade keyPath:@"textTest"];
  32. /*
  33. multiValueItemWithTitle:Apple TV Name description:You can name your Apple TV to make it easy to recognize when you use AirPlay and Home Sharing. representedObject:<TVSettingsDeviceFacade: 0x1c087e2c0> keyPath:name availableValues:(
  34. "Apple TV",
  35. "Living Room",
  36. "Family Room",
  37. Bedroom,
  38. Kitchen,
  39. "Great Room",
  40. Office
  41. )]
  42. */
  43. TSKSettingItem *multiItem = [TSKSettingItem multiValueItemWithTitle:@"Test" description:@"Science" representedObject:facade keyPath:@"SpoofVersion" availableValues:@[@"11.1", @"11.2", @"11.3", @"11.4"]];
  44. TSKSettingGroup *group = [TSKSettingGroup groupWithTitle:nil settingItems:@[toggleItem, multiItem]];
  45. [_backingArray addObject:group];
  46. [self setValue:_backingArray forKey:@"_settingGroups"];
  47. return _backingArray;
  48. }
  49. @end