Clock alarms: how to customize and replace the stock clock app
The application that takes care of the clock alarm is located in /system/b2g/webapps/clock.gaiamobile.org, you can safely extract it from the system ROM using the command:
however, this app differs from one device to another, in particular as regards the detection of multimedia files used as sound (MP3, OGG, OPUS ...) all located in the internal /shared/resources/media/alarms folder of the application.zip file.
This guide aims to get around this by downloading and modifying a simpler version of the Clock app, from a Nokia 8110 4G, so that you can install it on any KaiOS phone, using WebIDE or manually replacing it on /data, without losing updates.
Download and editing
Download and extract the Clock app of the Nokia 8110 4G from this link, then explore the application.zip file to the /shared/resources/media/alarms folder, containing all the audio files and list.json, the list of all these tracks with the name that must be shown on the menu. On the Nokia 8110 4G the file contain this:
There are some alarm clock hidden into the Clock app, to enable all of them just copy and paste this:
As you can see, it's sufficient to add a line. For example, if you add a SAMPLE.mp3 file in /shared/resources/media/alarms you must write this line:
Where "SAMPLE" is the name of the track that will be shown on the list. Use the JSONLint website to verify that the format is correct for any json file you want to modify.
NOTE that most likely the name of the track you have chosen will not appear, you will probably have to find out how to add it in the two files panel.html which are located in the "alarm_settings" and "alarm_edit" folders, both placed in /js/panels, but this is an issue that you can simply ignore if you have chosen your favorite song as your alarm clock .
How to replace the stock one
To install our custom Clock app, use WebIDE, like any other third party app. The only problem though is that we will have two Clock apps in our menu. The first option to solve this problem is to uninstall the existing one through the appropriate guide, as I have already mentioned at the top of this page... or alternativelly, the second option is to replace the stock one in /data manually, like this:
Push the app and its folder on the data partition, exactly in /data/local/webapps using a temporary root access:
Get the webapps.json file:
And change the value of the clock.gaiamobile.org app
in this way
Use again the JSONLint website to verify that the JSON file format is correct.
Afther this change push the webapps.json file in its place and reboot the phone:
After rebooting you have your personal alarm clock to choose on the list!
Being a safe change, the stock app will be restored after a factory reset or after the OTA update.