View Single Post
Posts: 105 | Thanked: 299 times | Joined on Sep 2010
#1
Lock your applications with a simple password or custom screens.


A friend of mine asked me if I could do something to lock email and sms application, so I made and app that does something very simple, it launches another app, it's very simple and it's still a WIP, but it does the job and maybe someone else need it.

You need to install the app and modify the .desktop launcher of the application you want to lock (I think you need root access for that, so I think it won't be possible to upload it to store, someone please tell me if it is possible).



the application install in
Code:
/opt/lockapp/bin/lockapp
and you need to give as argument the name of the screen used (currently two ships with the app, LockMe made by me and ImNotDrunk made by Flako Pana), those are located in

Code:
/opt/lockapp/bin/qml
Also you need to provide the name of the app to launch, so a simple example of how does it work in a .desktop file is:
Code:
Exec=/usb/bin/invoker --global-syms --wait-term --type=e /opt/lockapp/bin/lockapp LockMe /usr/bin/fenix %U
Instructions:
1.- Install LockApp application http://iktwo.wikidot.com/local--file....0.0_armel.deb

2.- Backup .desktop file of the app you want to lock (as root):
Code:
cp /usr/share/applications/mail.desktop /usr/share/applications/mail.desktop.back
3.- Edit the .desktop file (as root) I use nano, you can use vi

Code:
nano /usr/share/applications/mail.desktop
4.- Change the Exec line to something like this:

Code:
Exec=/usb/bin/invoker --global-syms --wait-term --type=m /opt/lockapp/bin/lockapp LockMe /usr/bin/fenix %U
*In applications that have X-Maemo-Service (email, messaging, gallery, ..) you need to remove that line, so don't skip the backup step.

The default password for LockMe it's
Code:
password
I'm still working on this, I'm trying to make a configuration GUI, maybe it would be easier with a script to lock and unlock the .desktop file..

Creating a custom lock screen:
If you want to create another lock screen you can do it with some very easy steps, you can see the code of LockMe.qml and ImNotDrunk.qml

You can define the interface as you wish and call a simple method.

Code:
wMain.startApplicationDetached();
If you need a random number you can use (where 15 is the limit, 1-14)
Code:
wMain.getRandomNumber(15);
Also there's an interface to access QSettings:

To save:
Code:
void saveSetting(QString key, QVariant value);
To access values:
Code:
QString getStringSetting(QString key, QString defaultValue);

bool getBoolSetting(QString key, bool defaultValue);

int getIntSetting(QString key, int defaultValue);

double getDoubleSetting(QString key, double defaultValue);
 

The Following 17 Users Say Thank You to Iktwo For This Useful Post: