Browse Source

way behind on putting up latest changes, honestly not even sure what was last changed. but about to do a massive overhaul and wanted to make sure this was up to date first

Kevin Bradley 5 years ago
parent
commit
7ddb854879

+ 3 - 0
.gitignore

@@ -1 +1,4 @@
 debs*
+worksish
+stupid
+

+ 0 - 6
AppEnabler/AppEnabler.plist

@@ -2,12 +2,6 @@
 	Filter = {
 		Bundles = (
 			"com.apple.PineBoard",
-			"com.apple.Security",
-			"com.apple.MobileCoreServices",
-			"com.apple.PineBoardServices",
-		);
-		Executables = (
-			installd,
 		);
 	};
 }

+ 2 - 1
AppEnabler/Makefile

@@ -11,8 +11,9 @@ AppEnabler_FILES = main.x Whitelist.xm ../PBReloadHelper.m
 AppEnabler_LIBRARIES = substrate
 AppEnabler_FRAMEWORKS = Foundation UIKit CoreGraphics MobileCoreServices
 AppEnabler_LDFLAGS = -undefined dynamic_lookup
+AppEnabler_CODESIGN=ldid2
 #AppEnabler_LIBRARIES += rocketbootstrap
-#AppEnabler_CODESIGN_FLAGS=-Slibrespring.xml
+AppEnabler_CODESIGN_FLAGS=-Slibrespring.xml
 
 include $(THEOS_MAKE_PATH)/tweak.mk
 

+ 42 - 0
AppEnabler/TVSettingsTweakViewController.h

@@ -0,0 +1,42 @@
+//
+//  TVSettingsTweakViewController.h
+//  nitoTV4
+//
+//  Created by Kevin Bradley on 7/28/18.
+//  Copyright © 2018 nito. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@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
+
+@interface TVSettingsTweakViewController : TSKViewController
+
+@end

+ 48 - 0
AppEnabler/TVSettingsTweakViewController.m

@@ -0,0 +1,48 @@
+//
+//  TVSettingsTweakViewController.m
+//  nitoTV4
+//
+//  Created by Kevin Bradley on 7/28/18.
+//  Copyright © 2018 nito. All rights reserved.
+//
+
+#import "TVSettingsTweakViewController.h"
+
+@implementation TVSettingsTweakViewController
+
+
+- (id)loadSettingGroups {
+    
+    NSMutableArray *_backingArray = [NSMutableArray new];
+    Class theClass = NSClassFromString(@"TVSettingsGeneralViewController");
+    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];
+    TSKSettingGroup *group = [TSKSettingGroup groupWithTitle:nil settingItems:@[testItem]];
+    [_backingArray addObject:group];
+    [self setValue:_backingArray forKey:@"_settingGroups"];
+
+    return _backingArray;
+    
+}
+
+@end
+
+@interface DDBSettingsController: TSKViewController
+
+@end
+
+@implementation DDBSettingsController
+
+- (id)loadSettingGroups {
+    
+    NSMutableArray *_backingArray = [NSMutableArray new];
+    Class theClass = NSClassFromString(@"TVSettingsGeneralViewController");
+    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];
+    TSKSettingGroup *group = [TSKSettingGroup groupWithTitle:nil settingItems:@[testItem]];
+    [_backingArray addObject:group];
+    [self setValue:_backingArray forKey:@"_settingGroups"];
+    
+    return _backingArray;
+    
+}
+
+@end

+ 27 - 0
AppEnabler/Whitelist.xm

@@ -7,6 +7,17 @@
 - (id)defaultWorkspace;
 @end
 
+@interface NSDistributedNotificationCenter : NSNotificationCenter
+
++ (id)defaultCenter;
+
+- (void)addObserver:(id)arg1 selector:(SEL)arg2 name:(id)arg3 object:(id)arg4;
+- (void)postNotificationName:(id)arg1 object:(id)arg2 userInfo:(id)arg3;
+
+@end
+
+
+
 %hook PBApplication
 
 %new - (void)openApp:(NSString *)bundleID {
@@ -84,11 +95,27 @@
     
 }
 
+
+%new - (void)delayedNitoTVLaunch:(id)note {
+
+       dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 4 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
+     
+         NSLog(@"opening nitoTV");
+         [self openApp:@"com.nito.nitoTV4"];
+    });
+}
+
 - (_Bool)application:(id)arg1 didFinishLaunchingWithOptions:(id)arg2 {
     
     _Bool orig = %orig;
     %log;
     NSFileManager *man = [NSFileManager defaultManager];
+
+    NSDistributedNotificationCenter* notificationCenter = [NSDistributedNotificationCenter defaultCenter];
+    
+    //NSLog(@"after note center");
+    [notificationCenter addObserver:self  selector:@selector(delayedNitoTVLaunch:) name:@"com.nitoTV.relaunch" object:nil];
+
     NSString *kickstartPath = @"/var/mobile/Library/Preferences/.kickstart";
     if ([man fileExistsAtPath:kickstartPath]){
         NSLog(@"kickstart");

+ 1 - 1
AppEnabler/main.x

@@ -7,6 +7,7 @@
  *
  */
 
+#import <CoreFoundation/CoreFoundation.h>
 #import <Foundation/Foundation.h>
 #include <mach-o/dyld.h>
 #import <objc/runtime.h>
@@ -163,7 +164,6 @@ id we_really_out_here(uint64_t a, uint64_t (^block)(id b1, uint64_t b2, uint64_t
 
 %ctor
 {
-    
 	dlopen("/System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation", RTLD_LAZY);
 	
 	MSImageRef gangshit = MSGetImageByName("/System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation");

+ 2 - 1
Makefile

@@ -4,7 +4,7 @@ export GO_EASY_ON_ME=1
 export SDKVERSION=10.1
 TARGET=appletv:clang:10.1:10.1
 SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS10.1.sdk
-THEOS_DEVICE_IP=atv11.local
+THEOS_DEVICE_IP=btv.local
 
 include theos/makefiles/common.mk
 
@@ -14,6 +14,7 @@ librespring_LIBRARIES = substrate
 #librespring_LIBRARIES += rocketbootstrap
 librespring_FRAMEWORKS = Foundation UIKit CoreGraphics
 #librespring_CODESIGN_FLAGS=-Slibrespring.xml
+librespring_CODESIGN=ldid2
 librespring_Frameworks += WebCore ImageIO Foundation CFNetwork AppSupport UIKit IOKit MobileCoreServices
 #librespring_PRIVATE_FRAMEWORKS = GraphicsServices FMCore
 

+ 11 - 3
PBReloadHelper.m

@@ -363,7 +363,12 @@
         [workspace _LSClearSchemaCaches]; //may or may not be necessary
         [workspace _LSPrivateRebuildApplicationDatabasesForSystemApps:YES internal:YES user:YES];
         [workspace _LSPrivateSyncWithMobileInstallation];
-        [workspace invalidateIconCache:nil];
+        if ([workspace respondsToSelector:@selector(invalidateIconCache:)]){
+            NSLog(@"invalidate icon cache");
+            [workspace invalidateIconCache:nil];
+        } else {
+            NSLog(@"## dont invalidate icon cache??");
+        }
     }
     
     [mutableWhiteList writeToFile:whitelistFile atomically:YES];
@@ -419,7 +424,9 @@
         
         //[@"science" writeToFile:@"/var/mobile/Library/Preferences/itshappening" atomically:YES encoding:NSUTF8StringEncoding error:nil];
         
-        [NSTask launchedTaskWithLaunchPath:whichKill arguments:@[@"-9", @"PineBoard", @"HeadBoard", @"lsd", @"installd"]];
+        [NSTask launchedTaskWithLaunchPath:whichKill arguments:@[@"-9", @"backboardd"]];
+        
+        //[NSTask launchedTaskWithLaunchPath:whichKill arguments:@[@"-9", @"PineBoard", @"HeadBoard", @"lsd", @"installd"]];
     });
     
 }
@@ -815,7 +822,8 @@
             
             //[@"science" writeToFile:@"/var/mobile/Library/Preferences/itshappening" atomically:YES encoding:NSUTF8StringEncoding error:nil];
             
-            [NSTask launchedTaskWithLaunchPath:whichKill arguments:@[@"-9", @"PineBoard", @"HeadBoard", @"lsd"]];
+            [NSTask launchedTaskWithLaunchPath:whichKill arguments:@[@"-9", @"backboardd"]];
+            //[NSTask launchedTaskWithLaunchPath:whichKill arguments:@[@"-9", @"PineBoard", @"HeadBoard", @"lsd"]];
         }
     });
     

+ 0 - 10
control

@@ -1,10 +0,0 @@
-Package: com.nito.uicache
-Name: uicache
-Pre-Depends: cy+model.appletv
-Depends:
-Version: 0.0.2
-Architecture: appletvos-arm64
-Description: Respring and reload any applications added to /Applications
-Maintainer: Kevin Bradley
-Author: Kevin Bradley
-Section: Library

+ 1 - 1
theos/makefiles/platform/Cygwin.mk

@@ -1 +1 @@
-include $(THEOS_MAKE_PATH)/platform/Windows.mk
+include $(THEOS_MAKE_PATH)/platform/Windows.mk

+ 1 - 1
theos/makefiles/targets/Darwin-arm/iphone.mk

@@ -82,7 +82,7 @@ TARGET_LD ?= $(_THEOS_TARGET_CXX)
 TARGET_STRIP ?= strip
 TARGET_STRIP_FLAGS ?= -x
 TARGET_CODESIGN_ALLOCATE ?= codesign_allocate
-TARGET_CODESIGN ?= ldid
+TARGET_CODESIGN ?= ldid2
 TARGET_CODESIGN_FLAGS ?= -S
 
 TARGET_PRIVATE_FRAMEWORK_PATH = $(SYSROOT)/System/Library/PrivateFrameworks

+ 1 - 1
theos/makefiles/targets/Darwin/appletv.mk

@@ -42,7 +42,7 @@ ISYSROOT ?= $(SYSROOT)
 endif
 
 TARGET_STRIP_FLAGS ?= -x
-TARGET_CODESIGN ?= ldid
+TARGET_CODESIGN ?= ldid2
 TARGET_CODESIGN_FLAGS ?= -S
 
 TARGET_PRIVATE_FRAMEWORK_PATH = $(SYSROOT)/System/Library/PrivateFrameworks

+ 1 - 1
theos/makefiles/targets/Darwin/iphone.mk

@@ -82,7 +82,7 @@ TARGET_LD ?= xcrun -sdk iphoneos $(_THEOS_TARGET_CXX)
 TARGET_STRIP ?= xcrun -sdk iphoneos strip
 TARGET_STRIP_FLAGS ?= -x
 TARGET_CODESIGN_ALLOCATE ?= "$(shell xcrun -sdk iphoneos -find codesign_allocate)"
-TARGET_CODESIGN ?= ldid
+TARGET_CODESIGN ?= ldid2
 TARGET_CODESIGN_FLAGS ?= -S
 
 TARGET_PRIVATE_FRAMEWORK_PATH = $(SYSROOT)/System/Library/PrivateFrameworks

+ 1 - 1
theos/makefiles/targets/Darwin/watchos.mk

@@ -43,7 +43,7 @@ ISYSROOT ?= $(SYSROOT)
 endif
 
 TARGET_STRIP_FLAGS ?= -x
-TARGET_CODESIGN ?= ldid
+TARGET_CODESIGN ?= ldid2
 TARGET_CODESIGN_FLAGS ?= -S
 
 TARGET_PRIVATE_FRAMEWORK_PATH = $(SYSROOT)/System/Library/PrivateFrameworks

+ 1 - 1
theos/makefiles/targets/Linux/iphone.mk

@@ -87,7 +87,7 @@ TARGET_LD ?= $(PREFIX)$(_THEOS_TARGET_CXX)
 TARGET_STRIP ?= $(PREFIX)strip
 TARGET_STRIP_FLAGS ?= -x
 TARGET_CODESIGN_ALLOCATE ?= $(PREFIX)codesign_allocate
-TARGET_CODESIGN ?= $(SDKBINPATH)/ldid
+TARGET_CODESIGN ?= $(SDKBINPATH)/ldid2
 TARGET_CODESIGN_FLAGS ?= -S
 
 TARGET_PRIVATE_FRAMEWORK_PATH = $(SYSROOT)/System/Library/PrivateFrameworks

+ 1 - 1
theos/makefiles/targets/Windows/iphone.mk

@@ -87,7 +87,7 @@ TARGET_LD ?= $(PREFIX)$(_THEOS_TARGET_CXX)
 TARGET_STRIP ?= $(PREFIX)strip
 TARGET_STRIP_FLAGS ?= -x
 TARGET_CODESIGN_ALLOCATE ?= $(PREFIX)codesign_allocate
-TARGET_CODESIGN ?= $(SDKBINPATH)/ldid
+TARGET_CODESIGN ?= $(SDKBINPATH)/ldid2
 TARGET_CODESIGN_FLAGS ?= -S
 
 TARGET_PRIVATE_FRAMEWORK_PATH = $(SYSROOT)/System/Library/PrivateFrameworks

+ 1 - 0
uicache/Makefile

@@ -8,6 +8,7 @@ uicache_FILES = uicache.m
 uicache_CFLAGS += -fvisibility=hidden
 uicache_INSTALL_PATH = /usr/bin
 uicache_CODESIGN_FLAGS=-Suicache.xml
+uicache_CODESIGN=ldid2
 #uicache_LIBRARIES += rocketbootstrap
 uicache_Frameworks += WebCore ImageIO Foundation CFNetwork AppSupport UIKit IOKit MobileCoreServices
 #uicache_PRIVATE_FRAMEWORKS = GraphicsServices FMCore