|
@@ -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);
|
|
|
}
|
|
|
}
|