03-05-2019, 02:32 PM | #1 |
Zealot
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
|
Feature request: Lock screen / padlock
Hi,
One thing i really miss is a way to lock my device. Something like this But a blank screen with an inputbox and keyboard would be great. Writing the sha256sum to a file, reading from it when checking it. I tried to program something myself in lua but quickly found out that that is not a skill i can pickup easily. |
03-05-2019, 03:20 PM | #2 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
IIRC, there's a really, really, really old FR on GH for that, that was stalled for fairly sensible reasons (at the time).
Stuff might have evolved since then, but it's not something anyone's been overly bothered about. |
03-05-2019, 03:21 PM | #3 |
cosiñeiro
Posts: 1,261
Karma: 2189337
Join Date: Apr 2014
Device: BQ Cervantes 4
|
It won't help most users security-wise (which run KOReader through KSM and/or KFMon), and where KOReader runs inside a partition exportable via usb.
If you want to implement you own software you're not tied to lua. You can write your own code to deal with the input device and use FBInk to write stuff to the framebuffer. |
03-06-2019, 05:54 AM | #4 | ||
Zealot
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
|
Quote:
Quote:
I thought of going that route, but i figured this would be like 20 mins for a pro Any idea on approaching grabbing those coordinates ? |
||
03-06-2019, 08:02 AM | #5 | |
cosiñeiro
Posts: 1,261
Karma: 2189337
Join Date: Apr 2014
Device: BQ Cervantes 4
|
Quote:
You need to parse /dev/input/event1, please read: https://www.kernel.org/doc/Documenta...nput/input.txt http://who-t.blogspot.com/2016/09/un...ing-evdev.html Since the Aura HD is using a single touch driver you will need to grab only ABS_X and ABS_Y. You can differenciate between finger-down and finger-up with ABS_PRESSURE. You will probably need to make a few adjustments on the code since in some models X values are mirrored and/or X/Y values swaped. Last edited by pazos; 03-06-2019 at 08:07 AM. |
|
03-08-2019, 10:39 AM | #6 |
Zealot
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
|
Got it working, written in standard posix shell script, how about that
If there is an gfx artist out there reading this: lockscreen image 1080x1440 png would be really appreciated But im stuck after loading koreader, i need to enable the lock when going to sleep. I tried everything but i cannot find what events control the power button. Also i need to enable to light by default, still looking into that. Need some more though |
03-08-2019, 04:11 PM | #7 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Going to need more details .
We grab event1 exclusively, so you won't be able to rely on that outside of KOReader to listen for Power button presses. |
03-09-2019, 12:16 AM | #8 |
Wizard
Posts: 4,465
Karma: 6900052
Join Date: Dec 2009
Location: The Heart of Texas
Device: Boox Note2, AuraHD, PDA,
|
I seem to remember tshering having a little password routine for KSM.
|
03-09-2019, 02:53 PM | #9 | ||
Zealot
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
|
Quote:
Quote:
All awesomeness aside, here I present to you: https://streamable.com/ajqrx Proof of concept code : see below Its awesome Last edited by BloodRagg; 03-10-2019 at 06:17 AM. |
||
03-09-2019, 03:57 PM | #10 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@BloodRagg: Whoops, I meant event0, my bad -_-". In any case, hard to make use of, since both Nickel & KOReader grab it exclusively.
The usual caveat with dealing with raw input events is the usual crap with the three of four different variants used by various Kobo models :/. Last edited by NiLuJe; 03-09-2019 at 04:01 PM. |
03-10-2019, 06:15 AM | #11 | |
Zealot
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
|
Quote:
ps |grep -v '\[' PID USER TIME COMMAND 1 root 0:00 init 830 root 0:00 inetd -f /tmp/inetd.conf 834 root 0:00 {busybox} telnetd -i 835 root 0:00 -sh 23044 root 0:00 ps ** found it, was using evtest instead of raw dev ** Also found that event2 is the g_sensor and can be used for screen rotation. When I picked up my device and it started puking all kinds coordinates. xyz But most important is to turn on /off the frontlight, i started looking through github but i could not find a /dev or /sys to write to. Any ideas on that ? I feel like a real dumbass here.. Last edited by BloodRagg; 03-10-2019 at 06:21 AM. |
|
03-10-2019, 08:34 AM | #12 | |
cosiñeiro
Posts: 1,261
Karma: 2189337
Join Date: Apr 2014
Device: BQ Cervantes 4
|
Quote:
Aura HD doesn't have g_sensor AFAIK. For turning on/off the frontlight: https://github.com/pazos/kobo-clock/...ight.c#L20-L26 |
|
03-10-2019, 10:06 AM | #13 |
Wizard
Posts: 4,465
Karma: 6900052
Join Date: Dec 2009
Location: The Heart of Texas
Device: Boox Note2, AuraHD, PDA,
|
The SOC (System On Chip) may include an interface for the sensor, but I don't think there is the actual hardware.
The old password thread: https://www.mobileread.com/forums/sh...d.php?t=233262 (found searching the developer's corner forum) Luck; Ken Last edited by Ken Maltby; 03-10-2019 at 10:52 AM. |
03-10-2019, 03:52 PM | #14 | |
Zealot
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
|
@pazos @ken
Quote:
/dev/input/event2 Input driver version is 1.0.0 Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0 Input device name: "mma7660abs" Supported events: Event type 0 (Sync) Event type 3 (Absolute) Event code 0 (X) Value 1 Min 0 Max 0 Event code 1 (Y) Value 19 Min 0 Max 0 Event code 2 (Z) Value 0 Min 0 Max 0 Event code 40 (Misc) Value 25 Min 0 Max 0 Testing ... (interrupt to exit) >> "PORTRAIT" Event: time 1552293573.090151 ------- Report Sync ------ x: 2 y: 21 p: 36728 ------------ Event: time 1552293573.590137 ------- Report Sync ------ x: 0 y: 21 p: 36728 ------------ Event: time 1552293574.590117 ------- Report Sync ------ x: 1 y: 20 p: 36728 ------------ Event: time 1552293575.090122 ------- Report Sync ------ x: 0 y: 19 p: 36728 ------------ Event: time 1552293575.590128 ------- Report Sync ------ x: 1 y: 22 p: 36728 ------------ Event: time 1552293576.090148 ------- Report Sync ------ x: 1 y: 20 p: 36728 ------------ Event: time 1552293576.590149 ------- Report Sync ------ x: 0 y: 22 p: 36728 ------------ >> -90 TURN to "LANDSCAPE" Event: time 1552293577.090123 ------- Report Sync ------ x: -10 y: 18 p: 36728 ------------ Event: time 1552293577.590130 ------- Report Sync ------ x: -13 y: 15 p: 36728 ------------ Event: time 1552293578.090118 ------- Report Sync ------ x: -17 y: 11 p: 36728 ------------ Event: time 1552293578.590126 ------- Report Sync ------ x: -18 y: 7 p: 36728 ------------ >> LANDSCAPE Event: time 1552293579.090125 ------- Report Sync ------ x: -19 y: 6 p: 36728 ------------ Event: time 1552293579.590147 ------- Report Sync ------ x: -19 y: 2 p: 36728 ------------ Event: time 1552293580.090124 ------- Report Sync ------ x: -20 y: 1 p: 36728 ------------ Event: time 1552293580.590124 ------- Report Sync ------ x: -19 y: 1 p: 36728 ------------ Event: time 1552293581.590164 ------- Report Sync ------ x: -18 y: 0 p: 36728 ------------ Event: time 1552293582.090137 ------- Report Sync ------ x: -20 y: 0 p: 36728 ------------ >> +90 TURN to "PORTRAIT" Event: time 1552293582.590153 ------- Report Sync ------ x: -18 y: 7 p: 36728 ------------ Event: time 1552293583.090165 ------- Report Sync ------ x: -13 y: 14 p: 36728 ------------ Event: time 1552293583.590168 ------- Report Sync ------ x: -12 y: 17 p: 36728 ------------ Event: time 1552293584.090167 ------- Report Sync ------ x: -10 y: 17 p: 36728 ------------ Event: time 1552293584.590181 ------- Report Sync ------ x: -5 y: 19 p: 36728 ------------ Event: time 1552293585.090155 ------- Report Sync ------ x: -3 y: 20 p: 36728 ------------ Event: time 1552293585.590139 ------- Report Sync ------ x: -2 y: 20 p: 36728 ------------ Event: time 1552293586.090145 ------- Report Sync ------ x: -1 y: 21 p: 36728 ------------ >> "PORTRAIT" Event: time 1552293586.590136 ------- Report Sync ------ x: 0 y: 21 p: 36728 ------------ Event: time 1552293587.090151 ------- Report Sync ------ x: -1 y: 20 p: 36728 ------------ Event: time 1552293587.590140 ------- Report Sync ------ x: -1 y: 21 p: 36728 ------------ Event: time 1552293588.590141 ------- Report Sync ------ x: -2 y: 20 p: 36728 ------------ Event: time 1552293589.090144 ------- Report Sync ------ x: -1 y: 21 p: 36728 ------------ Event: time 1552293589.590165 ------- Report Sync ------ x: 2 y: 20 p: 36728 ------------ Event: time 1552293590.090159 ------- Report Sync ------ x: -1 y: 20 p: 36728 ------------ Added a proof of concept, it works like expected Last edited by BloodRagg; 03-11-2019 at 10:32 AM. Reason: Added proof of concept |
|
03-11-2019, 10:41 AM | #15 |
Zealot
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
|
For the frontlight I had hoped that i could just print some data into /dev/ntx.
But it is more complicated than that unfortunately. Its a struct with some data in it. I tried to replicate it but i failed horribly: printf 'fl\x0\xf1\x0\x32\x0\x0\x0' > /dev/ntx_io (00000000 66 6c 00 f1 00 32 00 00 00 |fl...2...|) I tried hacking the lua script to /tmp/ntx_io as a file, hoping it would just dump its data in there, so i could do a replay from script. But that did not work *sigh* Does anyone know what data is send exactly ? I just need to turn on and off the frontlight, nothing fancy. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Feature Request: Lock Column | CRussel | Calibre | 31 | 02-11-2018 03:25 AM |
Screen Lock | sherbearjt08 | Nook Developer's Corner | 1 | 06-17-2011 03:57 PM |
Feature Request: Touch Screen Usage | ghostyjack | EPUBReader | 3 | 08-03-2010 07:29 AM |
Feature Request: Lock Metadata | carpii | Calibre | 3 | 02-27-2010 04:34 PM |
PRS-300 Who uses the lock feature? | icemncmth | Sony Reader | 11 | 01-23-2010 11:42 AM |