Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #28 from cytown/master
Browse files Browse the repository at this point in the history
add txt file support and add KUAL extensions for user choice
  • Loading branch information
chrox committed May 20, 2017
2 parents 76897fa + 85e4940 commit dcb9bf2
Show file tree
Hide file tree
Showing 12 changed files with 412 additions and 46 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.txt
@@ -1,3 +1,9 @@
2017-04-07 10:49 cytown

* add txt file opened by kpvbooklet
* add KUAL KPVBooklet Settings feature for user controll opened by
KOReader/HackedUpReader/Original

2016-07-17 13:53 chrox

* check new document settings path for updating progress and possibly add
Expand Down
4 changes: 3 additions & 1 deletion README.md
@@ -1,9 +1,11 @@
KPVBooklet for Kindle Touch, Kindle Paperwhite, New Kindle and Kindle Voyage
======================================

KPVBooklet is a Kindle booklet for starting KoReader
KPVBooklet is a Kindle booklet for starting KoReader/HackedUpReader
and updating last access and percentage finished information
in Kindle content catalog entry of the opened document.

User can switch the open type in KUAL KPVBooklet extentions.

KPVBooklet is licensed under the MIT license. See the file
LICENSE for more details.
2 changes: 1 addition & 1 deletion README_FIRST.txt
@@ -1,7 +1,7 @@
KPVBooklet for Kindle Touch, Kindle Paperwhite and Kindle Voyage
=================================================

KPVBooklet is a Kindle booklet for starting KOReader.
KPVBooklet is a Kindle booklet for starting KOReader/HackedUpReader.
It also updates last access and percentage finished information in Kindle's
content catalog entry of the opened document.

Expand Down
6 changes: 5 additions & 1 deletion build-updates.sh
Expand Up @@ -2,7 +2,7 @@

HACKNAME="kpvbooklet"
PKGNAME="${HACKNAME}"
PKGVER="0.6.4"
PKGVER="0.6.5"

# We need kindletool (https://github.com/NiLuJe/KindleTool) in $PATH
if (( $(kindletool version | wc -l) == 1 )) ; then
Expand All @@ -16,6 +16,9 @@ fi

# We also need GNU tar
TAR_BIN="tar"
if [[ "$OSTYPE" == "darwin"* ]] ; then
TAR_BIN="gtar"
fi
if ! ${TAR_BIN} --version | grep "GNU tar" > /dev/null 2>&1 ; then
echo "You need GNU tar to build this package."
exit 1
Expand All @@ -29,6 +32,7 @@ cp -f install.ffs build/install/install.ffs
cp -f build/jar/KPVBooklet.jar build/install/KPVBooklet.jar
cp -f mimes.install.sql build/install/mimes.install.sql
cp -f whispertouch.install.sql build/install/whispertouch.install.sql
cp -rf extensions build/install/

cp -f uninstall.ffs build/uninstall/uninstall.ffs
cp -f mimes.uninstall.sql build/uninstall/mimes.uninstall.sql
Expand Down
21 changes: 11 additions & 10 deletions build.xml
Expand Up @@ -7,8 +7,8 @@
<property environment="env"/>

<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.4"/>
<property name="source" value="1.4"/>
<property name="target" value="1.8"/>
<property name="source" value="1.8"/>

<!-- environment variable for the location of Amazon's jar files -->
<target name="checkProperties">
Expand All @@ -17,15 +17,16 @@
</target>

<path id="local.classpath">
<pathelement location="${env.KINDLE_EBOOK}/lib/json_simple-1.1.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/lib/utilities.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/lib/json_simple-1.1.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/lib/utilities.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/lib/kaf.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/lib/kafui.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/lib/ReaderSDK.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/lib/ReaderContentSDK.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/booklet/Reader.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/booklet/AbstractReaderBooklet.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/lib/concierge-1.0.0.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/lib/kafui.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/lib/kxml2.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/lib/ReaderSDK.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/lib/ReaderContentSDK.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/booklet/Reader.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/booklet/AbstractReaderBooklet.jar"/>
<pathelement location="${env.KINDLE_EBOOK}/lib/concierge-1.0.0.jar"/>
</path>

<target name="compile" depends="checkProperties">
Expand Down
12 changes: 12 additions & 0 deletions extensions/kpvbooklet/config.xml
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension>
<information>
<name>KPVBooklet</name>
<version>0.1</version>
<author>cytown@gmail.com</author>
<id>KPVBooklet</id>
</information>
<menus>
<menu type="json" dynamic="true">menu.json</menu>
</menus>
</extension>
210 changes: 210 additions & 0 deletions extensions/kpvbooklet/menu.json
@@ -0,0 +1,210 @@
{
"items": [
{
"name": "KPVBooklet Settings",
"if": "\"/mnt/us/hackedupreader/bin/cr3\" -f",
"priority": 5,
"items": [

{
"name": "PDF file opened by KO* (Original)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^pdf=\" -g! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^pdf=1$\" -g || ||",
"action": "./bin/booklet.sh",
"params": "pdf 0",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set PDF opened by Original"
},
{
"name": "PDF file opened by Original* (KO)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^pdf=0$\" -g &&",
"action": "./bin/booklet.sh",
"params": "pdf 1",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set PDF opened by KOReader"
},
{
"name": "TXT file opened by KO* (HackedUp, Original)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^txt=\" -g! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^txt=1$\" -g || ||",
"action": "./bin/booklet.sh",
"params": "txt 2",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set TXT opened by HackedUpReader"
},
{
"name": "TXT file opened by HackedUp* (Original, KO)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^txt=2$\" -g &&",
"action": "./bin/booklet.sh",
"params": "txt 0",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set TXT opened by Original"
},
{
"name": "TXT file opened by Original* (KO, HackedUp)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^txt=0$\" -g &&",
"action": "./bin/booklet.sh",
"params": "txt 1",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set TXT opened by KOReader"
},
{
"name": "EPUB file opened by KO* (HackedUp)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^epub=\" -g! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^epub=1$\" -g || ||",
"action": "./bin/booklet.sh",
"params": "epub 2",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set EPUB opened by HackedUpReader"
},
{
"name": "EPUB file opened by HackedUp* (KO)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^epub=2$\" -g &&",
"action": "./bin/booklet.sh",
"params": "epub 1",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set EPUB opened by KOReader"
},
{
"name": "PDB file opened by KO* (HackedUp)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^pdb=\" -g! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^pdb=1$\" -g || ||",
"action": "./bin/booklet.sh",
"params": "pdb 2",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set PDB opened by HackedUpReader"
},
{
"name": "PDB file opened by HackedUp* (KO)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^pdb=2$\" -g &&",
"action": "./bin/booklet.sh",
"params": "pdb 1",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set PDB opened by KOReader"
},
{
"name": "FB2 file opened by KO* (HackedUp)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^fb2=\" -g! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^fb2=1$\" -g || ||",
"action": "./bin/booklet.sh",
"params": "fb2 2",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set FB2 opened by HackedUpReader"
},
{
"name": "FB2 file opened by HackedUp* (KO)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^fb2=2$\" -g &&",
"action": "./bin/booklet.sh",
"params": "fb2 1",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set FB2 opened by KOReader"
},
{
"name": "RTF file opened by KO* (HackedUp)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^rtf=\" -g! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^rtf=1$\" -g || ||",
"action": "./bin/booklet.sh",
"params": "rtf 2",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set RTF opened by HackedUpReader"
},
{
"name": "RTF file opened by HackedUp* (KO)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^rtf=2$\" -g &&",
"action": "./bin/booklet.sh",
"params": "rtf 1",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set RTF opened by KOReader"
},
{
"name": "CHM file opened by KO* (HackedUp)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^chm=\" -g! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^chm=1$\" -g || ||",
"action": "./bin/booklet.sh",
"params": "chm 2",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set CHM opened by HackedUpReader"
},
{
"name": "CHM file opened by HackedUp* (KO)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^chm=2$\" -g &&",
"action": "./bin/booklet.sh",
"params": "chm 1",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set CHM opened by KOReader"
}
]
},
{
"name": "KPVBooklet Settings",
"if": "\"/mnt/us/hackedupreader/bin/cr3\" -f!",
"priority": 5,
"items": [

{
"name": "PDF file opened by KO* (Original)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^pdf=\" -g! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^pdf=1$\" -g || ||",
"action": "./bin/booklet.sh",
"params": "pdf 0",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set PDF opened by Original"
},
{
"name": "PDF file opened by Original* (KO)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^pdf=0$\" -g &&",
"action": "./bin/booklet.sh",
"params": "pdf 1",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set PDF opened by KOReader"
},
{
"name": "TXT file opened by KO* (Original)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^txt=\" -g! \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^txt=1$\" -g || ||",
"action": "./bin/booklet.sh",
"params": "txt 0",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set TXT opened by HackedUpReader"
},
{
"name": "TXT file opened by Original* (KO)",
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^txt=0$\" -g &&",
"action": "./bin/booklet.sh",
"params": "txt 1",
"refresh": true,
"exitmenu": false,
"status": false,
"internal": "status set TXT opened by KOReader"
}
]
}
]
}
5 changes: 4 additions & 1 deletion install.ffs
Expand Up @@ -57,7 +57,10 @@ if [ "$VERSION" \> "5.4" ]; then
touch "/MNTUS_EXEC"
fi

progress 80 "Mounting ro"
progress 80 "Installing KUAL Extension"
cp -r extensions/kpvbooklet /mnt/us/extensions/ || fail "Unable to copy KUAL Extension"

progress 90 "Mounting ro"
mntroot ro || fail "Unable to mount ro"

progress 100 "Installation complete."
Expand Down
5 changes: 5 additions & 0 deletions mimes.install.sql
Expand Up @@ -16,6 +16,8 @@ INSERT OR IGNORE INTO "associations" VALUES('com.github.koreader.kpvbooklet','de

INSERT OR IGNORE INTO "associations" VALUES('com.github.koreader.kpvbooklet','application','MT:application/pdf','true');

INSERT OR IGNORE INTO "associations" VALUES('com.github.koreader.kpvbooklet','application','MT:text/plain','true');

INSERT OR IGNORE INTO "mimetypes" VALUES('djvu','MT:image/x.djvu');
INSERT OR IGNORE INTO "extenstions" VALUES('djvu','MT:image/x.djvu');
INSERT OR IGNORE INTO "properties" VALUES('archive.displaytags.mimetypes','image/x.djvu','DjVu');
Expand Down Expand Up @@ -84,3 +86,6 @@ INSERT OR IGNORE INTO "associations" VALUES('com.github.koreader.kpvbooklet','ap

UPDATE "associations" SET defaultAssoc = 'false' WHERE interface = 'application' and contentId = 'MT:application/pdf' and handlerId = 'com.lab126.booklet.reader';
UPDATE "associations" SET defaultAssoc = 'true' WHERE interface = 'application' and contentId = 'MT:application/pdf' and handlerId = 'com.github.koreader.kpvbooklet';

UPDATE "associations" SET defaultAssoc = 'false' WHERE interface = 'application' and contentId = 'MT:text/plain' and handlerId = 'com.lab126.booklet.reader';
UPDATE "associations" SET defaultAssoc = 'true' WHERE interface = 'application' and contentId = 'MT:text/plain' and handlerId = 'com.github.koreader.kpvbooklet';
1 change: 1 addition & 0 deletions mimes.uninstall.sql
Expand Up @@ -13,3 +13,4 @@ DELETE FROM "associations" WHERE contentId='GL:*.doc' OR contentId='GL:*.fb2' OR
DELETE FROM "associations" WHERE contentId='GL:*.tcr' OR contentId='GL:*.xps' OR contentId='GL:*.zip';

UPDATE "associations" SET defaultAssoc = 'true' WHERE interface = 'application' and contentId = 'MT:application/pdf' and handlerId = 'com.lab126.booklet.reader';
UPDATE "associations" SET defaultAssoc = 'true' WHERE interface = 'application' and contentId = 'MT:text/plain' and handlerId = 'com.lab126.booklet.reader';

0 comments on commit dcb9bf2

Please sign in to comment.