I would like to implement a file access control in the Android framework. It has to be global - for each app. So each file call (for example open an image) should be checked by this controller.
I thought to place it in the FileInputStream or FileDescriptor class. Both doesn't support direct access to the file path by them self: FileDescriptor no path variable and: InputStream no path.
But, how it is mentioned in the other question, I will try to use a WeakHashMap<FileDescriptor,File>
to store the relations and information about the called FileDescriptor/InputStream.
The Java Security Manager provides an authentication & access control api.
My question is now, is it possible to use it (by using checkRead(FileDescriptor fd)
) in the Android framework? I also want to have dynamic restriction-filter, for example time-dependent access to the files.
I can't find something about in combination so I didn't even know if it's implementable. Here (Java and Android Security) we can see only the separately advantages of them.