Browse Source

added settings bundle, updated the project to no longer include the settings tweaking, still need to update the control file and update the preferences to actually spoof the version set via the UI, bit of unfinished flux ATM

Kevin Bradley 5 years ago
parent
commit
b4dbbb33b5

+ 2 - 0
DalesDeadBug.xm

@@ -144,6 +144,7 @@ static void settingsChangedLowerInstall()
 }
 
 %group settingsHooks
+/*
 %hook TVSettingsMainViewController
 
 - (id)loadSettingGroups {
@@ -167,6 +168,7 @@ static void settingsChangedLowerInstall()
 }
 
 %end
+*/
 %end
 
 %ctor

+ 3 - 3
Makefile

@@ -2,13 +2,13 @@ ARCHS = arm64
 TARGET = appletv
 export GO_EASY_ON_ME=1
 export SDKVERSION=10.2
-THEOS_DEVICE_IP=192.168.0.13
+THEOS_DEVICE_IP=etv.local
 
 include theos/makefiles/common.mk
 
 TWEAK_NAME = DalesDeadBug
 
-DalesDeadBug_FILES = DalesDeadBug.xm Shim.xm TVSettingsTweakViewController.m
+DalesDeadBug_FILES = DalesDeadBug.xm Shim.xm
 DalesDeadBug_LIBRARIES = substrate
 DalesDeadBug_FRAMEWORKS = Foundation UIKit TVSettingKit
 DalesDeadBug_CFLAGS += -I.
@@ -22,7 +22,7 @@ DalesDeadBug_ARCHS = arm64
 include $(THEOS_MAKE_PATH)/tweak.mk
 
 #comment in to install our uncaught notification hooker
-#SUBPROJECTS += Hopperh4x
+SUBPROJECTS += Hopperh4x ddbsettings
 include $(THEOS_MAKE_PATH)/aggregate.mk
 	
 all::

+ 16 - 0
Shim.xm

@@ -60,6 +60,22 @@
 
 %end
 
+%hook UITextField
+
+ -(void)setTextContentType:(id)arg1 {
+	
+	%log;
+	 @try {
+		%orig;
+	    } @catch (NSException *exception) {
+		
+			HBLogInfo(@"exception: %@", exception);
+	    }
+	
+}
+
+%end
+
 %hook UIView
 
 %new - (BOOL)insetsLayoutMarginsFromSafeArea {

+ 21 - 1
TVSettingsTweakViewController.m

@@ -45,7 +45,27 @@
     NSMutableArray *_backingArray = [NSMutableArray new];
     Class theClass = NSClassFromString(@"TVSettingsGeneralViewController");
     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];
-    TSKSettingGroup *group = [TSKSettingGroup groupWithTitle:nil settingItems:@[toggleItem]];
+    //TSKSettingItem *textEntryItem = [TSKSettingItem textInputItemWithTitle:@"Tests text entry" description:@"This is a test" representedObject:facade keyPath:@"textTest"];
+    /*
+     
+     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:(
+     "Apple TV",
+     "Living Room",
+     "Family Room",
+     Bedroom,
+     Kitchen,
+     "Great Room",
+     Office
+     )]
+
+     
+     */
+    
+    
+    
+
+    TSKSettingItem *multiItem = [TSKSettingItem multiValueItemWithTitle:@"Test" description:@"Science" representedObject:facade keyPath:@"version" availableValues:@[@"11.1", @"11.2", @"11.3", @"11.4"]];
+    TSKSettingGroup *group = [TSKSettingGroup groupWithTitle:nil settingItems:@[toggleItem, multiItem]];
     [_backingArray addObject:group];
     [self setValue:_backingArray forKey:@"_settingGroups"];
     

+ 11 - 0
ddbsettings/DDBSettingsController.h

@@ -0,0 +1,11 @@
+//#import <Preferences/PSListController.h>
+//
+//@interface DDBRootListController : PSListController
+//
+//@end
+#import "prefs.h"
+
+
+@interface DDBSettingsController: TSKViewController
+
+@end

+ 60 - 0
ddbsettings/DDBSettingsController.m

@@ -0,0 +1,60 @@
+//#include "DDBRootListController.h"
+//
+//@implementation DDBRootListController
+//
+//- (NSArray *)specifiers {
+//    if (!_specifiers) {
+//        _specifiers = [[self loadSpecifiersFromPlistName:@"Root" target:self] retain];
+//    }
+//
+//    return _specifiers;
+//}
+//
+//@end
+
+#import "DDBSettingsController.h"
+
+
+@implementation DDBSettingsController
+
+- (id)loadSettingGroups {
+    
+    /*
+     
+     +[<TSKSettingItem: 0x1ad71bc88> toggleItemWithTitle:Automatically Update Apps description:(null) representedObject:<TVSettingsPreferenceFacade: 0x1c0438480> keyPath:AutoUpdatesEnabled onTitle:(null) offTitle:(null)]
+     */
+    
+    id facade = [[ NSClassFromString(@"TVSettingsPreferenceFacade") alloc] initWithDomain:@"com.nito.dalesdeadbug" notifyChanges:TRUE];
+    
+    
+    NSMutableArray *_backingArray = [NSMutableArray new];
+    TSKSettingItem *toggleItem = [TSKSettingItem toggleItemWithTitle:@"Version spoofing" description:@"Whether or not to spoof a higher OS version to install officially unsupported application versions. " representedObject:facade keyPath:@"Enabled" onTitle:nil offTitle:nil];
+    //TSKSettingItem *textEntryItem = [TSKSettingItem textInputItemWithTitle:@"Tests text entry" description:@"This is a test" representedObject:facade keyPath:@"textTest"];
+    /*
+     
+     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:(
+     "Apple TV",
+     "Living Room",
+     "Family Room",
+     Bedroom,
+     Kitchen,
+     "Great Room",
+     Office
+     )]
+     
+     
+     */
+    
+    
+    
+    
+    TSKSettingItem *multiItem = [TSKSettingItem multiValueItemWithTitle:@"Spoofed Version" description:@"The version you are going to spoof." representedObject:facade keyPath:@"version" availableValues:@[@"11.1", @"11.2", @"11.3", @"11.4"]];
+    TSKSettingGroup *group = [TSKSettingGroup groupWithTitle:nil settingItems:@[toggleItem, multiItem]];
+    [_backingArray addObject:group];
+    [self setValue:_backingArray forKey:@"_settingGroups"];
+    
+    return _backingArray;
+    
+}
+
+@end

+ 20 - 0
ddbsettings/Makefile

@@ -0,0 +1,20 @@
+ARCHS = arm64
+TARGET = appletv
+export GO_EASY_ON_ME=1
+export SDKVERSION=10.2
+THEOS_DEVICE_IP=etv.local
+
+include $(THEOS)/makefiles/common.mk
+
+BUNDLE_NAME = DDBSettings
+DDBSettings_FILES = DDBSettingsController.m
+DDBSettings_INSTALL_PATH = /Library/PreferenceBundles
+DDBSettings_FRAMEWORKS = UIKit TVSettingKit
+DDBSettings_PRIVATE_FRAMEWORKS = Preferences
+DDBSettings_LDFLAGS = -undefined dynamic_lookup
+
+include $(THEOS_MAKE_PATH)/bundle.mk
+
+internal-stage::
+	$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END)
+	$(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/DDBSettings.plist$(ECHO_END)

+ 24 - 0
ddbsettings/Resources/Info.plist

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>DDBSettings</string>
+	<key>CFBundleIdentifier</key>
+	<string>com.nito.ddbsettings</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundlePackageType</key>
+	<string>BNDL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0.0</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>1.0</string>
+	<key>NSPrincipalClass</key>
+	<string>DDBSettingsController</string>
+</dict>
+</plist>

+ 29 - 0
ddbsettings/Resources/Root.plist

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>items</key>
+	<array>
+		<dict>
+			<key>cell</key>
+			<string>PSGroupCell</string>
+			<key>label</key>
+			<string>DDBSettings First Page</string>
+		</dict>
+		<dict>
+			<key>cell</key>
+			<string>PSSwitchCell</string>
+			<key>default</key>
+			<true/>
+			<key>defaults</key>
+			<string>com.nito.ddbsettings</string>
+			<key>key</key>
+			<string>AwesomeSwitch1</string>
+			<key>label</key>
+			<string>Awesome Switch 1</string>
+		</dict>
+	</array>
+	<key>title</key>
+	<string>DDBSettings</string>
+</dict>
+</plist>

+ 23 - 0
ddbsettings/entry.plist

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>entry</key>
+	<dict>
+		<key>bundle</key>
+		<string>DDBSettings</string>
+		<key>cell</key>
+		<string>PSLinkCell</string>
+		<key>detail</key>
+		<string>DDBSettingsController</string>
+		<key>icon</key>
+		<string>icon.png</string>
+		<key>isController</key>
+		<true/>
+		<key>label</key>
+		<string>Dales Dead Bug</string>
+		<key>description</key>
+		<string>You just be careful, Computers have already beaten the Communists at chess. Next thing you know, they&apos;ll be beating humans. - Dale Gribble</string>
+	</dict>
+</dict>
+</plist>

+ 47 - 0
ddbsettings/prefs.h

@@ -0,0 +1,47 @@
+#import <UIKit/UIKit.h>
+
+@interface TVSettingsPreferenceFacade : NSObject
+{
+    NSString *_domain;    // 16 = 0x10
+    NSString *_containerPath;    // 24 = 0x18
+}
+
+@property(readonly, copy, nonatomic) NSString *containerPath; // @synthesize containerPath=_containerPath;
+@property(readonly, copy, nonatomic) NSString *domain; // @synthesize domain=_domain;
+
+- (id)valueForUndefinedKey:(id)arg1;    // IMP=0x0000000100011ce0
+- (void)setValue:(id)arg1 forUndefinedKey:(id)arg2;    // IMP=0x0000000100011b98
+- (id)_initWithDomain:(id)arg1 containerPath:(id)arg2 notifyChanges:(_Bool)arg3;    // IMP=0x0000000100011a44
+- (id)initWithDomain:(id)arg1 notifyChanges:(_Bool)arg2;    // IMP=0x0000000100011a30
+- (id)initWithDomain:(id)arg1 containerPath:(id)arg2;    // IMP=0x00000001000119d0
+
+@end
+
+@interface TSKSettingItem: NSObject
++(id)childPaneItemWithBundle:(id)arg1 representedObject:(id)arg2 ;
++(id)valueForSettingItem:(id)arg1 ;
++(void)setValue:(id)arg1 forSettingItem:(id)arg2 ;
++(id)actionItemWithTitle:(id)arg1 description:(id)arg2 representedObject:(id)arg3 keyPath:(id)arg4 target:(id)arg5 action:(SEL)arg6 ;
++(id)childPaneItemWithTitle:(id)arg1 description:(id)arg2 representedObject:(id)arg3 keyPath:(id)arg4 childControllerClass:(Class)arg5 ;
++(id)childPaneItemWithTitle:(id)arg1 description:(id)arg2 representedObject:(id)arg3 keyPath:(id)arg4 childControllerBlock:(/*^block*/id)arg5 ;
++(id)childPaneItemWithBundle:(id)arg1 ;
++(id)titleItemWithTitle:(id)arg1 description:(id)arg2 representedObject:(id)arg3 keyPath:(id)arg4 ;
++(id)textInputItemWithTitle:(id)arg1 description:(id)arg2 representedObject:(id)arg3 keyPath:(id)arg4 ;
++(id)toggleItemWithTitle:(id)arg1 description:(id)arg2 representedObject:(id)arg3 keyPath:(id)arg4 onTitle:(id)arg5 offTitle:(id)arg6 ;
++(id)multiValueItemWithTitle:(id)arg1 description:(id)arg2 representedObject:(id)arg3 keyPath:(id)arg4 availableValues:(id)arg5 ;
+@end
+
+@interface TSKSettingGroup : TSKSettingItem
+@property (nonatomic,copy) NSArray * settingItems;
++(id)groupWithTitle:(id)arg1 settingItems:(id)arg2;
+@end
+
+@interface TSKTableViewController : UITableViewController
+
+@end
+
+@interface TSKViewController: TSKTableViewController
+
+-(id)loadSettingGroups;
+@property (nonatomic,copy,readonly) NSArray * settingGroups;
+@end