I'm developing an APP on Mac. There will be some template sensitive file be decrypte during the user using it.
I don't want my client see these files by Finder or Terminal, so I tried to mount a file system and store the decrypted folder under the filessystem, then don't return the contents of decrypted folder when filesystem call contentsOfDirectory
. It works under my filesystem.
But when user directly access these files by Finder(not from my filesystem mounted path), the files are still here can be seen by the user.
Is there anyway to make my files hide from Finder? Such as Finder extension, or some special folder Mac offered to store these sensitive files?
After several days research, finally I found a way to hide contents of the folder.
Just use the Endpoint system extension, and deny all ES_EVENT_TYPE_AUTH_READDIR when
the msg->event.readdir.target->path.data
is my folder path.
Although this makes it impossible for me to see these files under my filesystem, but I can still use file system API such as open(),
createFile()
to do some operations on the files.