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

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 12-22-2016, 04:20 AM   #16
CatRovacer
Member
CatRovacer began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Dec 2015
Location: Moscow
Device: Kobo Glo, Touch, Aura HD
Quote:
Run:
sqlite3 /mnt/kobo/.kobo/KoboReader.sqlite

delete from user;
insert into user values ('','','','','','','','','','','','','','','','',' ','');
.quit
Result of these manipulations depends by version of updates.

What is suitable for an earlier release will not accept a more recent update.

I still listened to comrades here and started the dummy account on kobo com )))
After exercise in editing database tables.
CatRovacer is offline   Reply With Quote
Old 01-11-2017, 11:54 PM   #17
very_rude_Turnip
Member
very_rude_Turnip will become famous soon enoughvery_rude_Turnip will become famous soon enoughvery_rude_Turnip will become famous soon enoughvery_rude_Turnip will become famous soon enoughvery_rude_Turnip will become famous soon enoughvery_rude_Turnip will become famous soon enough
 
Posts: 24
Karma: 560
Join Date: Dec 2016
Device: Kobo Aura v2
In the end, I never did get around to installing dropbear for ssh or anything like that. I disabled the 802.11 completely and don't use it. Instead I installed a physical console to the serial port by drilling a small rectangle on the bottom near the USB port and gluing a molex connector in place.

I sync my files by USB, an rsync script, and a udev rule. This works out really well.

Code:
ACTION=="add", SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="Kobo", ENV{ID_SERIAL_SHORT}=="xxxxxxxxxxxx", SUBSYSTEM=="usb", RUN+="/home/xxxx/bin/kobo_usb_sync.sh"
This udev rule will execute the script when the Kobo is plugged in and I've pressed the "Connect" button on the screen.

Be warned that this script runs as root the way I have it set up.

Code:
#!/bin/bash

MYNAME=$(basename $0)
MOUNT_DIR=/mnt/kobo
SYNC_DIR=/home/xxxx/ebooks/booksync
BAKDIR=/home/xxxx/ebooks/kobo_backups
BAKVER=$(date '+%Y%m%d%H%M%S')-$$
SYNC_OUTDIR=$BAKDIR/kobo-BACKUP-$BAKVER
SYNC_TIMEOUT=30
SYNC_INCLUDE=$MOUNT_DIR

logger "$MYNAME: Starting ereader sync."

if ! [[ -d "$MOUNT_DIR" ]] ; then
	logger "$MYNAME: ERROR: Mount dir does not exist: $MOUNT_DIR"
	exit 1
fi

if ! [[ -d "$SYNC_DIR" ]] ; then
	logger "$MYNAME: ERROR: Source dir does not exist: $SYNC_DIR"
	exit 1
fi

while true ; do
	if [[ "$COUNTER" -gt 8 ]] ; then
		logger "$MYNAME: ERROR: Timeout waiting for kobo to mount."
		exit 1
	elif ! [[ -v "$COUNTER" ]] ; then
		COUNTER=0
		sleep 2
	else
		COUNTER=$(( $COUNTER + 1 ))
	fi
	mount -L KOBOeReader -o fmask=0117,dmask=0007 $MOUNT_DIR ; X_MOUNT=$?
	if [[ "$X_MOUNT" == 0 ]] ; then
		logger "$MYNAME: Mounted. Starting sync."
		rsync -r -t --delete --delete-excluded $SYNC_DIR $MOUNT_DIR
		logger "$MYNAME: Sync completed. Exit code $?."
		if [[ -d "$BAKDIR" ]] ; then
			logger "$MYNAME: Starting backup."
			SYNC_LINKDEST=$(find $BAKDIR -maxdepth 1 -type d -regextype egrep -regex ".*/kobo-BACKUP-[0-9]+-[0-9]+$" | sort | tail -n 1)
			if [[ -n "$SYNC_LINKDEST" ]] ; then
				SYNC_LINK_DEST_ARG="--link-dest=$SYNC_LINKDEST"
			else
				SYNC_LINK_DEST_ARG=""
			fi
			rsync -a \
				--delete \
				--delete-excluded \
				--exclude "/booksync" \
				$SYNC_LINK_DEST_ARG \
				--timeout=$SYNC_TIMEOUT \
				$SYNC_INCLUDE/ $SYNC_OUTDIR
				X_RSYNC="$?"
			# [[ -d "$SYNC_OUTDIR" ]] && chown -R user:user $SYNC_OUTDIR && chmod -R o-rwx $SYNC_OUTDIR
			logger "$MYNAME: Backup completed. Exit code $X_RSYNC."
		fi
		umount $MOUNT_DIR
		break
	else
		logger "$MYNAME: Mount failed on try $COUNTER."
		sleep 1
	fi
done ; unset COUNTER

logger "$MYNAME: Finished ereader sync."
The above script uses rsync to mirror a directory where I keep my ebook files onto the reader. It also backs up the filesystem (minus the booksync directory we just uploaded) in an efficient manner using hard links (deduplication). The script never cleans up old backups, but they are tiny and I don't expect that to be a problem.

Calibre works great on Linux as a GUI app and I am very happy with it. I threw some money at the author for his work.

And, I updated my OS manually by copying the update files over USB:

Code:
sudo mount -L KOBOeReader -o fmask=0000,dmask=0000 /mnt/kobo/
cd ~/tmp
wget http://download.kobobooks.com/firmwares/kobo6/December2016/kobo-update-4.2.8110.zip
sudo unzip ~tmp/kobo-update*.zip -d /mnt/kobo/.kobo/
sudo umount /mnt/kobo/
rm -f ~tmp/kobo-update*.zip
My biggest complaint right now is that PDF files are rendered poorly. Mostly it's the huge inefficient margins issue. I will stick to my tablet for PDFs.

Last edited by very_rude_Turnip; 01-13-2017 at 10:13 PM.
very_rude_Turnip is offline   Reply With Quote
Advert
Old 01-13-2017, 08:13 PM   #18
besucherin
Junior Member
besucherin began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2017
Device: kobo
Quote:
Originally Posted by CatRovacer View Post
Result of these manipulations depends by version of updates.

What is suitable for an earlier release will not accept a more recent update.

I still listened to comrades here and started the dummy account on kobo com )))
After exercise in editing database tables.
I let mine connect to wifi and it updated before I realized it was a bad idea. After updating, the sqlite commmand returned:

Code:
sqlite> insert into user values ('','','','','','','','','','','','','','','','',' ','');
Error: table user has 19 columns but 18 values were supplied
So, all it needed was an extra ,'' to made it work without registration.
Code:
sqlite> insert into user values ('','','','','','','','','','','','','','','','',' ','','');

The schema for the user table after the update is:

CREATE TABLE user(UserID TEXT NOT NULL,
UserKey TEXT NOT NULL,
UserDisplayName TEXT,
UserEmail TEXT,
___DeviceID TEXT,
FacebookAuthToken TEXT,
HasMadePurchase BIT DEFAULT FALSE,
IsOneStoreAccount BIT DEFAULT FALSE,
IsChildAccount BIT DEFAULT FALSE,
RefreshToken TEXT,
AuthToken TEXT,
AuthType TEXT,
Loyalty BLOB,
IsLibraryMigrated BIT NOT NULL DEFAULT true,
SyncContinuationToken TEXT,
Subscription INT NOT NULL DEFAULT 0,
LibrarySyncType TEXT,
LibrarySyncTime TEXT,
SyncTokenAppVersion TEXT,
PRIMARY KEY (UserID));

Wondering what this loyalty blob is........
Edit: Found the old schema in another thread, the added field is SyncTokenAppVersion.

Last edited by besucherin; 01-13-2017 at 08:48 PM.
besucherin is offline   Reply With Quote
Old 01-13-2017, 08:30 PM   #19
besucherin
Junior Member
besucherin began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2017
Device: kobo
And more fun with sqlite......

Doing a backup first is always a good idea.....
Code:
sqlite> .backup /some/directory/kobodb
What other tables do we have?
Code:
sqlite> .fullschema
This one looks interesting:
Code:
CREATE TABLE AnalyticsEvents(.
Id TEXT,.
Type TEXT,.
Timestamp TEXT,.
Attributes TEXT,.
Metrics TEXT,.
TestGroups TEXT,.
PRIMARY KEY(Id));
It has the type of stuff you'd expect for it to tell you what percentage of a book you've read and how long you've spent reading, and when you sync, it sends something like this (along with the other events recorded? maybe I'll wireshark it one day and find out):
Code:
INSERT INTO "AnalyticsEvents" VALUES('<some unique string of numbers and letters>','UserMetadataUpdate','2017-01-13T23:40:57Z','{"AccountType": "Adult","Affiliate": "Kobo","CustomerType": "RMR","DeviceModel": "Kobo Aura ONE","KoboSuperPointsBalance": "0","KoboSuperPointsStatus": "","OSVersion": "3.0.35+","SDCardStatus": "No"}','{"DownloadedLibrarySize": 99,"LibrarySize": 116,"NumberOfDownloadedFreeBooks": 0,"NumberOfDownloadedPaidBooks": 0,"NumberOfDownloadedPreviews": 35,"NumberOfFreeBooks": 0,"NumberOfPaidBooks": 16,"NumberOfPreviews": 36,"NumberOfShelves": 0,"NumberOfSideloadedBooks": 64,"StorageSize": 6890}','{}');
Personally, I don't think they have any business knowing how many books I'm getting from elsewhere..... (btw the sync failed, "ServerErr", probably because there's no account set up.)

And here's an example of what Kobo sees if you flip through a preview book:
Code:
INSERT INTO "AnalyticsEvents" VALUES('<some unique string of numbers and letters>','OpenContent','2017-01-13T23:41:10Z','{"ContentFormat": "application/x-kobo-epub+zip","Monetization": "Preview","StartFile": "OEBPS/haupttitel.html","StartSpan": "kobo.1.1","volumeid": "<some nonunique string of numbers and letters>"}','{}','{}');
INSERT INTO "AnalyticsEvents" VALUES('<some unique string of numbers and letters>','LeaveContent','2017-01-13T23:42:16Z','{"ContentFormat": "application/x-kobo-epub+zip","Monetization": "","StartFile": "OEBPS/kapitel1.html","StartSpan": "kobo.1.1","volumeid": "<some nonunique string of numbers and letters>"}','{"IdleTime": 24,"PagesTurned": 2,"SecondsRead": 1}','{}');
I know some people don't have a problem with being constantly watched to be better advertised to, but I say no thanks. And I actually like, you know, owning my devices, you know?

edit:
Have you tried koreader? https://github.com/koreader/koreader
It's supposed to have better PDF handling than default, haven't gotten a chance to install it yet.

Last edited by besucherin; 01-13-2017 at 08:49 PM.
besucherin is offline   Reply With Quote
Old 01-13-2017, 09:12 PM   #20
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 18,378
Karma: 30661118
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by besucherin View Post
And more fun with sqlite......

Doing a backup first is always a good idea.....
Code:
sqlite> .backup /some/directory/kobodb
What other tables do we have?
Code:
sqlite> .fullschema
This one looks interesting:
Code:
CREATE TABLE AnalyticsEvents(.
Id TEXT,.
Type TEXT,.
Timestamp TEXT,.
Attributes TEXT,.
Metrics TEXT,.
TestGroups TEXT,.
PRIMARY KEY(Id));
It has the type of stuff you'd expect for it to tell you what percentage of a book you've read and how long you've spent reading, and when you sync, it sends something like this (along with the other events recorded? maybe I'll wireshark it one day and find out):
Code:
INSERT INTO "AnalyticsEvents" VALUES('<some unique string of numbers and letters>','UserMetadataUpdate','2017-01-13T23:40:57Z','{"AccountType": "Adult","Affiliate": "Kobo","CustomerType": "RMR","DeviceModel": "Kobo Aura ONE","KoboSuperPointsBalance": "0","KoboSuperPointsStatus": "","OSVersion": "3.0.35+","SDCardStatus": "No"}','{"DownloadedLibrarySize": 99,"LibrarySize": 116,"NumberOfDownloadedFreeBooks": 0,"NumberOfDownloadedPaidBooks": 0,"NumberOfDownloadedPreviews": 35,"NumberOfFreeBooks": 0,"NumberOfPaidBooks": 16,"NumberOfPreviews": 36,"NumberOfShelves": 0,"NumberOfSideloadedBooks": 64,"StorageSize": 6890}','{}');
Personally, I don't think they have any business knowing how many books I'm getting from elsewhere..... (btw the sync failed, "ServerErr", probably because there's no account set up.)

And here's an example of what Kobo sees if you flip through a preview book:
Code:
INSERT INTO "AnalyticsEvents" VALUES('<some unique string of numbers and letters>','OpenContent','2017-01-13T23:41:10Z','{"ContentFormat": "application/x-kobo-epub+zip","Monetization": "Preview","StartFile": "OEBPS/haupttitel.html","StartSpan": "kobo.1.1","volumeid": "<some nonunique string of numbers and letters>"}','{}','{}');
INSERT INTO "AnalyticsEvents" VALUES('<some unique string of numbers and letters>','LeaveContent','2017-01-13T23:42:16Z','{"ContentFormat": "application/x-kobo-epub+zip","Monetization": "","StartFile": "OEBPS/kapitel1.html","StartSpan": "kobo.1.1","volumeid": "<some nonunique string of numbers and letters>"}','{"IdleTime": 24,"PagesTurned": 2,"SecondsRead": 1}','{}');
I know some people don't have a problem with being constantly watched to be better advertised to, but I say no thanks. And I actually like, you know, owning my devices, you know?
The table has been discussed before. But my take on it is that it is information that helps Kobo understand the way the device is used and hence improve it. And looking at the rows you picked, they are for books you have purchased from Kobo. That means Kobo are already know about the book and are that fact in it's recommendations to you. For this and other reasons, I'm pretty sure the tracking for advertising is done by another mechanisms.

If you don't want this, then you can add a trigger to delete the rows as they are added. If you are a calibre user, my Kobo Utilities plugin has an option to do this. There is also an option on the "Reading settings" page to disable tracking reading activity. I don't know if this affects this table. The plugin will also do a backup (by file copy) of the database if you want.
davidfor is offline   Reply With Quote
Advert
Old 01-14-2017, 10:09 AM   #21
kido.resuri
Groupie
kido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura about
 
Posts: 172
Karma: 4282
Join Date: Dec 2016
Location: Hungary
Device: Kobo Aura H2O
Quote:
Originally Posted by davidfor View Post
There is also an option on the "Reading settings" page to disable tracking reading activity. I don't know if this affects this table.
It does, at least when I enabled tracking reading activity in the Reading settings, the table started to fill up with the rows mentioned above.
kido.resuri 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
Aura owner, is the H2O a big upgrade Desdinova Kobo Reader 15 08-19-2015 04:25 AM
Aura HD Kobo Glo/Aura/Aura HD future firmware feature request thread arspr Kobo Reader 25 03-26-2015 06:19 AM
CC no longer availabl eon my Kobo Aura HD using android hack Sternsam5 Calibre Companion 2 11-11-2014 06:45 AM
Replacing Nook Simple Touch: Onyx T68 vs Kobo Aura vs Kobo Aura H2O iNovelReader Which one should I buy? 0 10-28-2014 02:40 AM
Future new Kobo Aura owner ... marconique Introduce Yourself 9 04-23-2013 11:51 AM


All times are GMT -4. The time now is 11:07 AM.


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