More news.
For those in a hurry, just read this: it builds (again), but doesn't boot (again).
Keep reading if you want to know more.
I fully updated the device tree. You can see on github I have now 4 repositories:
1.
https://github.com/alexsmithbr/android_device_letv_max1 <- the main device tree
2.
https://github.com/alexsmithbr/android_device_letv_common <- common tree for letv devices
3.
https://github.com/alexsmithbr/android_kernel_letv_max1 <- max1 kernel tree (unmodified from leeco)
4.
https://github.com/alexsmithbr/android_vendor_letv_max1 <- vendor device tree for main device
I just copied the OnePlus2 structure and adapted accordingly, so android_device_letv_max1 was android_device_oneplus_oneplus2 and android_device_letv_common was android_device_oppo_common.
Inside trees #1 and #2, I replace everything related to "oneplus" for "letv" and everything related to "oneplus2" for "max1". Of course I looked at the code to fix any bugs this could cause.
Then I gave it a run and it built just fine.
I'm not surprised it didn't boot, since I didn't copy any vendor files from Max1 into vendor folder yet. Now I'll have to do it and see how it goes.
One interesting thing is that when I try to flash the new ROM, the assert function fails saying "
This package is for device: x900,X900,x900+,X900+,max1,Max1,MAX1; this device is ." It seems like my recovery (twrp 3.0.0) is not being able to use
getprop("ro.product.device") correctly, as device name is coming empty. So, in order to install the ROM, I had to temporarily patch
/build/make/tools/releasetools/edify_generator.py so that it would accept my device. I did this by updating
def AssertDevice(self, device): function. I just added a 1 == 1 before the test, so it will install despite the device I'm trying to use. It is dangerous, but I'm not publishing this ROM until I can boot it, so it's only dangerous for me.
Next steps:
- fixing proprietary-files.txt and populate vendor/letv/max1 folder, then build again.
- I'm thinking about compiling twrp as well. Maybe working with a recovery image will be faster and, once I get it working, I can come back to the full android development.