Skip to content

Commit

Permalink
Switch to libgrabkernel2
Browse files Browse the repository at this point in the history
  • Loading branch information
dhinakg committed Apr 23, 2024
1 parent 6c56555 commit 0f00b6b
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 34 deletions.
20 changes: 8 additions & 12 deletions Application/Dopamine.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
04DD0B442B7CBE2E0055DE4F /* DOThemeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 04DD0B432B7CBE2E0055DE4F /* DOThemeManager.m */; };
04DD0B472B7CBEEA0055DE4F /* DOTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 04DD0B462B7CBEEA0055DE4F /* DOTheme.m */; };
04DD0B592B7D19E60055DE4F /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 04DD0B5B2B7D19E60055DE4F /* Localizable.strings */; };
51F19D052BBF456200896361 /* libpartial.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 51AB98D92BBF44390042EA7B /* libpartial.a */; };
8C029F432B4DFD5D0071DE58 /* DOExploitManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C029F422B4DFD5D0071DE58 /* DOExploitManager.m */; };
8C029F462B4DFD910071DE58 /* DOBootstrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C029F452B4DFD910071DE58 /* DOBootstrapper.m */; };
8C029F4E2B4E1FF30071DE58 /* DOExploit.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C029F4D2B4E1FF30071DE58 /* DOExploit.m */; };
Expand Down Expand Up @@ -120,9 +121,7 @@
8CDD08342B4F63E100A32B61 /* kfd.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CDD07B32B4F639100A32B61 /* kfd.m */; };
8CDD08362B4F682000A32B61 /* IOSurface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CDD08352B4F682000A32B61 /* IOSurface.framework */; };
8CDD08382B4F682500A32B61 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CDD08372B4F682500A32B61 /* IOKit.framework */; };
8CDD083F2B4F6D8700A32B61 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CDD08392B4F6D8200A32B61 /* libcurl.a */; };
8CDD08402B4F6D8700A32B61 /* libfragmentzip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CDD083A2B4F6D8200A32B61 /* libfragmentzip.a */; };
8CDD08412B4F6D8700A32B61 /* libgrabkernel.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CDD083B2B4F6D8200A32B61 /* libgrabkernel.a */; };
8CDD08412B4F6D8700A32B61 /* libgrabkernel2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CDD083B2B4F6D8200A32B61 /* libgrabkernel2.a */; };
8CDD08462B4F6DD800A32B61 /* libchoma.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CDD08432B4F6DD800A32B61 /* libchoma.dylib */; };
8CDD08472B4F6DD800A32B61 /* libxpf.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CDD08442B4F6DD800A32B61 /* libxpf.dylib */; };
8CDD08482B4F6DF100A32B61 /* libxpf.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 8CDD08442B4F6DD800A32B61 /* libxpf.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
Expand Down Expand Up @@ -285,6 +284,7 @@
04DD0B5A2B7D19E60055DE4F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
04DD0B5C2B7D1A210055DE4F /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
04DD0B5D2B7D1A210055DE4F /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
51AB98D92BBF44390042EA7B /* libpartial.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpartial.a; path = Dopamine/Dependencies/libpartial.a; sourceTree = "<group>"; };
8C029F412B4DFD5D0071DE58 /* DOExploitManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOExploitManager.h; sourceTree = "<group>"; };
8C029F422B4DFD5D0071DE58 /* DOExploitManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DOExploitManager.m; sourceTree = "<group>"; };
8C029F442B4DFD910071DE58 /* DOBootstrapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOBootstrapper.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -370,9 +370,7 @@
8CDD07B32B4F639100A32B61 /* kfd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = kfd.m; sourceTree = "<group>"; };
8CDD08352B4F682000A32B61 /* IOSurface.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOSurface.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/IOSurface.framework; sourceTree = DEVELOPER_DIR; };
8CDD08372B4F682500A32B61 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/IOKit.framework; sourceTree = DEVELOPER_DIR; };
8CDD08392B4F6D8200A32B61 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = Dopamine/Dependencies/libcurl.a; sourceTree = "<group>"; };
8CDD083A2B4F6D8200A32B61 /* libfragmentzip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfragmentzip.a; path = Dopamine/Dependencies/libfragmentzip.a; sourceTree = "<group>"; };
8CDD083B2B4F6D8200A32B61 /* libgrabkernel.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgrabkernel.a; path = Dopamine/Dependencies/libgrabkernel.a; sourceTree = "<group>"; };
8CDD083B2B4F6D8200A32B61 /* libgrabkernel2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgrabkernel2.a; path = Dopamine/Dependencies/libgrabkernel2.a; sourceTree = "<group>"; };
8CDD08422B4F6DD800A32B61 /* libjailbreak.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libjailbreak.dylib; path = ../BaseBin/.build/libjailbreak.dylib; sourceTree = "<group>"; };
8CDD08432B4F6DD800A32B61 /* libchoma.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libchoma.dylib; path = ../BaseBin/.build/libchoma.dylib; sourceTree = "<group>"; };
8CDD08442B4F6DD800A32B61 /* libxpf.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxpf.dylib; path = ../BaseBin/.build/libxpf.dylib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -406,11 +404,10 @@
8CC139832B53E05300230143 /* IOKit.framework in Frameworks */,
8C029F682B4E31D50071DE58 /* libMobileGestalt.tbd in Frameworks */,
8C46D7252B588973002899DB /* libzstd in Frameworks */,
8CDD08412B4F6D8700A32B61 /* libgrabkernel.a in Frameworks */,
8CDD08412B4F6D8700A32B61 /* libgrabkernel2.a in Frameworks */,
51F19D052BBF456200896361 /* libpartial.a in Frameworks */,
042479E52B66B0DD0082581B /* Preferences.framework in Frameworks */,
8CDD08402B4F6D8700A32B61 /* libfragmentzip.a in Frameworks */,
8C029F662B4E2E970071DE58 /* libcompression.tbd in Frameworks */,
8CDD083F2B4F6D8700A32B61 /* libcurl.a in Frameworks */,
8C58E5592B7EAF8000E3ADAA /* CoreServices.framework in Frameworks */,
8C4ABEB62B52094100B43C9B /* libjailbreak.dylib in Frameworks */,
);
Expand Down Expand Up @@ -612,6 +609,7 @@
8C029F642B4E2E7D0071DE58 /* Frameworks */ = {
isa = PBXGroup;
children = (
51AB98D92BBF44390042EA7B /* libpartial.a */,
8C58E5582B7EAF8000E3ADAA /* CoreServices.framework */,
042479E42B66B0DD0082581B /* Preferences.framework */,
8CDD08372B4F682500A32B61 /* IOKit.framework */,
Expand All @@ -621,9 +619,7 @@
8CDD08442B4F6DD800A32B61 /* libxpf.dylib */,
8C029F672B4E31D50071DE58 /* libMobileGestalt.tbd */,
8C029F652B4E2E7D0071DE58 /* libcompression.tbd */,
8CDD08392B4F6D8200A32B61 /* libcurl.a */,
8CDD083A2B4F6D8200A32B61 /* libfragmentzip.a */,
8CDD083B2B4F6D8200A32B61 /* libgrabkernel.a */,
8CDD083B2B4F6D8200A32B61 /* libgrabkernel2.a */,
8C029F6A2B4E320E0071DE58 /* libz.tbd */,
);
name = Frameworks;
Expand Down
Binary file removed Application/Dopamine/Dependencies/libcurl.a
Binary file not shown.
Binary file removed Application/Dopamine/Dependencies/libfragmentzip.a
Binary file not shown.
Binary file removed Application/Dopamine/Dependencies/libgrabkernel.a
Binary file not shown.
Binary file not shown.
Binary file added Application/Dopamine/Dependencies/libpartial.a
Binary file not shown.
4 changes: 2 additions & 2 deletions Application/Dopamine/Jailbreak/DOEnvironmentManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#import <sys/sysctl.h>
#import <mach-o/dyld.h>
#import <libgrabkernel/libgrabkernel.h>
#import <libgrabkernel2/libgrabkernel2.h>
#import <libjailbreak/info.h>
#import <libjailbreak/codesign.h>
#import <libjailbreak/util.h>
Expand Down Expand Up @@ -539,7 +539,7 @@ - (NSString *)accessibleKernelPath
[[DOUIManager sharedInstance] sendLog:@"Downloading Kernel" debug:NO];
NSString *kernelcachePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/kernelcache"];
if (![[NSFileManager defaultManager] fileExistsAtPath:kernelcachePath]) {
if (grabkernel((char *)kernelcachePath.fileSystemRepresentation, 0) != 0) return nil;
if (grab_kernelcache(kernelcachePath) == false) return nil;
}
return kernelcachePath;
}
Expand Down
2 changes: 0 additions & 2 deletions Application/Dopamine/Jailbreak/DOExploitManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#import "DOEnvironmentManager.h"
#import "DOPreferenceManager.h"

#import <libgrabkernel/libgrabkernel.h>

#define FORCE_PAC_BYPASS 0

@implementation DOExploitManager
Expand Down
18 changes: 0 additions & 18 deletions BaseBin/_external/include/libgrabkernel/libgrabkernel.h

This file was deleted.

20 changes: 20 additions & 0 deletions BaseBin/_external/include/libgrabkernel2/libgrabkernel2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// grabkernel.h
// libgrabkernel2
//
// Created by Alfie on 14/02/2024.
//

#ifndef grabkernel_h
#define grabkernel_h

#include <Foundation/Foundation.h>

bool download_kernelcache(NSString *zipURL, bool isOTA, NSString *outPath);
bool grab_kernelcache(NSString *outPath);

// libgrabkernel compatibility shim
// Note that research kernel grabbing is not currently supported
int grabkernel(char *downloadPath, int isResearchKernel);

#endif /* grabkernel_h */

0 comments on commit 0f00b6b

Please sign in to comment.