Clock alarms

(safest method)

There are some alarm clock hidden into the Clock app, I've discovered how to customizing your "awake":

1. Extract the folder of the stock app using the command:

adb pull /system/b2g/webapps/clock.gaiamobile.org

2. Explore the application.zip file to the /shared/resources/media/alarms folder, containing all the audio files and the lint.json file, that lists that tracks with the name that must be shown on the menu. On the Nokia 8110 4G the file contain this:

{
  "Alarm_Clock_1.opus": {"l10nID": "Alarm_Clock_1"},
  "Alarm_Clock_2.opus": {"l10nID": "Alarm_Clock_2"},
  "Alarm_Clock_3.opus": {"l10nID": "Alarm_Clock_3"}
}

To enable all the hidden tracks on the bananaphone just copy and paste this:

{
  "ac_africa.ogg": {"l10nID": "Africa"},
  "ac_amazon.ogg": {"l10nID": "Amazon"},
  "ac_disco.ogg": {"l10nID": "Disco"},
  "ac_fairy_tales.ogg": {"l10nID": "Fairy_Tales"},
  "ac_fresh.ogg": {"l10nID": "Fresh"},
  "ac_galaxy.ogg": {"l10nID": "Galaxy"},
  "ac_mojito.ogg": {"l10nID": "Mojito"},
  "ac_techno.ogg": {"l10nID": "Techno"},
  "ac_woody.ogg": {"l10nID": "Woody"},
  "Alarm_Clock_1.opus": {"l10nID": "Alarm_Clock_1"},
  "Alarm_Clock_2.opus": {"l10nID": "Alarm_Clock_2"},
  "Alarm_Clock_3.opus": {"l10nID": "Alarm_Clock_3"}
}

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:

"SAMPLE.mp3": {"l10nID": "SAMPLE"},

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.

3. Push the app and its folder on the data partition, exactly in /data/local/webapps using a temporary root access:

adb push clock.gaiamobile.org /data/local/webapps

4. Get the webapps.json file:

adb pull /data/local/webapps/webapps.json

And change the value of the clock.gaiamobile.org app

  • "basePath": "/system/b2g/webapps",

in this way

  • "basePath": "/data/local/webapps",

Use again the JSONLint website to verify that the JSON file format is correct.

5. Afther this change push the webapps.json file in its place and reboot the phone:

adb push webapps.json /data/local/webapps/
adb reboot

After rebooting you have your personal alarm clock to choose on the list! Like many other changes like this, the app will be restored after a factory reset or after the update.

NOTE: if you wish, you can install the custom Clock app via WebIDE, but in this way you will have two icons of the same app in the menu. In this way, even after the update you will have your customized third-party app installed near the serial Clock app.