2

I run Opera Mobile 10.1 on Android. My device is rooted. How can I clear the history and cache of the browser via shell? As su, removing

/data/data/com.opera.browser/opera/profiles/smartphone/cookies4.dat

/data/data/com.opera.browser/opera/profiles/smartphone/cache

/data/data/com.opera.browser/opera/profiles/smartphone/cacheO

and a

/system/xbin/busybox killall -9 com.opera.browser

afterwards doesn't seem to do the job. Afterwards, bookmarks etc. are still there.

In Opera Mini I found it easy to just delete

/data/data/com.opera.mini.android/cache/webviewCache

/data/data/com.opera.mini.android/databases

but unfortunately, Opera Mini in it's current version has a bug and doesn't work on most devices.

Edit:

Another approach I tried is to kill the Opera process, then set an entry in the opera.ini, referring to http://www.opera.com/support/usingopera/operaini/#private:

[Clear Private Data Dialog]
CheckFlags=1023

but it doesn't cause Opera to clear the history and cache after a restart.

2 Answers 2

1

How about if you do a dump of the filesystem before and after clearing the cache and compare what has changed? For example, browse something to generate some cache, copy the filesystem to directory before-clear, clear the cache and copy again to directory after-clear. After this run a diff on the directories, eg. diff -q before-clear after-clear > differing_files.txt . After this you can check relevant files for changes and see if you can clear the cache just by removing/editing these files. Although, this only works if the cache is file-based, not in a db.

NOTE: this is just an idea, don't have a rooted phone to test it.

3

With Opera Mobile open,

  • Click on the Wrench Icon
  • Click on Settings
  • Scroll down and click on Privacy
  • From there you should see Options to Clear History, Password, Cookies, Cache, and Shared Locations.
4
  • Thanks for the reply, but as mentioned, I need to do it via shell, not manually in the browser. Dec 29, 2010 at 0:54
  • 1
    @Mathias Lin: You're telling us your solution, not your problem. Why do you need to use the shell if you can use Opera to delete Opera's stuffs?
    – Lie Ryan
    Dec 29, 2010 at 14:03
  • 1
    @Lie Ryan: It's not a solution I'm describing, it's a requirement - the problem is that I don't see where the history etc. is stored, even though I delete the entire cache directory. I need to find a way to clear the history and cache automatically from my own app, therefore from my app I want to call a shell script to clear the history. In my use case I cannot have the user to manually interact. So basically my question is, where does the data reside and which files to delete. For Opera Mini it's clear, but for Opera Mobile it's not very obvious which files to delete or where to find it. Dec 29, 2010 at 14:18
  • Of course if there's any other way than a shell script/command to clear, it's also fine, but I guess there's no intent for that to call, so command line is the only way if I don't want manual user interaction. Dec 29, 2010 at 14:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .