Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set temp directory used by iOS to background readable #20061

Merged
merged 2 commits into from
Oct 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions shared/ios/Keybase/Fs.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ - (BOOL) maybeMigrateDirectory:(NSString*)source dest:(NSString*)dest {
}

- (NSString*) setupAppHome:(NSString*)home sharedHome:(NSString*)sharedHome {
NSURL* tempUrl = [[NSFileManager defaultManager] temporaryDirectory];
// workaround a problem where iOS dyld3 loader crashes if accessing .closure files
// with complete data protection on
NSString* dyldDir = [NSString stringWithFormat:@"%@/com.apple.dyld", [tempUrl path]];
// Setup all directories
NSString* appKeybasePath = [@"~/Library/Application Support/Keybase" stringByExpandingTildeInPath];
NSString* appEraseableKVPath = [@"~/Library/Application Support/Keybase/eraseablekvstore/device-eks" stringByExpandingTildeInPath];
[self createBackgroundReadableDirectory:dyldDir setAllFiles:YES];
[self createBackgroundReadableDirectory:appKeybasePath setAllFiles:YES];
[self createBackgroundReadableDirectory:appEraseableKVPath setAllFiles:YES];
[self addSkipBackupAttributeToItemAtPath:appKeybasePath];
Expand Down