Tuesday, January 15, 2013

Exploring Permissions

I decided to take a closer look at android permissions and create a script that could search through the device and find issues with its permission settings. To do this, I am using MonkeyRunner, a tool made by Google and packaged inside the Android SDK. It allows scripting languages (in my case python) to communicate with android devices. I then installed Busybox on my phone to more easily find files and execute commands (for those of you who don't know, Busybox is a package of stripped down versions of many useful UNIX utilities). The script is at the bottom of this post for those interested, but I will walk through it step by step up here. The first three lines are just overhead that points to the python directory (I don't actually think this is necessary in this context), imports the MonkeyRunner libraries, and establishes a connection to the phone. The next lines are really the meat of the code. Each print statement simply tells the user exactly what is being displayed or displays it. The lines beginning in variables are statements that use MonkeyRunner to query the phone via ADB, which in turn uses BusyBox to execute a command.


No comments:

Post a Comment