Commit be1cfefe authored by Damiano Galassi's avatar Damiano Galassi

MacGui: disable security-scoped bookmarks resolution in the XPC service.

parent 9f05d779
......@@ -35,6 +35,14 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)writeErrorToActivityLog:(NSError *)error;
+ (void)writeToActivityLogWithNoHeader:(NSString *)text;
/**
Whether to resolve the security-scoped bookmarks or not.
Security-scoped bookmarks can't be resolved in a XPC service.
Use this options to avoid not useful errors
*/
@property (nonatomic, class, readwrite) BOOL resolveBookmarks;
+ (nullable NSURL *)URLFromBookmark:(NSData *)bookmark;
+ (nullable NSData *)bookmarkFromURL:(NSURL *)url;
+ (nullable NSData *)bookmarkFromURL:(NSURL *)url options:(NSURLBookmarkCreationOptions)options;
......
......@@ -9,6 +9,8 @@
#include "lang.h"
static BOOL hb_resolveBookmarks = YES;
@implementation HBUtilities
+ (NSString *)handBrakeVersion
......@@ -73,8 +75,23 @@
fprintf(stderr, "%s", text.UTF8String);
}
+ (void)setResolveBookmarks:(BOOL)resolveBookmarks
{
hb_resolveBookmarks = resolveBookmarks;
}
+ (BOOL)resolveBookmarks
{
return hb_resolveBookmarks;
}
+ (nullable NSURL *)URLFromBookmark:(NSData *)bookmark
{
if (hb_resolveBookmarks == NO)
{
return nil;
}
NSParameterAssert(bookmark);
NSError *error;
......
......@@ -5,6 +5,8 @@
#import <Foundation/Foundation.h>
#import "HandBrakeXPCService.h"
@import HandBrakeKit;
@interface HBXPCServiceDelegate : NSObject <NSXPCListenerDelegate>
@end
......@@ -27,6 +29,8 @@
int main(int argc, const char *argv[])
{
HBUtilities.resolveBookmarks = NO;
HBXPCServiceDelegate *delegate = [HBXPCServiceDelegate new];
NSXPCListener *listener = [NSXPCListener serviceListener];
......
......@@ -21,7 +21,11 @@ BUILD.out += $(MACOSX.osl.filelist)
MACOSX.project = -project $(MACOSX.src/)HandBrake.xcodeproj
## configuration: must be one of { release, debug }
MACOSX.configuration = -configuration $(MACOSX.map.g.$(MACOSX.GCC.g))
ifeq (1,$(FEATURE.macos.sandbox))
MACOSX.configuration = -configuration $(MACOSX.map.g.$(MACOSX.GCC.g))-sandbox
else
MACOSX.configuration = -configuration $(MACOSX.map.g.$(MACOSX.GCC.g))
endif
## mapping from symbolic debug value to xcode configuration
MACOSX.map.g.none = release
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment