]> granicus.if.org Git - handbrake/commitdiff
MacGui: initial sandbox support. Added two new scheme RELEASE-SANDBOX and DEBUG-SANDB...
authorDamiano Galassi <damiog@gmail.com>
Fri, 20 Jan 2017 17:52:22 +0000 (18:52 +0100)
committerDamiano Galassi <damiog@gmail.com>
Fri, 20 Jan 2017 17:52:22 +0000 (18:52 +0100)
23 files changed:
macosx/English.lproj/MainWindow.xib
macosx/HBChapterTitlesController.m
macosx/HBController.m
macosx/HBCore.m
macosx/HBDistributedArray.m
macosx/HBJob+HBJobConversion.m
macosx/HBJob+UIAdditions.m
macosx/HBJob.h
macosx/HBJob.m
macosx/HBJobOutputFileWriter.m
macosx/HBPreferencesController.m
macosx/HBPreviewGenerator.m
macosx/HBQueueController.m
macosx/HBUtilities.h
macosx/HBUtilities.m
macosx/HandBrake.entitlements [new file with mode: 0644]
macosx/HandBrake.xcodeproj/project.pbxproj
macosx/HandBrake.xcodeproj/xcshareddata/xcschemes/HandBrake [DEBUG-SANDBOX].xcscheme [new file with mode: 0644]
macosx/HandBrake.xcodeproj/xcshareddata/xcschemes/HandBrake [DEBUG].xcscheme
macosx/HandBrake.xcodeproj/xcshareddata/xcschemes/HandBrake [RELEASE-SANDBOX].xcscheme [new file with mode: 0644]
macosx/HandBrake.xcodeproj/xcshareddata/xcschemes/HandBrake [RELEASE].xcscheme
macosx/HandBrakeKitTests/HBJobTests.m
macosx/container-migration.plist [new file with mode: 0644]

index 198ea7caace0049b1cba7354d0620f933bfdc25c..fe73cb2702fac6b6f6b27eb2b7e0c52b20f390d8 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D30a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
     <dependencies>
         <deployment identifier="macosx"/>
         <development version="7000" identifier="xcode"/>
                             </binding>
                         </connections>
                     </textField>
-                    <textField verticalHuggingPriority="750" id="1552">
-                        <rect key="frame" x="5" y="454" width="47" height="17"/>
+                    <textField verticalHuggingPriority="750" misplaced="YES" id="1552">
+                        <rect key="frame" x="17" y="458" width="48" height="14"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-                        <textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="File:" id="4913">
+                        <textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Save as:" id="4913">
                             <font key="font" metaFont="smallSystem"/>
                             <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                             <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                             <binding destination="-2" name="content" keyPath="self.job.containers" id="aNr-1N-DaN"/>
                         </connections>
                     </popUpButton>
-                    <button toolTip="Browse to select a new destination path and file name for your encode." verticalHuggingPriority="750" id="1562">
-                        <rect key="frame" x="815" y="450" width="90" height="28"/>
-                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
-                        <buttonCell key="cell" type="push" title="Browse…" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" inset="2" id="4920">
-                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                            <font key="font" metaFont="smallSystem"/>
-                        </buttonCell>
-                        <accessibility description="Browse Destination"/>
-                        <connections>
-                            <action selector="browseDestination:" target="-2" id="FqS-ZD-MaJ"/>
-                            <binding destination="-2" name="enabled" keyPath="self.job" id="uGd-Ul-eBq">
-                                <dictionary key="options">
-                                    <string key="NSValueTransformerName">NSIsNotNil</string>
-                                </dictionary>
-                            </binding>
-                        </connections>
-                    </button>
                     <box verticalHuggingPriority="750" boxType="separator" id="1623">
                         <rect key="frame" x="98" y="490" width="802" height="5"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
                             <accessibilityConnection property="title" destination="1538" id="rra-Xj-yD0"/>
                         </connections>
                     </textField>
-                    <textField toolTip="Destination path, including directory and file name. This is where your new video will be created, and what it will be named." verticalHuggingPriority="750" id="1561">
-                        <rect key="frame" x="56" y="455" width="756" height="19"/>
+                    <textField toolTip="File name. This is what your new video will be named." verticalHuggingPriority="750" misplaced="YES" id="1561">
+                        <rect key="frame" x="71" y="455" width="395" height="19"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
                         <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" continuous="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="4919">
                             <font key="font" metaFont="smallSystem"/>
                                     <string key="NSValueTransformerName">NSIsNotNil</string>
                                 </dictionary>
                             </binding>
-                            <binding destination="-2" name="value" keyPath="self.job.destURL" id="5zX-7b-Y0f">
+                            <binding destination="-2" name="value" keyPath="self.job.outputFileName" id="cct-2d-Ycx">
                                 <dictionary key="options">
                                     <bool key="NSContinuouslyUpdatesValue" value="YES"/>
-                                    <string key="NSValueTransformerName">HBURLTransformer</string>
                                 </dictionary>
                             </binding>
                         </connections>
@@ -604,6 +586,46 @@ Blu-ray and DVD sources often have multiple titles, the longest of which is typi
                             </binding>
                         </connections>
                     </popUpButton>
+                    <pathControl verticalHuggingPriority="750" misplaced="YES" allowsExpansionToolTips="YES" id="PJi-21-hie">
+                        <rect key="frame" x="523" y="455" width="311" height="20"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <pathCell key="cell" controlSize="small" selectable="YES" alignment="left" id="5Bk-66-HFW">
+                            <font key="font" metaFont="smallSystem"/>
+                            <url key="url" string="file://localhost/Applications/"/>
+                        </pathCell>
+                        <connections>
+                            <binding destination="-2" name="value" keyPath="self.job.outputURL" id="FQU-UV-RCI"/>
+                        </connections>
+                    </pathControl>
+                    <button toolTip="Browse to select a new destination path and file name for your encode." verticalHuggingPriority="750" misplaced="YES" id="1562">
+                        <rect key="frame" x="831" y="450" width="74" height="28"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
+                        <buttonCell key="cell" type="push" title="Browse…" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" inset="2" id="4920">
+                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                            <font key="font" metaFont="smallSystem"/>
+                        </buttonCell>
+                        <accessibility description="Browse Destination"/>
+                        <connections>
+                            <action selector="browseDestination:" target="-2" id="FqS-ZD-MaJ"/>
+                            <binding destination="-2" name="enabled" keyPath="self.job" id="uGd-Ul-eBq">
+                                <dictionary key="options">
+                                    <string key="NSValueTransformerName">NSIsNotNil</string>
+                                </dictionary>
+                            </binding>
+                        </connections>
+                    </button>
+                    <textField verticalHuggingPriority="750" misplaced="YES" id="gfs-4j-YSE">
+                        <rect key="frame" x="477" y="458" width="40" height="14"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="To:" id="rfK-nQ-Aq2">
+                            <font key="font" metaFont="smallSystem"/>
+                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                        <connections>
+                            <binding destination="-2" name="textColor" keyPath="self.labelColor" id="dvP-fr-nOv"/>
+                        </connections>
+                    </textField>
                 </subviews>
             </view>
             <toolbar key="toolbar" implicitIdentifier="E92CA47A-01F7-432A-A61C-28FE4D58C2CD" explicitIdentifier="HBMainWindowToolbar" displayMode="iconAndLabel" sizeMode="regular" id="7g3-gy-bUl">
index cedc1088a2583c1ae9464b8aa862bca256025705..4c40ad58a51db3a232a17abaaa7b61b55f751e95 100644 (file)
     NSSavePanel *panel = [NSSavePanel savePanel];
     panel.allowedFileTypes = @[@"csv"];
     panel.directoryURL = destinationDirectory;
-    panel.nameFieldStringValue = self.job.destURL.lastPathComponent.stringByDeletingPathExtension;
+    panel.nameFieldStringValue = self.job.outputFileName.stringByDeletingPathExtension;
 
     [panel beginSheetModalForWindow:self.view.window completionHandler:^(NSInteger result)
     {
index 4a7605c613d18ef0c23b017b9f39b120cfeab199..2b44aa94579727f4a2e44e66b42906aab6199286 100644 (file)
 /// The current selected preset.
 @property (nonatomic, strong) HBPreset *currentPreset;
 
+/// The current destination.
+@property (nonatomic, strong) NSURL *currentDestination;
+
 /// Whether the job has been edited after a preset was applied.
 @property (nonatomic) BOOL edited;
 
         }
 
         _scanSpecificTitleIdx = 1;
+
+        // Check to see if the last destination has been set, use if so, if not, use Movies
+#ifdef __SANDBOX_ENABLED__
+        NSData *bookmark = [[NSUserDefaults standardUserDefaults] objectForKey:@"HBLastDestinationDirectoryBookmark"];
+        if (bookmark)
+        {
+            _currentDestination = [HBUtilities URLFromBookmark:bookmark];
+        }
+#else
+        _currentDestination = [[NSUserDefaults standardUserDefaults] URLForKey:@"HBLastDestinationDirectoryURL"];
+#endif
+
+        if (!_currentDestination)
+        {
+            _currentDestination = [NSURL fileURLWithPath:[NSSearchPathForDirectoriesInDomains(NSMoviesDirectory, NSUserDomainMask, YES) firstObject]
+                                             isDirectory:YES];
+        }
+
+#ifdef __SANDBOX_ENABLED__
+        [_currentDestination startAccessingSecurityScopedResource];
+#endif
     }
 
     return self;
 
     self.job = nil;
     [fSrcTitlePopUp removeAllItems];
+    self.window.representedURL = nil;
+    self.window.title = NSLocalizedString(@"HandBrake", nil);
 
     NSURL *mediaURL = [HBUtilities mediaURLFromURL:fileURL];
     NSString *displayName = [HBUtilities displayNameForURL:fileURL];
              {
                  for (HBTitle *title in self.core.titles)
                  {
-                     // Set Source Name at top of window with the browsedSourceDisplayName grokked right before -performScan
-                     fSrcDVD2Field.stringValue = displayName;
-
                      [fSrcTitlePopUp addItemWithTitle:title.description];
                  }
 
+                 // Set Source Name at top of window with the browsedSourceDisplayName grokked right before -performScan
+                 fSrcDVD2Field.stringValue = displayName;
+
+                 self.window.representedURL = mediaURL;
+                 self.window.title = mediaURL.lastPathComponent;
+
                  completionHandler(self.core.titles);
              }
              else
     }
 
     HBJob *job = [[HBJob alloc] initWithTitle:title andPreset:self.currentPreset];
-    job.destURL = [HBUtilities destURLForJob:job];
+    job.outputURL = self.currentDestination;
+    job.outputFileName = [HBUtilities defaultNameForJob:job];
 
     return job;
 }
        }
        else
        {
-               sourceDirectory = [[NSURL fileURLWithPath:NSHomeDirectory()] URLByAppendingPathComponent:@"Desktop"];
+        sourceDirectory = [NSURL fileURLWithPath:[NSSearchPathForDirectoriesInDomains(NSDesktopDirectory, NSUserDomainMask, YES) firstObject]
+                                                       isDirectory:YES];
        }
 
     [panel setDirectoryURL:sourceDirectory];
 - (IBAction)browseDestination:(id)sender
 {
     // Open a panel to let the user choose and update the text field
-    NSSavePanel *panel = [NSSavePanel savePanel];
+    NSOpenPanel *panel = [NSOpenPanel openPanel];
+    panel.canChooseFiles = NO;
+    panel.canChooseDirectories = YES;
+    panel.prompt = NSLocalizedString(@"Choose", nil);
 
-    if (self.job.destURL)
+    if (self.job.outputURL)
     {
-        panel.directoryURL = self.job.destURL.URLByDeletingLastPathComponent;
-        panel.nameFieldStringValue = self.job.destURL.lastPathComponent;
+        panel.directoryURL = self.job.outputURL;
     }
 
     [panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result)
      {
          if (result == NSFileHandlingPanelOKButton)
          {
-             self.job.destURL = panel.URL;
+             self.job.outputURL = panel.URL;
+             self.currentDestination = panel.URL;
 
              // Save this path to the prefs so that on next browse destination window it opens there
-             [[NSUserDefaults standardUserDefaults] setURL:panel.URL.URLByDeletingLastPathComponent
-                                                    forKey:@"HBLastDestinationDirectory"];
+             [[NSUserDefaults standardUserDefaults] setObject:[HBUtilities bookmarkFromURL:panel.URL]
+                                                       forKey:@"HBLastDestinationDirectoryBookmark"];
+             [[NSUserDefaults standardUserDefaults] setURL:panel.URL
+                                                    forKey:@"HBLastDestinationDirectoryURL"];
+
          }
      }];
 }
         NSString *fileName = [HBUtilities automaticNameForJob:self.job];
 
         // Swap the old one with the new one
-        self.job.destURL = [[self.job.destURL URLByDeletingLastPathComponent] URLByAppendingPathComponent:
-                            [NSString stringWithFormat:@"%@.%@", fileName, self.job.destURL.pathExtension]];
+        self.job.outputFileName = [NSString stringWithFormat:@"%@.%@", fileName, self.job.outputFileName.pathExtension];
     }
 }
 
     if (self.job)
     {
         NSString *extension = [HBUtilities automaticExtForJob:self.job];
-        if (![extension isEqualTo:self.job.destURL.pathExtension])
+        if (![extension isEqualTo:self.job.outputFileName.pathExtension])
         {
-            self.job.destURL = [[self.job.destURL URLByDeletingPathExtension] URLByAppendingPathExtension:extension];
+            self.job.outputFileName = [[self.job.outputFileName stringByDeletingPathExtension] stringByAppendingPathExtension:extension];
         }
     }
 }
  */
 - (void)runDestinationAlerts:(HBJob *)job didEndSelector:(SEL)didEndSelector
 {
-    NSString *destinationDirectory = job.destURL.path.stringByDeletingLastPathComponent;
-
-    if ([[NSFileManager defaultManager] fileExistsAtPath:destinationDirectory] == 0)
+    if ([[NSFileManager defaultManager] fileExistsAtPath:job.outputURL.path] == 0)
     {
         NSAlert *alert = [[NSAlert alloc] init];
         [alert setMessageText:NSLocalizedString(@"Warning!", @"")];
         [alert setInformativeText:NSLocalizedString(@"This is not a valid destination directory!", @"")];
         [alert beginSheetModalForWindow:self.window modalDelegate:self didEndSelector:didEndSelector contextInfo:NULL];
     }
-    else if ([job.fileURL isEqual:job.destURL])
+    else if ([job.fileURL isEqual:job.completeOutputURL])
     {
         NSAlert *alert = [[NSAlert alloc] init];
         [alert setMessageText:NSLocalizedString(@"A file already exists at the selected destination.", @"")];
         [alert setInformativeText:NSLocalizedString(@"The destination is the same as the source, you can not overwrite your source file!", @"")];
         [alert beginSheetModalForWindow:self.window modalDelegate:self didEndSelector:didEndSelector contextInfo:NULL];
     }
-    else if ([[NSFileManager defaultManager] fileExistsAtPath:job.destURL.path])
+    else if ([[NSFileManager defaultManager] fileExistsAtPath:job.completeOutputURL.path])
     {
         NSAlert *alert = [[NSAlert alloc] init];
         [alert setMessageText:NSLocalizedString(@"A file already exists at the selected destination.", @"")];
-        [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Do you want to overwrite %@?", @""), job.destURL.path]];
+        [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Do you want to overwrite %@?", @""), job.completeOutputURL.path]];
         [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"")];
         [alert addButtonWithTitle:NSLocalizedString(@"Overwrite", @"")];
         [alert setAlertStyle:NSCriticalAlertStyle];
 
         [alert beginSheetModalForWindow:self.window modalDelegate:self didEndSelector:didEndSelector contextInfo:NULL];
     }
-    else if ([fQueueController jobExistAtURL:job.destURL])
+    else if ([fQueueController jobExistAtURL:job.completeOutputURL])
     {
         NSAlert *alert = [[NSAlert alloc] init];
         [alert setMessageText:NSLocalizedString(@"There is already a queue item for this destination.", @"")];
-        [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Do you want to overwrite %@?", @""), job.destURL.path]];
+        [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Do you want to overwrite %@?", @""), job.completeOutputURL.path]];
         [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"")];
         [alert addButtonWithTitle:NSLocalizedString(@"Overwrite", @"")];
         [alert setAlertStyle:NSCriticalAlertStyle];
         if ([indexes containsIndex:title.index])
         {
             HBJob *job = [[HBJob alloc] initWithTitle:title andPreset:preset];
-            job.destURL = [HBUtilities destURLForJob:job];
+            job.outputURL = self.currentDestination;
+            job.outputFileName = [HBUtilities defaultNameForJob:job];
             job.title = nil;
             [jobs addObject:job];
         }
     NSMutableSet<NSURL *> *destinations = [[NSMutableSet alloc] init];
     for (HBJob *job in jobs)
     {
-        if ([destinations containsObject:job.destURL])
+        if ([destinations containsObject:job.completeOutputURL])
         {
             fileExists = YES;
             break;
         }
         else
         {
-            [destinations addObject:job.destURL];
+            [destinations addObject:job.completeOutputURL];
         }
 
-        if ([[NSFileManager defaultManager] fileExistsAtPath:job.destURL.path] || [fQueueController jobExistAtURL:job.destURL])
+        if ([[NSFileManager defaultManager] fileExistsAtPath:job.completeOutputURL.path] || [fQueueController jobExistAtURL:job.completeOutputURL])
         {
             fileExists = YES;
             break;
 
     for (HBJob *job in jobs)
     {
-        if ([job.fileURL isEqual:job.destURL]) {
+        if ([job.fileURL isEqual:job.completeOutputURL]) {
             fileOverwritesSource = YES;
             break;
         }
index 50b3e6cce1e9ae258da6c604531fa43f138c272e..dbce136f61ef5bc0202da3b8cdf97bf63bbbecd9 100644 (file)
@@ -27,6 +27,8 @@ static void hb_error_handler(const char *errmsg)
     }
 }
 
+typedef void (^HBCoreCleanupHandler)();
+
 /**
  * Private methods of HBCore.
  */
@@ -54,6 +56,9 @@ static void hb_error_handler(const char *errmsg)
 /// Completion handler.
 @property (nonatomic, readwrite, copy) HBCoreCompletionHandler completionHandler;
 
+/// Cleanup handle, used for internal HBCore cleanup.
+@property (nonatomic, readwrite, copy) HBCoreCleanupHandler cleanupHandler;
+
 @end
 
 @implementation HBCore
@@ -173,6 +178,11 @@ static void hb_error_handler(const char *errmsg)
 - (BOOL)canScan:(NSURL *)url error:(NSError * __autoreleasing *)error
 {
     NSAssert(url, @"[HBCore canScan:] called with nil url.");
+
+#ifdef __SANDBOX_ENABLED__
+    BOOL accessingSecurityScopedResource = [url startAccessingSecurityScopedResource];
+#endif
+
     if (![[NSFileManager defaultManager] fileExistsAtPath:url.path]) {
         if (error) {
             *error = [NSError errorWithDomain:@"HBErrorDomain"
@@ -217,6 +227,13 @@ static void hb_error_handler(const char *errmsg)
         }
     }
 
+#ifdef __SANDBOX_ENABLED__
+    if (accessingSecurityScopedResource)
+    {
+        [url stopAccessingSecurityScopedResource];
+    }
+#endif
+
     return YES;
 }
 
@@ -225,6 +242,16 @@ static void hb_error_handler(const char *errmsg)
     NSAssert(self.state == HBStateIdle, @"[HBCore scanURL:] called while another scan or encode already in progress");
     NSAssert(url, @"[HBCore scanURL:] called with nil url.");
 
+#ifdef __SANDBOX_ENABLED__
+    BOOL accessingSecurityScopedResource = [url startAccessingSecurityScopedResource];
+    self.cleanupHandler = ^{
+        if (accessingSecurityScopedResource)
+        {
+            [url stopAccessingSecurityScopedResource];
+        }
+    };
+#endif
+
     // Reset the titles array
     self.titles = @[];
 
@@ -232,16 +259,6 @@ static void hb_error_handler(const char *errmsg)
     self.progressHandler = progressHandler;
     self.completionHandler = completionHandler;
 
-    NSString *path = url.path;
-    HBDVDDetector *detector = [HBDVDDetector detectorForPath:path];
-
-    if (detector.isVideoDVD)
-    {
-        // The chosen path was actually on a DVD, so use the raw block
-        // device path instead.
-        path = detector.devicePath;
-    }
-
     // convert minTitleDuration from seconds to the internal HB time
     uint64_t min_title_duration_ticks = 90000LL * seconds;
 
@@ -260,7 +277,7 @@ static void hb_error_handler(const char *errmsg)
 
     [self preventAutoSleep];
 
-    hb_scan(_hb_handle, path.fileSystemRepresentation,
+    hb_scan(_hb_handle, url.path.fileSystemRepresentation,
             (int)index, (int)previewsNum,
             1, min_title_duration_ticks);
 
@@ -490,9 +507,15 @@ static void hb_error_handler(const char *errmsg)
     self.progressHandler = progressHandler;
     self.completionHandler = completionHandler;
 
+#ifdef __SANDBOX_ENABLED__
+    HBJob *jobCopy = [job copy];
+    [jobCopy startAccessingSecurityScopedResource];
+    self.cleanupHandler = ^{ [jobCopy stopAccessingSecurityScopedResource]; };
+#endif
+
     // Add the job to libhb
     hb_job_t *hb_job = job.hb_job;
-    hb_job_set_file(hb_job, job.destURL.path.fileSystemRepresentation);
+    hb_job_set_file(hb_job, job.completeOutputURL.path.fileSystemRepresentation);
     hb_add(_hb_handle, hb_job);
 
     // Free the job
@@ -510,7 +533,7 @@ static void hb_error_handler(const char *errmsg)
     // waiting for libhb to set it in a background thread.
     self.state = HBStateWorking;
 
-    [HBUtilities writeToActivityLog:"%s started encoding %s", self.name.UTF8String, job.destURL.lastPathComponent.UTF8String];
+    [HBUtilities writeToActivityLog:"%s started encoding %s", self.name.UTF8String, job.outputFileName.UTF8String];
     [HBUtilities writeToActivityLog:"%s with preset %s", self.name.UTF8String, job.presetName.UTF8String];
 }
 
@@ -674,6 +697,11 @@ static void hb_error_handler(const char *errmsg)
     // Call the completion block and clean ups the handlers
     self.progressHandler = nil;
 
+#ifdef __SANDBOX_ENABLED__
+    self.cleanupHandler();
+    self.cleanupHandler = nil;
+#endif
+
     HBCoreResult result = (_hb_state->state == HB_STATE_WORKDONE) ? [self workDone] : [self scanDone];
     [self runCompletionBlockAndCleanUpWithResult:result];
 }
index 8a9baef1dffdbaf5aec2aea15c77e01757ff1d8f..d56311244e1be14be0e31b46c24b42e6d92f3d67 100644 (file)
@@ -77,8 +77,9 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
         _array = [[NSMutableArray alloc] init];
         _objectClasses = [NSSet setWithObjects:[NSMutableArray class], objectClass, nil];
 
-        NSArray *runningInstances = [NSRunningApplication runningApplicationsWithBundleIdentifier:[[NSBundle mainBundle] bundleIdentifier]];
-        const char *name = [NSString stringWithFormat:@"/%@.hblock", _fileURL.lastPathComponent].UTF8String;
+        NSString *identifier = [[NSBundle mainBundle] bundleIdentifier];
+        NSArray *runningInstances = [NSRunningApplication runningApplicationsWithBundleIdentifier:identifier];
+        const char *name = [NSString stringWithFormat:@"%@/%@", identifier, _fileURL.lastPathComponent.stringByDeletingPathExtension].UTF8String;
 
         // Unlink the semaphore if we are the only
         // instance running, this fixes the case where
@@ -94,7 +95,7 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
         _mutex = sem_open(name, O_CREAT, 0777, 1);
         if (_mutex == SEM_FAILED)
         {
-            [HBUtilities writeToActivityLog:"%s: %d\n", "Error in creating semaphore: ", errno];
+            [HBUtilities writeToActivityLog:"%s: %d", "Error in creating semaphore: ", errno];
         }
 
         [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:HBDistributedArraWrittenToDisk object:nil];
@@ -182,12 +183,9 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
 {
     if (!([notification.object integerValue] == getpid()))
     {
-        if ([notification.userInfo[@"path"] isEqualToString:self.fileURL.path])
-        {
-            [self lock];
-            [self reload];
-            [self unlock];
-        }
+        [self lock];
+        [self reload];
+        [self unlock];
     }
 }
 
@@ -273,7 +271,7 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
     // Send a distributed notification.
     [[NSDistributedNotificationCenter defaultCenter] postNotificationName:HBDistributedArraWrittenToDisk
                                                                    object:[NSString stringWithFormat:@"%d", getpid()]
-                                                                 userInfo:@{@"path": self.fileURL.path}
+                                                                 userInfo:nil
                                                        deliverImmediately:YES];
 
     // Update the time, so we can avoid reloaded the file from disk later.
index 5c6d9126b61a1bd6c2c12afc3d07395e0b4ef3a6..852603e405908230d2fdec58f1ea1d3783cb58d2 100644 (file)
 - (hb_job_t *)hb_job
 {
     NSAssert(self.title, @"HBJob: calling hb_job without a valid title loaded");
-    NSAssert(self.destURL, @"HBJob: calling hb_job without a valid destination");
+    NSAssert(self.completeOutputURL, @"HBJob: calling hb_job without a valid destination");
 
     hb_title_t *title = self.title.hb_title;
     hb_job_t *job = hb_job_init(title);
 
-    hb_job_set_file(job, self.destURL.path.fileSystemRepresentation);
+    hb_job_set_file(job, self.completeOutputURL.path.fileSystemRepresentation);
 
     // Title Angle for dvdnav
     job->angle = self.angle;
index 865cad7d8dafc1e25e636e1700af151dc70e31a8..5edf48a9b6538b3d3c3b7206f485ec6f99905142 100644 (file)
@@ -167,7 +167,7 @@ static NSDictionary            *shortHeightAttr;
         [finalString appendString:[NSString stringWithFormat:@"%@", self.description] withAttributes:titleAttr];
 
         // lets add the output file name to the title string here
-        NSString *outputFilenameString = self.destURL.lastPathComponent;
+        NSString *outputFilenameString = self.outputFileName;
 
         summaryInfo = [NSString stringWithFormat: @" (%@, %@, %@) -> %@", titleString, startStopString, passesString, outputFilenameString];
 
@@ -249,7 +249,7 @@ static NSDictionary            *shortHeightAttr;
 
         // Fourth Line (Destination Path)
         [finalString appendString: @"Destination: " withAttributes:detailBoldAttr];
-        [finalString appendString: self.destURL.path withAttributes:detailAttr];
+        [finalString appendString: self.completeOutputURL.path withAttributes:detailAttr];
         [finalString appendString:@"\n" withAttributes:detailAttr];
 
 
index 416ac5b1c8870e02b721a696e7b9a7dd1cd669fd..ff4af8d097738b1094a87acbaf320cd9eaca3726 100644 (file)
@@ -58,7 +58,13 @@ typedef NS_ENUM(NSUInteger, HBJobState){
 @property (nonatomic, readonly) NSURL *fileURL;
 
 /// The file URL at which the new file will be created.
-@property (nonatomic, readwrite, copy, nullable) NSURL *destURL;
+@property (nonatomic, readwrite, copy, nullable) NSURL *outputURL;
+
+/// The name of the new file that will be created.
+@property (nonatomic, readwrite, copy, nullable) NSString *outputFileName;
+
+/// The URL at which the new file will be created.
+@property (nonatomic, readonly, nullable) NSURL *completeOutputURL;
 
 // Job settings
 @property (nonatomic, readwrite) int container;
@@ -80,6 +86,14 @@ typedef NS_ENUM(NSUInteger, HBJobState){
 
 @property (nonatomic, readwrite, weak, nullable) NSUndoManager *undo;
 
+/*  Given a HBJob created by NSSecureCoding, make the resource referenced by the job accessible to the process.
+ */
+- (BOOL)startAccessingSecurityScopedResource;
+
+/*  Revokes the access granted to the url by a prior successful call to startAccessingSecurityScopedResource.
+ */
+- (void)stopAccessingSecurityScopedResource;
+
 @end
 
 NS_ASSUME_NONNULL_END
index 2adee6bbbc799755dbacefec9eaed9ed38f9aa90..3eac48e3dbdc612397caf70487dca7c7541c473c 100644 (file)
 #import "HBCodingUtilities.h"
 #import "HBMutablePreset.h"
 
-
 #include "hb.h"
 
 NSString *HBContainerChangedNotification = @"HBContainerChangedNotification";
 NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
 
 @interface HBJob ()
+
 @property (nonatomic, readonly) NSString *name;
+
+/**
+ Store the security scoped bookmarks, so we don't
+ regenerate it each time
+ */
+@property (nonatomic, readonly) NSData *fileURLBookmark;
+@property (nonatomic, readwrite) NSData *outputURLFolderBookmark;
+
+/**
+ Keep track of startAccessingSecurityScopedResource return value
+ to avoid calling stopAccessingSecurityScopedResource when unnecessary
+ and stopping another instance from accessing the url.
+ */
+@property (nonatomic, readwrite) BOOL accessingSecurityScopedFileURL;
+@property (nonatomic, readwrite) BOOL accessingSecurityScopedOutputURL;
+
 @end
 
 @implementation HBJob
@@ -118,13 +134,32 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
     _presetName = [presetName copy];
 }
 
-- (void)setDestURL:(NSURL *)destURL
+- (void)setOutputURL:(NSURL *)outputURL
+{
+    if (![outputURL isEqualTo:_outputURL])
+    {
+        [[self.undo prepareWithInvocationTarget:self] setOutputURL:_outputURL];
+    }
+    _outputURL = [outputURL copy];
+
+#ifdef __SANDBOX_ENABLED__
+    // Clear we bookmark to regenerate it
+    self.outputURLFolderBookmark = nil;
+#endif
+}
+
+- (void)setOutputFileName:(NSString *)outputFileName
 {
-    if (![destURL isEqualTo:_destURL])
+    if (![outputFileName isEqualTo:_outputFileName])
     {
-        [[self.undo prepareWithInvocationTarget:self] setDestURL:_destURL];
+        [[self.undo prepareWithInvocationTarget:self] setOutputFileName:_outputFileName];
     }
-    _destURL = [destURL copy];
+    _outputFileName = [outputFileName copy];
+}
+
+- (NSURL *)completeOutputURL
+{
+    return [self.outputURL URLByAppendingPathComponent:self.outputFileName];
 }
 
 - (void)setContainer:(int)container
@@ -192,6 +227,38 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
     return self.name;
 }
 
+- (BOOL)startAccessingSecurityScopedResource
+{
+#ifdef __SANDBOX_ENABLED__
+    if (!self.accessingSecurityScopedFileURL)
+    {
+        self.accessingSecurityScopedFileURL = [self.fileURL startAccessingSecurityScopedResource];
+    }
+    if (!self.accessingSecurityScopedOutputURL)
+    {
+        self.accessingSecurityScopedOutputURL = [self.outputURL startAccessingSecurityScopedResource];
+    }
+
+    return self.accessingSecurityScopedFileURL || self.accessingSecurityScopedOutputURL;
+#else
+    return NO;
+#endif
+}
+
+- (void)stopAccessingSecurityScopedResource
+{
+#ifdef __SANDBOX_ENABLED__
+    if (self.accessingSecurityScopedFileURL)
+    {
+        [self.fileURL stopAccessingSecurityScopedResource];
+    }
+    if (self.accessingSecurityScopedOutputURL)
+    {
+        [self.outputURL stopAccessingSecurityScopedResource];
+    }
+#endif
+}
+
 #pragma mark - NSCopying
 
 - (instancetype)copyWithZone:(NSZone *)zone
@@ -206,8 +273,12 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
         copy->_titleIdx = _titleIdx;
         copy->_uuid = [[NSUUID UUID] UUIDString];
 
+        copy->_fileURLBookmark = [_fileURLBookmark copy];
+        copy->_outputURLFolderBookmark = [_outputURLFolderBookmark copy];
+
         copy->_fileURL = [_fileURL copy];
-        copy->_destURL = [_destURL copy];
+        copy->_outputURL = [_outputURL copy];
+        copy->_outputFileName = [_outputFileName copy];
 
         copy->_container = _container;
         copy->_angle = _angle;
@@ -242,7 +313,7 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
 
 - (void)encodeWithCoder:(NSCoder *)coder
 {
-    [coder encodeInt:2 forKey:@"HBJobVersion"];
+    [coder encodeInt:3 forKey:@"HBJobVersion"];
 
     encodeInt(_state);
     encodeObject(_name);
@@ -250,8 +321,51 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
     encodeInt(_titleIdx);
     encodeObject(_uuid);
 
+#ifdef __SANDBOX_ENABLED__
+    NSError *error = nil;
+
+    if (!_fileURLBookmark)
+    {
+        _fileURLBookmark = [_fileURL bookmarkDataWithOptions:NSURLBookmarkCreationWithSecurityScope|NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess
+                                 includingResourceValuesForKeys:nil
+                                                  relativeToURL:nil
+                                                          error:&error];
+
+        if (error)
+        {
+            NSLog(@"Error creating bookmark for URL (%@): %@", _fileURL, error);
+        }
+    }
+
+    encodeObject(_fileURLBookmark);
+
+    if (!_outputURLFolderBookmark)
+    {
+        BOOL accessed = [_outputURL startAccessingSecurityScopedResource];
+
+        _outputURLFolderBookmark = [_outputURL bookmarkDataWithOptions:NSURLBookmarkCreationWithSecurityScope
+                                                 includingResourceValuesForKeys:nil
+                                                                  relativeToURL:nil
+                                                                          error:&error];
+
+
+        if (error)
+        {
+            NSLog(@"Error creating bookmark for URL (%@): %@", _outputURL, error);
+        }
+        if (accessed)
+        {
+            [_outputURL stopAccessingSecurityScopedResource];
+        }
+    }
+
+    encodeObject(_outputURLFolderBookmark);
+
+#endif
+
     encodeObject(_fileURL);
-    encodeObject(_destURL);
+    encodeObject(_outputURL);
+    encodeObject(_outputFileName);
 
     encodeInt(_container);
     encodeInt(_angle);
@@ -274,7 +388,7 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
 {
     int version = [decoder decodeIntForKey:@"HBJobVersion"];
 
-    if (version == 2 && (self = [super init]))
+    if (version == 3 && (self = [super init]))
     {
         decodeInt(_state);
         decodeObject(_name, NSString);
@@ -282,8 +396,54 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
         decodeInt(_titleIdx);
         decodeObject(_uuid, NSString);
 
+#ifdef __SANDBOX_ENABLED__
+        NSError *error;
+
+        _fileURLBookmark = [HBCodingUtilities decodeObjectOfClass:[NSData class] forKey:@"_fileURLBookmark" decoder:decoder];
+
+        if (_fileURLBookmark)
+        {
+            BOOL bookmarkDataIsStale;
+            _fileURL = [NSURL URLByResolvingBookmarkData:_fileURLBookmark
+                                                 options:NSURLBookmarkResolutionWithSecurityScope
+                                           relativeToURL:nil
+                                     bookmarkDataIsStale:&bookmarkDataIsStale
+                                                   error:&error];
+            if (error)
+            {
+                NSLog(@"Error creating URL from bookmark (%@): %@", _outputURL, error);
+            }
+        }
+        else
+        {
+            decodeObject(_fileURL, NSURL);
+        }
+
+        _outputURLFolderBookmark = [HBCodingUtilities decodeObjectOfClass:[NSData class] forKey:@"_outputURLFolderBookmark" decoder:decoder];
+
+        if (_outputURLFolderBookmark)
+        {
+            BOOL bookmarkDataIsStale;
+            _outputURL = [NSURL URLByResolvingBookmarkData:_outputURLFolderBookmark
+                                                             options:NSURLBookmarkResolutionWithSecurityScope
+                                                       relativeToURL:nil
+                                                 bookmarkDataIsStale:&bookmarkDataIsStale
+                                                               error:&error];
+            if (error)
+            {
+                NSLog(@"Error creating URL from bookmark (%@): %@", _outputURL, error);
+            }
+        }
+        else
+        {
+            decodeObject(_outputURL, NSURL);
+        }
+#else
         decodeObject(_fileURL, NSURL);
-        decodeObject(_destURL, NSURL);
+        decodeObject(_outputURL, NSURL);
+#endif
+
+        decodeObject(_outputFileName, NSString);
 
         decodeInt(_container);
         decodeInt(_angle);
index 7f2f3d020af4b871188862a3ecbf2cb3c31e9a8a..f0641eac34d50d3cc7417b6c8610a0615a80e244 100644 (file)
@@ -8,12 +8,17 @@
 #import "HBJob.h"
 #import "HBUtilities.h"
 
+@interface HBJobOutputFileWriter ()
+
+@property (nonatomic, readonly) NSURL *outputFolderURL;
+@property (nonatomic, readwrite) BOOL accessingSecurityScopedFile;
+
+@end
+
 @implementation HBJobOutputFileWriter
 
 - (nullable instancetype)initWithJob:(HBJob *)job
 {
-    NSURL *outputURL= job.destURL;
-
     // Establish the log file location to write to.
     // We need to get the current time in YY-MM-DD HH-MM-SS format to put at the beginning of the name of the log file
     time_t _now = time(NULL);
 
     // Assemble the new log file name as YY-MM-DD HH-MM-SS mymoviename.txt
     NSString *outputDateFileName = [NSString stringWithFormat:@"%@ %@.txt",
-                                    outputURL.lastPathComponent.stringByDeletingPathExtension,
+                                    job.outputFileName.stringByDeletingPathExtension,
                                     dateForLogTitle];
 
+    NSURL *outputURL = nil;
+
     if ([[NSUserDefaults standardUserDefaults] boolForKey:@"EncodeLogLocation"])
     {
         // if we are putting it in the same directory with the movie
-        outputURL = [outputURL.URLByDeletingLastPathComponent URLByAppendingPathComponent:outputDateFileName];
+        outputURL = [job.outputURL URLByAppendingPathComponent:outputDateFileName];
+
+#ifdef __SANDBOX_ENABLED__
+        _outputFolderURL = job.outputURL;
+        _accessingSecurityScopedFile = [_outputFolderURL startAccessingSecurityScopedResource];
+#endif
+
     }
     else
     {
@@ -45,7 +58,7 @@
     if (self)
     {
         // Additional header info.
-        [self write:job.destURL.lastPathComponent];
+        [self write:job.outputFileName];
         [self write:@"\nPreset: "];
         [self write:job.presetName];
         [self write:@"\n"];
     return self;
 }
 
+- (void)dealloc
+{
+#ifdef __SANDBOX_ENABLED__
+    if (_accessingSecurityScopedFile)
+    {
+        [_outputFolderURL.URLByDeletingLastPathComponent stopAccessingSecurityScopedResource];
+    }
+#endif
+}
+
 @end
index 16bc3217084f2afb74065869fd9fc16069e99769..faebcb437221d6497c72dce4baee1c3b2cc67fce 100644 (file)
             NSURL *sendToAppDirectoryURL = [sendToAppURL URLByDeletingLastPathComponent];
             [[NSUserDefaults standardUserDefaults] setObject:[sendToAppDirectoryURL path] forKey:@"LastSendToAppDirectory"];
 
+            // We set the name of the app to send to in the display field
             NSString *sendToAppName = [[sendToAppURL lastPathComponent] stringByDeletingPathExtension];
-            /* we set the name of the app to send to in the display field */
             [fSendEncodeToAppField setStringValue:sendToAppName];
+
             [[NSUserDefaults standardUserDefaults] setObject:[fSendEncodeToAppField stringValue] forKey:@"HBSendToApp"];
         }
     }];
index 093a64fea915f25daa9e11b05c94d57d92a5cf77..f30115e4e640404170cc6071ac42e0f1ecf5f999 100644 (file)
 
     HBJob *job = [self.job copy];
     job.title = self.job.title;
-    job.destURL = destURL;
+    job.outputFileName = destURL.lastPathComponent;
+    job.outputURL = destURL.URLByDeletingLastPathComponent;
 
     job.range.type = HBRangePreviewIndex;
     job.range.previewIndex = (int)index + 1;;
index 7fb42dad11237590ce078c02e60b76eff4ed9b1f..8ff546176d945c9ed4def56ea5656de850ae5fb8 100644 (file)
@@ -12,6 +12,7 @@
 #import "HBQueueOutlineView.h"
 
 #import "NSArray+HBAdditions.h"
+#import "HBUtilities.h"
 
 #import "HBDockTile.h"
 
 
     for (HBJob *item in self.jobs)
     {
-        if ([item.destURL isEqualTo:url])
+        if ([item.completeOutputURL isEqualTo:url])
         {
             return YES;
         }
         // Check to see if there are any more pending items in the queue
         HBJob *nextJob = [self getNextPendingQueueItem];
 
-        if (nextJob && [self _isDiskSpaceLowAtURL:nextJob.destURL])
+        if (nextJob && [self _isDiskSpaceLowAtURL:nextJob.outputURL])
         {
             // Disk space is low, show an alert
             [HBUtilities writeToActivityLog:"Queue Stopped, low space on destination disk"];
     if (result != HBCoreResultCancelled)
     {
         // Send to tagger
-        [self sendToExternalApp:job.destURL];
+        [self sendToExternalApp:job];
     }
 
     // Mark the encode just finished
     job.title = self.core.titles[0];
 
     HBStateFormatter *formatter = [[HBStateFormatter alloc] init];
-    formatter.title = job.destURL.lastPathComponent;
+    formatter.title = job.outputFileName;
     self.core.stateFormatter = formatter;
 
     // Progress handler
  *  Sends the URL to the external app
  *  selected in the preferences.
  *
- *  @param fileURL the URL of the file to send
+ *  @param job the job of the file to send
  */
-- (void)sendToExternalApp:(NSURL *)fileURL
+- (void)sendToExternalApp:(HBJob *)job
 {
     // This end of encode action is called as each encode rolls off of the queue
     if ([[NSUserDefaults standardUserDefaults] boolForKey:@"HBSendToAppEnabled"] == YES)
     {
+#ifdef __SANDBOX_ENABLED__
+        BOOL accessingSecurityScopedResource = [job.outputURL startAccessingSecurityScopedResource];
+#endif
+
         NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
         NSString *app = [workspace fullPathForApplication:[[NSUserDefaults standardUserDefaults] objectForKey:@"HBSendToApp"]];
 
         if (app)
         {
-            if (![workspace openFile:fileURL.path withApplication:app])
+            if (![workspace openFile:job.completeOutputURL.path withApplication:app])
             {
                 [HBUtilities writeToActivityLog:"Failed to send file to: %s", app];
             }
         {
             [HBUtilities writeToActivityLog:"Send file to: app not found"];
         }
+
+#ifdef __SANDBOX_ENABLED__
+        if (accessingSecurityScopedResource)
+        {
+            [job.outputURL stopAccessingSecurityScopedResource];
+        }
+#endif
     }
 }
 
         {
             title = NSLocalizedString(@"Put down that cocktail…", nil);
             description = [NSString stringWithFormat:NSLocalizedString(@"your HandBrake encode %@ is done!", nil),
-                                     job.destURL.lastPathComponent];
+                                     job.outputFileName];
 
         }
         else
         {
             title = NSLocalizedString(@"Encode failed", nil);
             description = [NSString stringWithFormat:NSLocalizedString(@"your HandBrake encode %@ couldn't be completed.", nil),
-                           job.destURL.lastPathComponent];
+                           job.outputFileName];
         }
 
         [self showNotificationWithTitle:title
                             description:description
-                                    url:job.destURL];
+                                    url:job.completeOutputURL];
     }
 }
 
 
     NSUInteger currentIndex = [targetedRows firstIndex];
     while (currentIndex != NSNotFound) {
-        NSURL *url = [[self.jobs objectAtIndex:currentIndex] destURL];
+        NSURL *url = [[self.jobs objectAtIndex:currentIndex] completeOutputURL];
         [urls addObject:url];
         currentIndex = [targetedRows indexGreaterThanIndex:currentIndex];
     }
index af5538fb96a54566974e3cfdfe42fa905b93c263..c7f195b1fdd7ec7b91c94a5510e7059d6af133d8 100644 (file)
@@ -30,12 +30,15 @@ NS_ASSUME_NONNULL_BEGIN
  */
 + (void)writeToActivityLog:(const char *)format, ...;
 
++ (nullable NSURL *)URLFromBookmark:(NSData *)bookmark;
++ (nullable NSData *)bookmarkFromURL:(NSURL *)url;
+
 + (NSString *)displayNameForURL:(NSURL *)URL;
 + (NSURL *)mediaURLFromURL:(NSURL *)URL;
 
 + (NSString *)automaticNameForJob:(HBJob *)job;
 + (NSString *)automaticExtForJob:(HBJob *)job;
-+ (NSURL *)destURLForJob:(HBJob *)job;
++ (NSString *)defaultNameForJob:(HBJob *)job;
 
 /**
  *  Generates a file name automatically based on the inputs,
index bf0c8bfa814a9cec2414dda44440e17e18280667..a0db9927b3e50c6d87d2b1c2d09f901fa0f1537d 100644 (file)
     va_end(args);
 }
 
++ (nullable NSURL *)URLFromBookmark:(NSData *)bookmark
+{
+    NSParameterAssert(bookmark);
+
+    NSError *error;
+    BOOL isStale;
+
+    NSURL *url = [NSURL URLByResolvingBookmarkData:bookmark options:NSURLBookmarkResolutionWithSecurityScope relativeToURL:nil bookmarkDataIsStale:&isStale error:&error];
+
+    if (error)
+    {
+        NSString *error_message = [NSString stringWithFormat:@"Failed to resolved bookmark: %@", error];
+        [HBUtilities writeToActivityLog:"%s", error_message.UTF8String];
+    }
+
+    return isStale ? nil : url;
+}
+
++ (nullable NSData *)bookmarkFromURL:(NSURL *)url
+{
+    NSParameterAssert(url);
+
+    NSError *error;
+
+    NSData *bookmark = [url bookmarkDataWithOptions:NSURLBookmarkCreationWithSecurityScope includingResourceValuesForKeys:nil relativeToURL:nil error:&error];
+
+    if (error)
+    {
+        NSString *error_message = [NSString stringWithFormat:@"Failed to create bookmark: %@", error];
+        [HBUtilities writeToActivityLog:"%s", error_message.UTF8String];
+    }
+
+    return bookmark;
+}
+
 + (NSString *)displayNameForURL:(NSURL *)URL
 {
     NSString *displayName = URL.lastPathComponent;
             [HBUtilities writeToActivityLog:"not a known to package"];
         }
     }
+#ifndef __SANDBOX_ENABLED__
     else
     {
         // path is not a package, so we call perform scan directly on our file
             [HBUtilities writeToActivityLog:"trying to open a folder or file"];
         }
     }
+#endif
 
     return mediaURL;
 }
     return extension;
 }
 
-+ (NSURL *)destURLForJob:(HBJob *)job
++ (NSString *)defaultNameForJob:(HBJob *)job
 {
-    // Check to see if the last destination has been set,use if so, if not, use Desktop
-    NSURL *destURL = [[NSUserDefaults standardUserDefaults] URLForKey:@"HBLastDestinationDirectory"];
-    if (!destURL || ![[NSFileManager defaultManager] fileExistsAtPath:destURL.path])
-    {
-        destURL = [NSURL fileURLWithPath:[NSSearchPathForDirectoriesInDomains(NSDesktopDirectory, NSUserDomainMask, YES) firstObject]
-                             isDirectory:YES];
-    }
-
     // Generate a new file name
     NSString *fileName = job.title.name;
 
         fileName = [self automaticNameForJob:job];
     }
 
-    destURL = [destURL URLByAppendingPathComponent:fileName];
     // use the correct extension based on the container
     NSString *ext = [self automaticExtForJob:job];
-    destURL = [destURL URLByAppendingPathExtension:ext];
+    fileName = [fileName stringByAppendingPathExtension:ext];
     
-    return destURL;
+    return fileName;
 }
 
 + (NSString *)automaticNameForSource:(NSString *)sourceName
diff --git a/macosx/HandBrake.entitlements b/macosx/HandBrake.entitlements
new file mode 100644 (file)
index 0000000..e29f683
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>com.apple.security.app-sandbox</key>
+       <true/>
+       <key>com.apple.security.application-groups</key>
+       <array>
+               <string>fr.handbrake.HandBrake</string>
+       </array>
+       <key>com.apple.security.assets.movies.read-write</key>
+       <true/>
+       <key>com.apple.security.files.bookmarks.app-scope</key>
+       <true/>
+       <key>com.apple.security.files.user-selected.read-write</key>
+       <true/>
+       <key>com.apple.security.temporary-exception.files.absolute-path.read-only</key>
+       <array>
+               <string>/usr/local/</string>
+       </array>
+       <key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key>
+       <array>
+               <string>/.dvdcss/</string>
+       </array>
+</dict>
+</plist>
index 617b472c6d4083ed0fb40233da133463080d852f..091c5261e6141b37abea976e566a6ac2b28229ad 100644 (file)
@@ -3,7 +3,7 @@
        archiveVersion = 1;
        classes = {
        };
-       objectVersion = 46;
+       objectVersion = 47;
        objects = {
 
 /* Begin PBXBuildFile section */
                A9E1468316BC2AD800C307BC /* PrevTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = A9E1467F16BC2AD800C307BC /* PrevTemplate.pdf */; };
                A9E165521C523016003EF30E /* libavfilter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9E165511C523016003EF30E /* libavfilter.a */; };
                A9E2FD2B1A21BC6F000E8D3F /* AddPreset.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9E2FD291A21BC6F000E8D3F /* AddPreset.xib */; };
+               A9F217E61E2F934C00C10C6E /* container-migration.plist in Resources */ = {isa = PBXBuildFile; fileRef = A9F217E51E2F934C00C10C6E /* container-migration.plist */; };
                A9F2EB6F196F12C800066546 /* Audio.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9F2EB6D196F12C800066546 /* Audio.xib */; };
                A9F472891976B7F30009EC65 /* HBSubtitlesDefaultsController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9F472871976B7F30009EC65 /* HBSubtitlesDefaultsController.m */; };
                A9F7102619A475EC00F61301 /* HBDockTile.m in Sources */ = {isa = PBXBuildFile; fileRef = A9F7102519A475EC00F61301 /* HBDockTile.m */; };
                A9E66D6F1A67A2A8007B641D /* HBDistributedArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HBDistributedArray.m; path = ../HBDistributedArray.m; sourceTree = "<group>"; };
                A9EA43661A2210C400785E95 /* HBQueueOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBQueueOutlineView.h; sourceTree = "<group>"; };
                A9EA43671A2210C400785E95 /* HBQueueOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBQueueOutlineView.m; sourceTree = "<group>"; };
+               A9F217E41E2F897D00C10C6E /* HandBrake.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = HandBrake.entitlements; sourceTree = "<group>"; };
+               A9F217E51E2F934C00C10C6E /* container-migration.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "container-migration.plist"; sourceTree = "<group>"; };
                A9F2EB6E196F12C800066546 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Audio.xib; sourceTree = "<group>"; };
                A9F472861976B7F30009EC65 /* HBSubtitlesDefaultsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBSubtitlesDefaultsController.h; sourceTree = "<group>"; };
                A9F472871976B7F30009EC65 /* HBSubtitlesDefaultsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBSubtitlesDefaultsController.m; sourceTree = "<group>"; };
                273F204114ADBC210021BE6D /* HandBrake */ = {
                        isa = PBXGroup;
                        children = (
+                               A9F217E41E2F897D00C10C6E /* HandBrake.entitlements */,
+                               A9F217E51E2F934C00C10C6E /* container-migration.plist */,
                                A9B34D6F197683FE00871B7D /* Controllers */,
                                A98F00771A972007001C2298 /* Output Redirect */,
                                A901C2431BC7D05000D77735 /* Others */,
                        attributes = {
                                LastUpgradeCheck = 0800;
                                TargetAttributes = {
+                                       273F203814ADBC200021BE6D = {
+                                               SystemCapabilities = {
+                                                       com.apple.ApplicationGroups.Mac = {
+                                                               enabled = 0;
+                                                       };
+                                                       com.apple.Push = {
+                                                               enabled = 0;
+                                                       };
+                                                       com.apple.Sandbox = {
+                                                               enabled = 0;
+                                                       };
+                                               };
+                                       };
                                        A9736F011C7DA5FE008F1D18 = {
                                                CreatedOnToolsVersion = 7.3;
                                        };
                                };
                        };
                        buildConfigurationList = 273F1FE314AD9DA40021BE6D /* Build configuration list for PBXProject "HandBrake" */;
-                       compatibilityVersion = "Xcode 3.2";
+                       compatibilityVersion = "Xcode 6.3";
                        developmentRegion = English;
                        hasScannedForEncodings = 0;
                        knownRegions = (
                                A99F40D31B624EA500750170 /* HBPictureViewController.xib in Resources */,
                                A93E0ED71972958C00FD67FB /* Video.xib in Resources */,
                                A9935213196F38A70069C6B7 /* ChaptersTitles.xib in Resources */,
+                               A9F217E61E2F934C00C10C6E /* container-migration.plist in Resources */,
                                A9706CBA1AC1452800BAEAA8 /* ExceptionAlert.xib in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                                CLANG_WARN_SUSPICIOUS_MOVE = YES;
                                CLANG_WARN_UNREACHABLE_CODE = YES;
                                CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               CODE_SIGN_IDENTITY = "";
                                COPY_PHASE_STRIP = NO;
                                ENABLE_STRICT_OBJC_MSGSEND = YES;
                                EXTERNAL_BUILD = "$(CONFIGURATION_BUILD_DIR)/external";
                                CLANG_WARN_SUSPICIOUS_MOVE = YES;
                                CLANG_WARN_UNREACHABLE_CODE = YES;
                                CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               CODE_SIGN_IDENTITY = "";
                                COPY_PHASE_STRIP = YES;
                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
                                ENABLE_STRICT_OBJC_MSGSEND = YES;
                        };
                        name = release;
                };
+               A9A5CD991E32072F00947914 /* debug-sandbox */ = {
+                       isa = XCBuildConfiguration;
+                       baseConfigurationReference = 275916DA14B2AB27007211E9 /* native.xcconfig */;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
+                               CLANG_ANALYZER_NONNULL = YES;
+                               CLANG_ENABLE_MODULES = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INFINITE_RECURSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO;
+                               CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
+                               CLANG_WARN_SUSPICIOUS_MOVE = YES;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               CODE_SIGN_ENTITLEMENTS = "";
+                               CODE_SIGN_IDENTITY = "";
+                               COPY_PHASE_STRIP = NO;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               EXTERNAL_BUILD = "$(CONFIGURATION_BUILD_DIR)/external";
+                               EXTERNAL_DRIVER = xcode;
+                               EXTERNAL_JOBS = auto;
+                               EXTERNAL_SRC = ..;
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_PREPROCESSOR_DEFINITIONS = (
+                                       "DEBUG=1",
+                                       "$(inherited)",
+                                       "__SANDBOX_ENABLED__=1",
+                               );
+                               GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
+                               GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+                               GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+                               GCC_WARN_SHADOW = YES;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_LABEL = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               MACOSX_DEPLOYMENT_TARGET = 10.7;
+                               OTHER_LDFLAGS = (
+                                       "-filelist",
+                                       "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
+                                       "-lc++",
+                               );
+                               SDKROOT = macosx;
+                               SHARED_PRECOMPS_DIR = "$(CONFIGURATION_TEMP_DIR)/PrecompiledHeaders";
+                               STRIP_INSTALLED_PRODUCT = NO;
+                       };
+                       name = "debug-sandbox";
+               };
+               A9A5CD9A1E32072F00947914 /* debug-sandbox */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               PRODUCT_NAME = external;
+                       };
+                       name = "debug-sandbox";
+               };
+               A9A5CD9B1E32072F00947914 /* debug-sandbox */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               CLANG_ENABLE_MODULES = NO;
+                               CLANG_WARN_BOOL_CONVERSION = NO;
+                               CLANG_WARN_CONSTANT_CONVERSION = NO;
+                               CLANG_WARN_ENUM_CONVERSION = NO;
+                               CLANG_WARN_INT_CONVERSION = NO;
+                               CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
+                               GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO;
+                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
+                               HEADER_SEARCH_PATHS = (
+                                       "\"$(EXTERNAL_BUILD)/libhb\"",
+                                       "\"$(EXTERNAL_BUILD)/contrib/include\"",
+                               );
+                               LIBRARY_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "\"$(EXTERNAL_BUILD)/libhb\"",
+                                       "\"$(EXTERNAL_BUILD)/contrib/lib\"",
+                               );
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                       };
+                       name = "debug-sandbox";
+               };
+               A9A5CD9C1E32072F00947914 /* debug-sandbox */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_ANALYZER_NONNULL = YES;
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               CODE_SIGN_IDENTITY = "";
+                               COMBINE_HIDPI_IMAGES = YES;
+                               COPY_PHASE_STRIP = NO;
+                               CURRENT_PROJECT_VERSION = 1;
+                               DEBUG_INFORMATION_FORMAT = dwarf;
+                               DEFINES_MODULE = YES;
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               DYLIB_INSTALL_NAME_BASE = "@rpath";
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               ENABLE_TESTABILITY = YES;
+                               FRAMEWORK_VERSION = A;
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_DYNAMIC_NO_PIC = NO;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_PREPROCESSOR_DEFINITIONS = (
+                                       "DEBUG=1",
+                                       "$(inherited)",
+                               );
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               HEADER_SEARCH_PATHS = (
+                                       "\"$(EXTERNAL_BUILD)/libhb\"",
+                                       "\"$(EXTERNAL_BUILD)/contrib/include\"",
+                               );
+                               INFOPLIST_FILE = HandBrakeKit/Info.plist;
+                               INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
+                               LIBRARY_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "\"$(EXTERNAL_BUILD)/libhb\"",
+                                       "\"$(EXTERNAL_BUILD)/contrib/lib\"",
+                               );
+                               MACOSX_DEPLOYMENT_TARGET = 10.7;
+                               MTL_ENABLE_DEBUG_INFO = YES;
+                               ONLY_ACTIVE_ARCH = YES;
+                               PRODUCT_BUNDLE_IDENTIFIER = fr.handbrake.HandBrakeKit;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               SDKROOT = macosx;
+                               SKIP_INSTALL = YES;
+                               VERSIONING_SYSTEM = "apple-generic";
+                               VERSION_INFO_PREFIX = "";
+                       };
+                       name = "debug-sandbox";
+               };
+               A9A5CD9D1E32072F00947914 /* debug-sandbox */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_ANALYZER_NONNULL = YES;
+                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+                               CLANG_CXX_LIBRARY = "libc++";
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               COMBINE_HIDPI_IMAGES = YES;
+                               COPY_PHASE_STRIP = NO;
+                               DEBUG_INFORMATION_FORMAT = dwarf;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               ENABLE_TESTABILITY = YES;
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_DYNAMIC_NO_PIC = NO;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_PREPROCESSOR_DEFINITIONS = (
+                                       "DEBUG=1",
+                                       "$(inherited)",
+                               );
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               HEADER_SEARCH_PATHS = (
+                                       "\"$(EXTERNAL_BUILD)/libhb\"",
+                                       "\"$(EXTERNAL_BUILD)/contrib/include\"",
+                               );
+                               INFOPLIST_FILE = HandBrakeKitTests/Info.plist;
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+                               MACOSX_DEPLOYMENT_TARGET = 10.11;
+                               MTL_ENABLE_DEBUG_INFO = YES;
+                               ONLY_ACTIVE_ARCH = YES;
+                               PRODUCT_BUNDLE_IDENTIFIER = fr.handbrake.HandBrakeKitTests;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               SDKROOT = macosx;
+                               TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HandBrake.app/Contents/MacOS/HandBrake";
+                       };
+                       name = "debug-sandbox";
+               };
+               A9A5CD9E1E32072F00947914 /* debug-sandbox */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
+                               CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
+                               CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CODE_SIGN_ENTITLEMENTS = HandBrake.entitlements;
+                               CODE_SIGN_IDENTITY = "-";
+                               COMBINE_HIDPI_IMAGES = YES;
+                               FRAMEWORK_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "\"$(SRCROOT)\"",
+                               );
+                               GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+                               HEADER_SEARCH_PATHS = (
+                                       "\"$(EXTERNAL_BUILD)/libhb\"",
+                                       "\"$(EXTERNAL_BUILD)/contrib/include\"",
+                               );
+                               INFOPLIST_FILE = "$(EXTERNAL_BUILD)/macosx/Info.plist";
+                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks";
+                               LIBRARY_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "\"$(EXTERNAL_BUILD)/libhb\"",
+                                       "\"$(EXTERNAL_BUILD)/contrib/lib\"",
+                               );
+                               MACOSX_DEPLOYMENT_TARGET = 10.7;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               WRAPPER_EXTENSION = app;
+                       };
+                       name = "debug-sandbox";
+               };
+               A9A5CD9F1E32073800947914 /* release-sandbox */ = {
+                       isa = XCBuildConfiguration;
+                       baseConfigurationReference = 275916DA14B2AB27007211E9 /* native.xcconfig */;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
+                               CLANG_ANALYZER_NONNULL = YES;
+                               CLANG_ENABLE_MODULES = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INFINITE_RECURSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO;
+                               CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
+                               CLANG_WARN_SUSPICIOUS_MOVE = YES;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               CODE_SIGN_ENTITLEMENTS = "";
+                               CODE_SIGN_IDENTITY = "";
+                               COPY_PHASE_STRIP = YES;
+                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               EXTERNAL_BUILD = "$(CONFIGURATION_BUILD_DIR)/external";
+                               EXTERNAL_DRIVER = xcode;
+                               EXTERNAL_JOBS = auto;
+                               EXTERNAL_SRC = ..;
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_PREPROCESSOR_DEFINITIONS = "__SANDBOX_ENABLED__=1";
+                               GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
+                               GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+                               GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+                               GCC_WARN_SHADOW = YES;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_LABEL = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               MACOSX_DEPLOYMENT_TARGET = 10.7;
+                               OTHER_LDFLAGS = (
+                                       "-filelist",
+                                       "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
+                                       "-lc++",
+                               );
+                               SDKROOT = macosx;
+                               SHARED_PRECOMPS_DIR = "$(CONFIGURATION_TEMP_DIR)/PrecompiledHeaders";
+                               STRIP_INSTALLED_PRODUCT = YES;
+                       };
+                       name = "release-sandbox";
+               };
+               A9A5CDA01E32073800947914 /* release-sandbox */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               PRODUCT_NAME = external;
+                       };
+                       name = "release-sandbox";
+               };
+               A9A5CDA11E32073800947914 /* release-sandbox */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               CLANG_ENABLE_MODULES = NO;
+                               CLANG_WARN_BOOL_CONVERSION = NO;
+                               CLANG_WARN_CONSTANT_CONVERSION = NO;
+                               CLANG_WARN_ENUM_CONVERSION = NO;
+                               CLANG_WARN_INT_CONVERSION = NO;
+                               CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
+                               GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO;
+                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
+                               HEADER_SEARCH_PATHS = (
+                                       "\"$(EXTERNAL_BUILD)/libhb\"",
+                                       "\"$(EXTERNAL_BUILD)/contrib/include\"",
+                               );
+                               LIBRARY_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "\"$(EXTERNAL_BUILD)/libhb\"",
+                                       "\"$(EXTERNAL_BUILD)/contrib/lib\"",
+                               );
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                       };
+                       name = "release-sandbox";
+               };
+               A9A5CDA21E32073800947914 /* release-sandbox */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_ANALYZER_NONNULL = YES;
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               CODE_SIGN_IDENTITY = "";
+                               COMBINE_HIDPI_IMAGES = YES;
+                               COPY_PHASE_STRIP = NO;
+                               CURRENT_PROJECT_VERSION = 1;
+                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+                               DEFINES_MODULE = YES;
+                               DYLIB_COMPATIBILITY_VERSION = 1;
+                               DYLIB_CURRENT_VERSION = 1;
+                               DYLIB_INSTALL_NAME_BASE = "@rpath";
+                               ENABLE_NS_ASSERTIONS = NO;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               FRAMEWORK_VERSION = A;
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               HEADER_SEARCH_PATHS = (
+                                       "\"$(EXTERNAL_BUILD)/libhb\"\n",
+                                       "\"$(EXTERNAL_BUILD)/contrib/include\"",
+                               );
+                               INFOPLIST_FILE = HandBrakeKit/Info.plist;
+                               INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
+                               LIBRARY_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "\"$(EXTERNAL_BUILD)/libhb\"",
+                                       "\"$(EXTERNAL_BUILD)/contrib/lib\"",
+                               );
+                               MACOSX_DEPLOYMENT_TARGET = 10.7;
+                               MTL_ENABLE_DEBUG_INFO = NO;
+                               PRODUCT_BUNDLE_IDENTIFIER = fr.handbrake.HandBrakeKit;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               SDKROOT = macosx;
+                               SKIP_INSTALL = YES;
+                               VERSIONING_SYSTEM = "apple-generic";
+                               VERSION_INFO_PREFIX = "";
+                       };
+                       name = "release-sandbox";
+               };
+               A9A5CDA31E32073800947914 /* release-sandbox */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_ANALYZER_NONNULL = YES;
+                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+                               CLANG_CXX_LIBRARY = "libc++";
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               COMBINE_HIDPI_IMAGES = YES;
+                               COPY_PHASE_STRIP = NO;
+                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+                               ENABLE_NS_ASSERTIONS = NO;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               HEADER_SEARCH_PATHS = (
+                                       "\"$(EXTERNAL_BUILD)/libhb\"",
+                                       "\"$(EXTERNAL_BUILD)/contrib/include\"",
+                               );
+                               INFOPLIST_FILE = HandBrakeKitTests/Info.plist;
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+                               MACOSX_DEPLOYMENT_TARGET = 10.11;
+                               MTL_ENABLE_DEBUG_INFO = NO;
+                               PRODUCT_BUNDLE_IDENTIFIER = fr.handbrake.HandBrakeKitTests;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               SDKROOT = macosx;
+                               TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HandBrake.app/Contents/MacOS/HandBrake";
+                       };
+                       name = "release-sandbox";
+               };
+               A9A5CDA41E32073800947914 /* release-sandbox */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
+                               CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
+                               CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CODE_SIGN_ENTITLEMENTS = HandBrake.entitlements;
+                               CODE_SIGN_IDENTITY = "-";
+                               COMBINE_HIDPI_IMAGES = YES;
+                               FRAMEWORK_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "\"$(SRCROOT)\"",
+                               );
+                               GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+                               HEADER_SEARCH_PATHS = (
+                                       "\"$(EXTERNAL_BUILD)/libhb\"",
+                                       "\"$(EXTERNAL_BUILD)/contrib/include\"",
+                               );
+                               INFOPLIST_FILE = "$(EXTERNAL_BUILD)/macosx/Info.plist";
+                               LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks";
+                               LIBRARY_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "\"$(EXTERNAL_BUILD)/libhb\"",
+                                       "\"$(EXTERNAL_BUILD)/contrib/lib\"",
+                               );
+                               MACOSX_DEPLOYMENT_TARGET = 10.7;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               WRAPPER_EXTENSION = app;
+                       };
+                       name = "release-sandbox";
+               };
 /* End XCBuildConfiguration section */
 
 /* Begin XCConfigurationList section */
                        isa = XCConfigurationList;
                        buildConfigurations = (
                                273F1FE614AD9DA40021BE6D /* debug */,
+                               A9A5CD991E32072F00947914 /* debug-sandbox */,
                                273F1FE714AD9DA40021BE6D /* release */,
+                               A9A5CD9F1E32073800947914 /* release-sandbox */,
                        );
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = release;
                        isa = XCConfigurationList;
                        buildConfigurations = (
                                273F200814ADAE950021BE6D /* debug */,
+                               A9A5CD9B1E32072F00947914 /* debug-sandbox */,
                                273F200914ADAE950021BE6D /* release */,
+                               A9A5CDA11E32073800947914 /* release-sandbox */,
                        );
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = release;
                        isa = XCConfigurationList;
                        buildConfigurations = (
                                273F205414ADBC210021BE6D /* debug */,
+                               A9A5CD9E1E32072F00947914 /* debug-sandbox */,
                                273F205514ADBC210021BE6D /* release */,
+                               A9A5CDA41E32073800947914 /* release-sandbox */,
                        );
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = release;
                        isa = XCConfigurationList;
                        buildConfigurations = (
                                273F217214ADD2170021BE6D /* debug */,
+                               A9A5CD9A1E32072F00947914 /* debug-sandbox */,
                                273F217314ADD2170021BE6D /* release */,
+                               A9A5CDA01E32073800947914 /* release-sandbox */,
                        );
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = release;
                        isa = XCConfigurationList;
                        buildConfigurations = (
                                A9736F191C7DA5FE008F1D18 /* debug */,
+                               A9A5CD9C1E32072F00947914 /* debug-sandbox */,
                                A9736F1A1C7DA5FE008F1D18 /* release */,
+                               A9A5CDA21E32073800947914 /* release-sandbox */,
                        );
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = release;
                        isa = XCConfigurationList;
                        buildConfigurations = (
                                A9736F1B1C7DA5FE008F1D18 /* debug */,
+                               A9A5CD9D1E32072F00947914 /* debug-sandbox */,
                                A9736F1C1C7DA5FE008F1D18 /* release */,
+                               A9A5CDA31E32073800947914 /* release-sandbox */,
                        );
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = release;
diff --git a/macosx/HandBrake.xcodeproj/xcshareddata/xcschemes/HandBrake [DEBUG-SANDBOX].xcscheme b/macosx/HandBrake.xcodeproj/xcshareddata/xcschemes/HandBrake [DEBUG-SANDBOX].xcscheme
new file mode 100644 (file)
index 0000000..2dbfc6f
--- /dev/null
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "0710"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "273F203814ADBC200021BE6D"
+               BuildableName = "HandBrake.app"
+               BlueprintName = "HandBrake"
+               ReferencedContainer = "container:HandBrake.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "273F1FFE14ADAE950021BE6D"
+               BuildableName = "HandBrakeCLI"
+               BlueprintName = "HandBrakeCLI"
+               ReferencedContainer = "container:HandBrake.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "NO"
+            buildForProfiling = "NO"
+            buildForArchiving = "NO"
+            buildForAnalyzing = "NO">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "A9736F0A1C7DA5FE008F1D18"
+               BuildableName = "HandBrakeKitTests.xctest"
+               BlueprintName = "HandBrakeKitTests"
+               ReferencedContainer = "container:HandBrake.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "debug-sandbox"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <Testables>
+      </Testables>
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "273F1FFE14ADAE950021BE6D"
+            BuildableName = "HandBrakeCLI"
+            BlueprintName = "HandBrakeCLI"
+            ReferencedContainer = "container:HandBrake.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "debug-sandbox"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "273F203814ADBC200021BE6D"
+            BuildableName = "HandBrake.app"
+            BlueprintName = "HandBrake"
+            ReferencedContainer = "container:HandBrake.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "debug-sandbox"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "273F1FFE14ADAE950021BE6D"
+            BuildableName = "HandBrakeCLI"
+            BlueprintName = "HandBrakeCLI"
+            ReferencedContainer = "container:HandBrake.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "debug-sandbox">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "debug-sandbox"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>
index 29dd0e4d0fe317b71357e118a3056491d0189e6d..2e411547b7f7bb2caeb1fa02fb8959388bbfcfe1 100644 (file)
@@ -11,8 +11,7 @@
             buildForRunning = "YES"
             buildForProfiling = "YES"
             buildForArchiving = "YES"
-            buildForAnalyzing = "YES"
-            hideIssues = "NO">
+            buildForAnalyzing = "YES">
             <BuildableReference
                BuildableIdentifier = "primary"
                BlueprintIdentifier = "273F203814ADBC200021BE6D"
@@ -26,8 +25,7 @@
             buildForRunning = "YES"
             buildForProfiling = "YES"
             buildForArchiving = "YES"
-            buildForAnalyzing = "YES"
-            hideIssues = "NO">
+            buildForAnalyzing = "YES">
             <BuildableReference
                BuildableIdentifier = "primary"
                BlueprintIdentifier = "273F1FFE14ADAE950021BE6D"
diff --git a/macosx/HandBrake.xcodeproj/xcshareddata/xcschemes/HandBrake [RELEASE-SANDBOX].xcscheme b/macosx/HandBrake.xcodeproj/xcshareddata/xcschemes/HandBrake [RELEASE-SANDBOX].xcscheme
new file mode 100644 (file)
index 0000000..50a0b46
--- /dev/null
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "0710"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "273F203814ADBC200021BE6D"
+               BuildableName = "HandBrake.app"
+               BlueprintName = "HandBrake"
+               ReferencedContainer = "container:HandBrake.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "273F1FFE14ADAE950021BE6D"
+               BuildableName = "HandBrakeCLI"
+               BlueprintName = "HandBrakeCLI"
+               ReferencedContainer = "container:HandBrake.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "NO"
+            buildForProfiling = "NO"
+            buildForArchiving = "NO"
+            buildForAnalyzing = "NO">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "A9736F0A1C7DA5FE008F1D18"
+               BuildableName = "HandBrakeKitTests.xctest"
+               BlueprintName = "HandBrakeKitTests"
+               ReferencedContainer = "container:HandBrake.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "release-sandbox"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <Testables>
+      </Testables>
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "273F1FFE14ADAE950021BE6D"
+            BuildableName = "HandBrakeCLI"
+            BlueprintName = "HandBrakeCLI"
+            ReferencedContainer = "container:HandBrake.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "release-sandbox"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "273F203814ADBC200021BE6D"
+            BuildableName = "HandBrake.app"
+            BlueprintName = "HandBrake"
+            ReferencedContainer = "container:HandBrake.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "release-sandbox"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "273F1FFE14ADAE950021BE6D"
+            BuildableName = "HandBrakeCLI"
+            BlueprintName = "HandBrakeCLI"
+            ReferencedContainer = "container:HandBrake.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "release-sandbox">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "release-sandbox"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>
index 91183912c39ec4b434b87fa4cb39efc9b013691e..d94e0f9108ab6473101419056864c198fbf40e99 100644 (file)
@@ -11,8 +11,7 @@
             buildForRunning = "YES"
             buildForProfiling = "YES"
             buildForArchiving = "YES"
-            buildForAnalyzing = "YES"
-            hideIssues = "NO">
+            buildForAnalyzing = "YES">
             <BuildableReference
                BuildableIdentifier = "primary"
                BlueprintIdentifier = "273F203814ADBC200021BE6D"
@@ -26,8 +25,7 @@
             buildForRunning = "YES"
             buildForProfiling = "YES"
             buildForArchiving = "YES"
-            buildForAnalyzing = "YES"
-            hideIssues = "NO">
+            buildForAnalyzing = "YES">
             <BuildableReference
                BuildableIdentifier = "primary"
                BlueprintIdentifier = "273F1FFE14ADAE950021BE6D"
@@ -41,8 +39,7 @@
             buildForRunning = "NO"
             buildForProfiling = "NO"
             buildForArchiving = "NO"
-            buildForAnalyzing = "NO"
-            hideIssues = "NO">
+            buildForAnalyzing = "NO">
             <BuildableReference
                BuildableIdentifier = "primary"
                BlueprintIdentifier = "A9736F0A1C7DA5FE008F1D18"
index dba18e35dda5ebe74f15e4544ba791e70fbefe98..88aec0b5ef63b2f1fe9984bc4fd244217ba7c483 100644 (file)
@@ -57,7 +57,8 @@
     self.title = self.core.titles.firstObject;
 
     self.job = [[HBJob alloc] initWithTitle:self.title andPreset:self.preset];
-    self.job.destURL = [NSURL fileURLWithPath:@"/Dest.mp4"];
+    self.job.outputURL = [NSURL fileURLWithPath:@"/"];
+    self.job.outputFileName = @"Dest.mp4";
 }
 
 - (void)tearDown
@@ -82,7 +83,8 @@
 
     XCTAssertNotNil(self.job);
 
-    job.destURL = [NSURL fileURLWithPath:@"/Dest.mp4"];
+    self.job.outputURL = [NSURL fileURLWithPath:@"/"];
+    self.job.outputFileName = @"Dest.mp4";
     [job applyPreset:preset];
 }
 
diff --git a/macosx/container-migration.plist b/macosx/container-migration.plist
new file mode 100644 (file)
index 0000000..24c6d42
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>Move</key>
+       <array>
+               <string>${ApplicationSupport}/HandBrake</string>
+       </array>
+</dict>
+</plist>