programmatically erase android browser cache, history, etc. with root
I have an android tablet that is lo开发者_如何转开发cked down (users will only be able to use standard issue android browser), so all the temporary internet stuff should be in the same place.
Assuming I am able to root the device
sometime here soon, I would like to be able to wipe out (1) cookies,(2) temp internet files,(3) history,(4) form data,(5) location access info,(6) passwords, (7) cache.
I think I can knock out most of these by erasing:
/data/data/com.android.browser/cache
The cookies appear to be in a database. I'm not sure if I can just delete it
/data/data/com.android.browser/databases/webview.db
And then I think I can just delete these files to erase
location information:
/data/data/com.google.android.location/files/wifi
/data/data/com.google.android.location/files/cell
Will that take care of everything?
What am I leaving out?
Is it safe to just erase that database
? Does anyone know?
how about something as simple as
adb shell pm clear com.android.browser
from command line ?
This API is deprecated in Android Marshmallow. If you build using API 23 it wont work any more.
You can delete them @micahhoover, You can delete complete com.android.browser sub directories, every time you relaunch browser, all the sub folders gets created.
To delete android browser History(Default)
in your Activity.java file add the follwing code
Browser.clearHistory(getContentResolver());
In your manifest add
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
精彩评论