Created
July 13, 2015 07:07
-
-
Save greg/04ac59de24c21aa5e9b7 to your computer and use it in GitHub Desktop.
Skedule backup file extractor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// Skedule Data Extractor | |
// | |
// Created by Greg Omelaenko on 27/09/12. | |
// Copyright (c) 2012 Mostly Infinite Studios. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
int main(int argc, const char * argv[]) | |
{ | |
NSURL *url = [NSURL fileURLWithPath:@(argv[1])]; | |
NSData *importedData = [NSData dataWithContentsOfURL:url]; | |
NSFileWrapper *archive = [[NSFileWrapper alloc] initWithSerializedRepresentation:importedData]; | |
NSData *database = [[[archive fileWrappers] objectForKey:@"data.sqlite"] regularFileContents]; | |
[database writeToURL:[[url URLByDeletingLastPathComponent] URLByAppendingPathComponent:@"data.sqlite"] atomically:YES]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment