Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Onyx Boox

Notices

Reply
 
Thread Tools Search this Thread
Old 04-19-2015, 03:33 PM   #1
zoidberg
Junior Member
zoidberg doesn't litterzoidberg doesn't litterzoidberg doesn't litter
 
Posts: 8
Karma: 204
Join Date: Apr 2015
Location: United Kingdom
Device: m96
M96 - device encryption?

Hi all,
Just got my m96 recently from ereader-store. Long story short, I can't find a way to enable android device encryption.

I'm vaguely familiar with the usb debugging and managed to pull this error from the log:
Code:
Orig filesystem overlaps crypto footer region. Cannot encrypt in place.
I'm not sure how I might get around this, solutions I've found online all seem to rely on installing a more advanced recovery tool like CWM, any advice anyone can offer would be appreciated!

TIA
zoidberg is offline   Reply With Quote
Old 04-21-2015, 08:29 AM   #2
ZeKK
Member
ZeKK began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Apr 2014
Device: kindle
What wish you read?
ZeKK is offline   Reply With Quote
 
Advertisement
Old 04-24-2015, 02:32 PM   #3
zoidberg
Junior Member
zoidberg doesn't litterzoidberg doesn't litterzoidberg doesn't litter
 
Posts: 8
Karma: 204
Join Date: Apr 2015
Location: United Kingdom
Device: m96
I did make *some* progress with this, I was able to force unmount the filesystem and reformat it to a slightly smaller size. Unfortunately the process is still failing and I haven't been able to pin down the source yet. I can post more details is anybody's interested!

Quote:
Originally Posted by ZeKK View Post
What wish you read?
A variety of things really, mostly technical documents, but also some personal documents (e-ink displays are great for proofreading!) hence encryption is desirable.
zoidberg is offline   Reply With Quote
Old 06-09-2015, 02:20 PM   #4
zoidberg
Junior Member
zoidberg doesn't litterzoidberg doesn't litterzoidberg doesn't litter
 
Posts: 8
Karma: 204
Join Date: Apr 2015
Location: United Kingdom
Device: m96
I finally figured this one out!
The kernel was compiled without sha256 support, was able to compile that as a module against (roughly) compatible kernel sources I found here: http://git.freescale.com/git/

After that module is loaded, encryption completes. You can then add that module to the init.freescale.rc to make it load on boot.

The only snag was that the touchscreen stopped responding after boot completed, just needed to restart 'onyx_tpd' after the crypto device is mounted, there are events for that in the init rc as well.

maybe nobody cares but me, but I thought it might help someone someday!
zoidberg is offline   Reply With Quote
Old 06-10-2015, 07:16 AM   #5
Randy11
Fanatic
Randy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exercise
 
Posts: 593
Karma: 38230
Join Date: Oct 2008
Device: Samsung EB60, Onyx M92
Quote:
Originally Posted by zoidberg View Post
maybe nobody cares but me, but I thought it might help someone someday!
No, I found this very interesting. THANKS !

I've too some papers for which the encryption will be useful.

I'm not so clever as you in Linux system to debug hardware and Android, so could you give a copy of the modified files ?

How do you restart the 'onyx_tpd' ?

Some people here doesn't know, roughly, anything about the Android OS and Linux.

If the module is small, could you attach the file ? If the like is broken, we have always the attached file.

Last edited by Randy11; 06-10-2015 at 07:19 AM.
Randy11 is offline   Reply With Quote
Old 06-12-2015, 03:30 PM   #6
zoidberg
Junior Member
zoidberg doesn't litterzoidberg doesn't litterzoidberg doesn't litter
 
Posts: 8
Karma: 204
Join Date: Apr 2015
Location: United Kingdom
Device: m96
Hi Randy, I was a bit brief before so I may as well document the whole thing more thoroughly now. TBH it got messy at times!

Before getting started, if you aren't already you'll wanna get acquainted with the Android Debug Bridge (adb), part of the Android SDK. You use it to connect to the device over a USB cable and run commands on it.

1.
The first problem, the 'Crypto Footer Region' business. I couldn't find a way to unmount the data partition at the time, but since my device was new, I could just deliberately screw it up with the 'dd' command so the OS couldn't use it when I restarted:
The command I used was
Code:
dd if=/dev/zero of=/dev/block/mmcblk0p7 bs=4k count=10000
.
If you do that it *will* corrupt your data, possibly beyond all hope of recovery. *Definitely* have a confirmed backup before trying anything like it!! Also make sure you get the right block device. (it's possible yours isn't mmcblk0p7, run 'mount' to check what gets mounted to 'data')

Once that was done it would let me re-format the filesystem to a slightly smaller size, by doing this:
Code:
mke2fs -T ext4 -L data /dev/block/mmcblk0p7 524031
. Once that's done, the encryption process can get a step further.

2.
Then there was another problem, something to do with the signal the android framework uses to tell the software it's ready to go with the encryption. I can't remember how I got to the bottom of that one, but the solution involved prying open the boot file from the last update.zip I used and modifying it to change a setting.
You can read more about that here: http://www.mobileread.com/forums/sho...d.php?t=244556
In there is the "init.rc" file I was talking about, at this point, uncommenting this setting got me a step further:
Code:
setprop vold.post_fs_data_done 1
3.
The last error is the sha256 one. After much searching and head scratching, I guessed that this was the problem and managed to compile the module (I'll attach it to this post!), here's a basic starter point on kernel compiling: https://source.android.com/source/building-kernels.html.
Using the kernel source from Freescale and the google's cross-compiler toolchain, I managed to build the module. The only additional steps are; when you're running the build configuration tool, select to modularise sha256, then when you're done, run
Code:
make CFLAGS_MODULE=-fno-pic modules
That cflags bit has something to do with stopping the system rejecting the module cos it wasn't build with *precisely* the same settings as the kernel.

Use adb to push the file onto the device then use the 'insmod' command to insert it. to make that permanent, try adding it to the end of the init.freescale.rc file, same idea as before.

Finally, the touchscreen thing: in init.rc, I added 'restart onyx_tpd' to the end of the 'vold.decrypt=trigger_restart_framework' and 'vold.decrypt=trigger_load_persist_props' sections, that did the trick.

You might have guessed; there was plenty of trial and error and educated guessing going on, still barely understand some of the stuff I actually did, so if anybody has any comments, they're welcome!

Worth mentioning; for all I know there are perfectly good reasons Onyx/Freescale built the software this way, so long term, who knows... Still, so far the system's been as stable as before, my long journey into the linuxy guts of android is over for now!
Attached Files
File Type: zip sha256_generic (armv7).ko.zip (5.0 KB, 7 views)
zoidberg is offline   Reply With Quote
Old 06-15-2015, 06:44 AM   #7
Randy11
Fanatic
Randy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exerciseRandy11 juggles running chainsaws for a bit of light exercise
 
Posts: 593
Karma: 38230
Join Date: Oct 2008
Device: Samsung EB60, Onyx M92
Thanks a lot for this beautiful explanation :-)

There is a lot of work !
Randy11 is offline   Reply With Quote
Old 06-15-2015, 03:57 PM   #8
zoidberg
Junior Member
zoidberg doesn't litterzoidberg doesn't litterzoidberg doesn't litter
 
Posts: 8
Karma: 204
Join Date: Apr 2015
Location: United Kingdom
Device: m96
Quote:
Originally Posted by Randy11 View Post
Thanks a lot for this beautiful explanation :-)

There is a lot of work !
Don't mention it, glad I could help!
zoidberg is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[M96] Perfect cover case for M96 kuskro Onyx Boox 3 01-30-2015 12:28 PM
Encryption of ebooks in Calibre svenlind Calibre 14 04-16-2012 09:35 AM
ePub encryption possible? elielscott ePub 9 03-17-2012 09:08 AM
re-encryption therinken Nook Developer's Corner 1 02-27-2011 12:32 PM
Email Encryption.. Do you use it? Bob Russell Lounge 8 06-17-2006 04:33 AM


All times are GMT -4. The time now is 05:13 PM.


MobileRead.com is a privately owned, operated and funded community.