1

I need to secure my apps data securely on external data. Is there a way to hide data from getting accessed via other apps or by USB? There is lot of data so don't want to use internal storage in private mode. How can I set permissions on a file like chmod 700 ?

App data is PDF file which need to be opened in PDF readers. So need to take care of that also

Abhinav Tyagi
  • 5,158
  • 3
  • 30
  • 60

1 Answers1

1

Is there a way to hide data from getting accessed via other apps or by USB?

No.

There is lot of data so don't want to use internal storage in private mode.

On most Android 3.0+ devices, internal storage and external storage are on the same partition and have the same amount of space. Hence, if a "lot of data" is too much for internal storage, it is too much for external storage, on most Android 3.0+ devices.

It is on Android 1.x/2.x where internal storage tended to be separate and a lot smaller than external storage.

How can I set permissions on a file like chmod 700 ?

You can't.

You are welcome to use libraries like Facebook's Conceal to encrypt files on external storage, using a key maintained on internal storage. This has the net effect of preventing others from examining your data (except on rooted devices, of course). However, users or other apps can still delete your files.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • If I use internal storage will I be able to pass intent to pdf readers to read this data? – Abhinav Tyagi Jun 25 '14 at 13:17
  • @AbhinavTyagi: You would need to use something [like `FileProvider`](http://developer.android.com/reference/android/support/v4/content/FileProvider.html) for that. Of course, you would need a similar sort of `ContentProvider` to decrypt Conceal'd files as well. – CommonsWare Jun 25 '14 at 13:20