Ask / Submit

Hacking/Modding System

asked 2018-04-22 06:52:43 +0300

Levone1 gravatar image

updated 2018-04-22 07:05:32 +0300

Long-time Android user recently switched to Sailfish, thanks to excellent port to Sony Xperia X Compact. As always, my first thoughts turn to hacking and modding, (nothing illegal, just personalization...). So far, I haven't figured out too much, except that the generous devs here do a great job with apps and patches for us, which I've been making use of, but I can't help but want to know more...

With Android, most UI functions are controlled by app packages, (apk files), which are made up of 2 parts: resources, and smali, (code). Apk files can be decompiled, have contents edited, then recompiled, and pushed back to the file system. Resources are pretty easy to mod, and smali is trickier, (different language), and even Java framework files can be modded, to bypass security, etc, if you really know what you're doing, (or have a guide to follow), but all of it is easily accessible in the file system, (with root).

Maybe I just haven't looked hard enough yet, but I haven't found the equivalent of this is Sailfish yet. I've dug around in the file system a bit, and found a few things that seem like they might be in this realm, but I have a feeling I'm missing something, like maybe these types of files are in a different partition, which has to be mounted, or maybe they are only moddable during app building, and not after, or... ???

So, what is the equivalent structure here, if any, for modifying apps, (particularly system apps)? For example, (what really got me started on this), I was wanting to set the time it takes for the power menu to pop up while long-pressing the power button, to be much shorter, (it's about a full 3 seconds - way too long). In android, I might find it in framework-res.apk/res/values..., or maybe in smali code. Where would it be here?


edit retag flag offensive close delete


Welcome to SailfishOS! Most of the apps ship their qml files as in-exe resources. Which makes customization hard.

tortoisedoc ( 2018-04-22 07:33:04 +0300 )edit

You can find the qml files in de directory usr/share/. The names of harbour apps will start with harbour, the official apps will start with jolla or sailfish. Be aware that changes can disappear after each update... You can find a simple example in this how-to

rgrnetalk ( 2018-04-22 10:27:28 +0300 )edit

@rgrnetalk - So, in Settings qml file, for example, (/usr/share/jolla-settings/settings.qml), there is a reference to a 'path' at /com/jolla/settings/ui. Where is that?

Levone1 ( 2018-04-23 05:10:41 +0300 )edit

@tortoisedoc Well, if the app is open source (and many/most native Sailfish OS apps are) you can rebuild the app yourself with any changes, even if it ships with QML in resources by default. :)

MartinK ( 2018-04-25 14:22:42 +0300 )edit

@Levone1 this is about [dbus adapter and some internal handling of jolla.

rgrnetalk ( 2018-05-07 21:41:23 +0300 )edit

3 Answers

Sort by » oldest newest most voted

answered 2018-04-22 23:11:28 +0300

spiiroin gravatar image

"I was wanting to set the time it takes for the power menu to pop up while long-pressing the power button"

In this particular case no patching / modding is needed. Power key is handled by mce service and there is a setting for the long-press duration.The setting is not visible in ui, but you can tweak it from command line with mcetool utility. For example down to 250 ms:

mcetool --set-powerkey-long-press-delay=250

The default is 1500 ms. And keep it below well below 5000 ms (another system service "dsme" is also monitoring power key and will initiate shutdown if it is kept pressed > 5 seconds).

The setting can be changed as a regular user, but you need root privileges/developer mode for installing the utility itself:

pkcon refresh
pkcon install mce-tools
edit flag offensive delete publish link more


Nice, thanks. I think 750 is probably more than enough for me, since I don't use it for anything else but a quick tap for screen-off. That's the kind of stuff I like knowing about; going to install mce tools. By the way, someone here indicated that modding rpms is tricky. Do you find that to be the case? What's the best method?

Levone1 ( 2018-04-23 00:01:12 +0300 )edit

Testing som mce commands found here - - and working well. I like the glance setting...

Levone1 ( 2018-04-23 00:28:16 +0300 )edit

answered 2018-08-07 15:05:21 +0300

Levone1 gravatar image

updated 2018-08-16 02:00:37 +0300

So, after messing around here and there, I thought maybe a good idea to post some easily-attained examples of helpful discoveries, (probably academic/old news to many here, but maybe some other newbs will appreciate...). Feel free to add other examples.

  1. Since launcher patches don't work on my community port, (v., I wanted to tweak my launcher background, etc. Starting with /usr/share/lipstick-jolla-home-qt5/launcher/Launcherview.qml, and using Tinyedit Root app from Openrepos, I found a line that said 'color: (I think the entry was 'black', but can't remember for sure)'. I changed it to '#d9121518', which is hex code for a semi-transparent dark blue-grey. This is the launcher background, but there's another layer which manifests over that, when you open the app drawer, so to deal with that,
  2. go to /usr/share/lipstick-jolla-home-qt5/layers/LauncherLayer.qml, and add the line 'opaque: false', (credit to this thread for the tip - Now, your launcher bg is customized,

    but now the issue is that, for whatever reason, when opacity is removed from launcher layer, it activates an overlay, which covers the top row of apps in the launcher with some kind of Android back-button rectangle. The overlay actually doesn't cause any function, and if you press the space where your app icon is, (hidden by the overlay), the app will still launch, you just have to know where the icon is.

  3. I discovered the code for this at the bottom of /usr/share/lipstick-jolla-home-qt5/launcher/launcher.qml. There is code for a rectangle which says a bunch of stuff about 'back' function, etc. Delete the whole code for that rectangle, and it disappears from the launcher.

image description

Update - I Figured out how to get scroll-without-pages:

  1. Go to /usr/share/lipstick-jolla-home-qt5/launcher/launcher.qml, and find 'snapMode: ListView.SnapOneItem' and 'highlightRangeMode: ListView.StrictlyEnforceHighlight', (there were 3 instances of each in mine).
  2. Change them to 'snapMode: ListView.NoSnap', and 'highlightRangeMode: ListView.NoHighlightRange'. I Think that's all needed. I did also add a line, but I'm pretty sure it didn't do anything. Let me know if not working for you.


  • Keyboard/Covers

I tend to prefer things dark/dull/flat, so, even though I like the Sailfish UI overall, there are certain things that are just too bright and shiny for me. I found 2 files called GlassBackground.qml - one of them is in /usr/share/lipstick-jolla-home-qt5/compositor/, and one is in /usr/lib/qt5/qml/Sailfish/Silica. I found that if you change any value that says 'highlightBackgroundColor' to 'highlightDimmerColor', you will get dimmer, darker colors. Also changing the opacity levels, (like from 0.7 to 0.1, or something - experiment), helps. This seems to mainly affect the keyboard and the minimized cards, (covers), (so, if you have a blue highlight color set for your ambience, the minimized cards are usually bright blue, but this can make them more like a dark, shadowy color, accented by your wallpaper.

Also, the GlassBackground file uses 2 png files, noise.png, (found in /usr/lib/qt5/qml/Sailfish/Silica), and graphic-shader-effect.png, (found in /usr/share/Themes/Meegotouch/Sailfish-default/icons/). Both of these cause the glassy/blurry type of look in different areas. I replaced both of them with a flat, solid color image. This makes the keyboard solid-looking, and seems to make the general glassy-ui more like a blur-ui, (you can't see the little bumpy marks). Of course this is all varying depending on opacity levels in different files, etc, so...) image description


  • Solid Background for apps, (no glass)

go to /usr/share/lipstick-jolla-home-qt5/compositor/ApplicationWallpaper.qml, and find the line that says '... 0,0,0,0.5)', and change it to '... 0,0,0,1.0). 0.5 indicates opacity halfway to solid, so changing it to 1.0 makes it totally solid. I thought the 0,0,0 would be rgb color, but when I attempted to change it to something else, the whole screen whited-out. Maybe there's only certain allowed range values or something... Update - figured it out... You need the rgb values to have decimals. So my color, hex #121518, is rgb 18,21,24, so I need to enter .18,.21,.24,1.0. image description

  • Cool neon dialer

Follow instructions above to get solid app background, then go to /usr/lib/qt5/qml/Sailfish/Silica/keypad.qml. Find 'property color textColor: Theme.primaryColor', and change it to 'property color textColor: Theme.highlightColor'. Tjen set a bright loud color in your ambience...

image description image description

  • Transparent Covers

Go to /usr/lib/qt5/qml/Sailfish/Silica/CoverBackground.qml, and change 'transparent: true' to 'transparent: false', and the covers become transparent, (strange but true).

image description

  • Solid Lock Screen (no vignette)

files are in /usr/share/lipstick-jolla-home-qt5/lockscreen/. Mainly 'lockscreen' and 'vignette' files. Look for value called 'open radius', and change it to 0.0. Also interesting is a value called 'frag color' at the end of 'vignette' file. It says 'vec4', followed by parentheses with 3 rgb decimals inside. Change the values similarly to described above to change the color of the screen lock overlay. Changing vec4 to vec(any other number) results in a solid, hot-pink screen overlay. I'm not sure what that value means.

image description

Note: Always have files backed up, and/or know how to get back to where you started if things get messed up. Handy tip for emergencies: If the phone boots ok, but your app drawer is gone, go to events page, and click on a Storeman notification. Storeman opens, and go to Fingerterm, and select 'launch' from pulley menu, then use vim with root to edit files. I can add more specific code lines, etc., if anyone wants, but it's just a general example. I think code will probably vary from version-to-version, device-to-device, etc. The idea is that you can poke around, and figure different things out. If you're too unsure to test without specifics, you might want to stay away...

edit flag offensive delete publish link more



interesting, thanks for sharing :)

ced117 ( 2018-08-10 20:16:43 +0300 )edit

answered 2018-04-22 10:29:45 +0300

pisarz1958 gravatar image

updated 2018-04-22 10:40:58 +0300

Take a look at PatchManager in OpenRepos. It lets you apply/unapply changes to files after you've modded them.

edit flag offensive delete publish link more


Have been using patchmanager. I was more in the realm of wanting to know what the patch makers know - how the app files work, and how to know what to change...

Levone1 ( 2018-04-23 05:13:43 +0300 )edit

hmm @Levone1 you can look at the patches themselves to see how the magic is made; they are really patches.

juiceme ( 2018-04-23 15:03:31 +0300 )edit

Good idea... Also, I found an app calles 'rpm repackager' or something. Is it necessary to modify and repackage rpm, then install, or can I just edit already-installed files and reboot? (I'm planning on testing and experimenting either way, but trial and error goes quicker with input from those who know...) Thanks

Levone1 ( 2018-04-23 18:44:12 +0300 )edit

Just modify the files with your favorite editor and reboot. Don't forget to backup them first. In case something goes horribly wrong you can use recovery cconsole.

pisarz1958 ( 2018-04-24 09:15:57 +0300 )edit
Login/Signup to Answer

Question tools



Asked: 2018-04-22 06:52:43 +0300

Seen: 1,296 times

Last updated: 7 hours ago