How to prevent apps from using my SD for its data? So, as you all know, even though they are they're installed in internal app memory, some apps tend to store some of its data in internal SD and some in external SD card. (To be more precise, in "/sdcard/Android/data/" and "/extSdCard/Android/data/" folder, respectively.) 

Now, I was wondering if there was any way to prevent this, so that they store their data only in the app's private folder (in "/data/data/app-package/")? Or at least prevent writing data into the external SD card and just use internal SD for the purpose? 

Info:
- Model: Samsung s3
- OS: Android 4.4 stock ROM (rooted)
Since the device is rooted you can install XPrivacy from Play Store. For this app to work you need to install Xposed Framework. Once this framework is installed, you'll have to enable XPrivacy's  module in Xposed framework which will require a reboot.


Once XPrivacy is installed and device rebooted, launch the app and tap any app icon amongst the list of apps icons(say Facebook app icon).
Scroll down to Storage and tap it to list permissions inside it.
Two entries there requires our attention:

getExternalStorageState -- Returns the current state of the primary "external" storage device.
sdcard (aka [(READ/WRITE/ACCESS_ALL)_EXTERNAL_STORAGE]) -- Allows an application to read/write from and into external storage. 



Now that it is obvious from the context I mentioned around these two entries, you can go ahead restricting them for the apps you desire. 

Note that there could be repercussions for restricting them, and the obvious would be the app failing to launch or crashing intermittently. It is advised to take a nandroid backup as well as an app backup.

XPrivacy allows et al.: 


Creating a template of permissions which can be applied on apps individually rather than selecting the permissions by going into every app individually. The pro version allows applying this template on multiple apps simultaneously.
Restrict on Demand feature which will seek user's discretion every time a selected app is launched.
Automatic default template implementation on any new user installed app.




About XPrivacy


  Privacy can prevent applications from leaking privacy sensitive data by restricting the categories of data an application can access. XPrivacy feeds applications fake data or no data at all. It can restrict several data categories, such as contacts or location. For example, if you restrict an application's access to contacts, that application will receive an empty contacts list. Similarly, restricting an application's access to your location will send a fake location to that application.
  
  XPrivacy doesn't revoke or block permissions from an application, so most applications will continue to work as before and won't force close (crash).


About Xposed Framework


  Xposed is a framework for modules that can change the behavior of the system and apps without touching any APKs. That's great because it means that modules can work for different versions and even ROMs without any changes (as long as the original code was not changed too much). It's also easy to undo. As all changes are done in the memory, you just need to deactivate the module and reboot to get your original system back. There are many other advantages, but here is just one more: Multiple modules can do changes to the same part of the system or app. With modified APKs, you to decide for one. No way to combine them, unless the author builds multiple APKs with different combinations.