maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   Security lock on the Nokia N9 (https://talk.maemo.org/showthread.php?t=85373)

Brownout 2012-07-09 20:41

Security lock on the Nokia N9
 
Hi,
is there any way to make the device ask for the security code at startup without enabling autolock?

I would also like be able to security lock the device with a button, gesture, whatever... on the N900 I would have pressed the power button and clicked "secure device", anything equivalent on the N9?

rainisto 2012-07-09 21:47

Re: Security lock on the Nokia N9
 
enable autolock and set timeout to million minutes from commandline.

rabilon 2012-07-10 03:08

Re: Security lock on the Nokia N9
 
Could you provide more details on setting the timeout?

When trying to get Mail for Exchange working, I enabled autolock. I get 5 tries to unlock and it locks after 15 minutes - and there does not appear to be any way to increase these values.

solbrit 2013-01-14 23:07

Re: Security lock on the Nokia N9
 
Quote:

Originally Posted by rainisto (Post 1234864)
enable autolock and set timeout to million minutes from commandline.

I used to do this on the N900, whats the command for the N9?

ruplee76 2013-01-22 07:51

Re: Security lock on the Nokia N9
 
Quote:

Originally Posted by solbrit (Post 1314890)
I used to do this on the N900, whats the command for the N9?

settings/security/device lock/autolock/ set your time

solbrit 2013-01-23 00:05

Re: Security lock on the Nokia N9
 
Quote:

Originally Posted by ruplee76 (Post 1316516)
settings/security/device lock/autolock/ set your time


Yes, but the top limit is one hour. That's why I'd like to know how to set a higher value from the terminal, as proposed by rainisto. It should be a matter of editing a configuration file (as on the N900), but which one?

Edit: looking back, it was gconf on the N900:

/usr/bin/gconftool -s -t int /system/osso/dsm/locks/devicelock_autolock_timeout 1000000

This does nothing on the N9 though. Any ideas? Anyone......?

solbrit 2013-01-31 22:42

Re: Security lock on the Nokia N9
 
Still nothing, no clever ideas, no imaginative suggestions...? Lend me a hand oh you clever people out there...

Eztran 2013-02-01 00:22

Re: Security lock on the Nokia N9
 
Quote:

Originally Posted by solbrit (Post 1316794)
Edit: looking back, it was gconf on the N900:

/usr/bin/gconftool -s -t int /system/osso/dsm/locks/devicelock_autolock_timeout 1000000

This does nothing on the N9 though. Any ideas? Anyone......?

I've searched through the N9's settings (thankfully, there aren't too many). I found the timeout before the screen dims, locks etc. easily enough, but not the security lock.

It doesn't look like that setting's stored using GConf any more, basically, and I've no idea what they actually are using.

Sorry if this isn't very helpful.

solbrit 2013-02-01 15:15

Re: Security lock on the Nokia N9
 
Yeah, searching the system I came to the same conclusion. Frustrating. It has to be possible somehow... Thanks for posting anyway.

erendorn 2013-02-02 10:09

Re: Security lock on the Nokia N9
 
maybe the ability to set an "infinite" security timeout was deemed unsecure, and the possibility removed?

rainisto 2013-02-02 10:45

Re: Security lock on the Nokia N9
 
#!/bin/sh
/usr/bin/gconftool-2 --type=int --set /system/osso/dsm/display/inhibit_blank_mode 3
/usr/bin/gconftool-2 --type=int --set /schemas/system/osso/dsm/display/inhibit_blank_mode 3
/usr/bin/gconftool-2 --type=int --set /system/osso/dsm/display/display_blank_timeout 600000000
/usr/bin/gconftool-2 --type=int --set /schemas/system/osso/dsm/display/display_blank_timeout 600000000
/usr/bin/gconftool-2 --type=int --set /system/osso/dsm/display/display_dim_timeout 600000000
/usr/bin/gconftool-2 --type=int --set /schemas/system/osso/dsm/display/display_dim_timeout 600000000
/usr/bin/gconftool-2 --type=bool --set /system/osso/dsm/locks/touchscreen_keypad_autolock_enabled false

This only works if you do not have mail for exchange setup with forced values. There is a way to disable the timeout force on mfe too, but that requires you to hack devicelockd and clear the force bits, so that is another story and too complicated for most people to do.

Eztran 2013-02-02 14:40

Re: Security lock on the Nokia N9
 
The thing with the above is that it will also mean having a screen that will never timeout at all, so you have to lock it manually all the time.

I was looking for a setting like in Settings>Security>Device lock>Autolock, where you can adjust the time before the security lock engages without changing the screen timeout (which I think is what solbrit was looking for, if not the OP).

solbrit 2013-02-02 20:22

Re: Security lock on the Nokia N9
 
Thankyou for replying rainisto!

As Eztran points out it is a drawback though that this adresses the problem by changing the screen timeout settings...

It's a shame that this isn't as easy as on the N900 where you could change the devicelock-autolock timeout to whatever you liked. I actually prefer the devicelock kicking in after a while, but one hour is too short.

solbrit 2013-02-08 16:20

Re: Security lock on the Nokia N9
 
And btw, if you set the screen to never timeout as suggested and lock it manually you'll still get the security lock after x minutes as usual...

solbrit 2013-02-10 09:26

Re: Security lock on the Nokia N9
 
I just stumbled upon this.

http://talk.maemo.org/showthread.php?t=83603

With a way to enable the security lock from command line it's easy to write a script to check if the screen is locked (or one that checks for screen input, if you prefer) for x time and if true enable the security lock, and have the script run a constant loop.

Code:

#!/bin/bash

/usr/bin/devicelock-enable --lock-screen

# Sleep time 20 --> 3 lines/minute if screen locked
while true; do sleep 20 &&

if dbus-send --system --type=method_call --dest="com.nokia.mce" --print-reply "/com/nokia/mce/request" com.nokia.mce.request.get_tklock_mode|awk -F "\"" '/g/ {print $2}' | grep -q 'unlocked'

then
> /path/to/sec-lock.log

else
echo "Screen locked..." >> /path/to/sec-lock.log

fi

# Check if sec-lock.log is full (3 lines/minute --> 120 minutes = 360 lines)
if [ 360 -eq "$(wc -l < /path/to/sec-lock.log)" ]

then
> /path/to/sec-lock.log && /usr/bin/devicelock-enable --lock-screen

fi;

done

This will enable the security lock once initially and then keep locking it after two hours if the screen isn't unlocked during that time. You can use it in /etc/init/apps to enable it from boot (what OP was going for would be running only the first line on boot).

solbrit 2013-03-29 01:38

Re: Security lock on the Nokia N9
 
This might be a bit more interesting. It enables the security lock after 30 minutes if the phone's neither charging nor connected through wifi, both of which only occur, in my case, when at home.

Code:

#!/bin/bash

# Enable device lock on boot
/usr/bin/devicelock-enable

# Sleep time 20 --> 3 lines/minute if discharging, not connected to wlan and screen locked
while true; do sleep 20 &&

if
lshal | grep -q 'battery.rechargeable.is_charging = true'

then
> /opt/sec-lock/sec-lock.log

elif dbus-send --system --type=method_call --dest="com.nokia.mce" --print-reply "/com/nokia/mce/request" com.nokia.mce.request.get_tklock_mode|awk -F "\"" '/g/ {print $2}' | grep -q 'unlocked'

then
> /opt/sec-lock/sec-lock.log

elif /usr/sbin/iw dev wlan0 link | grep -q 'Connected to'

then
> /opt/sec-lock/sec-lock.log

else
echo "Screen locked..." >> /opt/sec-lock/sec-lock.log

fi

# Check if sec-lock.log is full (3 lines/minute --> 30 minutes = 90 lines)
if [ 90 -eq "$(wc -l < /opt/sec-lock/sec-lock.log)" ]

then
> /opt/sec-lock/sec-lock.log && /usr/bin/devicelock-enable

fi;

done



All times are GMT. The time now is 15:20.

vBulletin® Version 3.8.8