Commit b88d27f2 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Andreas Traczyk

fix: check if app is sandboxed

Change-Id: Ib1789b188722994c6b14208ca02a721db9ad3b5e
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 44dea104
......@@ -131,8 +131,9 @@ static inline bool isUrlAccessibleFromSandbox(NSURL* url)
static inline bool appSandboxed()
{
NSString* bundleID = [[NSBundle mainBundle] bundleIdentifier];
NSDictionary* environment = [[NSProcessInfo processInfo] environment];
if(environment[bundleID]) {
NSString* url = [[NSURL fileURLWithPath:NSHomeDirectory()] path];
NSString* appPath = [@"Library/Containers/" stringByAppendingString:bundleID];
if ([url containsString: appPath]) {
return YES;
}
return NO;
......
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