0

I'd like to access (and change) settings of the stock android browser via code. Is it possible, and if so - how?

YES, it's programming question - i'd like to change it by code, not by manual clicking.

What about doing it for rooted device?

Drakosha
  • 11,925
  • 4
  • 39
  • 52

1 Answers1

2

Android's operating system level security model basically prevents this. Your program would need to run as the same user ID as the browser or as the superuser, which is not possible unless you have the certificate used to sign the browser or your application is only for rooted phones.

In the unlikely event that one of these is the case, you would ensure the browser is not running and then simply change its private databases. Looking at the browser source should reveal anything that's not clear about the databases and any other places it might be storing things.

With some work, you could make an alternative browser that is a near twin of the stock one but either cooperates by providing an API for programmatic settings changes, or is signed with a certificate you do possess, so that your other program can establish a shared user id with it and change its settings db.

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
Chris Stratton
  • 39,853
  • 6
  • 84
  • 117