Android - Delete SMS completely from the device and make SMS non recoverable

梦想的初衷 提交于 2019-12-11 04:38:01

问题


I want to delete all the sms from the mobile through my application. Currently, I am deleting messages using below code.

    Uri uriSms = Uri.parse("content://sms/");
        Cursor c = getContentResolver().query(uriSms,
            new String[] { "_id", "thread_id", "address","person", "date", "body" }, null, null, null);

        if (c != null && c.moveToFirst()) {
            do {
                long id = c.getLong(0);
                getContentResolver().delete(Uri.parse("content://sms/" + id), null, null);
            } while (c.moveToNext());
        }

I am able to delete messages from mobile.

But by using some recovery applications, they are restored.

I tried to remove it completely by deleting the file from path

"data/data/com.android.providers.telephony/databases/mmssms.db"

But it gave me following permission denied error.

12-12 00:37:29.673: W/System.err(9724): java.io.FileNotFoundException: /data/data/com.android.providers.telephony/databases/mmssms.db (Permission denied)

How can I completely remove the messages from my device? Using some secure delete method?


回答1:


you can't remove a file that's stored on another application sandbox (as com.android.providers.telephony) unless the device is rooted.



来源:https://stackoverflow.com/questions/13831648/android-delete-sms-completely-from-the-device-and-make-sms-non-recoverable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!