This code is still ugly, please re-write it and send pull-requests, if you want to use this.
Android Root Exploit