There are two cases that you must consider:
- Server Side Authorization
- Android Account Manager (Device side) Authorization
Case 1:
Server Side revocation for Google Accounts can be done at: https://accounts.google.com/IssuedAuthSubTokens
You just have to login with the corresponding google account and choose to revoke the App/Website
Case 2:
If on your android device you are presented with a screen saying something like: "Application wants to access your Google Account....Allow/Deny? " then this is an Account Manager type authorization where you need to modify the sqlite3 database on your phone in order to revoke the application (not as trivial as the Case 1 and this requires root accessed to your phone):
i. First copy off the database and journal file (accounts.db and accounts.db-journal) to another location (eg: on your SDcard or to a computer). The database files can be found in this directory on your android device:
/data/system/users/0/accounts.db
/data/system/users/0/accounts.db-journal
ii. You now need a sqlite3 editor. I used Sqlite Debugger from the Google Play Store. Alternatively you can use an sqlite3 binaries from http://www.sqlite.org/download.html and do this on a Computer.
iii. You know need to use the editor to remove certain entries in the "extras" table of the accounts.db database. You might want to take a quick tutorial on sqlite commands but here are some examples and "Sqlite Debugger" makes this a easy learn:
First open the accounts.db file in the editor
To list all rows in table "extras" you could use the following command:
SELECT * from extras
A better idea would be to only list rows in table "extras" which correspond to the application which you would like to revoke. For example if "com.someapp" is the name of your App you could use the following command:
SELECT * from extras WHERE key like '%com.someapp%'
You should get some output similar to this:
id|accountsid|key|value
10|1|perm.xxxxxxxxxxxxxxxxxxxxxxxxxxx.oauth2:https://google.com/|1
11|1|EXP:xxxxxxxxxxxxxxxxxxxxxxxxxxxx.oauth2:https://google.com/|xxxxxxx
Make a note of the id numbers you want to delete from the above output (i.e. the rows corresponding to the App you want to revoke) and then use the following commands to delete those rows:
DELETE from extras where _id = 10
DELETE from extras where _id = 11
Copy back the database and journal file to its original location. Make sure you set the permissions and ownership back to the original. read/write for owner and group only and owner and group owners are both "system". This operation will require root access!
Restart your device and you should have revoked the permission for the App. You could test this by asking the app to request Authorization again. If you are presented with the screen asking you to Authorize the app ("Application wants to access your Google Account....Allow/Deny?) then you have successfully revoked the app.
References:
- https://groups.google.com/forum/#!topic/android-developers/3lQb83jeyE8
- https://github.com/jberkel/sms-backup-plus/issues/369