mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-10 09:40:53 +01:00
Clover.app v1.03 Beta
CloverDaemonNew corections and improvements to mount. Updated de.strings
This commit is contained in:
parent
01f730036f
commit
77ff1c12b1
@ -782,6 +782,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = Clover/Clover.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1.03;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Clover/Frameworks",
|
||||
@ -795,6 +796,7 @@
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Clover/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.03;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.slice.Clover;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
@ -809,6 +811,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = Clover/Clover.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1.03;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Clover/Frameworks",
|
||||
@ -822,6 +825,7 @@
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Clover/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.03;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.slice.Clover;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
@ -2,6 +2,26 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>LSUIElement</key>
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
@ -21,26 +41,6 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.02</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.02</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2019 CloverHackyColor. All rights reserved.</string>
|
||||
<key>NSMainStoryboardFile</key>
|
||||
|
@ -304,6 +304,7 @@
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
GCC_WARN_UNUSED_VARIABLE = NO;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
|
@ -61,14 +61,19 @@ void powerCallback(void *refCon, io_service_t service, natural_t type, void *arg
|
||||
|
||||
- (void)removeNVRAMPlist {
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:@"/nvram.plist"]) {
|
||||
printf("Found /nvram.plist after waking from sleep, removing it:\n");
|
||||
NSError *error = nil;
|
||||
[[NSFileManager defaultManager] removeItemAtPath:@"/nvram.plist" error:&error];
|
||||
if (error == nil) {
|
||||
printf("/nvram.plist correctly removed.\n");
|
||||
} else {
|
||||
printf("%s\n", [[error localizedFailureReason] UTF8String]);
|
||||
printf("Found /nvram.plist after waking from sleep, checking fro Apple GUIDs..\n");
|
||||
NSDictionary *nvram = [NSDictionary dictionaryWithContentsOfFile:@"/nvram.plist"];
|
||||
if (nvram != nil) {
|
||||
NSArray *keys = [nvram allKeys];
|
||||
for (int i = 0; i < [keys count]; i++) {
|
||||
NSString *key = [keys objectAtIndex:i];
|
||||
if ([key hasPrefix:@"8BE4DF61-93CA-11D2-AA0D-00E098032B8C:"]) {
|
||||
printf("/nvram.plist contains %s\n", [key UTF8String]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
@ -9,6 +9,7 @@
|
||||
import Foundation
|
||||
import CoreFoundation
|
||||
|
||||
let daemonVersion = "1.01"
|
||||
let fm = FileManager.default
|
||||
|
||||
/*
|
||||
@ -99,24 +100,36 @@ func saveNVRAM(bootDevice: String, filesystem: String, nvram: NSMutableDictionar
|
||||
echo "Error: nvram not found to a temporary location."
|
||||
exit 0
|
||||
fi
|
||||
launchctl load -F /System/Library/LaunchDaemons/com.apple.diskarbitrationd.plist > /dev/null 2>&1
|
||||
launchctl load -F /System/Library/LaunchDaemons/com.apple.diskmanagementd.plist > /dev/null 2>&1
|
||||
diskutil mount \(bootDevice) > /dev/null 2>&1
|
||||
mp=$(LC_ALL=C mount | egrep "^/dev/\(bootDevice) on" | sed 's/^.* on *//;s/ ([^(]*//')
|
||||
if [[ "${mp}" == "/"* ]]; then
|
||||
cat /tmp/nvramsaved.plist > "${mp}"/nvram.plist
|
||||
echo 'nvram saved to disk with UUID \(uuid)'
|
||||
else
|
||||
mkdir -p '\(mp)'
|
||||
mount -t \(type) /dev/\(bootDevice) '\(mp)'
|
||||
if [ $? -eq 0 ]; then
|
||||
cat /tmp/nvramsaved.plist > '\(mp)/nvram.plist'
|
||||
echo 'nvram saved to disk with UUID \(uuid)'
|
||||
umount -f \(bootDevice) 2>/dev/null
|
||||
if [[ $? -eq 0 ]]; then
|
||||
rm -rf '\(mp)'
|
||||
attempts=1
|
||||
until [ $attempts -ge 11 ]
|
||||
do
|
||||
launchctl load -F /System/Library/LaunchDaemons/com.apple.diskarbitrationd.plist > /dev/null 2>&1
|
||||
launchctl load -F /System/Library/LaunchDaemons/com.apple.diskmanagementd.plist > /dev/null 2>&1
|
||||
sleep 0.2
|
||||
mount -t \(type) /dev/\(bootDevice) '\(mp)' > /dev/null 2>&1
|
||||
sleep 0.3
|
||||
if [ $? -eq 0 ]; then
|
||||
cat /tmp/nvramsaved.plist > '\(mp)/nvram.plist'
|
||||
echo 'nvram saved to disk with UUID \(uuid)'
|
||||
echo "$attempts attempts required."
|
||||
break
|
||||
else
|
||||
attempts=$[$attempts+1]
|
||||
if [ $attempts -eq 11 ]; then
|
||||
echo "Error: \(bootDevice) doesn't want to mount after $attempts attempts, try to save in /."
|
||||
cat /tmp/nvramsaved.plist > /nvram.plist
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "Error: \(bootDevice) doesn't want to mount, try to save in /."
|
||||
cat /tmp/nvramsaved.plist > /nvram.plist
|
||||
fi
|
||||
done
|
||||
fi
|
||||
"""
|
||||
let task = Process()
|
||||
@ -174,9 +187,10 @@ func main() {
|
||||
df.dateFormat = "yyyy-MM-dd hh:mm:ss"
|
||||
var now = df.string(from: Date())
|
||||
print("--------------------------------------------")
|
||||
print("- CloverDaemonNew v\(daemonVersion)")
|
||||
print("- System start at \(now)")
|
||||
print("--------------------------------------------")
|
||||
var powerObserver : PowerObserver? = PowerObserver()
|
||||
var powerObserver : PowerObserver? = PowerObserver() // I want it to be var
|
||||
if let volname = getMediaName(from: "/") {
|
||||
print("root mount point is '/Volumes/\(volname)'")
|
||||
}
|
||||
@ -272,6 +286,7 @@ func main() {
|
||||
now = df.string(from: Date())
|
||||
print("")
|
||||
print("- System power off at \(now)")
|
||||
print("- CloverDaemonNew v\(daemonVersion)")
|
||||
powerObserver = nil // no longer needed
|
||||
doJob()
|
||||
}
|
||||
@ -324,7 +339,9 @@ if CommandLine.arguments.contains("--install") {
|
||||
|
||||
try fm.setAttributes(launchAttr(),
|
||||
ofItemAtPath: "/Library/LaunchDaemons/com.slice.CloverDaemonNew.plist")
|
||||
|
||||
if fm.fileExists(atPath: "/Library/LaunchDaemons/com.slice.CloverDaemonNew.plist") {
|
||||
run(cmd: "launchctl unload /Library/LaunchDaemons/com.slice.CloverDaemonNew.plist")
|
||||
}
|
||||
run(cmd: "launchctl load /Library/LaunchDaemons/com.slice.CloverDaemonNew.plist")
|
||||
run(cmd: "launchctl start /Library/LaunchDaemons/com.slice.CloverDaemonNew.plist")
|
||||
exit(EXIT_SUCCESS)
|
||||
|
@ -15,7 +15,7 @@
|
||||
"Install Clover" = "Clover installieren";
|
||||
"Current Clover revision" = "Aktuelle Clover revision";
|
||||
"Boot device" = "Boot Device";
|
||||
"config path:" = "Config-Pfad:";
|
||||
"config path:" = "Config.plist Pfad:";
|
||||
|
||||
"Clover wants to mount %@" = "Clover möchte %@ mounten";
|
||||
"Clover wants to umount %@" = "Clover möchte %@ unmounten";
|
||||
@ -97,7 +97,7 @@
|
||||
|
||||
"AudioDxe.efi" = "HDA Treiber zur Unterstützung eines Startup Ton.
|
||||
Startup Ton über das Option Menü konfigurieren, inklusiv:
|
||||
Lutstärke und Adio Gerät (nur für unterstützte Audio-Geräte).";
|
||||
Lautstärke und Audio Gerät (nur für unterstützte Audio-Geräte).";
|
||||
|
||||
"FirmwareVolume.efi" = "Erstellt ein FirmwareVolume mit cursor images für FileVault2.";
|
||||
|
||||
@ -160,4 +160,4 @@ Diesen Treiber nur benutzen, wenn es ohne ihn Probleme gibt.";
|
||||
|
||||
"VBoxHfs.efi" = "Treiber für das HFS+ Dateisystem.";
|
||||
|
||||
"VBoxIso9600.efi" = "Treiber für das ISO 9600 Dateisystem.";
|
||||
"VBoxIso9600.efi" = "Treiber für das ISO 9600 Dateisystem.";
|
||||
|
Loading…
Reference in New Issue
Block a user