We have moved to a new Sailfish OS Forum. Please start new discussions there.
1

How to change lock code with root priviledges [answered]

asked 2018-10-16 15:28:03 +0300

Drmegananostrukt gravatar image

updated 2018-10-31 08:41:37 +0300

jiit gravatar image

Hello there, i have seen some videos about hacking the jolla to gain acces to the hash of the lock/security code (for different sailfish version and different device and no directory names called out) as i want to keep my data on my intex device and still have my root pw on my intex i would like to overwrite the hash with the lock code to spare myself sendig my device to india (or would it be jolla) to be able to make an update to the next jolla version. so do you know where the hash is located and how i could generate an new hash to overwrite it?

As jolla is using gpled code i could enforce my right to ask for it by lawyer, but i'd rather ask mannered and politely.

So if you are knowledgable please anwser this.

thank you!

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by Spam Hunter
close date 2020-05-10 23:23:55.175611

Comments

Yes i have forgotten my lock code, sadly not written it down.

Drmegananostrukt ( 2018-10-16 15:29:15 +0300 )edit

I have neither locked my phone nor do i miss root priviledges, so not a duplicate. And there are solutions. I have seen a solution getting out the lock code by brute force, but then automaticly flashing the device in the maemo forum. not what i want. https://www.youtube.com/watch?v=QVJ9XxUS_4g this video talks about partitions to be mounted, as root i should be able to do just that. I aksed the authors of the video what to mount and how to do it but didn't receive an answer. to clarify i am using a 2.1.2.3 kiiminkijoki sailfish version. to saying that i am screwed is neither polite nor furthering this. Thank you for hinting me on other questions that have also been declined for substanceless reasons, showing an anti-foss attitude in the jolla community. I hope there are voices for progress and problem solving with a more helpfull attitude.

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

Tries set to infinite, lock code unkown, phone stil not locked. That easy. You behave like stung by a needle as if you where jolla yourself. My threats aren't idle and i have allready supported a case from foss point with the help of the gnu legal group (FSF) against a different violator of the gpl. I haven't threatend you and neither jolla, as i might still see value in a at least seemingly foss friendly way. I just told that i could, like everybody else ask the fsf for help in getting that code. If you are a representant of jolla i seriously consider doing that by now!

Drmegananostrukt ( 2018-10-16 21:06:52 +0300 )edit
1

Do you have command line access?

Have you ever really searched for the source code, e.g. there?: https://git.merproject.org/mer-core/nemo-qml-plugin-devicelock/tree/master/

Besides, if the implementation is good, the source code won't help you: https://en.wikipedia.org/wiki/Kerckhoffs%27s_principle (neither does flaming around)

The only possibility I think of right now is booting into recovery mode and brute-force the lock code from a PC (all text-based interfaces, should be easily scriptable). Depends on the length of your lock code, though.

And I'm not sure whether there are better ways in general...

takimata ( 2018-10-16 21:58:40 +0300 )edit

Yes i have root command line acces. Thank you for pointing out the code of the specific part! you're a positive surprise :) Ok so i could run a john or similar on the device lock hash if i can figure out from the code which partition i need to mount and the directory (or someone would be so kind just telling me) Or even better just overwrite it if possible to generate a new one knowing the salt that is used in the hashing process.

and i wasn't trying to flame. I just have read many similar questions on _together_ jolla where the people who have asked more or less nicely just have been told to "shut off and use the damn jolla service" which i was not going to accept as an answer in any case.

you say recovery mode? is that necessary if i have root acces to my sailfish os terminal already? Will the device/partition only then be mountable in that mode? And thanks again takimata :)

Drmegananostrukt ( 2018-10-17 00:56:51 +0300 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2018-10-31 00:10:07 +0300

Drmegananostrukt gravatar image

updated 2018-10-31 00:59:54 +0300

So basically merging the information i got from the code repository you linked - with what i found on its trail -; through search engines revealed it to me. (long story short at end of post)

https://jolla.zendesk.com/hc/en-us/articles/201440487-What-are-the-Device-Lock-and-Security-code-

There the location of the root device containing the the device lock hash is shown to be mounted. for my aquafish it was mount /dev/mapper/sailfish-root to a directory of my preference.

Maybe it is allready mounted in normal operation but now i knew where to look. further searching gave me: https://talk.maemo.org/showpost.php?p=1543338&postcount=13 https://talk.maemo.org/showthread.php?s=8ed0735b033b96e413ae8ef079c7ae9c&t=92621&page=2

Instructions to just remove usr/share/lipstick/devicelock/.devicelock.enc from either relative mount path or if it is in the system mount path allready, from /usr/share/lipstick/devicelock/.devicelock.enc Thanks to jakibaki to the jolla faq and especially you takimata i was finaly able to set the device lock code new :)

so long story short:

  1. get root

    devel-su
  2. create mount direcotry:

    cd /mnt
    mkdir sailfishroot
    
  3. mount the root device

    mount /dev/mapper/sailfish-root /mnt/sailfishroot
    
  4. remove the deviceloc.enc

    rm /mnt/sailfishroot/usr/share/lipstick/devicelock/.devicelock.enc
  5. create new lock code:

  • a)

    with jolla settings, devicelock.

  • b)

    /usr/lib/qt5/plugins/devicelock/encpartition --set-code

edit flag offensive delete publish link more

Question tools

Follow
3 followers

Stats

Asked: 2018-10-16 15:28:03 +0300

Seen: 731 times

Last updated: Oct 31 '18