maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   Secure Device (Manually) on Harmattan? (https://talk.maemo.org/showthread.php?t=89623)

HtheB 2013-03-27 00:40

Secure Device (Manually) on Harmattan?
 
Is there a way (like an easy homescreen icon) to Secure the device?

On the N900, we could press the power button once, to select it over there. The reason is, that I don't want to put in my code every time, so I've set the time to '5 minutes'. But there are moments that I want to lock it immediately, that's where this button will be handy for!

bandora 2013-03-27 01:32

Re: Secure Device (Manually) on Harmattan?
 
This could be done via script easily I believe (then add an icon on app menu to trigger it), maybe contacting Schturman to add this function to N9QT would be the ideal solution..

EDIT: Maybe also one could add the function to the power key (hit it twice and it would lock the phone?)

HtheB 2013-03-27 11:40

Re: Secure Device (Manually) on Harmattan?
 
Quote:

Originally Posted by bandora (Post 1332109)
This could be done via script easily I believe (then add an icon on app menu to trigger it), maybe contacting Schturman to add this function to N9QT would be the ideal solution..

EDIT: Maybe also one could add the function to the power key (hit it twice and it would lock the phone?)

That could be possible, altough I don't know what command you have to use to activate the "Secure Device".

Does anyone know this?

rainisto 2013-03-27 13:25

Re: Secure Device (Manually) on Harmattan?
 
Run following command with exploited capas:

Quote:

opensh -c "dbus-send --system --type=method_call --print-reply --dest=com.nokia.devicelock /request com.nokia.devicelock.setState int32:1 int32:1;dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:locked"
You can pretty easily make desktop icon for it, but you need incepted opensh to make it run because of aegis capabilities.

PS. and word of warning: don't play with variables there, just use copy & paste. Since if you change the parameter values, you can for example force secure wipe of the device (without asking any confirmations), and most likely you dont want that :)

Mikkosssss 2013-03-27 14:20

Re: Secure Device (Manually) on Harmattan?
 
Asked for this on like first week I got my N9.

I hope someone does script.

thedead1440 2013-03-27 14:39

Re: Secure Device (Manually) on Harmattan?
 
Quote:

Originally Posted by rainisto (Post 1332226)
And your wrong, your example only closes the screen, but does not trigger device lock code query.

Ah I thought it was the same; so dbus it is then :D

lanccu 2013-03-27 15:46

Re: Secure Device (Manually) on Harmattan?
 
Like this?

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

Schturman 2013-03-27 17:04

Re: Secure Device (Manually) on Harmattan?
 
I already created icon and it work perfectly... Will be added to the next version of N9QT. Thanks rainisto.

Schturman 2013-03-27 17:56

Re: Secure Device (Manually) on Harmattan?
 
rainisto, maybe you know how to/which process we need to restart to get the dbus notification popup windows get to work again ?
Because if we restart this process:
Code:

/sbin/initctl restart xsession/devicelockd
the dbus notification popup windows stop to work and I can't found which process to restart to get it work again.
Thanks

Schturman 2013-03-27 18:08

Re: Secure Device (Manually) on Harmattan?
 
OK, found it :D
Code:

gconftool-2 --type boolean --set  /desktop/meego/notifications/previews_enabled true

Schturman 2013-03-28 02:19

Re: Secure Device (Manually) on Harmattan?
 
Quote:

Originally Posted by rainisto (Post 1332209)
Run following command with exploited capas:



You can pretty easily make desktop icon for it, but you need incepted opensh to make it run because of aegis capabilities.

PS. and word of warning: don't play with variables there, just use copy & paste. Since if you change the parameter values, you can for example force secure wipe of the device (without asking any confirmations), and most likely you dont want that :)

It work perfectly for me when I just installed it:
Code:

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Name=Secure Phone
Exec=/opt/N950QTweak/Secure/device_secure.sh
Icon=/usr/share/icons/hicolor/80x80/apps/device_secure80.png
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable

and
Code:

#!/bin/sh

echo root | ariadne sh -c "dbus-send --system --type=method_call --print-reply --dest=com.nokia.devicelock /request com.nokia.devicelock.setState int32:1 int32:1;dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:locked"

exit 0

Why it stopped to work after reboot ? It cause reboot + Malfunction window -> reboot again and load your phone normally... :(
Thanks

Schturman 2013-03-28 03:42

Re: Secure Device (Manually) on Harmattan?
 
Ok, i got it work after reboot with .conf file... But it take 3-5 min after reboot, harmattan limitation as we know...
Any other ideas ?

Kallela 2013-03-28 08:56

Re: Secure Device (Manually) on Harmattan?
 
Quote:

Originally Posted by Schturman (Post 1332392)
Code:

#!/bin/sh

echo root | ariadne sh -c "dbus-send --system --type=method_call --print-reply --dest=com.nokia.devicelock /request com.nokia.devicelock.setState int32:1 int32:1;dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:locked"

exit 0


Of course, you cannot make assumptions about the root password, so you cannot use script like this in N9QT.

Maybe creating a deb package of the script & desktop file, granting the required security token for the script file in the aegis manifest and then incepting the package when activating the tweak? Otherwise you have to depend on and use opensh instead, like in rainisto's example, which may not be the best approach for N9QT as having opensh installed is kind of security risk. Maybe playing with refhashlist, restok, etc. is one option to grant tokens for the script without packaging, but messing them up is a risk too.

Don't know about that rebooting and MALF problem you faced, unfortunately.

Schturman 2013-03-28 11:31

Re: Secure Device (Manually) on Harmattan?
 
Thanks, I already got it work
http://talk.maemo.org/showpost.php?p...postcount=5930


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

vBulletin® Version 3.8.8