Skip to content
Snippets Groups Projects
Commit b88d27f2 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Andreas Traczyk
Browse files

fix: check if app is sandboxed


Change-Id: Ib1789b188722994c6b14208ca02a721db9ad3b5e
Reviewed-by: default avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 44dea104
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment