[Android Software/Hacking General [Developers Only]] deathsled:
Hi all,

I'm reaching out to the Android community as a whole hoping to get some pointers. I'm having a hard time finding the information I need here and by googling (although I'm sure it exists) so I was hoping to get some tips or pointers from some people in the know. I've reached out to a few people privately who I know have already done this kind of work but no one is responding to me which is kind of a bummer.

While I'm specifically trying to port the latest Incredible OTA to the EVO, I'm hoping any information gathered here will be helpful to others and applicable to other devices.

Why port the Incredible rom to the EVO? Well for starters the hardware is virtually identical from what I can tell, so it's a good starting point to teach myself some basics and get familiar with Android and rom construction. Second, it's to solve a strange MMS problem for EVO users on Cricket and MetroPCS. We can't send MMS using Sprint based roms but can with Verizon based ones, or by putting the Verizon MMS app on our Sprint roms, but it doesn't work properly. Some people are looking to disassemble the MMS app and figure out what it will take to get it working properly on a Sprint rom. I'm attacking from the other direction (since I have seen it work with the avafroyo vcrc3 rom) by taking the entire Incredible rom and making it work on the EVO.

So my starting point was to install a copy of the latest rooted Incredible OTA on to my phone and then install the latest EVO kernel from HTC. This definitely got me up and running, however I could not use the hardware buttons below the screen (VERY difficult to do anything on the phone lol) and also quickly found out that the SD card was not being recognized either.

I think it was about this time that I found the Android Kitchen that had support for both the incredible and the evo, and starting using that instead of my entirely manual way.

I found that to fix the hardware buttons below the screen I just needed to remove the incredible-keypad.kl file from /system/usr/keylayout and replace it with the supersonic-keypad.kl file from a EVO rom. Maybe renaming the incredible file would have done the trick? Is the kernel somehow looking for a file by that name? I have no idea how this works and would love some explanation.

So now that I had the buttons working I was able to freely navigate the phone and find what else didn't work. It seems that all thing related to the BCM4329 broadcom chip are not working, which means that there is no wifi, there is no bluetooth, and there is no FM radio. All of these features produce errors or don't work within any applications that use them or attempt to turn them on. The SD card was not being recognized so I couldn't read or write to it. Also screen rotation is not working.

Since I'm interested in preserving the apps and framework from the Incredible verizon rom I stayed away from the /system/app and /system/framework folders and looked in other places. I found that bin, etc, and lib folders also look virtually identical between the two roms except for a few minor differences. These also appear to be mostly drivers and stuff. So what I then did was merge the two versions from each rom and replace duplicates with the EVO versions. After this I found that I had proper SD card access again and I know GPS is working as well (no clue if it did before or not).

So at this point I have a rooted Incredible rom running on my EVO with the verizon incredible apps and framework. GPS, 3G, buttons, USB, sd card all work, however still no wifi, bluetooth, or fm radio. It's all this one BCM4329 chip. The drivers and related files all seem to be the same. The incredible and the EVO both use the same chip from what I can tell. I don't know where the breakdown occurs now. Is it in the framework or app? Is the support for the wifi and stuff built directly into the kernel? I've noticed during repacking of the boot image that there seems to be a driver in there for the broadcom chip.

I found a sensor file in the /system/lib/hw folder called sensors.inc.so. I copied over a sensors.supersonic.so file from the EVO rom and also renamed a copy to sensors.inc.so just in case. This hasn't helped with any of the rotation though. It seems like the contents of /system/lib are almost identical between the Incredible and EVO roms and these seem like they're all hardware drivers.

Anyone have any input towards getting screen rotation and the wireless stuff working? I feel like I've made decent progress literally replacing stuff, but I've either replaced too much, or there now needs to be some real editing somewhere, or something.