3

TL;DR On non-rooted devices, where do Android apps store data that survives uninstall?

Backstory: I installed an Android app a couple months ago and configured it to my liking. After a couple weeks, I no longer needed it, so I uninstalled it. After the uninstall, I didn't see any files left behind in Internal Storage, and the device had no microSD card installed, so no files were stored there either.

To my surprise, when I reinstalled the app, it remembered all of it's configurations. I use a firewall, so it didn't download the configurations from the cloud.

Thus, the question: On non-rooted devices, where do Android apps store data that survives an uninstall?

4

Apps are supposed to store their data and related files either in /sdcard/Android/data/com.app.id or /data/data/com.app.id; however, many apps (especially ones from China) don't abide by this guideline and create folders in storage individually, that store various information.

For example, apps using Aliyun SDK will generate .DataStorage, .SystemConfig and .UTSystemConfig directories under the root of the internal storage, primarily for storing device ID info. Such info can be used to identify users even if they haven't registered an account of respective apps.

As for what you described - fully-locally-stored data (no access to cloud) - it also is possible. I have one such example on my phone which is a 3rd-party app to a forum (I prefer not to disclose what exact app it is), with several features like signatures, custom ID flairs to enhance the original app. It stores all settings related to those enhancements under .db files in a folder under the root of internal storage. When the user changes device, he can just copy the folder over to the new device, and upon opening these customizations will be read and appear intact. Below shows one of the pages of its main .db file, storing key setting values (sensitive info redacted):

enter image description here

  • This is the only way known to me for an app to have its data survive an uninstallation. +1. – Death Mask Salesman Nov 16 '17 at 8:05
0

Some applications may leave the application residues in /data partition specifically, /data/data/com.packagename where package name represents the particular application package.

In these directories that's where you usually find app's databases, configs as well as preferences files, which are normally preserved during reinstalling or updating etc (which is the reason I suspect they might be preserved even during uninstalls)

In any case, you can actually scan these residual or "corpse" files with 3rd party applications such as sd maid to have a clear breakdown.

I tested on Android 4.3 perhaps things have changed since then, but at in basing my answer on that

  • 2
    Xavier_fakerat, Does that mean non-rooted devices can not delete the residual files? How does a 3rd party app have access to files the user doesn't? – LateralTerminal Nov 15 '17 at 21:18
  • 3
    From Lollipop onwards, I've never seen examples of /data/data/com.packagename app data surviving the parent app being uninstalled, unlike what happens on Microsoft Windows. Could you provide some examples of this behavior happening in the wild? – Death Mask Salesman Nov 15 '17 at 22:01
  • @Death what I meant is that the /data directory is not visible is your device is not rooted and additionally, one needs root explorer to view this directory. FYI I tested on Android 4.3 which I'm using, so this explains why. There are chances that residual files may remain after uninstallation its just a possibility which you can't count out – xavier_fakerat Nov 16 '17 at 3:24
  • @LateralTerminal basing my explanation on Android version Im using, in the first place you need root, to view the /data directory, well you can use shell commands to delete the files – xavier_fakerat Nov 16 '17 at 3:26
  • So, can apps like SD Maid clean the residual files without root? – RockPaperLizard Nov 16 '17 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.