davidbb/Meteorite — pull request #1 by binaryparadox (2012-05-19 19:23:09+00:00)
Title: Refactoring & some new code.

I did this in three stages. You should check the commits history/comment for each of the commits in the pull request. I did my best to document what I changed.

There were some pretty huge improvements to be had. The biggest is probably that I was able to entirely remove the Process spawn to find the APK for an app and the unzipping/iterating of the APK in-memory to extract the certs. Turns out the PackageManager interface lets you get at all of that if you dig deep enough into the API. The rest was just clean-up/restyling/documenting for the most part.

I migrated in the calculation that we used in the Obs. code to calculate the UAppID. I suspect I need to talk to you in person about this because it doesn't take into account the length prefix or the binary APK hash right now, it is just a hash of the app pkgname concatenated to the hashes of each cert the app was signed with.

Anyway! Enjoy! I've done some rudimentary testing on my Nexus S and it seems to work. I love that you get a notification from Meteorite when you install Meteorite! Makes it pretty apparent when it is working. Like the code in your repo it just displays the new package name in-app. The rest of the fun is just printed to abd.

- Dan