Skip to content

Commit

Permalink
v6 beta 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Lrdsnow committed Sep 16, 2024
1 parent 153367a commit 719c7bc
Show file tree
Hide file tree
Showing 16 changed files with 501 additions and 287 deletions.
105 changes: 105 additions & 0 deletions PureKFD/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,112 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Mobile Device Pairing File</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>uwu.lrdsnow.purekfd.mobiledevicepairing</string>
</array>
</dict>
<dict>
<key>CFBundleTypeName</key>
<string>PureKFD Tweak</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>uwu.lrdsnow.purekfd.tweak</string>
</array>
</dict>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.text</string>
</array>
<key>UTTypeDescription</key>
<string>Mobile Device Pairing File</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>uwu.lrdsnow.purekfd.mobiledevicepairing</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>mobiledevicepairing</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.zip-archive</string>
</array>
<key>UTTypeDescription</key>
<string>PureKFD Tweak</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>uwu.lrdsnow.purekfd.tweak</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>purekfd</string>
</array>
</dict>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.text</string>
</array>
<key>UTTypeDescription</key>
<string>Mobile Device Pairing File</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>uwu.lrdsnow.purekfd.mobiledevicepairing</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>mobiledevicepairing</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.zip-archive</string>
</array>
<key>UTTypeDescription</key>
<string>PureKFD Tweak</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>uwu.lrdsnow.purekfd.tweak</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>purekfd</string>
</array>
</dict>
</dict>
</array>
</dict>
</plist>
19 changes: 18 additions & 1 deletion PureKFD/Main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,24 @@ struct ContentView: View {
}
}.onAppear() {
log("Running on an \(DeviceInfo.modelName) (\(DeviceInfo.cpu)) running \(DeviceInfo.osString) \(DeviceInfo.version) (\(DeviceInfo.build))")
}
}.onOpenURL(perform: { url in
if url.pathExtension == "mobiledevicepairing" {
let loading = showLoadingPopup()
url.startAccessingSecurityScopedResource()
defer { url.stopAccessingSecurityScopedResource() }
let fm = FileManager.default
let importedURL = URL.documents.appendingPathComponent("imported")
let pairingFileURL = importedURL.appendingPathComponent("PairingFile")
try? fm.createDirectory(at: importedURL, withIntermediateDirectories: true)
try? fm.removeItem(at: pairingFileURL)
try? fm.copyItem(at: url, to: pairingFileURL)
DispatchQueue.main.async {
loading.dismiss(animated: true) {
showPopup("Success", "Imported Pairing File Successfully")
}
}
}
})
}
}

31 changes: 0 additions & 31 deletions Shared/SparseRestore/Makefile

This file was deleted.

96 changes: 73 additions & 23 deletions Shared/build_sparsebox.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,76 @@
if [ -d "$BUILD_DIR/Libraries" ]; then
echo "Libraries already exist."
if [ -f "$BUILD_DIR/Libraries/platform" ]; then
LAST_PLATFORM=$(cat "$BUILD_DIR/Libraries/platform")
else
LAST_PLATFORM=""
fi

if [ "$EFFECTIVE_PLATFORM_NAME" == "$LAST_PLATFORM" ] && \
[ -f "$BUILD_DIR/Libraries/libEMProxy.dylib" ] && \
[ -f "$BUILD_DIR/Libraries/libimobiledevice.dylib" ]; then
echo "Libraries already exist for the current platform ($EFFECTIVE_PLATFORM_NAME). Skipping build."
exit 0
else
echo "Rebuilding libraries for platform: $EFFECTIVE_PLATFORM_NAME"
fi
else
source ~/.zshrc
cd SparseBox

/bin/sh get_libraries.sh

cp ../SparseRestore/Makefile Makefile
cp ../SparseRestore/include/minimuxer-Bridging-Header.h include/minimuxer-Bridging-Header.h
cp ../SparseRestore/include/list_installed.h include/list_installed.h
cp ../SparseRestore/list_installed.c list_installed.c
cp ../SparseRestore/DeviceManager.m DeviceManager.m
cp ../SparseRestore/include/DeviceManager.h include/DeviceManager.h
cp ../SparseRestore/AppInfo.h AppInfo.h
cp ../SparseRestore/AppInfo.m AppInfo.m

make

mkdir -p $BUILD_DIR/Libraries

mv .theos/obj/debug/libEMProxy.dylib $BUILD_DIR/Libraries/libEMProxy.dylib
mv .theos/obj/debug/libimobiledevice.dylib $BUILD_DIR/Libraries/libimobiledevice.dylib

rm -rf .theos
echo "Building libraries for platform: $EFFECTIVE_PLATFORM_NAME"
fi

source ~/.zshrc
cd SparseBox

/bin/sh get_libraries.sh

echo """
ARCHS := $ARCHS
PACKAGE_FORMAT := ipa
TARGET := $TARGET_PLATFORM
include $THEOS/makefiles/common.mk
LIBRARY_NAME = libEMProxy libimobiledevice
libEMProxy_FILES = lib/empty.swift
libEMProxy_LDFLAGS = -force_load lib/libem_proxy-ios.a -install_name @rpath/libEMProxy.dylib
libEMProxy_FRAMEWORKS = Security
libEMProxy_INSTALL_PATH = /Applications/SparseBox.app/Frameworks
libimobiledevice_FILES = idevicebackup2.c list_installed.c DeviceManager.m AppInfo.m
libimobiledevice_CFLAGS = -Iinclude
libimobiledevice_LDFLAGS = \
-force_load lib/libimobiledevice-1.0.a \
-force_load lib/libimobiledevice-glue-1.0.a \
-force_load lib/libplist-2.0.a \
-force_load lib/libusbmuxd-2.0.a \
-force_load lib/libcrypto.a \
-force_load lib/libssl.a \
-force_load lib/libminimuxer-ios.a \
-Wl \
-install_name @rpath/libimobiledevice.dylib
libimobiledevice_FRAMEWORKS = Foundation Security SystemConfiguration
libimobiledevice_INSTALL_PATH = /Applications/SparseBox.app/Frameworks
include $THEOS/makefiles/library.mk
SparseBox_TARGET =
""" > Makefile

cp ../SparseRestore/include/minimuxer-Bridging-Header.h include/minimuxer-Bridging-Header.h
cp ../SparseRestore/include/list_installed.h include/list_installed.h
cp ../SparseRestore/list_installed.c list_installed.c
cp ../SparseRestore/DeviceManager.m DeviceManager.m
cp ../SparseRestore/include/DeviceManager.h include/DeviceManager.h
cp ../SparseRestore/AppInfo.h AppInfo.h
cp ../SparseRestore/AppInfo.m AppInfo.m

make

mkdir -p $BUILD_DIR/Libraries

mv .theos/obj/debug/libEMProxy.dylib $BUILD_DIR/Libraries/libEMProxy.dylib
mv .theos/obj/debug/libimobiledevice.dylib $BUILD_DIR/Libraries/libimobiledevice.dylib

echo "$EFFECTIVE_PLATFORM_NAME" > "$BUILD_DIR/Libraries/platform"

rm -rf .theos
4 changes: 2 additions & 2 deletions purebox.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@
);
LIBRARY_SEARCH_PATHS = $BUILD_DIR/Libraries;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = uwu.lrdsnow.purekfd.;
PRODUCT_BUNDLE_IDENTIFIER = uwu.lrdsnow.purekfdiOS;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = Shared/Bridge.h;
Expand Down Expand Up @@ -938,7 +938,7 @@
);
LIBRARY_SEARCH_PATHS = $BUILD_DIR/Libraries;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = uwu.lrdsnow.purekfd.;
PRODUCT_BUNDLE_IDENTIFIER = uwu.lrdsnow.purekfdiOS;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = Shared/Bridge.h;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<key>PureRestore.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>2</integer>
</dict>
<key>SparseBox.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
<integer>1</integer>
</dict>
<key>purebox macOS.xcscheme_^#shared#^_</key>
<dict>
Expand Down
9 changes: 5 additions & 4 deletions purekfd/Backend/Exploit/KFD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ class KFD: NSObject {
overwriteFile2(from.path, to.path)
}

@objc public static func endExploit() {
@objc public static func endExploit() -> String? {
SmartKclose()
return nil
}

@objc public static func startExploit(_ json: [String:String]) -> Bool {
@objc public static func startExploit(_ json: [String:String]) -> String? {
do {
if json["useCustomSettings"] == "true" {
var puaf_pages: UInt64? = nil
Expand All @@ -44,9 +45,9 @@ class KFD: NSObject {
} else {
try SmartKopen()
}
return true
return nil
} catch {
return false
return "Failed to kopen"
}
}

Expand Down
Loading

0 comments on commit 719c7bc

Please sign in to comment.