Nominate our 2022 Qt Champions!

How to hide (and protect) data files on Symbian?

  • Hi,

    my applications currently installs a lot of media files (images, sounds, etc.) into E:\somedir. It basically works, but there are a couple of problems with that approach. So my questions are:

    • How can I prevent those files from showing up in the music player and image viewer apps?
    • Can I prevent users to access those files through the file manager?
    • If I publish this app on Ovi, is this media content somehow protected?

    Unfortunately I can't put all these media assets into a resource file because they are around 100MB.

    I'd be happy to hear your suggestions!

  • What level of protection are you looking for?
    One way to prevent a scatter of loose media files would be to put them all in a tar (-like) file container format. That would of course not provide any real protection to the files themselves, but would probably shield them from showing up in your media player and file manager apps.

  • Thanks Andre! My primary concern is, that those files won't show up in some other apps. For example, I'm also distributing many many map tiles and it's really annoying to have your photos mixed with 1000 map tiles ;) So here some tar-like container would be sufficient. Is there anything like that in Qt? Best would be an API that represents the content of that container as files system.

    And since I'm packaging content that was provided by others, my secondary concern would be to protect this content from being illegally copied. I think Ovi applies some DRM to published apps, no?

  • There are solutions for that, yes. I know of a solution for using .zip files that exposes them as a QIODevice, so you can read them like a file. Here are a few of them mentioned:

    I don't know anything about protecting your data from misuse or OVI's features for that. Note that any protection will be breachable: your application must be able to read the data, thus any protection can be breached by your program, thus anything you need for getting the raw data is on the device that is beyond your control. That means: no security you can enforce. Look at DVD and Blue-ray and all those formats. One by one, they are broken, and they are using way more sophisticated schemes than I could come up with.

  • Thanks a lot! I'll read through the other thread. I hope random access inside a ZIP file will be fast enough and that not the complete file has to live in memory. I'll try it and report my findings here.

    Regarding DRM: Of course I know that it's breachable, but at least I'd like to tell my clients that I've done everything (within reason) to protect their assets. But, as I said, that's only my secondary concern and I'll look at it closer once I coped with the real problem :)

    Last question is there a simply way in Symbian to hide files from file manager. Something like .dot files on Linux?

  • That's why I started with suggesting a .tar like format. That whould handle seeking just fine. Note that you can easily create something like that yourself. All you would need to do, is create a file that starts with an index with file names and their offsets into the file, and then concatenate all content files in that one file. That should be pretty fast, I think.

    The last question is a bit too Symbian specific for this forum. Perhaps you can find that out more easily on a more specialized channel.

  • 'Bugless' claims to handle tar and zip also they provide a QIODevice interface. The latter is something I think, I really need because currently I'll pass QUrls from C++ to QML and then use QML to render audio and images. So even if I roll my own solution I probably need to have a closer look at all the QIO stuff.

    Lots to do :)

  • [quote author="conny" date="1301568350"]
    Last question is there a simply way in Symbian to hide files from file manager. Something like .dot files on Linux?
    One quick solution is to change file attributes to hidden.That way they will not appear in file manager or any other app on the device.

  • Thanks itzwiz! Do you maybe have a link that explains how to do that? I couldn't find anything. I mean, I somehow need to tell the .sis package to alter those permissions, right?

    Also I've seen that putting the files into the private app directory could work. But I couldn't find information whether or not it's possible to have a private app dir on drive E.

  • I am not aware of any qt api to hide a folder.But if you want a symbian specific solution then you can use following piece of code to make your folder hidden.Now all the files inside this hidden folder will not be visible to any application.

    RFs fs;
    fs.SetAtt( KFolder, KEntryAttHidden,KEntryAttNormal );

  • Thanks for that! Now it would be even better to have this during installation. Because if I do it like this, the images still might show up on the image viewer before my app was started the first time.

Log in to reply