Gdrive Hidden Data on App Folder or other ways to hide data

Hello,

I am currently searching for ways to make my data inside Google Drive hidden.
Even though I have an EDU account, and in somehow my data is more protected from Google invasive analyses of my data than traditional Free accounts, I am still somehow afraid of having my account hacked. I know I am a bit paranoid, but it is never bad to have my data as protected as possible.
I found out that some apps can store data in Gdrive using “App Data” Folder. This “App Data” will not appear on Gdrive WebUI interface. It seems only the app which created the “App Data” can access it.
Do you know if there is a way to create “App Data” folders with rclone and store backups on it, instead of traditional folders? This would be a great feature… Or do you know if at least it is possible to hide the files in some way? I tried to add a “.” to the start of filenames, and it didn’t work.
If you want to see an example of an app using this feature, please, take a look at: http://hiddenfolder.flowsoft7.com/
Also, here we can find the documentation on AppData: https://developers.google.com/drive/v3/web/appdata
Thanks for your help!

If you make these changes to rclone

@@ -57,7 +57,10 @@ var (
 	driveUploadCutoff = chunkSize
 	// Description of how to auth for this app
 	driveConfig = &oauth2.Config{
-		Scopes:       []string{"https://www.googleapis.com/auth/drive"},
+		Scopes: []string{
+			"https://www.googleapis.com/auth/drive",
+			"https://www.googleapis.com/auth/drive.appdata",
+		},
 		Endpoint:     google.Endpoint,
 		ClientID:     rcloneClientID,
 		ClientSecret: fs.MustReveal(rcloneEncryptedClientSecret),
@@ -434,6 +437,7 @@ func NewFs(name, path string) (fs.Fs, error) {
 	if f.isTeamDrive {
 		f.about.RootFolderId = f.teamDriveID
 	}
+	f.about.RootFolderId = "appDataFolder"
 
 	f.dirCache = dircache.New(root, f.about.RootFolderId, f)

And recompile, then re-authenticate then I think it will probably do what you want.

I compiled this here - let me know if that does what you want and if it does please make a new issue on github and I’ll implement it properly.

Note that the appData folder is private to rclone’s client_id so you should probably get your own client id if you want to experiment with this.

https://pub.rclone.org/v1.38-085-g8f4a5cca-drive-appdataβ/

Hello Nick,

Thanks a lot for the fast answer.
I have tried your compiled version, but unhappily it seems there are more steps needed to get it working. I use my own client_id, but I am getting this error when trying to copy a file:

Failed to copy: googleapi: Error 403: The current scope does not allow use of the appdata folder, forbidden

It would be great if we could add AppData Gdrive accounts while adding a remote via rclone config.

Regards
p.s.: I am creating a Github issue right now.

UPDATE:
I have added a new Remote using the version you compiled and now it works great! I will do some more testing to see if nothing is broken.
I think now it is just a matter of creating an option of adding “Gdrive App Data” remotes, on rclone config.

Great - thanks!

It needs a bit of docs too. I’ll think about the neatest way of integrating it unless you’d like to do some coding?

Sure, adding a function would need extra docs. But it would be almost copy and paste from actual GDrive.
I feel challenged to code it myself, it would indeed be a good opportunity to learn some Go, and get more into rclone structure. But it might take me sometime.

I am looking through the code on Github right now, and I can’t find the part of the code that manages the rclone config functions. Which files should I look for?

Everything you would need to change would be in drive/drive.go

I see… I was thinking of adding a new remote type.
There is Google Drive, and there could be Google Drive AppFolder. I think it would be neat if it was implemented like this.

If I do add an extre register do the fs (like this):
fs.Register(&fs.RegInfo{
Name: “driveapp”,
Description: “Google Drive AppFolder”,
etc…
A new kind of remote will be automatically added?
I am sorry, I don’t have the time this week to look through the entire rclone code. It is a big project by now. I will need some hours of digging.

I think the way to do this is to add another config parameter called “root_id” and a config option to type this in, one of the defaults being “appDataFolder”. The root_id would be useful for other purposes too… This would need a small patch to set f.about.RootFolderId from that config parameter. So probably about 10 lines of extra code in total.

If I get right the implementation would be similar to the one of TeamDrive?

Yes, you set it up once and it will be forever appdata.