]> granicus.if.org Git - handbrake/commitdiff
MacGui: improve management of security scoped resources. Fix external SRT in the...
authorDamiano Galassi <damiog@gmail.com>
Wed, 25 Jan 2017 10:03:00 +0000 (11:03 +0100)
committerDamiano Galassi <damiog@gmail.com>
Wed, 25 Jan 2017 10:03:00 +0000 (11:03 +0100)
13 files changed:
macosx/HBAudio.m
macosx/HBCodingUtilities.h
macosx/HBCore.m
macosx/HBJob+Private.h
macosx/HBJob.h
macosx/HBJob.m
macosx/HBSecurityAccessToken.h [new file with mode: 0644]
macosx/HBSecurityAccessToken.m [new file with mode: 0644]
macosx/HBSubtitles.m
macosx/HBSubtitlesTrack.m
macosx/HBUtilities.h
macosx/HBUtilities.m
macosx/HandBrake.xcodeproj/project.pbxproj

index be7df2465bc2d0a6ddbacdee029ad19f3603bb99..410749427bd8446e0e95901dde8b0c4a6a383ab3 100644 (file)
@@ -7,7 +7,7 @@
 #import "HBAudio.h"
 
 #import "HBJob.h"
-#import "HBJob+HBJobConversion.m"
+#import "HBJob+HBJobConversion.h"
 #import "HBTitle.h"
 #import "HBAudioTrack.h"
 #import "HBAudioTrackPreset.h"
index 17d188b7fbdfeadfb138788e51f3d0441a1c7db8..cc92f9b6e9a80fa2dc4254c705e2a1f41d11e4aa 100644 (file)
@@ -23,6 +23,9 @@
 
 #define decodeCollectionOfObjects2(x, cl, objectcl, objectcl2) x = [HBCodingUtilities decodeObjectOfClasses:[NSSet setWithObjects:[cl class], [objectcl class], [objectcl2 class], nil] forKey:OBJC_STRINGIFY(x) decoder:decoder];
 
+#define decodeCollectionOfObjects3(x, cl, objectcl, objectcl2, objectcl3) x = [HBCodingUtilities decodeObjectOfClasses:[NSSet setWithObjects:[cl class], [objectcl class], [objectcl2 class], [objectcl3 class], nil] forKey:OBJC_STRINGIFY(x) decoder:decoder];
+
+
 #define decodeObjectOrFail(x, class) x = [HBCodingUtilities decodeObjectOfClass:class forKey:OBJC_STRINGIFY(x) decoder:decoder]; if (x == nil) {NSLog(@"Failed to decode: %@", OBJC_STRINGIFY(x)); goto fail;}
 
 NS_ASSUME_NONNULL_BEGIN
index dbce136f61ef5bc0202da3b8cdf97bf63bbbecd9..7e9024b47559119b4926b0e9fc366b28304c8713 100644 (file)
@@ -12,6 +12,7 @@
 
 #import "HBStateFormatter+Private.h"
 #import "HBTitle+Private.h"
+#import "HBJob+Private.h"
 
 #include <dlfcn.h>
 
@@ -243,13 +244,8 @@ typedef void (^HBCoreCleanupHandler)();
     NSAssert(url, @"[HBCore scanURL:] called with nil url.");
 
 #ifdef __SANDBOX_ENABLED__
-    BOOL accessingSecurityScopedResource = [url startAccessingSecurityScopedResource];
-    self.cleanupHandler = ^{
-        if (accessingSecurityScopedResource)
-        {
-            [url stopAccessingSecurityScopedResource];
-        }
-    };
+    __block HBSecurityAccessToken *token = [HBSecurityAccessToken tokenWithObject:url];
+    self.cleanupHandler = ^{ token = nil; };
 #endif
 
     // Reset the titles array
@@ -509,8 +505,8 @@ typedef void (^HBCoreCleanupHandler)();
 
 #ifdef __SANDBOX_ENABLED__
     HBJob *jobCopy = [job copy];
-    [jobCopy startAccessingSecurityScopedResource];
-    self.cleanupHandler = ^{ [jobCopy stopAccessingSecurityScopedResource]; };
+    __block HBSecurityAccessToken *token = [HBSecurityAccessToken tokenWithObject:jobCopy];
+    self.cleanupHandler = ^{ token = nil; };
 #endif
 
     // Add the job to libhb
index 2479516e60a255d4979f89f6aad71b872b1d9745..8392672536de91978c6fb495a0db2c221a159fb7 100644 (file)
@@ -7,6 +7,10 @@
 //
 
 #import <HandBrakeKit/HandBrakeKit.h>
+#import "HBSecurityAccessToken.h"
+
+@interface HBJob (Private) <HBSecurityScope>
+@end
 
 @interface HBVideo (Private)
 
@@ -44,7 +48,7 @@
 
 @end
 
-@interface HBSubtitles (Private)
+@interface HBSubtitles (Private) <HBSecurityScope>
 
 - (instancetype)initWithJob:(HBJob *)job;
 
index ff4af8d097738b1094a87acbaf320cd9eaca3726..66a42ccec0d4367687d4977eea59e9c1e0f7d1d8 100644 (file)
@@ -86,14 +86,6 @@ 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 3eac48e3dbdc612397caf70487dca7c7541c473c..725036377ff4fad8094449541ad68e31418dfe26 100644 (file)
 
 #import "HBAudioDefaults.h"
 #import "HBSubtitlesDefaults.h"
+#import "HBMutablePreset.h"
 
 #import "HBCodingUtilities.h"
-#import "HBMutablePreset.h"
+#import "HBUtilities.h"
+#import "HBSecurityAccessToken.h"
 
 #include "hb.h"
 
@@ -31,12 +33,12 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
 @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.
+ Keep track of security scoped resources status.
  */
-@property (nonatomic, readwrite) BOOL accessingSecurityScopedFileURL;
-@property (nonatomic, readwrite) BOOL accessingSecurityScopedOutputURL;
+@property (nonatomic, readwrite) HBSecurityAccessToken *fileURLToken;
+@property (nonatomic, readwrite) HBSecurityAccessToken *outputURLToken;
+@property (nonatomic, readwrite) HBSecurityAccessToken *subtitlesToken;
+@property (nonatomic, readwrite) NSInteger *accessCount;
 
 @end
 
@@ -230,16 +232,14 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
 - (BOOL)startAccessingSecurityScopedResource
 {
 #ifdef __SANDBOX_ENABLED__
-    if (!self.accessingSecurityScopedFileURL)
+    if (self.accessCount == 0)
     {
-        self.accessingSecurityScopedFileURL = [self.fileURL startAccessingSecurityScopedResource];
+        self.fileURLToken = [HBSecurityAccessToken tokenWithObject:self.fileURL];
+        self.outputURLToken = [HBSecurityAccessToken tokenWithObject:self.outputURL];
+        self.subtitlesToken = [HBSecurityAccessToken tokenWithObject:self.subtitles];
     }
-    if (!self.accessingSecurityScopedOutputURL)
-    {
-        self.accessingSecurityScopedOutputURL = [self.outputURL startAccessingSecurityScopedResource];
-    }
-
-    return self.accessingSecurityScopedFileURL || self.accessingSecurityScopedOutputURL;
+    self.accessCount += 1;
+    return YES;
 #else
     return NO;
 #endif
@@ -248,13 +248,13 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
 - (void)stopAccessingSecurityScopedResource
 {
 #ifdef __SANDBOX_ENABLED__
-    if (self.accessingSecurityScopedFileURL)
-    {
-        [self.fileURL stopAccessingSecurityScopedResource];
-    }
-    if (self.accessingSecurityScopedOutputURL)
+    self.accessCount -= 1;
+    NSAssert(self.accessCount >= 0, @"[HBJob stopAccessingSecurityScopedResource:] unbalanced call");
+    if (self.accessCount == 0)
     {
-        [self.outputURL stopAccessingSecurityScopedResource];
+        self.fileURLToken = nil;
+        self.outputURLToken = nil;
+        self.subtitlesToken = nil;
     }
 #endif
 }
@@ -322,41 +322,20 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
     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);
-        }
+        _fileURLBookmark = [HBUtilities bookmarkFromURL:_fileURL
+                                                options:NSURLBookmarkCreationWithSecurityScope |
+                                                        NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess];
     }
 
     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];
-        }
+        __attribute__((unused)) HBSecurityAccessToken *token = [HBSecurityAccessToken tokenWithObject:_outputURL];
+        _outputURLFolderBookmark = [HBUtilities bookmarkFromURL:_outputURL];
+        token = nil;
     }
 
     encodeObject(_outputURLFolderBookmark);
@@ -397,22 +376,11 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
         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);
-            }
+            _fileURL = [HBUtilities URLFromBookmark:_fileURLBookmark];
         }
         else
         {
@@ -423,16 +391,7 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
 
         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);
-            }
+            _outputURL = [HBUtilities URLFromBookmark:_outputURLFolderBookmark];
         }
         else
         {
diff --git a/macosx/HBSecurityAccessToken.h b/macosx/HBSecurityAccessToken.h
new file mode 100644 (file)
index 0000000..1ad0b39
--- /dev/null
@@ -0,0 +1,35 @@
+//
+//  HBSecurityAccessToken.h
+//  HandBrake
+//
+//  Created by Damiano Galassi on 24/01/17.
+//
+//
+
+#import <Foundation/Foundation.h>
+
+@protocol HBSecurityScope <NSObject>
+
+/*  Given an instance, 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
+
+@interface NSURL (HBSecurityScope) <HBSecurityScope>
+
+- (BOOL)startAccessingSecurityScopedResource;
+- (void)stopAccessingSecurityScopedResource;
+
+@end
+
+@interface HBSecurityAccessToken : NSObject
+
++ (instancetype)tokenWithObject:(id<HBSecurityScope>)object;
+- (instancetype)initWithObject:(id<HBSecurityScope>)object;
+
+@end
diff --git a/macosx/HBSecurityAccessToken.m b/macosx/HBSecurityAccessToken.m
new file mode 100644 (file)
index 0000000..027f669
--- /dev/null
@@ -0,0 +1,42 @@
+//
+//  HBSecurityAccessToken.m
+//  HandBrake
+//
+//  Created by Damiano Galassi on 24/01/17.
+//
+//
+
+#import "HBSecurityAccessToken.h"
+
+@interface HBSecurityAccessToken ()
+@property (nonatomic, readonly) id<HBSecurityScope> object;
+@property (nonatomic, readonly) BOOL accessed;
+@end
+
+@implementation HBSecurityAccessToken
+
+- (instancetype)initWithObject:(id<HBSecurityScope>)object;
+{
+    self = [super init];
+    if (self)
+    {
+        _object = object;
+        _accessed = [_object startAccessingSecurityScopedResource];
+    }
+    return self;
+}
+
++ (instancetype)tokenWithObject:(id<HBSecurityScope>)object
+{
+    return [[self alloc] initWithObject:object];
+}
+
+- (void)dealloc
+{
+    if (_accessed)
+    {
+        [_object stopAccessingSecurityScopedResource];
+    }
+}
+
+@end
index c98f9fcecfff64d5f74bce13c15d0c12399e8fde..7a0ca382898f6959f7dd4db067c55d90e0ee5237 100644 (file)
@@ -13,7 +13,9 @@
 #import "HBJob+HBJobConversion.h"
 #import "HBTitle.h"
 #import "HBCodingUtilities.h"
+#import "HBUtilities.h"
 #import "HBJob+Private.h"
+#import "HBSecurityAccessToken.h"
 
 #include "common.h"
 
@@ -22,6 +24,7 @@ extern NSString *keySubTrackLanguageIsoCode;
 extern NSString *keySubTrackType;
 
 extern NSString *keySubTrackSrtFileURL;
+extern NSString *keySubTrackSrtFileURLBookmark;
 
 #define NONE_TRACK_INDEX        0
 #define FOREIGN_TRACK_INDEX     1
@@ -30,6 +33,9 @@ extern NSString *keySubTrackSrtFileURL;
 
 @property (nonatomic, readwrite) NSArray<NSDictionary *> *sourceTracks;
 
+@property (nonatomic, readonly) NSMutableArray<HBSecurityAccessToken *> *tokens;
+@property (nonatomic, readwrite) NSInteger *accessCount;
+
 @property (nonatomic, readwrite, weak) HBJob *job;
 @property (nonatomic, readwrite) int container;
 
@@ -50,6 +56,7 @@ extern NSString *keySubTrackSrtFileURL;
 
         _tracks = [[NSMutableArray alloc] init];
         _defaults = [[HBSubtitlesDefaults alloc] init];
+        _tokens = [NSMutableArray array];
 
         NSMutableArray *sourceTracks = [job.title.subtitlesTracks mutableCopy];
 
@@ -215,12 +222,26 @@ extern NSString *keySubTrackSrtFileURL;
 
 - (void)addSrtTrackFromURL:(NSURL *)srtURL
 {
+#ifdef __SANDBOX_ENABLED__
+    // Create the security scoped bookmark
+    NSData *bookmark = [HBUtilities bookmarkFromURL:srtURL
+                                    options:NSURLBookmarkCreationWithSecurityScope |
+                                            NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess];
+#endif
+
     // Create a new entry for the subtitle source array so it shows up in our subtitle source list
     NSMutableArray *sourceTrack = [self.sourceTracks mutableCopy];
+#ifdef __SANDBOX_ENABLED__
     [sourceTrack addObject:@{keySubTrackName: srtURL.lastPathComponent,
-                                   keySubTrackType: @(SRTSUB),
-                                   keySubTrackSrtFileURL: srtURL}];
-    self.sourceTracks = sourceTrack;
+                             keySubTrackType: @(SRTSUB),
+                             keySubTrackSrtFileURL: srtURL,
+                             keySubTrackSrtFileURLBookmark: bookmark}];
+#else
+    [sourceTrack addObject:@{keySubTrackName: srtURL.lastPathComponent,
+                             keySubTrackType: @(SRTSUB),
+                             keySubTrackSrtFileURL: srtURL}];
+#endif
+    self.sourceTracks = [sourceTrack copy];
     HBSubtitlesTrack *track = [self trackFromSourceTrackIndex:self.sourceTracksArray.count - 1];
     [self insertObject:track inTracksAtIndex:[self countOfTracks] - 1];
 }
@@ -396,6 +417,38 @@ extern NSString *keySubTrackSrtFileURL;
     }];
 }
 
+- (BOOL)startAccessingSecurityScopedResource
+{
+#ifdef __SANDBOX_ENABLED__
+    if (self.accessCount == 0)
+    {
+        for (NSDictionary *sourceTrack in self.sourceTracks)
+        {
+            if (sourceTrack[keySubTrackSrtFileURLBookmark])
+            {
+                [self.tokens addObject:[HBSecurityAccessToken tokenWithObject:sourceTrack[keySubTrackSrtFileURL]]];
+            }
+        }
+    }
+    self.accessCount += 1;
+    return YES;
+#else
+    return NO;
+#endif
+}
+
+- (void)stopAccessingSecurityScopedResource
+{
+#ifdef __SANDBOX_ENABLED__
+    self.accessCount -= 1;
+    NSAssert(self.accessCount >= 0, @"[HBSubtitles stopAccessingSecurityScopedResource:] unbalanced call");
+    if (self.accessCount == 0)
+    {
+        [self.tokens removeAllObjects];
+    }
+#endif
+}
+
 #pragma mark - NSCopying
 
 - (instancetype)copyWithZone:(NSZone *)zone
@@ -419,6 +472,7 @@ extern NSString *keySubTrackSrtFileURL;
         }
 
         copy->_defaults = [_defaults copy];
+        copy->_tokens = [NSMutableArray array];
     }
 
     return copy;
@@ -445,8 +499,33 @@ extern NSString *keySubTrackSrtFileURL;
 {
     self = [super init];
 
+    _tokens = [NSMutableArray array];
+
     decodeInt(_container);
-    decodeCollectionOfObjects2(_sourceTracks, NSArray, NSDictionary, NSURL);
+    decodeCollectionOfObjects3(_sourceTracks, NSArray, NSDictionary, NSURL, NSData);
+
+#ifdef __SANDBOX_ENABLED__
+    NSMutableArray *sourceTracks = [_sourceTracks mutableCopy];
+    for (NSDictionary *sourceTrack in _sourceTracks)
+    {
+        if (sourceTrack[keySubTrackSrtFileURLBookmark])
+        {
+            NSMutableDictionary<NSString *, id> *copy =  [sourceTrack mutableCopy];
+            NSURL *srtURL = [HBUtilities URLFromBookmark:sourceTrack[keySubTrackSrtFileURLBookmark]];
+            if (srtURL)
+            {
+                copy[keySubTrackSrtFileURL] = srtURL;
+            }
+            [sourceTracks addObject:copy];
+        }
+        else
+        {
+            [sourceTracks addObject:sourceTrack];
+        }
+    }
+    _sourceTracks = [sourceTracks copy];
+#endif
+
     decodeCollectionOfObjects(_tracks, NSMutableArray, HBSubtitlesTrack);
 
     for (HBSubtitlesTrack *track in _tracks)
index bcff453fad44e6e8dc90c10091ba70e590210ae9..f87a7be5ba4ac9829be2f61ff2dcb1c8290f36b1 100644 (file)
@@ -19,6 +19,7 @@ NSString *keySubTrackName = @"keySubTrackName";
 NSString *keySubTrackLanguageIsoCode = @"keySubTrackLanguageIsoCode";
 NSString *keySubTrackType = @"keySubTrackType";
 NSString *keySubTrackSrtFileURL = @"keySubTrackSrtFileURL";
+NSString *keySubTrackSrtFileURLBookmark = @"keySubTrackSrtFileURLBookmark";
 
 @interface HBSubtitlesTrack ()
 @property (nonatomic, readwrite) BOOL validating;
index c7f195b1fdd7ec7b91c94a5510e7059d6af133d8..1807cdca8159eca7d4d4796aad7d8f521fee4ff6 100644 (file)
@@ -32,6 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 + (nullable NSURL *)URLFromBookmark:(NSData *)bookmark;
 + (nullable NSData *)bookmarkFromURL:(NSURL *)url;
++ (nullable NSData *)bookmarkFromURL:(NSURL *)url options:(NSURLBookmarkCreationOptions)options;
 
 + (NSString *)displayNameForURL:(NSURL *)URL;
 + (NSURL *)mediaURLFromURL:(NSURL *)URL;
index a0db9927b3e50c6d87d2b1c2d09f901fa0f1537d..8d83f46f3bf6010342e612538b0f9b7b7024bbd0 100644 (file)
     return isStale ? nil : url;
 }
 
-+ (nullable NSData *)bookmarkFromURL:(NSURL *)url
++ (nullable NSData *)bookmarkFromURL:(NSURL *)url options:(NSURLBookmarkCreationOptions)options
 {
     NSParameterAssert(url);
 
     NSError *error;
 
-    NSData *bookmark = [url bookmarkDataWithOptions:NSURLBookmarkCreationWithSecurityScope includingResourceValuesForKeys:nil relativeToURL:nil error:&error];
+    NSData *bookmark = [url bookmarkDataWithOptions:options includingResourceValuesForKeys:nil relativeToURL:nil error:&error];
 
     if (error)
     {
     return bookmark;
 }
 
++ (nullable NSData *)bookmarkFromURL:(NSURL *)url
+{
+    return [HBUtilities bookmarkFromURL:url options:NSURLBookmarkCreationWithSecurityScope];
+}
+
 + (NSString *)displayNameForURL:(NSURL *)URL
 {
     NSString *displayName = URL.lastPathComponent;
index 091c5261e6141b37abea976e566a6ac2b28229ad..bf1467439bb3480b5cf508c21f844b9d5b6c2ef7 100644 (file)
                A91CE2FC1C7DB99D0068F46F /* HBPreset.h in Headers */ = {isa = PBXBuildFile; fileRef = A9CF25F21990D64E0023F727 /* HBPreset.h */; settings = {ATTRIBUTES = (Public, ); }; };
                A91CE2FD1C7DB99D0068F46F /* HBMutablePreset.h in Headers */ = {isa = PBXBuildFile; fileRef = A96CD1741BCC5F9100F372F1 /* HBMutablePreset.h */; settings = {ATTRIBUTES = (Public, ); }; };
                A91CE2FE1C7DB99D0068F46F /* HBTreeNode.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D488A31996270300E9B1BA /* HBTreeNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
+               A91D54871E378ABD006D0997 /* HBSecurityAccessToken.h in Headers */ = {isa = PBXBuildFile; fileRef = A91D54851E378ABD006D0997 /* HBSecurityAccessToken.h */; };
+               A91D54881E378ABD006D0997 /* HBSecurityAccessToken.m in Sources */ = {isa = PBXBuildFile; fileRef = A91D54861E378ABD006D0997 /* HBSecurityAccessToken.m */; };
                A91F97351D7B2A4E00D82DCE /* HBAudioTransformers.h in Headers */ = {isa = PBXBuildFile; fileRef = A91F97331D7B2A4E00D82DCE /* HBAudioTransformers.h */; };
                A91F97361D7B2A4E00D82DCE /* HBAudioTransformers.m in Sources */ = {isa = PBXBuildFile; fileRef = A91F97341D7B2A4E00D82DCE /* HBAudioTransformers.m */; };
                A92268781A6E555500A8D5C5 /* HBAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A92268771A6E555500A8D5C5 /* HBAppDelegate.m */; };
                A91CE2CF1C7DABCE0068F46F /* libbz2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.tbd; path = usr/lib/libbz2.tbd; sourceTree = SDKROOT; };
                A91CE2D11C7DABDA0068F46F /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
                A91CE2D31C7DABE40068F46F /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; };
+               A91D54851E378ABD006D0997 /* HBSecurityAccessToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBSecurityAccessToken.h; sourceTree = "<group>"; };
+               A91D54861E378ABD006D0997 /* HBSecurityAccessToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBSecurityAccessToken.m; sourceTree = "<group>"; };
                A91F97331D7B2A4E00D82DCE /* HBAudioTransformers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBAudioTransformers.h; sourceTree = "<group>"; };
                A91F97341D7B2A4E00D82DCE /* HBAudioTransformers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBAudioTransformers.m; sourceTree = "<group>"; };
                A92268761A6E555500A8D5C5 /* HBAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBAppDelegate.h; sourceTree = "<group>"; };
                                A93B0DF71C804CF50051A3FA /* NSDictionary+HBAdditions.m */,
                                A98F38041C7DCA7E00E469C8 /* HBStateFormatter+Private.h */,
                                A98F38051C7DCA7E00E469C8 /* HBStateFormatter+Private.m */,
+                               A91D54851E378ABD006D0997 /* HBSecurityAccessToken.h */,
+                               A91D54861E378ABD006D0997 /* HBSecurityAccessToken.m */,
                        );
                        name = Others;
                        sourceTree = "<group>";
                        files = (
                                A9736F051C7DA5FE008F1D18 /* HandBrakeKit.h in Headers */,
                                A91CE2D71C7DAEEE0068F46F /* HBCore.h in Headers */,
+                               A91D54871E378ABD006D0997 /* HBSecurityAccessToken.h in Headers */,
                                A91CE2D81C7DAEEE0068F46F /* HBTitle.h in Headers */,
                                A91CE2D91C7DAEEE0068F46F /* HBJob.h in Headers */,
                                A91CE2DA1C7DAEEE0068F46F /* HBRange.h in Headers */,
                                A91CE2A01C7DA7320068F46F /* HBRange+UIAdditions.m in Sources */,
                                A91CE2A21C7DA7320068F46F /* HBVideo+UIAdditions.m in Sources */,
                                A91CE2A41C7DA7320068F46F /* HBPicture+UIAdditions.m in Sources */,
+                               A91D54881E378ABD006D0997 /* HBSecurityAccessToken.m in Sources */,
                                A91119A61C7DD64A001C463C /* HBDistributedArray.m in Sources */,
                                A91CE2A61C7DA7320068F46F /* HBFilters+UIAdditions.m in Sources */,
                                A91CE2A81C7DA7320068F46F /* HBDVDDetector.m in Sources */,