https://github.com/JackpotClavin/Android-Blob-Utility
The purpose of this program is to help AOSP-based ROM developers quickly and easily find out which proprietary blobs need to be copied into the ROMs build, or built using source. How the program works is you do a /system dump into a folder on a Linux computer. Then you do a dump of an emulator image by Google using the same Android version of your /system dump (i.e. if your /system dump is Android 4.4, and intend port a KitKat-based ROM, then download and extract an Android 4.4 emulator image into another folder on your computer).
After you've pulled the /system dump, and extracted the emulator system image, you can build the program with the make command. After it has been created, you can run the program. When it prompts you for the emulator root, enter the path to folder you extracted the emulator image to; so if the path to the build.prop of the emulator is under:
Code:
/home/user/backup/emulator/system/build.prop
then just use
Code:
/home/user/backup/emulator/system
and press enter. The next thing the utility will do is prompt you for location of the /system dump you pulled. Just like the emulator, if the location of the build.prop of the /system dump is under:
Code:
/home/user/backup/dump/system/build.prop
then just use:
Code:
/home/user/backup/dump/system
Finally, the utility will ask you how many files you wish to run through the program. In the case of my LG G2, the KitKat build requires two main proprietary camera-related libraries to run (/system/bin/mm-qcamera-daemon and
/system/lib/hw/camera.msm8974.so).
So I typed in 2 and pressed enter (because I'm running two proprietary files through the program)
Then simply typed in:
Code:
/home/android/dump/bin/mm-qcamera-daemon
and pressed enter and it printed out *every* proprietary file needed to get /system/bin/mm-qcamera-daemon running.
Then it asked for the final proprietary file, so I simply typed in:
Code:
/home/android/dump/lib/hw/camera.msm8974.so
and pressed enter and it printed out every* proprietary file needed to get /system/lib/hw/camera.msm8974.so running.
An example usage of this program can be found here:
http://pastebin.com/raw.php?i=MciGPrkE that's 92 libraries done in a flash!
The beauty of this program is that it's recursive, so if proprietary file 'A' needs proprietary file 'B' to run, but proprietary file 'B' needs proprietary file 'C' to run, which in turn needs 'D' to run, then simply entering proprietary file A to run will print out all A, B, C, and D nicely formatted so that you can simply 'find and replace' the name of your device's manufacturer and device's codename and put that in the vendor/manufacturer/codename/codename-vendor-blobs.mk file in your AOSP build source tree's root.
Another great thing about this program is that it doesn't just catch the libraries needed to satisfy the linker, but rather, it will also print out those libraries that are called within the actual code of the library itself, like:
Code:
dlopen("libfoo.so", RTLD_NOW);
libfoo.so is not marked as a shared library, so the linker won't complain that libfoo.so is missing, and there might be no sign that libfoo.so missing and needed, but when it's time for the daemon or library to run, it won't show any sign that something is wrong, until you see that it doesn't work. This program will catch and display that libfoo.so is needed.
So basically:
1. Extract /system dump image
2. Extract emulator image
3. Build program
4. Tell program location of emulator system dump
5. Tell program location of /system dump
6. Tell program how many files you wish to run through the utility
7. Tell program the location of the file(s) you wish to run through the program.
8. Copy the output of the utility to a text file, and 'find and replace' "manufacturer/device" with the manufacturer and name of the device you wish to build an AOSP-based ROM to. (i.e. I would 'find and replace' "manufacturer/device" with "lge/vs980" for my Verizon LG G2)