Reputation: 139
I have an iOS app that stores data in Google Drive as hidden app data.
How can I access the hidden app data for this app (besides using the app itself)?
(A similar question has been asked and answered here, but in reference to an Android app. The answer however makes use of the Android apk file, which I don't have since I'm using an app on iOS. I am guessing the same information could be gotten from analyzing packets with Wireshark or Charles Proxy or the like; I just am not sure what I'm looking for exactly.)
Upvotes: 2
Views: 5361
Reputation: 117271
The 'Application Data folder' is a special folder that is only accessible by your application. Its content is hidden from the user, and from other apps.
The permissions to access and see the application data folder are locked to your application denoted by its client credentials. The only way to see what is in it is with client associated with that application and the consent granted by the user who has authenticated your application.
How can I access the hidden app data for this app (besides using the app itself)?
The data is locked to your application. Your application is denoted by the client ID/client secret. If you have access to the client credentials for this application then you could create another application and access the data that way.
How can I access hidden app data stored in Google Drive?
NSData *fileData = [[NSFileManager defaultManager] contentsAtPath:@"files/config.json"];
GTLRDrive_File *metadata = [GTLRDrive_File object];
metadata.name = @"config.json";
metadata.parents = @[@"appDataFolder"];
GTLRUploadParameters *uploadParameters = [GTLRUploadParameters uploadParametersWithData:fileData
MIMEType:@"application/json"];
uploadParameters.shouldUploadWithSingleRequest = TRUE;
GTLRDriveQuery_FilesCreate *query = [GTLRDriveQuery_FilesCreate queryWithObject:metadata
uploadParameters:uploadParameters];
query.fields = @"id";
[driveService executeQuery:query completionHandler:^(GTLRServiceTicket *ticket,
GTLRDrive_File *file,
NSError *error) {
if (error == nil) {
NSLog(@"File ID %@", file.identifier);
} else {
NSLog(@"An error occurred: %@", error);
}
}];
Code example stolen from Storing Application Data there are examples on this page for using other languages as well.
Upvotes: 3