diff --git a/Application/Dopamine.xcodeproj/project.pbxproj b/Application/Dopamine.xcodeproj/project.pbxproj index d2859f633..755c700d7 100644 --- a/Application/Dopamine.xcodeproj/project.pbxproj +++ b/Application/Dopamine.xcodeproj/project.pbxproj @@ -2235,7 +2235,7 @@ "$(PROJECT_DIR)/Dopamine/Dependencies", "$(PROJECT_DIR)/Dopamine/Resources", ); - MARKETING_VERSION = 2.1.6; + MARKETING_VERSION = 2.1.7; PRODUCT_BUNDLE_IDENTIFIER = com.opa334.Dopamine; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -2273,7 +2273,7 @@ "$(PROJECT_DIR)/Dopamine/Dependencies", "$(PROJECT_DIR)/Dopamine/Resources", ); - MARKETING_VERSION = 2.1.6; + MARKETING_VERSION = 2.1.7; PRODUCT_BUNDLE_IDENTIFIER = com.opa334.Dopamine; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/Application/Dopamine/Jailbreak/DOBootstrapper.m b/Application/Dopamine/Jailbreak/DOBootstrapper.m index 5d714e1be..0f4d2134a 100644 --- a/Application/Dopamine/Jailbreak/DOBootstrapper.m +++ b/Application/Dopamine/Jailbreak/DOBootstrapper.m @@ -17,7 +17,7 @@ #import #import "NSString+Version.h" -#define LIBKRW_DOPAMINE_BUNDLED_VERSION @"2.0.2" +#define LIBKRW_DOPAMINE_BUNDLED_VERSION @"2.0.3" #define LIBROOT_DOPAMINE_BUNDLED_VERSION @"1.0.1" #define BASEBIN_LINK_BUNDLED_VERSION @"1.0.0" diff --git a/Application/Dopamine/UI/DOUIManager.m b/Application/Dopamine/UI/DOUIManager.m index 29cb0735f..cb64bad6c 100644 --- a/Application/Dopamine/UI/DOUIManager.m +++ b/Application/Dopamine/UI/DOUIManager.m @@ -254,7 +254,7 @@ - (void)completeJailbreak [self.logView didComplete]; } -- (void)startLogCapture +- (void)observeFileDescriptor:(int)fd withCallback:(void (^)(char *line))callbackBlock { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ int stdout_pipe[2]; @@ -263,33 +263,28 @@ - (void)startLogCapture return; } - dup2(STDOUT_FILENO, stdout_orig[1]); + dup2(fd, stdout_orig[1]); close(stdout_orig[0]); - dup2(stdout_pipe[1], STDOUT_FILENO); + dup2(stdout_pipe[1], fd); close(stdout_pipe[1]); - char buffer[1024]; + char cur = 0; char line[1024]; int line_index = 0; ssize_t bytes_read; - while ((bytes_read = read(stdout_pipe[0], buffer, sizeof(buffer) - 1)) > 0) { + while ((bytes_read = read(stdout_pipe[0], &cur, sizeof(cur))) > 0) { @autoreleasepool { - // Tee: Write back to the original standard output - write(stdout_orig[1], buffer, bytes_read); - - buffer[bytes_read] = '\0'; // Null terminate to handle as string - for (int i = 0; i < bytes_read; ++i) { - if (buffer[i] == '\n') { - line[line_index] = '\0'; - NSString *str = [NSString stringWithUTF8String:line]; - [self sendLog:str debug:YES]; - line_index = 0; - } else { - if (line_index < sizeof(line) - 1) { - line[line_index++] = buffer[i]; - } + write(stdout_orig[1], &cur, bytes_read); + + if (cur == '\n') { + line[line_index] = '\0'; + callbackBlock(line); + line_index = 0; + } else { + if (line_index < sizeof(line) - 1) { + line[line_index++] = cur; } } } @@ -298,6 +293,19 @@ - (void)startLogCapture }); } +- (void)startLogCapture +{ + [self observeFileDescriptor:STDOUT_FILENO withCallback:^(char *line) { + NSString *str = [NSString stringWithUTF8String:line]; + [self sendLog:str debug:YES]; + }]; + + [self observeFileDescriptor:STDERR_FILENO withCallback:^(char *line) { + NSString *str = [NSString stringWithUTF8String:line]; + [self sendLog:str debug:YES]; + }]; +} + - (NSString *)localizedStringForKey:(NSString*)key { NSString *candidate = NSLocalizedString(key, nil); diff --git a/BaseBin/_external/basebin/.version b/BaseBin/_external/basebin/.version index b6da51221..9671f9a9b 100644 --- a/BaseBin/_external/basebin/.version +++ b/BaseBin/_external/basebin/.version @@ -1 +1 @@ -2.1.6 \ No newline at end of file +2.1.7 \ No newline at end of file diff --git a/Packages/libkrw-provider/control b/Packages/libkrw-provider/control index 3dd34be46..9954b512a 100644 --- a/Packages/libkrw-provider/control +++ b/Packages/libkrw-provider/control @@ -3,9 +3,9 @@ Name: libkrw Plug-in (Dopamine) Author: opa334 Maintainer: opa334 Architecture: iphoneos-arm64 -Version: 2.0.2 +Version: 2.0.3 Provides: libkrw0-plugin -Depends: libiosexec1 (>= 1.3.1), libkrw0 +Depends: libiosexec1 (>= 1.3.1) Section: Libraries Priority: standard Homepage: https://github.com/opa334/Dopamine/tree/main/Packages/libkrw-provider