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

Commit dcb9bf2

Browse files
authored
Merge pull request #28 from cytown/master
add txt file support and add KUAL extensions for user choice
2 parents 76897fa + 85e4940 commit dcb9bf2

12 files changed

+412
-46
lines changed

ChangeLog.txt

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2017-04-07 10:49 cytown
2+
3+
* add txt file opened by kpvbooklet
4+
* add KUAL KPVBooklet Settings feature for user controll opened by
5+
KOReader/HackedUpReader/Original
6+
17
2016-07-17 13:53 chrox
28

39
* check new document settings path for updating progress and possibly add

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
KPVBooklet for Kindle Touch, Kindle Paperwhite, New Kindle and Kindle Voyage
22
======================================
33

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

8+
User can switch the open type in KUAL KPVBooklet extentions.
9+
810
KPVBooklet is licensed under the MIT license. See the file
911
LICENSE for more details.

README_FIRST.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
KPVBooklet for Kindle Touch, Kindle Paperwhite and Kindle Voyage
22
=================================================
33

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

build-updates.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
HACKNAME="kpvbooklet"
44
PKGNAME="${HACKNAME}"
5-
PKGVER="0.6.4"
5+
PKGVER="0.6.5"
66

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

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

3337
cp -f uninstall.ffs build/uninstall/uninstall.ffs
3438
cp -f mimes.uninstall.sql build/uninstall/mimes.uninstall.sql

build.xml

+11-10
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<property environment="env"/>
88

99
<property name="debuglevel" value="source,lines,vars"/>
10-
<property name="target" value="1.4"/>
11-
<property name="source" value="1.4"/>
10+
<property name="target" value="1.8"/>
11+
<property name="source" value="1.8"/>
1212

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

1919
<path id="local.classpath">
20-
<pathelement location="${env.KINDLE_EBOOK}/lib/json_simple-1.1.jar"/>
21-
<pathelement location="${env.KINDLE_EBOOK}/lib/utilities.jar"/>
20+
<pathelement location="${env.KINDLE_EBOOK}/lib/json_simple-1.1.jar"/>
21+
<pathelement location="${env.KINDLE_EBOOK}/lib/utilities.jar"/>
2222
<pathelement location="${env.KINDLE_EBOOK}/lib/kaf.jar"/>
23-
<pathelement location="${env.KINDLE_EBOOK}/lib/kafui.jar"/>
24-
<pathelement location="${env.KINDLE_EBOOK}/lib/ReaderSDK.jar"/>
25-
<pathelement location="${env.KINDLE_EBOOK}/lib/ReaderContentSDK.jar"/>
26-
<pathelement location="${env.KINDLE_EBOOK}/booklet/Reader.jar"/>
27-
<pathelement location="${env.KINDLE_EBOOK}/booklet/AbstractReaderBooklet.jar"/>
28-
<pathelement location="${env.KINDLE_EBOOK}/lib/concierge-1.0.0.jar"/>
23+
<pathelement location="${env.KINDLE_EBOOK}/lib/kafui.jar"/>
24+
<pathelement location="${env.KINDLE_EBOOK}/lib/kxml2.jar"/>
25+
<pathelement location="${env.KINDLE_EBOOK}/lib/ReaderSDK.jar"/>
26+
<pathelement location="${env.KINDLE_EBOOK}/lib/ReaderContentSDK.jar"/>
27+
<pathelement location="${env.KINDLE_EBOOK}/booklet/Reader.jar"/>
28+
<pathelement location="${env.KINDLE_EBOOK}/booklet/AbstractReaderBooklet.jar"/>
29+
<pathelement location="${env.KINDLE_EBOOK}/lib/concierge-1.0.0.jar"/>
2930
</path>
3031

3132
<target name="compile" depends="checkProperties">

extensions/kpvbooklet/config.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<extension>
3+
<information>
4+
<name>KPVBooklet</name>
5+
<version>0.1</version>
6+
<author>[email protected]</author>
7+
<id>KPVBooklet</id>
8+
</information>
9+
<menus>
10+
<menu type="json" dynamic="true">menu.json</menu>
11+
</menus>
12+
</extension>

extensions/kpvbooklet/menu.json

+210
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
{
2+
"items": [
3+
{
4+
"name": "KPVBooklet Settings",
5+
"if": "\"/mnt/us/hackedupreader/bin/cr3\" -f",
6+
"priority": 5,
7+
"items": [
8+
9+
{
10+
"name": "PDF file opened by KO* (Original)",
11+
"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 || ||",
12+
"action": "./bin/booklet.sh",
13+
"params": "pdf 0",
14+
"refresh": true,
15+
"exitmenu": false,
16+
"status": false,
17+
"internal": "status set PDF opened by Original"
18+
},
19+
{
20+
"name": "PDF file opened by Original* (KO)",
21+
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^pdf=0$\" -g &&",
22+
"action": "./bin/booklet.sh",
23+
"params": "pdf 1",
24+
"refresh": true,
25+
"exitmenu": false,
26+
"status": false,
27+
"internal": "status set PDF opened by KOReader"
28+
},
29+
{
30+
"name": "TXT file opened by KO* (HackedUp, Original)",
31+
"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 || ||",
32+
"action": "./bin/booklet.sh",
33+
"params": "txt 2",
34+
"refresh": true,
35+
"exitmenu": false,
36+
"status": false,
37+
"internal": "status set TXT opened by HackedUpReader"
38+
},
39+
{
40+
"name": "TXT file opened by HackedUp* (Original, KO)",
41+
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^txt=2$\" -g &&",
42+
"action": "./bin/booklet.sh",
43+
"params": "txt 0",
44+
"refresh": true,
45+
"exitmenu": false,
46+
"status": false,
47+
"internal": "status set TXT opened by Original"
48+
},
49+
{
50+
"name": "TXT file opened by Original* (KO, HackedUp)",
51+
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^txt=0$\" -g &&",
52+
"action": "./bin/booklet.sh",
53+
"params": "txt 1",
54+
"refresh": true,
55+
"exitmenu": false,
56+
"status": false,
57+
"internal": "status set TXT opened by KOReader"
58+
},
59+
{
60+
"name": "EPUB file opened by KO* (HackedUp)",
61+
"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 || ||",
62+
"action": "./bin/booklet.sh",
63+
"params": "epub 2",
64+
"refresh": true,
65+
"exitmenu": false,
66+
"status": false,
67+
"internal": "status set EPUB opened by HackedUpReader"
68+
},
69+
{
70+
"name": "EPUB file opened by HackedUp* (KO)",
71+
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^epub=2$\" -g &&",
72+
"action": "./bin/booklet.sh",
73+
"params": "epub 1",
74+
"refresh": true,
75+
"exitmenu": false,
76+
"status": false,
77+
"internal": "status set EPUB opened by KOReader"
78+
},
79+
{
80+
"name": "PDB file opened by KO* (HackedUp)",
81+
"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 || ||",
82+
"action": "./bin/booklet.sh",
83+
"params": "pdb 2",
84+
"refresh": true,
85+
"exitmenu": false,
86+
"status": false,
87+
"internal": "status set PDB opened by HackedUpReader"
88+
},
89+
{
90+
"name": "PDB file opened by HackedUp* (KO)",
91+
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^pdb=2$\" -g &&",
92+
"action": "./bin/booklet.sh",
93+
"params": "pdb 1",
94+
"refresh": true,
95+
"exitmenu": false,
96+
"status": false,
97+
"internal": "status set PDB opened by KOReader"
98+
},
99+
{
100+
"name": "FB2 file opened by KO* (HackedUp)",
101+
"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 || ||",
102+
"action": "./bin/booklet.sh",
103+
"params": "fb2 2",
104+
"refresh": true,
105+
"exitmenu": false,
106+
"status": false,
107+
"internal": "status set FB2 opened by HackedUpReader"
108+
},
109+
{
110+
"name": "FB2 file opened by HackedUp* (KO)",
111+
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^fb2=2$\" -g &&",
112+
"action": "./bin/booklet.sh",
113+
"params": "fb2 1",
114+
"refresh": true,
115+
"exitmenu": false,
116+
"status": false,
117+
"internal": "status set FB2 opened by KOReader"
118+
},
119+
{
120+
"name": "RTF file opened by KO* (HackedUp)",
121+
"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 || ||",
122+
"action": "./bin/booklet.sh",
123+
"params": "rtf 2",
124+
"refresh": true,
125+
"exitmenu": false,
126+
"status": false,
127+
"internal": "status set RTF opened by HackedUpReader"
128+
},
129+
{
130+
"name": "RTF file opened by HackedUp* (KO)",
131+
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^rtf=2$\" -g &&",
132+
"action": "./bin/booklet.sh",
133+
"params": "rtf 1",
134+
"refresh": true,
135+
"exitmenu": false,
136+
"status": false,
137+
"internal": "status set RTF opened by KOReader"
138+
},
139+
{
140+
"name": "CHM file opened by KO* (HackedUp)",
141+
"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 || ||",
142+
"action": "./bin/booklet.sh",
143+
"params": "chm 2",
144+
"refresh": true,
145+
"exitmenu": false,
146+
"status": false,
147+
"internal": "status set CHM opened by HackedUpReader"
148+
},
149+
{
150+
"name": "CHM file opened by HackedUp* (KO)",
151+
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^chm=2$\" -g &&",
152+
"action": "./bin/booklet.sh",
153+
"params": "chm 1",
154+
"refresh": true,
155+
"exitmenu": false,
156+
"status": false,
157+
"internal": "status set CHM opened by KOReader"
158+
}
159+
]
160+
},
161+
{
162+
"name": "KPVBooklet Settings",
163+
"if": "\"/mnt/us/hackedupreader/bin/cr3\" -f!",
164+
"priority": 5,
165+
"items": [
166+
167+
{
168+
"name": "PDF file opened by KO* (Original)",
169+
"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 || ||",
170+
"action": "./bin/booklet.sh",
171+
"params": "pdf 0",
172+
"refresh": true,
173+
"exitmenu": false,
174+
"status": false,
175+
"internal": "status set PDF opened by Original"
176+
},
177+
{
178+
"name": "PDF file opened by Original* (KO)",
179+
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^pdf=0$\" -g &&",
180+
"action": "./bin/booklet.sh",
181+
"params": "pdf 1",
182+
"refresh": true,
183+
"exitmenu": false,
184+
"status": false,
185+
"internal": "status set PDF opened by KOReader"
186+
},
187+
{
188+
"name": "TXT file opened by KO* (Original)",
189+
"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 || ||",
190+
"action": "./bin/booklet.sh",
191+
"params": "txt 0",
192+
"refresh": true,
193+
"exitmenu": false,
194+
"status": false,
195+
"internal": "status set TXT opened by HackedUpReader"
196+
},
197+
{
198+
"name": "TXT file opened by Original* (KO)",
199+
"if": "\"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" -f \"/mnt/us/extensions/kpvbooklet/bin/booklet.ini\" \"^txt=0$\" -g &&",
200+
"action": "./bin/booklet.sh",
201+
"params": "txt 1",
202+
"refresh": true,
203+
"exitmenu": false,
204+
"status": false,
205+
"internal": "status set TXT opened by KOReader"
206+
}
207+
]
208+
}
209+
]
210+
}

install.ffs

+4-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ if [ "$VERSION" \> "5.4" ]; then
5757
touch "/MNTUS_EXEC"
5858
fi
5959

60-
progress 80 "Mounting ro"
60+
progress 80 "Installing KUAL Extension"
61+
cp -r extensions/kpvbooklet /mnt/us/extensions/ || fail "Unable to copy KUAL Extension"
62+
63+
progress 90 "Mounting ro"
6164
mntroot ro || fail "Unable to mount ro"
6265

6366
progress 100 "Installation complete."

mimes.install.sql

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ INSERT OR IGNORE INTO "associations" VALUES('com.github.koreader.kpvbooklet','de
1616

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

19+
INSERT OR IGNORE INTO "associations" VALUES('com.github.koreader.kpvbooklet','application','MT:text/plain','true');
20+
1921
INSERT OR IGNORE INTO "mimetypes" VALUES('djvu','MT:image/x.djvu');
2022
INSERT OR IGNORE INTO "extenstions" VALUES('djvu','MT:image/x.djvu');
2123
INSERT OR IGNORE INTO "properties" VALUES('archive.displaytags.mimetypes','image/x.djvu','DjVu');
@@ -84,3 +86,6 @@ INSERT OR IGNORE INTO "associations" VALUES('com.github.koreader.kpvbooklet','ap
8486

8587
UPDATE "associations" SET defaultAssoc = 'false' WHERE interface = 'application' and contentId = 'MT:application/pdf' and handlerId = 'com.lab126.booklet.reader';
8688
UPDATE "associations" SET defaultAssoc = 'true' WHERE interface = 'application' and contentId = 'MT:application/pdf' and handlerId = 'com.github.koreader.kpvbooklet';
89+
90+
UPDATE "associations" SET defaultAssoc = 'false' WHERE interface = 'application' and contentId = 'MT:text/plain' and handlerId = 'com.lab126.booklet.reader';
91+
UPDATE "associations" SET defaultAssoc = 'true' WHERE interface = 'application' and contentId = 'MT:text/plain' and handlerId = 'com.github.koreader.kpvbooklet';

mimes.uninstall.sql

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ DELETE FROM "associations" WHERE contentId='GL:*.doc' OR contentId='GL:*.fb2' OR
1313
DELETE FROM "associations" WHERE contentId='GL:*.tcr' OR contentId='GL:*.xps' OR contentId='GL:*.zip';
1414

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

0 commit comments

Comments
 (0)