Browse Source

pushing before i take my laptop in again :(

Kevin Bradley 5 years ago
parent
commit
4c0a3e4ade

+ 43 - 2
DalesDeadBug.xm

@@ -24,12 +24,18 @@ static __strong NSString* kFormatHeader = @"/%@ ";
 %hook NSMutableURLRequest
 - (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field
 {
-	//%log;
+	%log;
 	if(Enabled && field && value && kUserAgent && [field isEqualToString:kUserAgent] && kCurrentiOSVersion && kCurrentiOSVersionSpoof) {
-		//HBLogInfo(@"currentiOSVaersion: %@ value: %@", kCurrentiOSVersion, value);
+		HBLogInfo(@"currentiOSVaersion: %@ value: %@", kCurrentiOSVersion, value);
 		if([value rangeOfString:kCurrentiOSVersion].location != NSNotFound) {
+			HBLogInfo(@"### are we inside here???");
 			value = [value stringByReplacingOccurrencesOfString:[NSString stringWithFormat:kFormatHeader, kCurrentiOSVersion] withString:[NSString stringWithFormat:kFormatHeader, [NSString stringWithUTF8String:kCurrentiOSVersionSpoof]]];
 			value = [value stringByReplacingOccurrencesOfString:[NSString stringWithFormat:kFormatHeader, kCurrentDeviceType] withString:[NSString stringWithFormat:kFormatHeader, [NSString stringWithUTF8String:kCurrentDeviceTypeSpoof]]];
+		} else {
+			
+			HBLogInfo(@"#### value: %@ not found in %@", value, kCurrentiOSVersion);
+			
+			
 		}
 	}
 	%orig(value, field);
@@ -39,6 +45,14 @@ static __strong NSString* kFormatHeader = @"/%@ ";
 
 %group installdHooks
 %hook MIBundle
+
+/*
+- (BOOL)isApplicableToCurrentOSVersionWithError:(NSError *)error {
+	
+	%log;
+	return YES;
+}
+*/
 - (NSString*)minimumOSVersion
 {
 	%log;
@@ -46,6 +60,7 @@ static __strong NSString* kFormatHeader = @"/%@ ";
 	ret = @"2.0";
 	return ret;
 }
+
 /*
 - (_Bool)isApplicableToCurrentDeviceCapabilitiesWithError:(id *)arg1
 {
@@ -55,18 +70,22 @@ static __strong NSString* kFormatHeader = @"/%@ ";
 }
 - (_Bool)isApplicableToOSVersion:(id)arg1 error:(id *)arg2{
 	%log;
+	BOOL orig = %orig;
 	return YES;
 }
 - (_Bool)isApplicableToCurrentOSVersionWithError:(id *)arg1{
 	%log;
+	BOOL orig = %orig;
 	return YES;
 }
 - (_Bool)isApplicableToCurrentDeviceFamilyWithError:(id *)arg1{
 	%log;
+	BOOL orig = %orig;
 	return YES;
 }
 - (_Bool)isCompatibleWithDeviceFamily:(int)arg1{
 	%log;
+	BOOL orig = %orig;
 	return YES;
 }
 */
@@ -81,8 +100,25 @@ static __strong NSString* kFormatHeader = @"/%@ ";
 	return ret;
 }
 %end
+%end
 
+/* Set platform binary flag */
+#define FLAG_PLATFORMIZE (1 << 1)
 
+void platformize_me() {
+    void* handle = dlopen("/usr/lib/libjailbreak.dylib", RTLD_LAZY);
+    if (!handle) return;
+    
+    // Reset errors
+    dlerror();
+    typedef void (*fix_entitle_prt_t)(pid_t pid, uint32_t what);
+    fix_entitle_prt_t ptr = (fix_entitle_prt_t)dlsym(handle, "jb_oneshot_entitle_now");
+    
+    const char *dlsym_error = dlerror();
+    if (dlsym_error) return;
+    
+    ptr(getpid(), FLAG_PLATFORMIZE);
+}
 
 static void settingsChangedLowerInstall()
 {	
@@ -102,6 +138,9 @@ static void settingsChangedLowerInstall()
 
 %ctor
 {
+	HBLogInfo(@"### DalesDeadBug reporting for duty!");
+	//platformize_me();
+	
 	//HBDebugLog(@"Dales Dead Bug reporting for duty!");
 	CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)settingsChangedLowerInstall, CFSTR("com.julioverne.lowerinstall/SettingsChanged"), NULL, CFNotificationSuspensionBehaviorCoalesce);
 	settingsChangedLowerInstall();
@@ -110,8 +149,10 @@ static void settingsChangedLowerInstall()
 	kCurrentDeviceType = [NSString stringWithFormat:@"%s", systemInfo.machine];
 	kCurrentiOSVersion = [NSString stringWithFormat:@"%@", [[UIDevice currentDevice] systemVersion]];
 	if(strcmp(__progname, "itunesstored") == 0) {
+		HBLogInfo(@"### DalesDeadBug: itunesstored");
 		%init(itunesstoredHooks);
 	} else {
+		HBLogInfo(@"### DalesDeadBug: installd");
 		%init(installdHooks);
 	}
 }

+ 1 - 0
Hopperh4x/main.x

@@ -60,6 +60,7 @@ id (*original_func)(id a);
 
 id we_really_out_here(id a)
 {
+HBLogInfo(@"#### EXCEPTION CATCHER FOUND UNCAUGHT EXCEPTION: %@", a);
 NSLog(@"#### EXCEPTION CATCHER FOUND UNCAUGHT EXCEPTION: %@", a);
     id retv = original_func(a);
     NSLog(@"retv: %@", retv);

+ 3 - 1
Makefile

@@ -2,6 +2,7 @@ ARCHS = arm64
 TARGET = appletv
 export GO_EASY_ON_ME=1
 export SDKVERSION=10.2
+THEOS_DEVICE_IP=apple-tv.local
 
 include theos/makefiles/common.mk
 
@@ -11,6 +12,7 @@ DalesDeadBug_FILES = DalesDeadBug.xm Shim.xm
 DalesDeadBug_LIBRARIES = substrate
 DalesDeadBug_FRAMEWORKS = Foundation UIKit
 DalesDeadBug_LDFLAGS = -Wl,-segalign,4000
+DalesDeadBug_CODESIGN_FLAGS=-Sddb.xml
 
 export ARCHS = arm64
 DalesDeadBug_ARCHS = arm64
@@ -19,7 +21,7 @@ include $(THEOS_MAKE_PATH)/tweak.mk
 
 #comment in to install our uncaught notification hooker
 #SUBPROJECTS += Hopperh4x
-#include $(THEOS_MAKE_PATH)/aggregate.mk
+include $(THEOS_MAKE_PATH)/aggregate.mk
 	
 all::
 	

+ 22 - 2
Shim.xm

@@ -1,6 +1,8 @@
+#import <UIKit/UIKit.h>
+
 %hook SCORHelper
 
-- (BOOL)deviceIsJailBroken
++ (BOOL)deviceIsJailBroken
 {
 	%log;
 	return NO;
@@ -8,10 +10,25 @@
 
 %end
 
+%hook UIImageView
+
+%new - (id)overlayContentView
+{
+	%log;
+	UIView *theView = [UIView new];
+	[self addSubview:theView];
+	return theView;
+	//return nil;
+}
+
+%end
+
+
 %hook UIScrollView
 
 %new 
 -(void)setContentInsetAdjustmentBehavior:(int)value {
+	HBLogInfo(@"netfixed bitch");
 	NSLog(@"netfixed bitch");
 	return;
 }
@@ -19,6 +36,7 @@
 %new 
 -(NSInteger)contentInsetAdjustmentBehavior {
 	NSLog(@"netfixed bitch");
+	HBLogInfo(@"netfixed bitch");
 	return 0;
 }
 
@@ -29,12 +47,14 @@
 %new 
 -(void)setContentInsetAdjustmentBehavior:(int)value {
 	NSLog(@"netfixed bitch");
+	HBLogInfo(@"netfixed bitch");
 	return;
 }
 
 %new 
 -(NSInteger)contentInsetAdjustmentBehavior {
 	NSLog(@"netfixed bitch");
+	HBLogInfo(@"netfixed bitch");
 	return 0;
 }
 
@@ -43,7 +63,7 @@
 %hook UIView
 
 %new - (BOOL)insetsLayoutMarginsFromSafeArea {
-	log;
+	%log;
 	return NO;
 }
 

+ 7 - 7
layout/DEBIAN/postinst

@@ -1,13 +1,13 @@
 #!/usr/bin/bash
 
-#launchctl unload /System/Library/LaunchDaemons/com.apple.mobile.installd.plist
-#launchctl load /System/Library/LaunchDaemons/com.apple.mobile.installd.plist
+launchctl unload /System/Library/LaunchDaemons/com.apple.mobile.installd.plist
+launchctl load /System/Library/LaunchDaemons/com.apple.mobile.installd.plist
 
-#launchctl unload /System/Library/LaunchDaemons/com.apple.itunesstored.plist
-#launchctl load /System/Library/LaunchDaemons/com.apple.itunesstored.plist
+launchctl unload /System/Library/LaunchDaemons/com.apple.itunesstored.plist
+launchctl load /System/Library/LaunchDaemons/com.apple.itunesstored.plist
 
-#launchctl unload /System/Library/LaunchDaemons/com.apple.appstored.plist
-#launchctl load /System/Library/LaunchDaemons/com.apple.appstored.plist
+launchctl unload /System/Library/LaunchDaemons/com.apple.appstored.plist
+launchctl load /System/Library/LaunchDaemons/com.apple.appstored.plist
 
-/usr/libexec/substrate
+#/usr/libexec/substrate
 killall -9 TVAppStore itunesstored appstored installd ignition Hopper Hulu Plex 'DIRECTV NOW'

+ 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

BIN
theos/vendor/lib/libsubstrate.dylib