diff --git a/RealRoot.xcodeproj/project.pbxproj b/RealRoot.xcodeproj/project.pbxproj index 7b01b60..6a69cc4 100644 --- a/RealRoot.xcodeproj/project.pbxproj +++ b/RealRoot.xcodeproj/project.pbxproj @@ -350,6 +350,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "MODULE_VERSION=$(MODULE_VERSION)", "PRODUCT_NAME=$(PRODUCT_NAME)", + LILU_CUSTOM_IOKIT_INIT, "$(inherited)", ); HEADER_SEARCH_PATHS = "${PROJECT_DIR}/Lilu.kext/Contents/Resources"; @@ -362,7 +363,7 @@ MODULE_NAME = dev.ploosh.RealRoot; MODULE_START = "$(PRODUCT_NAME)_kern_start"; MODULE_STOP = "$(PRODUCT_NAME)_kern_stop"; - MODULE_VERSION = 1.0.8; + MODULE_VERSION = 1.1.0; OTHER_CFLAGS = ( "-mmmx", "-msse", @@ -378,7 +379,6 @@ "-Wno-ossharedptr-misuse", "-Wno-vla", "-masm=intel", - "-DLILU_CUSTOM_IOKIT_INIT", ); OTHER_LDFLAGS = "-static"; PRODUCT_BUNDLE_IDENTIFIER = dev.ploosh.RealRoot; @@ -400,6 +400,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "MODULE_VERSION=$(MODULE_VERSION)", "PRODUCT_NAME=$(PRODUCT_NAME)", + LILU_CUSTOM_IOKIT_INIT, ); HEADER_SEARCH_PATHS = "${PROJECT_DIR}/Lilu.kext/Contents/Resources"; INFOPLIST_FILE = RealRoot/Info.plist; @@ -412,7 +413,7 @@ MODULE_NAME = dev.ploosh.RealRoot; MODULE_START = "$(PRODUCT_NAME)_kern_start"; MODULE_STOP = "$(PRODUCT_NAME)_kern_stop"; - MODULE_VERSION = 1.0.8; + MODULE_VERSION = 1.1.0; OTHER_CFLAGS = ( "-mmmx", "-msse", @@ -428,7 +429,6 @@ "-Wno-ossharedptr-misuse", "-Wno-vla", "-masm=intel", - "-DLILU_CUSTOM_IOKIT_INIT", ); OTHER_LDFLAGS = "-static"; PRODUCT_BUNDLE_IDENTIFIER = dev.ploosh.RealRoot; diff --git a/RealRoot/kern_realroot.cpp b/RealRoot/kern_realroot.cpp index c280296..263fec9 100644 --- a/RealRoot/kern_realroot.cpp +++ b/RealRoot/kern_realroot.cpp @@ -163,33 +163,16 @@ void PatchSandbox(void *_user, KernelPatcher &patcher, size_t index, mach_vm_add } mach_vm_address_t getKernelBase() { -#ifdef LILU_COMPRESSION_SUPPORT - static constexpr const char *prelinkKernelPaths[7] { - // This is the usual kernel cache place, which often the best thing to use - "/System/Library/Caches/com.apple.kext.caches/Startup/kernelcache", - // Otherwise fallback to one of the prelinked kernels - // Since we always verify the LC_UUID value, trying the kernels could be done in any order. - "/System/Library/PrelinkedKernels/prelinkedkernel", // normal - "/macOS Install Data/Locked Files/Boot Files/prelinkedkernel", // 10.13 installer - "/com.apple.boot.R/prelinkedkernel", // 10.12+ fusion drive installer - "/com.apple.boot.S/System/Library/PrelinkedKernels/prelinkedkernel", // 10.11 fusion drive installer - "/com.apple.recovery.boot/prelinkedkernel", // recovery - "/kernelcache" // 10.7 installer - }; -#endif - static constexpr const char *kernelPaths[2] { "/System/Library/Kernels/kernel", "/mach_kernel" }; static mach_vm_address_t kbase = 0; if (!kbase) { - bool usePrelinkedCache = LILU_COMPRESSION_SUPPORT && WIOKit::usingPrelinkedCache(); - auto info = MachInfo::create(true, "kernel"); if (!info) { return 0; - } else if ((info->init(usePrelinkedCache ? prelinkKernelPaths : kernelPaths, usePrelinkedCache ? arrsize(prelinkKernelPaths) : arrsize(kernelPaths), 0, false)) != KERN_SUCCESS) { + } else if ((info->init(kernelPaths, arrsize(kernelPaths), 0, false)) != KERN_SUCCESS) { return 0; } @@ -219,6 +202,7 @@ void PatchKernel(void *_user, KernelPatcher &patcher) { } void InitRealRoot() { + if (WIOKit::usingPrelinkedCache()) return; // disable in installer/update lilu.onPatcherLoadForce(PatchKernel); lilu.onKextLoadForce(&kextAPFS, 1, PatchAPFS); lilu.onKextLoadForce(&kextSandbox, 1, PatchSandbox);