vendredi 22 mai 2015

Encrypt android database , dont working (apparently)

I do all process to encrypt database of android: Setting>security>Encrypt phone

Then i try get my database of android

$ adb shell
$ run-as com.your.package cat /data/data/com.your.package/databases/your_db > /storage/sdcard0/Download/your.db

and result is all of my data are not encrypt....

i do another test and reeinstal my app, and get my database again, all data stay uncrypted...

what i need to do, to encrypt my database (without code), and how i can check this data encrypted?

---edited---

if i test encrypt with this code, i get return "true", but i still can acess the .db and read all information...

@SuppressLint("NewApi")
    public static boolean isEncrypted(Context context) {
        DevicePolicyManager devicePolicyManager = (DevicePolicyManager) context
                .getSystemService(Context.DEVICE_POLICY_SERVICE);

        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) {
            int status = devicePolicyManager.getStorageEncryptionStatus();
            if (DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE == status) {
                return true;
            }
        }
        return false;
    }

Aucun commentaire:

Enregistrer un commentaire