https://github.com/dweinstein/android-permissions
utilities for searching android permissions
https://github.com/dweinstein/android-permissions
Last synced: about 2 months ago
JSON representation
utilities for searching android permissions
- Host: GitHub
- URL: https://github.com/dweinstein/android-permissions
- Owner: dweinstein
- Created: 2012-12-07T22:36:45.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-02-23T17:47:22.000Z (about 12 years ago)
- Last Synced: 2025-01-12T03:27:49.398Z (4 months ago)
- Language: Racket
- Size: 1.09 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Get racket and this code
* Grab the racket language from http://racket-lang.org/download/
* Add the 'racket' binary to your path:
``` $ export PATH="/Users/user/Downloads/Local Applications/Racket\ v5.3/bin/:${PATH}" ```
* Download this code:
```
$ git clone [email protected]:dweinstein/android-permissions.git
```
* You can either run DrRacket and load the 'gui.rkt' file and run it, or use the terminal:# GUI usage:
To run the GUI (open a terminal and navigate to this directory):
```
$ racket gui.rkt
```
# REPL usage
```racket
$ racket
Welcome to Racket v5.3.
-> (require "permissions.rkt")
-> (current-platform)
(platform "Android 2.2.X" 8 "FROYO" #)
```
## API available
From [permissions.rkt](https://github.com/dweinstein/android-permissions/blob/master/permissions.rkt)
```racket
(provide platform-for-version
lookup/perm->apis
lookup/api->perm
lookup-permission/re
lookup-api/re
get-platform-strings
get-permission-strings
current-platform)
```
## Android Platforms Spported
```
-> (get-platform-strings)
'("froyo" "gingerbread" "honeycomb" "ics" "jellybean")
```## Change platform
By changing the 'current-platform' you can adjust the context of the methods when doing lookup operations.```racket
-> (current-platform)
(platform "Android 2.2.X" 8 "FROYO" #)
-> (current-platform 'ics)
-> (current-platform)
(platform
"Android 4.0, 4.0.1, 4.0.2"
14
"ICE_CREAM_SANDWICH"
#)
```## Find permissions
```racket
-> (lookup-permission/re "bluetooth")
'("android.permission.BLUETOOTH_ADMIN" "android.permission.BLUETOOTH")
```## Lookup APIs and their permissions
Note that the lookup-api/re function uses a case sensitive matching:
```racket
-> (lookup-api/re "sms")
'("boolean com.android.contacts.ContactsListActivity$ContactsSearchActivity.smsContact(android.database.Cursor)"
"boolean com.android.contacts.SearchResultsActivity.smsContact(android.database.Cursor)"
"boolean com.android.contacts.ContactsListActivity$JoinContactActivity.smsContact(android.database.Cursor)"
"boolean com.android.contacts.ContactsListActivity.smsContact(android.database.Cursor)")
```Now what if you wanted to see for each of these APIs, what permissions do they exercise each individually:
```racket
-> (map (lambda (api)
(lookup/api->perm api))
(lookup-api/re "sms"))
'(("android.permission.GET_ACCOUNTS"
"android.permission.WRITE_CONTACTS"
"android.permission.READ_CONTACTS")
("android.permission.GET_ACCOUNTS"
"android.permission.WRITE_CONTACTS"
"android.permission.READ_CONTACTS")
("android.permission.GET_ACCOUNTS"
"android.permission.WRITE_CONTACTS"
"android.permission.READ_CONTACTS")
("android.permission.GET_ACCOUNTS"
"android.permission.WRITE_CONTACTS"
"android.permission.READ_CONTACTS"))
```Now we see that they all somehow interact with GET_ACCOUNTS, WRITE_CONTACTS, and READ_CONTACTS.
# Thanks
This utility uses the results from the work done at University of Toronto on PScout (http://pscout.csl.toronto.edu/)