Making Altitude ROM, a custom Android OS


It’s been a while since I last worked on my custom ROM. (See here for the previous post). In the elapsed time between the last post and now, I finally managed to get everything working properly.

The first problem I encountered was that the phone would not boot despite the fact that the ROM was installed seemingly without any errors in TWRP. It would hang on the initial splash screen without ever reaching the ROM’s boot animation. At first, I thought this would be solved by simply removing the custom boot animation I had added. I thought that perhaps some incompatibility with the file was preventing the phone from initializing the boot sequence beyond the bootloader. This was not the case. Next, I considered that some of the files that I had removed should not have been due to some strange Knox issue. In fact, I managed to find some confirmation of this fact in the forum thread of the ROM kitchen, which suggested that removing some .jar files related to Knox would prevent the phone from booting. However, even without any of the debloating measures in place, I still had no luck. Finally, I desperately tried to remove all the modifications to the ROM in the hopes that maybe the kernel wasn’t installed properly or the Magisk installer had corrupted the boot.img.

Still nothing.

At this point, I put the project on hold and moved onto the self driving truck, mostly due to the time it was taking and the distressing lack of progress.

Around a month later, I reached out to the developer of the ROM kitchen that I had been using to ask about my issues. After comparing the updater-script produced by his tool to the one from my own, it was clear there was a problem with my install. I finally decided to download the Windows version of his tool (after also trying the liveUSB version) and the updater-script became the same as his. It turns out the bug I had encountered was a genuine issue with the program, and not operator error on my part. The problem was fixed in an update for the Linux version of the tool.

Now that I was finally able to boot the firmware I was making, I could turn my focus back to developing the ROM. After the May security patch (CRED) was pushed by Samsung, I downloaded it and got to work. For the first release of my ROM, I decided I would be keeping things simple. I debloated, rooted, BusyBoxed (see below), zipaligned, adblocked and added the Android P launcher from the beta.

A few bugs ironed out, and Altitude ROM was fully functional on the S8.

I mentioned BusyBox as one of the main features above, as it’s something I think is really amazing as an Android/Linux fan. In short, BusyBox adds in a lot of BASH commands back into Android. Android itself is, at heart, a Linux OS, and so by adding BusyBox to a ROM, you gain the ability to perform very powerful commands in the terminal, some apps, and in BASH scripts.

Using these new tools, I was able to code a simple BASH script to allow for easy remapping of the Bixby button on a system level. Without root, apps like BxActions are forced to rely on the calling of the Bixby service to detect when the Bixby button has been pressed. However, the /system/usr/keylayout/Generic.kl contains all of the mappings needed by bluetooth keyboards/controllers. The Bixby button’s mapping is also located in that file. Therefore, in order to remap the button to a system function, only one line needs to be modified. The BASH script simply has to ask the user what they would like the button to be mapped to eg. playing/pausing media playback, and then change that line to the corresponding mapping. After a reboot, the button is remapped at a system level, meaning it has instantaneous response compared to any other solution (not that BxActions performs poorly with ADB permissions, but it isn’t on the same level of responsiveness).

Once the modifications were completed, it was a case of building the ROM and flashing it on my phone. After some testing, I concluded that the ROM was fit to be uploaded for use by other people. All that was left was to write the forum post for XDA, and to make a small banner logo in GIMP.

Here’s the finished forum post. Go and take a look for more technical information about the ROM, and if you have a SM-G950F or FD, please try it out!

At the time of writing, the total number of downloads is getting up towards 130, after just 4 days!

Overall, this has been one of the most frustrating but rewarding projects to date, due to my steadily increasing interest in Android and the mobile telecommunications industry.

I’ve made good progress on the truck, but not enough to warrant a blog post (yet). Stay tuned for more in the Altitude ROM and autonomous truck series’.

To keep up-to-date on this and future projects, join the mailing list by pressing the “Subscribe” button at the top of the page.

Comments

  1. I am so impressed... I'm still just struggling away with my front end code, especially javascript and mobile - this is inspiring me to try a bit harder!! Ms J

    ReplyDelete

Post a Comment

Popular posts from this blog

Writing a MicroPython Pi-hole for the ESP8266

The Casio F-91W

Mini server update