Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova LocalStorage persists data even after app uninstall

I am using the LocalStorage in my cordova-based android app to store some information, but I have recently experienced something very weird. The LocalStorage persists even after I uninstall the app and install it again!

As far as I can understand, this should not be the case. Everywhere I read people say something like "LocalStorage is deleted when you clear app data from settings, or the app in uninstalled".

This has made me wonder a few things; How persistent is the LocalStorage? Does it persist between applications? Is it possible that I have some other cordova app installed which would be able to access the same LocalStorage?

More importantly; Is LocalStorage safe? Can I be sure no other application (or "cracker") could access that information?

I have only seen this behaviour on android.

This is not what I expect, or want, to happen. Is there some way I can force the data to be deleted when the user uninstalls the app?

Some info is found here:

How permanent is local storage on Android and iOS?


  • Android 6.0.1 (cyanogenmod on Samsung galaxy s3 GTI9300)
  • Cordova version 6.3.0
  • Using cordova-plugin-crosswalk-webview 1.7.2
  • Cordova android platform version 5.1.1
  • Plugin list:
    • com.keepe.cardio 1.0.9 "CardIO"
    • custom.version.of.cordova.camerapreview 1.0.1 "CameraPreview"
    • cordova-plugin-backbutton 0.3.0 "Backbutton"
    • cordova-plugin-console 1.0.2 "Console"
    • cordova-plugin-crosswalk-webview 1.7.2 "Crosswalk WebView Engine"
    • cordova-plugin-customurlscheme 4.2.0 "Custom URL scheme"
    • cordova-plugin-device 1.1.1 "Device"
    • cordova-plugin-file 4.1.1 "File"
    • cordova-plugin-file-transfer 1.5.1 "File Transfer"
    • cordova-plugin-firebase 0.1.7 "Google Firebase Plugin"
    • cordova-plugin-geolocation 2.1.0 "Geolocation"
    • cordova-plugin-google-analytics 0.8.1 "Google Universal Analytics Plugin"
    • cordova-plugin-inappbrowser 1.3.0 "InAppBrowser"
    • cordova-plugin-ios-longpress-fix 1.0.1 "iOS LongPress Fix"
    • cordova-plugin-network-information 1.2.0 "Network Information"
    • cordova-plugin-statusbar 2.1.1 "StatusBar"
    • cordova-plugin-vibration 2.1.0 "Vibration"
    • cordova-plugin-webserver 1.0.3 "CordovaWebServer"
    • cordova-plugin-whitelist 1.2.1 "Whitelist"
    • cordova-plugin-x-socialsharing 5.1.1 "SocialSharing"
like image 465
Automatico Avatar asked Aug 05 '16 09:08

Automatico


1 Answers

I also had a same kind of problem you can find a answer from this link. It was worked for me.

These are the steps I followed.

  • After project build go to path: platforms\android\
  • Then in AndroidManifest.xml file add the followings to application tag

android:allowBackup="false" and android:fullBackupContent="false"

eg: In my case it is look like this.

<application android:allowBackup="false" android:fullBackupContent="false" android:hardwareAccelerated="true" android:icon="@mipmap/icon" android:label="@string/app_name" android:supportsRtl="true">
like image 51
coder Avatar answered Sep 30 '22 12:09

coder