Răsfoiți Sursa

Merge branch 'saagarjha-master'

osy 4 ani în urmă
părinte
comite
1fba3e0575

+ 7 - 7
Platform/UTMData.swift

@@ -389,16 +389,16 @@ class UTMData: ObservableObject {
         }
     }
     
-    func removeDrive(at: Int, forConfig: UTMConfiguration) throws {
-        let name = forConfig.driveImagePath(for: at)!
-        let path = forConfig.imagesPath.appendingPathComponent(name)
-        
-        if fileManager.fileExists(atPath: path.path) {
-            try fileManager.removeItem(at: path)
+    func removeDrive(at index: Int, for config: UTMConfiguration) throws {
+        if let name = config.driveImagePath(for: index) {
+            let path = config.imagesPath.appendingPathComponent(name);
+            if fileManager.fileExists(atPath: path.path) {
+                try fileManager.removeItem(at: path)
+            }
         }
         
         DispatchQueue.main.async {
-            forConfig.removeDrive(at: at)
+            config.removeDrive(at: index)
         }
     }
     

+ 1 - 1
Platform/UTMJailbreak.m

@@ -175,7 +175,7 @@ static NSDictionary *cached_app_entitlements(void) {
 
 bool jb_has_jit_entitlement(void) {
     NSDictionary *entitlements = cached_app_entitlements();
-    return [entitlements[@"dynamic-codesigning"] boolValue];
+    return [entitlements[@"dynamic-codesigning"] boolValue] || [entitlements[@"com.apple.security.cs.allow-jit"] boolValue];
 }
 
 bool jb_has_cs_execseg_allow_unsigned(void) {

+ 1 - 1
Platform/iOS/VMConfigDrivesView.swift

@@ -103,7 +103,7 @@ struct VMConfigDrivesView: View {
     private func deleteDrives(offsets: IndexSet) {
         data.busyWork {
             for offset in offsets {
-                try data.removeDrive(at: offset, forConfig: config)
+                try data.removeDrive(at: offset, for: config)
             }
         }
     }

+ 1 - 1
Platform/macOS/VMConfigDrivesView.swift

@@ -116,7 +116,7 @@ struct DriveCard: View {
     
     func deleteDrive() {
         data.busyWork {
-            try data.removeDrive(at: index, forConfig: config)
+            try data.removeDrive(at: index, for: config)
         }
     }