How to build a harmattan pre-init runnable component?
I do have a bit special requirement for an utility;
I am now experimenting on encrypting the whole home directory on N9, to counter the relaxed security of the device caused by running in open mode. When I am in open mode I want same (or better) security as in closed mode, but on my own terms! I want to protect my own data, not to be protected from the system :D I have managed to install encfs on the device, and am planning to set up home directory encryption. However, the challenge is to get the passphrase from user in preinit phase, when device is running in sinle user mode. I am planning on mounting the encfs home just before OS selection (as I am runing nitdroid dual boot) so that both meego and android partitions can be encrypted. The input that can easily be obtained from user at that phase is just keypresses; volume keys and power key. What I would like to do is build an utility that presents the user a virtual keypad for passphrase entry. However, I am unsure how to do it? Is there a way of building for example a qt application that has all the needed component libraries linked statically to it, so that there is no need for external dependencies and it can be run stand-alone from the preinit script? I thought of building some extra functionality to it, in addition of just passphrase entry via virtual keyboard; For example, it could show device owner contact information when incorrect passphrase is typed so that changes of getting lost device back would increase. |
Re: How to build a harmattan pre-init runnable component?
Aarrgh, now I suddenly realised the unpleasant truth...
The darn box is not yet running X at preinit stage, right? So, propably qt is out of scope here, then. Does anybody have any good suggestions on how to handle it? Are there any libraries that handle raw input and output like on the device console? If not, do I need to read raw position events off some device or somerhing like that? |
Re: How to build a harmattan pre-init runnable component?
Quote:
maybe? or you can look evkey.c source: https://gitorious.org/android-n900/m.../evkey/evkey.c and do it like in there ;) |
Re: How to build a harmattan pre-init runnable component?
I'm guessing you'd be entering numbers using the volume and power buttons. Up to increment until it rolls around to 0, down to move cursor, power to enter.
Take a look at sillyboot for a pre-init component. |
Re: How to build a harmattan pre-init runnable component?
Using evkey and just three buttons.... Well even that came into my mind but it is REALLY cumbersome to do it that way, I rather try to make it a decent UI even as it will be lots of more work.
Think about it for a moment, if you have a passphrase of maybe 30 letters and numbers it is next to impossible to enter that without making mistakes... No, keyboard is the way to go! How I thought about implementing it now; Yes, I need to get touch input, a steam of coordinates for the keypresses, For that there sure needs to be a driver, and in preinit I can modprobe it up and mknod the needed device. For "keyboard" just an image suffices. There is no need really for visual confirmation of keypresses and that actually would be a bad thing, as it is needed for passphrase input. The image of the keyboard is just png file, shown up like in sillyboot. For keypress confrmation I would like tactile feedback, so there needs also to be a device that can be written to to create the keypress vibrations. |
Re: How to build a harmattan pre-init runnable component?
it all can be done :D
you just need some time and good ideas ;) |
Re: How to build a harmattan pre-init runnable component?
OK, so I did some tinkering and now I am able to read off coordinates from the touch screen. It turned out to be fairly easy after I found out the correct device to use, each touch will generate a burst of events, out of which I am filtering out all except absolute X and Y coordinate events. The following snippet shows how I am doing it.
Code:
struct input_event ievent; |
Re: How to build a harmattan pre-init runnable component?
Okay, tick to another box, tactile feedback covered :)
Checking syslog I found that the vibra device is created as "/dev/input/event6" and reading the device while trying out virtual keyboard indeed threw up some codes. Writing the events back to device produce small vibration. Nice! Code:
int fdev, ret; However, I need to have shift/caps-lock functionality, so what I need to do is to change bitmaps on the screen while running my utility. There are propably at least 3 ways of doing this, which are of varying complexity...
Any thoughts on this? |
Re: How to build a harmattan pre-init runnable component?
4. you can turn your code into evtap and vibra command-line tools. it will be very handy for peoples. and write main code in another app, then just use evkey evtap and vibra tools (and show_png of corse) then need. also (maybe?) some tool for writing text in portait orientation? (landscape text with T2S is good, but i prefer portait)
|
Re: How to build a harmattan pre-init runnable component?
Quote:
See, when my son borrowed my N9 to play Angry Birds Space on nitdroid he instinctively tried to tap on the android icon in the booting phase instead of using the volume keys to change the default boot OS. Hence I tried it, and it is quite simple to read a touch on either upper or lower part of the screen to select the desired image... |
All times are GMT. The time now is 23:05. |
vBulletin® Version 3.8.8