How to not brick your phone 6x times in a row!
Context
This project has the objective of making an old device. A Motorola G9 Plus (codename: odessa) have a new life with Android 16 and the latest 4.14.x kernel.
In the last post I said about how GPT-5.6-Sol, helped me fix a USB device first-try.
Kernel Update
Well, after the fix to 4.14.282 was done we proceed to to 4.14.283 it bootlooped, so after giving the task to GPT it fixed and we were done!
With 4.14.283 fixed, I went to another midpoint this time was 4.14.310 and it also worked flawlessly! So we just merged 4.14.336 and also done!
Applying the OTA update!
Well, I did some of the clean-up to the OS and proceeded to appling the update, it didn’t work. The dumbass here didn’t read that the recovery warning that was an version older than the kernel itself.
Well after rebuilding and choosing the right one, I got an Installation Error with code 5. After giving AI a few more jobs to run it fixed it.
Almost bricking the device
After the AI fixing the Install error code 5 the install proceed as inteded and a popup appered saying something like “Reboot the device to proceed or to install addons” (addons can be Magisk/Root or Google Play Store).
Well after restart a red text appered screaming “NO VALID OPERATING SYSTEM FOUND”. And after going back to the bootloader the device was in a semi-bricked state, without being able to flash a Recovery or anything.
The GPT suggested using Motorola Software Fix tool to bring the device back to Android 11 and removing the bricked state. After trying the tool it basicly said “Well your device is now a paper-weight, if you want ship it to Motorola and they might be able to fix”.
Hopeless and at 01:00 AM I started googling and found a tool from a fellow developer called Gorniaky (I knew him from my Discord Bot days, really smart folk) called Flashfile-XML-to-Batch-Script-for-Windows and after converting the stollen previuous stock ROM files I was able to make then in a bash script that was able to restore the phone Partion Table and everything back to there to the stock ROM days.
Next steps
Well, I tried again making GPT work to fix the OS installation nuking problem but it didn’t work, my limits ran-out, my friend didn’t wanna give up his for mine so I bought the OpenCode Go and tried the newly release Kimi K3 model, pretty good one, that was heavly distilled by Fable.
Well, it didn’t work so well, it made a 200k+ tokens chat and ran out of my 5-hour limit. Next day I woke up and tried the “Hey, you kinda went too strong on my limits, what that hell did you did so far?” and it had fixed my problems.
Semi-Bricking the device once again (5x times)
Well, we came to the vicious cycle (the image, that is not mine, will haunt me for days…) for nuking everything and fixing it afterwards. The latest news are it is broken, I got my friend to give me access to his Claude Pro account and test Opus 5 and its currently working heavlly to fix this problem.