Customize shortcuts menu & silent mode on Nokia 8110 4G and similar phones

by Mathero11, Nokia Tips and Sylvain BLOT, improved by Vivek

(safe method)

How to customize shortcuts

This was tested on a Nokia 8110 4G with the old launcher version:

1. Get a copy of the launcher application's folder from the system:

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

2. extract the application.zip, open the /dist/app.bundle.js file and use a website like Beautifier to read in a more detailed way the content of the js file. After line 4200 (at least on Nokia 8110) you should find something like this:

{ name: "volume", icon: "sound-max", isShortcut: !0, title: "volume", order: { portrait: 1, landscape: 1 }, click: function(t) { return e.volumeManagerTimer ? void("ArrowUp" !== t && "ArrowDown" !== t || (e.enterVolumeManagerMode(), navigator.volumeManager["request" + t.slice(5)]())) : (e.enterVolumeManagerMode(), void navigator.volumeManager.requestShow()) } }, { name: "brightness", icon: "brightness", isShortcut: !0, title: "brightness", subtitle: "percentage-number", order: { portrait: 2, landscape: 2 }, cskType: "toggle", click: e.toggleBrightness.bind(e) }, { name: "flashlight", icon: "flashlight-on", iconInactived: "flashlight-off", title: "flashlight", removed: !0, order: { portrait: 4, landscape: 3 }, cskType: "toggle", click: v.default.toggle.bind(v.default) }, { name: "camera", icon: "camera", isShortcut: !0, title: "camera", order: { portrait: 7, landscape: 6 }, cskType: "launch", click: function() { y.default.launch("manifestURL", "app://camera.gaiamobile.org/manifest.webapp") } }, { name: "store", icon: "calculator", isShortcut: !0, title: "calculator", order: { portrait: 5, landscape: -1 }, cskType: "launch", click: function() { y.default.launch("manifestURL", "app://calculator.gaiamobile.org/manifest.webapp") } }, { name: "settings", icon: "settings", isShortcut: !0, title: "settings", order: { portrait: 8, landscape: 7 }, cskType: "launch", click: function() { y.default.launch("manifestURL", "app://settings.gaiamobile.org/manifest.webapp") } }, { name: "wifi", icon: "wifi-32px", iconInactived: "wifi-off-32px", title: "wifi", observerSetting: "wifi.enabled", removed: !0, order: { portrait: 0, landscape: 0 }, cskType: "toggle" }, { name: "network", icon: "network-activity", iconInactived: "network-activity-off", title: "cellular-data", observerSetting: "ril.data.enabled", order: { portrait: 3, landscape: 4 }, cskType: "toggle" }, { name: "bluetooth", icon: "bluetooth-32px", iconInactived: "bluetooth-off-32px", title: "bluetooth", removed: !0, observerSetting: "bluetooth.enabled", order: { portrait: 6, landscape: 5 }, cskType: "toggle" }

You have to edit this, for example (as suggested from our friend Mathero11 on Youtube), to replace Bluetooth with GPS and Airplane mode with Vibration on Nokia 8110:

  • For Geolocation:

name: "geolocation", icon: "route", iconInactived: "location", title: "gps", observerSetting: "geolocation.enabled", order: { portrait: 6, landscape: 5 }, cskType: "toggle"
  • For Vibration:

name: "vibration", icon: "vibrate-32px", iconInactived: "mute-32px", title: "vibrate", observerSetting: "vibration.enabled", order: { portrait: 8, landscape: 7 }, cskType: "toggle"
  • and find flashlight, if useless, because by holding FORWARD in the homescreen it will also enabled:

name: "airplane-mode", icon: "airplane-mode", iconInactived: "airplane-mode-off", title: "airplane-mode",observerSetting: "airplaneMode.enabled", //removed: !0, this was flashlight order: { portrait: 4, landscape: 3 }, cskType: "toggle", //click: v.default.toggle.bind(v.default)
  • For USB tethering (suggested by Aronno on Discord):

name: "tethering-usb", icon: "usb", iconInactived: "usb", title: "usb-tethering", observerSetting: "tethering.usb.enabled", order: { portrait: 5, landscape: -1 }, cskType: "toggle"add locale: {"$i":"usb-tethering","$v":"USB tethering"},

To add the new created names you've to edit your locales language, for example, in case this you use Dutch the file is nl.json, for Italy is it.json, and so on. The locales files are located in /locales-obj/(your language).json of the Launcher's app. In my case of nl.json, open a text editor (Notepad++ on Windows, any editor on Linux), then find the line |-> {"$i":"airplane-mode","$v": <-|

Now take a note at the begin of the bracket { to the end of the bracket } including the comma, in my case this is: {"$i":"airplane-mode","$v":"Vliegtuigmodus"}, then create two new options (change "Trillen" to your language for "vibrate", in Dutch), then


{"$i":"vibrate","$v":"Trillen"},{"$i":"gps","$v":"GPS"},

then we place them like this:

{"$i":"airplane-mode","$v":"Vliegtuigmodus"},{"$i":"vibrate","$v":"Trillen"},{"$i":"gps","$v":"GPS"},

To better understand all this, just watch this video:

This was only an example, you can set the path of any application you need on the launcher menu.

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

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

4. Get the webapps.json file:

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

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

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

in this way

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

Use the JSONLint website to verify that the format is correct for any json file you want to modify.

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 your launcher will be ready to "launch" your favourite apps. All the changes will be restored after a factory reset or after the update.

(source by Sylvain BLOT, improved by Vivek... a big thanks to Mathero11 from YouTube for its tutorial)

How to enable the Silent Mode

by Nokia Tips

After enabling vibration shortcut (read above) come back here. This is what we are going to get at last :

  • Long press # button = silent mode on

  • Long press # button, then switch on vibration shortcut = vibrate only mode

  • Long press * button = silent mode off

Proceedings

1. Get a copy of the system.gaiamobile.org application's folder from the system:

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

2. Open the /js/sound_manager.js file in the application.zip using a text editor. Use a website like beautifier.io to read javascript in a more understandable format.


3. Search for "hash", you will see this line:

window.addEventListener('holdhash', this);

add this new line below it:

window.addEventListener('holdstar', this);

4. continue the search, you will see this:

case 'holdhash':

below it you will see this :

this.toggleVibrate();

change this.toggleVibrate(); like this:

this.enterSilentMode('notification');

5. Now just copy these lines from "case 'holdhash' :" to "break;" and paste those lines just below "break;"

it will be look like this:

case 'holdhash': if (Service.query('getTopMostWindow').isHomescreen && Service.query('getTopMostUI').name === 'AppWindowManager' && document.activeElement.tagName.toLowerCase() === 'iframe') { this.enterSilentMode('notification'); } break;

now change holdhash to case 'holdstar': and change this.enterSilentMode('notification'); as like:

this.leaveSilentMode('notification');

Check attached images if you have confusion.

Picture 1

Picture 2


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

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

7. Get the webapps.json file:

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

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

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

in this way

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

8. After this change push the webapps.json file in its place and reboot the phone:

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

adb reboot