View Single Post
Old 05-15-2015, 10:38 PM   #14
mattmc
Connoisseur
mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.
 
Posts: 89
Karma: 185923
Join Date: May 2015
Device: iPad 1/2/Air, K3/PW2/Fire1, Kobo Touch, Samsung Tab, Nook Color/Touch
Quote:
Originally Posted by DaleDe View Post
Wow, great effort at decoding this mysterious format. It looks like a very complete analysis. Unfortunately I don't have any idea why you are getting failures. Possibly simplifying your source and getting something to work and then adding back pieces seems like it would help.
Thanks

Quote:
Originally Posted by Doitsu View Post
Try the following:
  • Build an .azk file without embedded fonts.
  • Build an .azk file without images and embedded fonts.
  • Successively delete 50% of the .html files and test the resulting .azk file.
Yeah, I think I'll take roughly that approach.

Before I dive into the carve-try-repeat process, I wanted to see if I could get some more data from log files. With iFunbox, I was able to find some text logs in Kindle.app/Library/Caches/logs.

This is roughly the log of what occurs when I try to open the broken book:

Code:
I KindleDocViewerFactory:+[KindleDocViewerFactory openHtmlBook:]:Thread(707)::Open Mobi8 Book with ASIN KPR2015-MAY-16_01_57_53.789863:  (info | KindleDocViewerFactory.mm:201)
I OCIPHAnimatedBookView:-[OCIPHAnimatedBookView openBookWithReaderItem:periodicalsModel:readerStyle:inReplicaMode:error:]:Thread(707)::Open book successfully with ASIN: KPR2015-MAY-16_01_57_53.789863  (info | OCIPHAnimatedBookView.mm:230)
I KcrDocWebViewBridge:-[KcrDocWebViewBridge openBook:rendererSize:fontName:fontSize:colors:margins:lineSpacing:numColumns:startPosition:leftJustification:]:Thread(707)::Open KCR book with ASIN KPR2015-MAY-16_01_57_53.789863: , fontName: Georgia ,fontSize: 20.900000 ,renderer's width: 628.000000 ,and renderer's height: 899.000000  (info | KcrDocWebViewBridge.mm:257)
E EANData:-[EANData initWithSidecarData:bookData:onBookOpen:]:Thread(707)::End-Actions: Unable to successfully load sidecar  (error | EANData.m:56)
E KcrDocWebViewBridge:-[KcrDocWebViewBridge pageRenderError:]:Thread(707)::Renderer error: No Message  (error | KcrDocWebViewBridge.mm:763)
Omitted are the logs of all of the "metrics" functions--the Kindle app has very thorough metrics recorded of every event. I also omitted all of the sync-related calls; the app attempts to verify that the book you've just opened is the correct version and syncs down the correct one if it's outdated. Finally, I also carved off the timestamps. As curiosa, each log entry is prefixed with "Lassen: ", the meaning of which I can only guess at--perhaps the German word, which translates to "leave"?

The character all the way to the left of those lines would be the type of the log message: I'm guessing "I" for info and "E" for error. The EANData error can be ruled out, I think, because EAN is essentially a product code, like the ISBN. I loaded up Doitsu's AZK that he gave me, and it also had that EANData error, but it displays fine. So the "pageRenderError" from "KcrDocWebViewBridge" is the killer.

So then, what logs do I have when I load a book in?

Code:
I LibraryManager:-[LibraryManager deleteBooksAtPaths:]:Thread(707)::Removed 0 files in library. 0 books archived, 0 books deleted.  (info | LibraryManager.mm:649)
I LibraryFileManager:-[LibraryFileManager scanDirectoryAtPath:]:Thread(5093)::Library scanning completed for path '/var/mobile/Applications/0931E3A7-F562-4BE9-BB60-ACF67D118443/Documents'. 1 files in path, 0 books added, 1 M8 books sideloaded, 0 books archived, 0 books deleted from core data, 0 files deleted  (info | LibraryFileManager.mm:770)
I KindleApplicationDelegate:-[KindleApplicationDelegate applicationDidReceiveMemoryWarning:]:Thread(707)::Memory warning received.  (info | KindleApplicationDelegate.mm:549)
I LibraryManager:-[LibraryManager deleteBooksAtPaths:]:Thread(707)::Removed 0 files in library. 0 books archived, 0 books deleted.  (info | LibraryManager.mm:649)
I LibraryFileManager:-[LibraryFileManager scanDirectoryAtPath:]:Thread(3c7b)::Library scanning completed for path '/var/mobile/Applications/0931E3A7-F562-4BE9-BB60-ACF67D118443/Library/eBooks'. 9 files in path, 1 books added, 0 M8 books sideloaded, 0 books archived, 0 books deleted from core data, 1 files deleted  (info | LibraryFileManager.mm:770)
I LibraryFileManager:-[LibraryFileManager scanDirectoryAtPath:]:Thread(3c7b)::Library scanning completed for path '/var/mobile/Applications/0931E3A7-F562-4BE9-BB60-ACF67D118443/Documents'. 0 files in path, 0 books added, 0 M8 books sideloaded, 0 books archived, 0 books deleted from core data, 0 files deleted  (info | LibraryFileManager.mm:770)
I LibraryManager:-[LibraryManager deleteBooksAtPaths:]:Thread(707)::Removed 0 files in library. 0 books archived, 0 books deleted.  (info | LibraryManager.mm:649)
Well, all that really tells me is that the "Library Manager" scanned the Documents folder, and found a sideloaded M8 book (Mobi v8?). 30 seconds later, according to the timestamps, it had added 1 book to the library and deleted the document. So there are logs of the conversion process happening, but no errors or anything.

Alright, time to start slicing and dicing...
mattmc is offline   Reply With Quote