diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7390aa5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +bin/ +*.zip +*.tgz +log.txt diff --git a/copypatches.sh b/copypatches.sh new file mode 100755 index 0000000..c7ec620 --- /dev/null +++ b/copypatches.sh @@ -0,0 +1,4 @@ +cat ../kobopatch-patches/src/versions/$KOBOVERSION/libadobe.so.yaml/* > ./src/libadobe.so.yaml +cat ../kobopatch-patches/src/versions/$KOBOVERSION/libnickel.so.1.0.0.yaml/* > ./src/libnickel.so.1.0.0.yaml +cat ../kobopatch-patches/src/versions/$KOBOVERSION/librmsdk.so.1.0.0.yaml/* > ./src/librmsdk.so.1.0.0.yaml +cat ../kobopatch-patches/src/versions/$KOBOVERSION/nickel.yaml/* > ./src/nickel.yaml diff --git a/kobopatch.sh b/kobopatch.sh new file mode 100755 index 0000000..a836306 --- /dev/null +++ b/kobopatch.sh @@ -0,0 +1,29 @@ +#!/bin/bash +cd "$(dirname "$0")" +rm -f "out/KoboRoot.tgz" +case `uname -s` in + CYGWIN_NT*) + ./bin/koboptch-windows.exe + ;; + Darwin) + ./bin/kobopatch-darwin-64bit + ;; + Linux) + case `uname -m` in + i?86) + ./bin/kobopatch-linux-32bit + ;; + x86_64) + ./bin/kobopatch-linux-64bit + ;; + arm*) + ./bin/kobopatch-linux-arm + ;; + aarch64) + ./bin/kobopatch-linux-arm + ;; + *) + echo "Unsupported architecture" + esac + ;; +esac \ No newline at end of file diff --git a/kobopatch.yaml b/kobopatch.yaml new file mode 100644 index 0000000..2048928 --- /dev/null +++ b/kobopatch.yaml @@ -0,0 +1,58 @@ +## Works with kobopatch v0.14.0 and later. +## You can update kobopatch by downloading the latest release from https://github.com/geek1011/kobopatch/releases. +version: 4.20.14622 +in: src/kobo-update-4.20.14622.zip +out: out/KoboRoot.tgz +log: out/log.txt + +patchFormat: kobopatch + +patches: + src/nickel.yaml: usr/local/Kobo/nickel + src/libadobe.so.yaml: usr/local/Kobo/libadobe.so + src/libnickel.so.1.0.0.yaml: usr/local/Kobo/libnickel.so.1.0.0 + src/librmsdk.so.1.0.0.yaml: usr/local/Kobo/librmsdk.so.1.0.0 + +## You can put lines in the following section to override the enabled state of patches. +## The indentation matters! Each override should be indented by 4 spaces. Add to the +## section below. This section can be copy and pasted into newer patch versions to +## keep your selections. +## +## Example of how it should look: +## overrides: +## src/nickel.yaml: +## Custom synopsis/details line spacing: yes +## Whatever the yaml is called: no +## src/libadobe.so.yaml: +## You get the idea: yes +overrides: + src/nickel.yaml: + Show all games: yes + Dictionary pop-up - increase available text area: yes + src/libadobe.so.yaml: + src/libnickel.so.1.0.0.yaml: + Always show confirmation dialog before upgrading: yes + Allow showing info panel on random screensaver: yes + Allow searches on Extra dictionaries: yes + Allow rotation on all devices: yes + Don't uppercase header/footer text: yes + Enable advanced settings for all fonts: yes + Shorten dictionary entry not found message: yes + src/librmsdk.so.1.0.0.yaml: + +## TRANSLATIONS ## +# Optional, use only if lrelease is not in PATH and if translations are needed +# lrelease: /path/to/lrelease + +# Uncomment the following to add translations (replace lc with the language code) +# translations: +# src/whatever.ts: usr/local/Kobo/translations/trans_lc.qm + +## ADDITIONAL FILES ## +# Uncomment the following to add additional files to the tgz (like init scripts or hyphen dicts) +# The files will be root-owned, and world readable, writable, and executable (0777) +# files: +# src/whatever.txt: usr/local/Kobo/whatever.txt +# src/whateverToPutInMultiplePlaces.txt: +# - usr/local/Kobo/location1.txt +# - usr/local/Kobo/location2.txt diff --git a/out/run_kobopatch_to_generate_these_files.txt b/out/run_kobopatch_to_generate_these_files.txt new file mode 100644 index 0000000..e69de29 diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..5719664 --- /dev/null +++ b/readme.txt @@ -0,0 +1,7 @@ +Kobopatch config management, so I don't have to keep copying my overrides each time. + +copypatches.sh assumes that kobopatch-patches is cloned to a directory the same level as this one. It reads the KOBOVERSION environment variable. + +KOBOVERSION= ./copypatches.sh + +Kobopatch must be placed in bin/ diff --git a/src/libadobe.so.yaml b/src/libadobe.so.yaml new file mode 100644 index 0000000..e91f2c5 --- /dev/null +++ b/src/libadobe.so.yaml @@ -0,0 +1,8 @@ +# The following patch(es) were fixed and are updated by geek1011 + +Remove PDF map widget shown during panning: + - Enabled: no + - Description: Removes the PDF map widget shown during panning and zooming. + - BaseAddress: {Sym: "N3AdobeReader::showMapWidget()"} + - ReplaceBytes: {Offset: 80, FindInstBW: {SymPLTTail: "N3AdobeReader::updatePanningMap()"}, ReplaceInstBW: {SymPLTTail: "N3AdobeReader::hideMapWidget()"}} + - ReplaceBytes: {Offset: 190, FindInstBW: {SymPLTTail: "N3AdobeReader::updatePanningMap()"}, ReplaceInstBW: {SymPLTTail: "N3AdobeReader::hideMapWidget()"}} diff --git a/src/libnickel.so.1.0.0.yaml b/src/libnickel.so.1.0.0.yaml new file mode 100644 index 0000000..4538e4e --- /dev/null +++ b/src/libnickel.so.1.0.0.yaml @@ -0,0 +1,1440 @@ +# The following patch(es) are by geek1011 + +Both page turn buttons go next: + - Enabled: no + - Description: Make both page turn buttons on the Forma go next in the reader. + - ReplaceBytes: + Base: "ReadingView::keyPressEvent(QKeyEvent*)" + Offset: 54 + FindInstBW: {SymPLTTail: "ReadingView::prevPageWithTimer()"} + ReplaceInstBW: {SymPLTTail: "ReadingView::nextPageWithTimer()"} + +Both page turn sides go next: + - Enabled: no + - Description: Make both page turn sides go next in the reader. + # In ReadingView::processTap(TapGesture*) where the page direction is checked: + - BaseAddress: {Sym: "ReadingView::processTap(TapGesture*)", Rel: 362} + - ReplaceBytes: {Offset: 0, FindInstBLX: {SymPLT: "ReadingView::leftToRightPageProgressDirection() const"}, CheckOnly: true} + # nop the branch for checking if left-to-right (so it always runs the swap of back/forward) + - ReplaceBytes: {Offset: 4, FindH: 18 B9, ReplaceInstNOP: true} + # where r3 = *(r7+0x18) (back) and r2 = *(r7+0x20) (forward), then they are stored in reverse, + # instead of storing each one, just store forward (by changing the source register in the str + # instruction) + - ReplaceBytes: {Offset: 10, FindH: 3B 62, ReplaceH: 3A 62} + # This patch could have also been done later on where the tap point is checked against different + # QRects, but that's a lot more complicated due to the use of QHash s of pointers to functions. + +Replace adobe page numbers toggle with invert screen: + - Enabled: no + - Description: | + Replaces the adobe page numbers toggle in reading settings with an invert + screen one. + # Settings page + - BaseAddress: "N3SettingsReadingView::N3SettingsReadingView(QWidget*)" + - ReplaceBytes: {Offset: 876, FindInstBLX: {SymPLT: "ReadingSettings::getShowAdobePageNumbers()"}, ReplaceInstBLX: {SymPLT: "FeatureSettings::invertScreen()"}} + # Settings page controller + - BaseAddress: {Sym: "N3SettingsReadingController::showAdobePageNumbersToggled()"} + - ReplaceBytes: {Offset: 62, FindInstBLX: {SymPLT: "ReadingSettings::getShowAdobePageNumbers()"}, ReplaceInstBLX: {SymPLT: "FeatureSettings::invertScreen()"}} + - ReplaceBytes: {Offset: 74, FindInstBLX: {SymPLT: "ReadingSettings::setShowAdobePageNumbers(bool)"}, ReplaceInstBLX: {SymPLT: "FeatureSettings::setInvertScreen(bool)"}} + # Settings page text + - FindReplaceString: {Find: "Show Adobe EPUB page numbers", Replace: "Invert screen"} + +Always show confirmation dialog before upgrading: + - Enabled: no + - PatchGroup: Firmware upgrade options + - Description: This patch makes the confirmation dialog always show before upgrading. + - BaseAddress: "UpgradeManager::requestUpgradeConfirmation(UpgradeType, QString const&)" + - ReplaceBytes: {Offset: 22, FindH: 01 2C, ReplaceH: A4 42} # make the optional UpgradeType check always true (CMP r4, #1 -> CMP r4, r4) + - ReplaceBytes: {Offset: 42, FindInstBLX: {SymPLT: "UpgradeManager::isSilent()"}, ReplaceH: 4F F0 00 00} # make the call to UpgradeManager::isSilent always false (MOV r0, #0) + +Allow USB storage even when device locked: + - Enabled: no + - Description: | + Always allows USB storage even when the device is locked. When combined + with an enabled lock screen, this patch allows recovery from almost any + segfaulting patch without a factory reset, as most code isn't executed + until after the initial unlock. WARNING - this patches renders the lock + screen security completely useless! But, for some security by obscurity + this will only take effect when you plug it in while the sleep screen is + visible. + # Never reject the permission request (i.e. don't set *r5 = false), even when + # the PIN entry dialog is enabled: + - ReplaceBytes: + Base: "N3PowerWorkflowManager::onUSBPlugPermissionRequest(PermissionRequest*)" + Offset: 40 + FindH: 2B 70 # strb r3, [r5] + ReplaceInstNOP: true + +Hide browser from beta features: + - Enabled: no + - Description: Hides the built-in browser from beta features. + - ReplaceBytes: + Base: "N3SettingsExtrasView::N3SettingsExtrasView(QWidget*)" + Offset: 1220 + FindInstBLX: {SymPLT: "Device::isParentalControlEnabled() const"} + ReplaceH: 4F F0 01 00 + - ReplaceBytes: + Base: {Sym: "SelectionMenuController::setupMainOptions()"} + Offset: 474 + FindInstBLX: {SymPLT: "Device::isParentalControlEnabled() const"} + ReplaceH: 4F F0 01 00 + +Remove beta features not supported text: + - Enabled: no + - Description: Does what it says to clear up the clutter. + - ReplaceBytes: + Base: "Ui_N3SettingsExtrasView::retranslateUi(QWidget*)" + Offset: 96 + FindInstBLX: {SymPLT: "QLabel::setText(QString const&)"} + ReplaceInstBLX: {SymPLT: "QWidget::hide()"} + +Disable all tutorial dialogs: + - Enabled: no + - Description: | + Removes the annoying tutorials (and recurring dialogs). Note - I may + have missed a few of them. If I have, just open an issue on GitHub or + PM me (geek1011) on MobileRead, and I'll fix it. + # QVariant::toBool is called after getting the setting (of if it has/should + # show) as a QVariant. I am replacing this method as opposed to replacing the + # return value of the function because 1. A MOV instruction with an immediate + # (fixed) value is 4 long (rather than 2) and 2. This is simpler to update as + # I only need to update the function offset and the offset for each setting. + - ReplaceBytes: {Base: "DialogSettings::firstPurchaseCreditJitShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "DialogSettings::quickTurnDialogShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "DialogSettings::returningReaderDialogShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::koboLoveDialogShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::quickTourWidgetShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::overDriveFilterShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::wifiReminderDialogShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::readABookShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::borrowDialogShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::quickTourShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::libraryFTEShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::zoomFTEShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::welcomeShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::koboPlusPromoShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::syncWarningDialogShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::addedToMyWordsDialogShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::longPressDialogShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::swipeDialogShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::syncReminderDialogShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::eReaderBooksManagementFTEShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + - ReplaceBytes: {Base: "ApplicationSettings::libraryCuratedListsDialogShown()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + +Remove recommendations (row1col2) from home screen: + - Enabled: no + - Description: | + By default, when there are less than 2 books open, a recommendations + column shows in the top right of the home screen. This patch hides it. + - ReplaceBytes: + Base: "HomePageView::configureTopRight(HomePageWidgets)" + Offset: 48 + FindH: 58 B1 # never skip hiding the top-right widget + ReplaceInstNOP: true + +Rename new home screen footer: + - Enabled: no + # This patch happens use shared strings in most versions, and may cause unusual + # replacements in other parts of the GUI (see https://github.com/geek1011/kobopatch-patches/issues/34). + # This isn't usually an issue (and changes between versions), but occasionally, + # the keyboard uses a letter from one of these strings, and will type the letter + # from the replacement. + - FindReplaceString: {Find: "Find your next great read", Replace: "Find your next great read"} + - FindReplaceString: {Find: "Buy, borrow, or preview books", Replace: "Buy, borrow, or preview books"} + - FindReplaceString: {Find: "Find your next book in Kobo Plus or our store", Replace: "Find your next book in Kobo Plus or our store"} + # You can enable the following replacement, but note that it might cause the o letter on the keyboard to change +# - FindReplaceString: {Find: "Shop Kobo", Replace: "9char-str"} + +## Change Browse Kobo home screen link target ### +# This patch allows you to change the target of the Browse Kobo link. To +# rename the top description, use the rename home screen footer patch. +# +# The easy options for this patch are fairly limited, as BrowseKoboWidget::tapped +# just calls the superclass event, then the call to DiscoverNavMixin::storeFront +# in the PLT is tail-call optimized. This places a number of restrictions on the +# replacement target, namely: the branch must be a branch and exchange, but not +# link (lr must be unchanged to return correctly), which is implemented as a +# 32-bit branch to a bx pc (nop branch, but still switch instruction sets) +# immediately before a PLT entry to a nav mixin without any arguments (i.e. +# must be static). Note that the first branch is relative to pc. Also, note that +# in general, this requirement means anything called by StatusBarController (the +# menu) can be used as a replacement. +# +# Basically, the following two steps are needed: +# - In BrowseKoboWidget::tapped, change the tail-call to the bx before +# [something]NavMixin::[something] in the PLT. +# - In the BrowseKoboWidget constructor, change which function is called to get +# the bottom text (Shop Kobo) from N3DeviceCharm::shopName (Shop Kobo / Walmart) +# to N3DeviceCharm::[something] (note that there isn't enough room to +# load an entirely different string here). + +Change Browse Kobo home screen link target - Activity: + - Enabled: no + - PatchGroup: Browse Kobo link target + - Description: See the comment above. + - ReplaceBytes: + Base: "BrowseKoboWidget::tapped()" + Offset: 14 + FindInstBW: {SymPLTTail: "DiscoverNavMixin::storefront()"} # Store + ReplaceInstBW: {SymPLTTail: "ReadingLifeNavMixin::chooseActivity()"} # Activity + - ReplaceBytes: + Base: "BrowseKoboWidget::BrowseKoboWidget(QWidget*)" + Offset: 190 + FindInstBLX: {SymPLT: "N3DeviceCharm::shopName()"} # "Shop Kobo" or "Walmart" + ReplaceInstBLX: {SymPLT: "N3DeviceCharm::extrasName()"} # "Activity" + +Change Browse Kobo home screen link target - Articles: + - Enabled: no + - PatchGroup: Browse Kobo link target + - Description: See the comment above. + - ReplaceBytes: + Base: "BrowseKoboWidget::tapped()" + Offset: 14 + FindInstBW: {SymPLTTail: "DiscoverNavMixin::storefront()"} # Store + ReplaceInstBW: {SymPLTTail: "LibraryNavMixin::showPocketLibrary()"} # My Articles + - ReplaceBytes: + Base: "BrowseKoboWidget::BrowseKoboWidget(QWidget*)" + Offset: 190 + FindInstBLX: {SymPLT: "N3DeviceCharm::shopName()"} # "Shop Kobo" or "Walmart" + ReplaceInstBLX: {SymPLT: "N3DeviceCharm::articlesSearchName()"} # "My Articles" + +### + +### Smartlink patches ### + +Set visible SmartLink: + - Enabled: no + - PatchGroup: SmartLink + - Description: Sets the currently visible smartlink (does not override priority messages). + # SmartLinks: (name from SmartLinkWidget::getAnalyticsMessage) + # # - internal name - default condition - what - action + # PRIORITY MESSAGES (shown first up to 3 times each): (SmartLinkWidget::showPriorityMessage, ActivityManager::smartLinkPriorityMessage, SmartLinkWidget::tapped) + # 5 - ReleaseNotes - whats new available from Activity - RELEASE NOTES: Find out what's new in this software update - whats new (from Activity) + # 6 - OverdriveFTE - overdrive enabled && not signed in - OVERDRIVE: Learn how to borrow eBooks from your public library - overdrive about + # 7 - KoboPlusFTE - kobo plus enabled && not subscribed - KOBO PLUS: Browse Kobo Plus books - kobo store -> kobo plus + # ROTATION MESSAGES (randomly chosen): (SmartLinkWidget::showRotationMessage, ActivityManager::smartLinkGeneralMessage, SmartLinkWidget::tapped) + # 1 - Pocket - pocket not signed in - POCKET: Read articles from the web on your eReader - pocket about + # 2 - KoboPlus - kobo plus enabled && not subscribed - KOBO PLUS: Get unlimited access to books in all genres - kobo store -> kobo plus + # 2 - KoboPlus - kobo plus enabled && not subscribed - KOBO PLUS: Read as much as you want with a Kobo Plus subscription- kobo store -> kobo plus + # 3 - Overdrive - overdrive enabled && not signed in - OVERDRIVE: Borrow eBooks from your public library - overdrive about + # 4 - Categories - always - CATEGORIES: Browse fiction, romance, biography and more - kobo store -> categories + # 8 - NaturalLight - has light sensor && not viewed tutorial - DEVICE NAME: Learn about the Natural Light feature - rgb front light about + # 9 - QuickTour - quick tour not shown && quick turn tile not visible - GETTING STARTED: Get to know your %0 - quick tour + # 10 - ReadingTour - read a book tour not showed - READING A BOOK: Get quick tips about reading on your eReader - read a book tutorial + # 11 - UserGuide - user guide present && not opened - USER GUIDE: Read the user guide for your %0 - read -> user guide + # 12 - RelatedReads - recent book available from Activity - RELATED READS: Discover books related to the ones you're reading - browse -> similar books + # 13 - Wishlist - no wishlist items || something else - WISHLIST: Create a Wishlist of books you're interested in - browse -> wishlist + # 14 - ReadingSettings - reading settings not changed - READING SETTINGS: Customize the way you read a book - settings -> reading settings + # 15 - ReadingStats - books finished > 0 && hours read rounded to .5 > 0 - READING STATS: You've finished %n books and read for %n hours - reading life -> stats + # 16 - SuperPoints - participating in super points && points > 2400 - KOBO SUPER POINTS: You have %0 Super Points to redeem - kobo store + # 17 - PocketUser - unread pocket articles > 0 - POCKET: Catch up on the %n article(s) you added recently - library -> pocket + # + - BaseAddress: {Sym: "SmartLinkWidget::showRotationMessage(Device const&)", Rel: 20} + - ReplaceBytes: {FindInstBLX: {SymPLT: "ActivityManager::smartLinkGeneralMessage(Device const&)"}, ReplaceH: 4F F0 04 00} # MOV.W r0, #4 + # set the new SmartLink to show (you can set this to your preference based on + # the list above, but it MUST be one of the above options, or you may need + # to factory reset): + - ReplaceInt: {Offset: 2, Find: 4, Replace: 4} + +Only show Pocket SmartLink: + - Enabled: no + - PatchGroup: SmartLink + - Description: Only show the Pocket SmartLink on the home screen. + - ReplaceBytes: + Base: "SmartLinkWidget::showRotationMessage(Device const&)" + Offset: 20 + FindInstBLX: {SymPLT: "ActivityManager::smartLinkGeneralMessage(Device const&)"} + ReplaceH: 4F F0 11 00 + # replace the text (choose one, or remove both): + - FindReplaceString: {Find: "Catch up on the %n article(s) you added recently", Replace: "My Articles"} +# - FindReplaceString: {Find: "Catch up on the %n article(s) you added recently", Replace: "My Articles (%n unread)"} + +Only show stats SmartLink: + - Enabled: no + - PatchGroup: SmartLink + - Description: Only show the stats SmartLink on the home screen. + - ReplaceBytes: + Base: "SmartLinkWidget::showRotationMessage(Device const&)" + Offset: 20 + FindInstBLX: {SymPLT: "ActivityManager::smartLinkGeneralMessage(Device const&)"} + ReplaceH: 4F F0 0F 00 + +Never show Kobo Plus, wishlist, and points SmartLinks: + - Enabled: no + - PatchGroup: SmartLink + - Description: Removes Kobo Plus, wishlist, and points SmartLinks from the rotation. + - BaseAddress: "ActivityManager::smartLinkGeneralMessage(Device const&)" + # NOP Kobo Plus (2): + - ReplaceBytes: {Offset: 292, FindH: 02 23, CheckOnly: true} # MOVS r3, #2 + - ReplaceBytes: {Offset: 302, FindInstBLX: {SymPLT: "QVector::append(SmartLinkType const&)"}, ReplaceInstNOP: true} + # NOP wishlist (13): + - ReplaceBytes: {Offset: 266, FindH: 0D 23, CheckOnly: true} # MOVS r3, #13 + - ReplaceBytes: {Offset: 276, FindInstBLX: {SymPLT: "QVector::append(SmartLinkType const&)"}, ReplaceInstNOP: true} + # NOP super points (16): + - ReplaceBytes: {Offset: 1540, FindH: 10 23, CheckOnly: true} # MOVS r3, #16 + - ReplaceBytes: {Offset: 1552, FindInstBLX: {SymPLT: "QVector::append(SmartLinkType const&)"}, ReplaceInstNOP: true} + +### + +### Hide top-left menu items ### +# This following patches take advantage of the parental controls feature, as +# StatusBarMenuController::updateParentControlSensitiveMenuItems is always +# called when setting them up. All that is needed to hide items is to hardcode +# false before calling QAction::setVisible ([XX 46] mov r1, XX -> [00 21] movs r1, #0). +# To prevent ghost items, the value which stores the number of items to draw +# also needs to be fixed before the ldrex/strex just after the setVisible. + +# Note for updating: +# It's just the r1 before QAction::setVisible and after +# QWidgetAction::defaultWidget for each widget name. + +Hide top-left menu item - Dropbox: + - Enabled: no + - Description: See the comment above. + - BaseAddress: {Sym: "StatusBarMenuController::updateParentControlSensitiveMenuItems()", Rel: 182} + - ReplaceBytes: {Offset: 0, FindH: 51 46, ReplaceH: 00 21} # DropboxSeparator (sl=51) (sl:sb&r5) + - ReplaceBytes: {Offset: 22, FindH: 51 46, ReplaceH: 00 21} # DropboxSeparator (sl=51) + - ReplaceBytes: {Offset: 124, FindH: 41 46, ReplaceH: 00 21} # DropboxWidget (r8=41) (r8:r8&r5) + - ReplaceBytes: {Offset: 146, FindH: 41 46, ReplaceH: 00 21} # DropboxWidget (r8=41) + +Hide top-left menu item - Pocket: + - Enabled: no + - Description: See the comment above. + - BaseAddress: {Sym: "StatusBarMenuController::updateParentControlSensitiveMenuItems()", Rel: 484} + - ReplaceBytes: {Offset: 0, FindH: 29 46, ReplaceH: 00 21} # PocketSeparator (r5=29) + - ReplaceBytes: {Offset: 22, FindH: 29 46, ReplaceH: 00 21} # PocketSeparator (r5=29) + - ReplaceBytes: {Offset: 112, FindH: 29 46, ReplaceH: 00 21} # PocketWidget (r5=29) + - ReplaceBytes: {Offset: 134, FindH: 29 46, ReplaceH: 00 21} # PocketWidget (r5=29) + +Hide top-left menu item - Store: + - Enabled: no + - Description: See the comment above. + - BaseAddress: {Sym: "StatusBarMenuController::updateParentControlSensitiveMenuItems()", Rel: 774} + - ReplaceBytes: {Offset: 0, FindH: 29 46, ReplaceH: 00 21} # StoreSeparator (r5=29) + - ReplaceBytes: {Offset: 22, FindH: 29 46, ReplaceH: 00 21} # StoreSeparator (r5=29) + - ReplaceBytes: {Offset: 178, FindH: 29 46, ReplaceH: 00 21} # StoreWidget (r5=29) + - ReplaceBytes: {Offset: 200, FindH: 29 46, ReplaceH: 00 21} # StoreWidget (r5=29) + +Hide top-left menu item - Recommended: + - Enabled: no + - Description: See the comment above. + - BaseAddress: {Sym: "StatusBarMenuController::updateParentControlSensitiveMenuItems()", Rel: 1130} + - ReplaceBytes: {Offset: 0, FindH: 29 46, ReplaceH: 00 21} # RecommendedSeparator (r5=29) + - ReplaceBytes: {Offset: 22, FindH: 29 46, ReplaceH: 00 21} # RecommendedSeparator (r5=29) + - ReplaceBytes: {Offset: 178, FindH: 29 46, ReplaceH: 00 21} # RecommendedWidget (r5=29) + - ReplaceBytes: {Offset: 200, FindH: 29 46, ReplaceH: 00 21} # RecommendedWidget (r5=29) + +# Note about updating: the following ones were mistakenly detected as outside +# the procedure by Hopper, but this can be fixed by NOPing the DDs between and +# recreating the procedure (press P at the start). + +Hide top-left menu item - Wishlist: + - Enabled: no + - Description: See the comment above. + - BaseAddress: {Sym: "StatusBarMenuController::updateParentControlSensitiveMenuItems()", Rel: 4664} + - ReplaceBytes: {Offset: 0, FindH: 51 46, ReplaceH: 00 21} # WishlistSeparator (sl=51) (sl:sb&r5) + - ReplaceBytes: {Offset: 22, FindH: 51 46, ReplaceH: 00 21} # WishlistSeparator (sl=51) + - ReplaceBytes: {Offset: 398, FindH: 49 46, ReplaceH: 00 21} # WishlistWidget (sb=49) (sb:sb&r5) + - ReplaceBytes: {Offset: 420, FindH: 49 46, ReplaceH: 00 21} # WishlistWidget (sb=49) + +Hide top-left menu item - Activity: + - Enabled: no + - Description: See the comment above. + - BaseAddress: {Sym: "StatusBarMenuController::updateParentControlSensitiveMenuItems()", Rel: 5574} + - ReplaceBytes: {Offset: 0, FindH: 29 46, ReplaceH: 00 21} # ActivitySeparator (r5=29) + - ReplaceBytes: {Offset: 22, FindH: 29 46, ReplaceH: 00 21} # ActivitySeparator (r5=29) + - ReplaceBytes: {Offset: 380, FindH: 29 46, ReplaceH: 00 21} # ActivityWidget (r5=29) + - ReplaceBytes: {Offset: 402, FindH: 29 46, ReplaceH: 00 21} # ActivityWidget (r5=29) + +### + +Increase TOC level indentation: + - Enabled: no + - PatchGroup: TOC Indentation + - Description: | + The space indented Table of Contents levels are quite hard to see, as the + difference is almost too small to easily notice. + - ReplaceBytes: + Base: {Sym: "N3TableOfContentsWidget::setContent(Shortcover const&)"} + Offset: 198 + FindH: 42 00 # left shift by 1 (i.e. multiply by 2) (LSLS r2, r0, #1) + ReplaceH: 82 00 # left shift by 2 (i.e. multiply by 4) (LSLS r2, r0, #2) + +Increase TOC level indentation and fix extra indentation bug: + - Enabled: no + - PatchGroup: TOC Indentation + - Description: | + The space indented Table of Contents levels are quite hard to see, as the + difference is almost too small to easily notice. In addition, this fixes + the bug where all TOC entries are indented by 1 level extra. + - BaseAddress: {Sym: "N3TableOfContentsWidget::setContent(Shortcover const&)", Rel: 194} + # Clear out existing instructions with NOPs + - ReplaceBytes: {Offset: 0, FindH: 07 F1 0C 0B, ReplaceH: 00 20 00 20} # put string address in fp + - ReplaceBytes: {Offset: 4, FindH: 42 00, ReplaceH: 00 20} # shift level by 1 (multiply by 2) into r2 + - ReplaceBytes: {Offset: 6, FindH: 4F F0 20 01, ReplaceH: 00 20 00 20} # set r1 to 0x20 (space char) + - ReplaceBytes: {Offset: 10, FindH: 58 46, ReplaceH: 00 20} # put fp in r0 + # Put new instructions + - ReplaceBytes: {Offset: 0, FindH: 00 20, ReplaceH: 40 1E} # decrease level by 1 + - ReplaceBytes: {Offset: 2, FindH: 00 20, ReplaceH: 82 00} # shift level by 2 (multiply by 4) into r2 + - ReplaceBytes: {Offset: 4, FindH: 00 20, ReplaceH: 20 21} # set r1 to 0x20 (space char) + - ReplaceBytes: {Offset: 6, FindH: 00 20 00 20, ReplaceH: 07 F1 0C 0B} # put string address into fp + - ReplaceBytes: {Offset: 10, FindH: 00 20, ReplaceH: 58 46} # put fp in r0 + +Allow showing info panel on random screensaver: + - Enabled: no + - Description: | + See https://www.mobileread.com/forums/showthread.php?t=321609. This patch + allows showing the info panel even when using a random screensaver image + from .kobo/screensaver (note that full-screen covers needs to be enabled + for the screensaver to show). + - ReplaceBytes: + Base: "PowerViewController::updateCover()" + Offset: 252 + FindInstBLX: {SymPLT: "FullScreenDragonPowerView::setInfoPanelVisible(bool)"} + ReplaceInstNOP: true + +Remove title from reading header/footer: + - Enabled: no + - Description: Removes the chapter/book title from the new reading header/footer. + # In the longest form of ReadingFooter::update (the others are wrappers with + # the args being set to the current value), the first one is the title. The + # final string is created by starting with the title, then appending the "-", + # then the page number / percentage / etc text. + # + # This one is slightly unusual in that the reading header also shares the + # ReadingFooter code (ReadingView::updateProgressHeader only has the page + # text, and it ends with a branch to ReadingFooter::update). This means we + # only have to patch one place, but it also means you can't have the title in + # one, but not the other. + # + # We'll patch this in a slightly hacky and inefficient, but simple and + # easy-to-update way by replacing the first QString::append (the dash) with a + # QString::resize to zero (I would have done a QString::clear, but that symbol + # isn't imported): + - BaseAddress: {Sym: "ReadingFooter::update(QString const&, QString const&, QString const&, bool)", Rel: 304} + - ReplaceBytes: {Offset: 0, FindH: F9 68, ReplaceH: 00 21} # replace LDR r1, [...] with MOV r1, #0 (the LDR doesn't matter, but may to be updated to match) + - ReplaceBytes: {Offset: 4, FindInstBLX: {SymPLT: "QString::append(QString const&)"}, ReplaceInstBLX: {SymPLT: "QString::resize(int)"}} + +# Prevent Kobo from scanning dotfiles/folders (since 4.17.13651): See https://www.mobileread.com/forums/showthread.php?t=323083. + +Larger Sleep/Power-off timeouts: + - Enabled: no + - PatchGroup: Sleep/Power-off timeouts + - Description: | + Increase the available sleep/power-off timeouts to larger values (up to a + few weeks). To customize this patch, see https://pgaskin.net/kobopatch-patches/lgrpwroff-14601.html . + + IMPORTANT - Although this patch has been tested by multiple users and + confirmed to be working, the interaction between the RTC timer and Nickel + has many moving parts. As reported by JSWolf on MR, this patch might have + issues with actually powering-off with timeouts longer than a day. The + cause is likely to be the auto-sync interval or sleepcover causing the + timer to be overridden/reset every day. Nevertheless, this patch should + work reliably for timeouts under 12 hours, and probably under 1 day. + + If you are using this patch with timeouts above 12 hours, and can confirm + if it works/doesn't work, please PM me or comment on GitHub with your + setting values, sleepcover or not, auto-sync interval, wifi on/off, firmware + version, and Kobo model. + + See https://github.com/geek1011/kobopatch-patches/issues/28#issuecomment-537161827 + for more details about this. + # Multipliers + - ReplaceBytes: + Base: "N3PowerWorkflowManager::configureWakeup(AlarmControl*, int, char const*)" + Offset: 12 + FindH: 04 FB 05 F5 # MUL r5(dest), r4(multiplier), r5(mins) + ReplaceH: 4F EA C5 45 # LSL r5, r5, #19 + - ReplaceBytes: {Base: "N3PowerWorkflowManager::pollBattery()", Offset: 106, FindH: 08 FB 00 F8, ReplaceH: 4F EA C0 48} # MUL r8(dest), r8(multiplier), r0(mins) -> LSL r8, r0, #19 + - ReplaceBytes: {Base: "N3PowerWorkflowManager::pollBattery()", Offset: 156, FindH: 02 FB 00 F2, ReplaceH: 4F EA C0 42} # MUL r2(dest), r2(multiplier), r0(mins) -> LSL r2, r0, #19 + # Menu text + - FindBaseAddressString: "5 mins\0" + - ReplaceString: {Offset: 0, Find: "5 mins\0", Replace: "8m"} + - ReplaceString: {Offset: 8, Find: "10 mins", Replace: "34m"} + - ReplaceString: {Offset: 16, Find: "15 mins", Replace: "1h1m"} + - ReplaceString: {Offset: 24, Find: "30 mins", Replace: "4h4m"} + - ReplaceString: {Offset: 32, Find: "45 mins", Replace: "12h5m"} + - ReplaceString: {Offset: 38, Find: "60 mins", Replace: "24h1m"} + # Values (see https://www.mobileread.com/forums/showpost.php?p=3887105) + - FindBaseAddressSymbol: "N3SettingsPowerView::initChoices()" + - ReplaceInt: {Offset: 11, Find: 5, Replace: 1} + - ReplaceInt: {Offset: 465, Find: 5, Replace: 1} + - ReplaceInt: {Offset: 99, Find: 10, Replace: 4} + - ReplaceInt: {Offset: 525, Find: 10, Replace: 4} + - ReplaceInt: {Offset: 159, Find: 15, Replace: 7} + - ReplaceInt: {Offset: 583, Find: 15, Replace: 7} + - ReplaceInt: {Offset: 219, Find: 30, Replace: 28} + - ReplaceInt: {Offset: 641, Find: 30, Replace: 28} + - ReplaceInt: {Offset: 279, Find: 45, Replace: 83} + - ReplaceInt: {Offset: 699, Find: 45, Replace: 83} + - ReplaceInt: {Offset: 339, Find: 60, Replace: 165} + - ReplaceInt: {Offset: 755, Find: 60, Replace: 165} + +Allow rotation on all devices: + - Enabled: no + - Description: | + Enables rotation on all devices. This shows a rotation icon in the status + bar, which shows a menu allowing you to choose between portrait and landscape + when pressed. This icon is only shown on rotateable views (like the reader). + Unlike only the DeveloperSettings ForceAllowLandscape option, this patch + also makes the rotation icon show on the new reader as well. + # Always return true for ForceAllowLandscape: + - ReplaceBytes: {Offset: 0x72A5AE, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + # In ReadingMenuView::ReadingMenuView, replace the value of Device::hasOrientationSensor, + # which is passed to a function to hide/show the rotate icon: + - ReplaceBytes: {Offset: 0xB38C6C, FindInstBLX: {SymPLT: "Device::hasOrientationSensor() const"}, ReplaceH: 4F F0 01 00} + # Also fix sizing of popup by doing the same in RotatePopup::RotatePopup, but + # note that this will make the Automatic option show too (and do nothing): + - ReplaceBytes: {Offset: 0xB54A86, FindInstBLX: {SymPLT: "Device::hasOrientationSensor() const"}, ReplaceH: 4F F0 01 00} + +Don't uppercase header/footer text: + - Enabled: no + - Description: Prevents the text in the reader header/footer from being uppercased. + - PatchGroup: Header/footer page number text + # Replace QString::toUpper call with QString::trimmed (to copy the string, and + # not need to add a mov instruction and NOP the destructor): + - ReplaceBytes: + Base: "ReadingView::getChapterTitle()" + Offset: 282 + FindInstBLX: {SymPLT: "QString::toUpper() const"} + ReplaceInstBLX: {SymPLT: "QString::trimmed() const"} + - ReplaceBytes: + Base: "ReadingView::updateFooter()" + Offset: 26 + FindInstBLX: {SymPLT: "QString::toUpper() const"} + ReplaceInstBLX: {SymPLT: "QString::trimmed() const"} + # Page number text: + - FindReplaceString: {Find: "%1 OF %2", Replace: "%1 of %2"} + +Custom header/footer page number text: + - Enabled: no + - PatchGroup: Header/footer page number text + - Description: Changes the page number text format in the reading header & footer + - FindReplaceString: {Find: "%1 OF %2", Replace: "%1 / %2"} + +Don't uppercase header/footer text and change page number text: + - Enabled: no + - Description: Combines the previous two patches. + - PatchGroup: Header/footer page number text + - ReplaceBytes: + Base: "ReadingView::getChapterTitle()" + Offset: 282 + FindInstBLX: {SymPLT: "QString::toUpper() const"} + ReplaceInstBLX: {SymPLT: "QString::trimmed() const"} + - ReplaceBytes: + Base: "ReadingView::updateFooter()" + Offset: 26 + FindInstBLX: {SymPLT: "QString::toUpper() const"} + ReplaceInstBLX: {SymPLT: "QString::trimmed() const"} + - FindReplaceString: {Find: "%1 OF %2", Replace: "%1 / %2"} + +Swap reading header/footer: + - Enabled: no + - Description: | + Swaps the reading header/footer text (i.e. book progress on top, chapter + progress on the bottom). This patch has undefined behaviour if the header + or footer is disabled. + # Both the header and footer use the ReadingFooter class and update them using + # the overloaded ReadingFooter::update function. The difference is which r0 (this) + # is passed to them. Since tbe header and footer are both members of ReadingView, + # and they are loaded just before the update (and aren't used otherwise), they + # can be swapped by switching the struct offset used by LDR. + # + # Offsets (since 4.19.14123): + # - ReadingView->header - 0x10 + # - ReadingView->footer - 0x1C + - ReplaceBytes: + Base: "ReadingView::updateProgressHeader(QString const&, QString const&)" + Offset: 8 + FindH: 00 69 # LDR r0, [r0, #0x10] + ReplaceH: C0 69 # LDR r0, [r0, #0x1C] + - ReplaceBytes: + Base: "ReadingView::updatePercentageFooter(QString const&)" + Offset: 158 + FindH: C0 69 # LDR r0, [r0, #0x1C] + ReplaceH: 00 69 # LDR r0, [r0, #0x10] + - ReplaceBytes: + Base: "ReadingView::updatePageFooter(QString const&)" + Offset: 178 + FindH: C0 69 # LDR r0, [r0, #0x1C] + ReplaceH: 00 69 # LDR r0, [r0, #0x10] + - ReplaceBytes: + Base: "ReadingView::updateTimeFooter(QString const&)" + Offset: 100 + FindH: D3 F8 1C 90 # LDR.W sb, [r3, #0x1C] + ReplaceH: D3 F8 10 90 # LDR.W sb, [r3, #0x10] + +Enable advanced settings for all fonts: + - Enabled: no + - Description: | + This patch allows the advanced font options (weight/sharpness adjustments) + to work with sideloaded fonts too. (KEPUB - OTF and TTF. EPUB - TTF only.) + - ReplaceBytes: + Base: "AdvancedFontSettingsController::loadView()" # font dropdown in advanced font settings dialog + Offset: 144 + FindInstBLX: {SymPLT: "N3FontTypeUtil::setupMonotypeDropdown(TouchDropDown*, QString const&)"} # monotype fonts only + ReplaceInstBLX: {SymPLT: "N3FontTypeUtil::setupDropdown(TouchDropDown*, QString const&)"} # all fonts + - ReplaceBytes: + Base: "ReadingMenuFontSettingsController::setupAdvancedOption(QString const&)" + Offset: 112 + FindInstBLX: {SymPLT: "N3FontTypeUtil::isMonotypeFont(QString const&)"} + ReplaceH: 4F F0 01 00 + +Customize ComfortLight settings: + - Enabled: no + - Description: | + Change the times available in the ComfortLight bedtime dropdown and the + start/end times for the color changes. All values in this patch are + customizable. + + The default values for this patch give you 21 options between 5PM and 3AM + at 30 minute intervals, with the colour change starting at 4PM, and the + change back to blue between 5AM and 7AM. The firmware default is 13 options + between 9PM-3AM at 30 minute intervals, with the transition starting at 6PM. + ## + # In an unnamed subroutine two layers into FrontLightPopupController::loadView + # (find it by going back from QTime::addSecs), the times for the dropdown are + # generated into a QVector> with a simple loop. + # + # Change the initial hour / first bedtime dropdown item passed to the QTime + # constructor (mov r1, #21): + - ReplaceInt: {Offset: 0xA91E2E, Find: 21, Replace: 17} # 21:00 (9PM) -> 17:00 (5PM) + # + # Optional: Change the increment passed to QTime::addSecs (you need to use an + # ARM assembler to change this value): + - ReplaceBytes: {Offset: 0xA91E92, FindH: 4F F4 E1 61, ReplaceH: 4F F4 E1 61} # mov.w r1, #1800: 30m + # + # Change the number of increments / bedtime dropdown options (start at the + # initial time, add this number -1 more items with the above increment each + # time) (movs r5, #13): + - ReplaceInt: {Offset: 0xA91E66, Find: 13, Replace: 21} # 13 [9PM..3AM]+30m -> 21 [5PM..3AM]+30m + # + # Change the number of pre-allocated elements (I don't think this is actually + # required, as Qt will realloc as necessary, but we might as well do this just + # in case) (mov r1, #21): + - ReplaceInt: {Offset: 0xA920D0, Find: 13, Replace: 21} # same as prev replacement + ## + # The actual color adjustment is done in BedtimeManager::adjustTemperature. + # The color temperature is based on the current time, the bedtime, the hardcoded + # sunset, the hardcoded sunrise start, the hardcoded sunrise end, the daytime + # temperature, and the nighttime temperature. + # + # Change the sunset time (the transition to a warmer temperature starts here + # and transitions until the bedtime chosen) (this should be 1-3 hours before + # the minimum bedtime from the first replacement above) (mov r1, #18): + - ReplaceInt: {Offset: 0xA8A922, Find: 18, Replace: 16} # 18:00 (9PM-3=6PM) -> 16:00 (5PM-1=4PM) + # + # Change the time for the sunset timer to fire at (this is passed to a QTime + # constructor which is passed to PowerTime::fireAt) (mov r1, #18): + - ReplaceInt: {Offset: 0xA8AA3A, Find: 18, Replace: 16} # should match the sunset time above + # + # Optional: Change the sunrise start time (the transition back to a cooler + # temperature starts here) (this should be sometime after the last bedtime, + # but before the sunset time) (mov r1, #5): + - ReplaceInt: {Offset: 0xA8A944, Find: 5, Replace: 5} # 5AM + # + # Optional: Change the sunrise end time (the transition back to a cooler + # temperature ends here) (this should be 1-3 hours after the sunrise start but + # before the sunset time or bad things will happen with negative values) (mov r1, #7): + - ReplaceInt: {Offset: 0xA8A90E, Find: 7, Replace: 7} # 5AM+2=7AM + +# The following patches allow you to enable a config file option with a patch. + +FeatureSettings - BookSpecificStats: + - Enabled: no + - Description: Adds an option to view stats for a specific book to the book menu. + - ReplaceBytes: {Base: "FeatureSettings::bookSpecificStatsEnabled()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + +FeatureSettings - ShowFacebookShare: + - Enabled: no + - Description: Re-enables the Facebook share option in menus. + - ReplaceBytes: {Base: "FeatureSettings::showFacebookShare()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + +FeatureSettings - FullScreenBrowser: + - Enabled: no + - Description: Makes the browser fullscreen (note that there is no way out except for rebooting). + - ReplaceBytes: {Base: "FeatureSettings::fullScreenBrowser()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + +FeatureSettings - MyWords: + - Enabled: no + - Description: Enables the My Words tab of the Activity screen. + - ReplaceBytes: {Base: "FeatureSettings::myWords()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + +FeatureSettings - ExportHighlights: + - Enabled: no + - Description: Add an option to export highlights to the book menu. + - ReplaceBytes: {Base: "FeatureSettings::exportHighlightsEnabled()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} + +DeveloperSettings - AutoUsbGadget: + - Enabled: no + - Description: Automatically enable USB Storage mode when connected. + - ReplaceBytes: {Offset: 0x72A64E, FindBLX: 0x4B685C, ReplaceH: 4F F0 01 00} + +PowerSettings - UnlockEnabled: + - Enabled: no + - Description: Disables/enables the slide to unlock feature. + - ReplaceBytes: {Offset: 0x7344FE, FindBLX: 0x4B685C, ReplaceH: 4F F0 00 00} # disable +# - ReplaceBytes: {Offset: 0x7344FE, FindBLX: 0x4B685C, ReplaceH: 4F F0 01 00} # enable +# The following patch(es) were made by GeoffR, and most are updated by geek1011 + +# The next 2 patches are alternatives. +# Beware that the KePub reader has problems with its page break position +# when narrow line spacings are selected, depending on which font is used. +# You can increase the replace_float values at the bottom of each patch to +# avoid those problems, or else simply refrain from selecting narrowest +# line spacings when reading KePubs. + +My 10 line spacing values: + - Enabled: no + - PatchGroup: Line spacing values alternatives + - Description: | + This patch changes the values on the line spacing adjustment slider, + reducing the number of spacing options from 15 to 10, but allowing + much narrower spacing values to be set. + # Bypass code-constructed values 1.0, 1.2, 1.5, 2.0, 3.0 + # These are all the appends not loaded using adr. + - BaseAddress: {Sym: "ReadingSettings::lineHeightScalars() const", Rel: 84} # first append + - ReplaceBytes: {Offset: 0, FindInstBLX: {SymPLT: "QList::append(double const&)"}, ReplaceInstNOP: true} + - ReplaceBytes: {Offset: 86, FindInstBLX: {SymPLT: "QList::append(double const&)"}, ReplaceInstNOP: true} + - ReplaceBytes: {Offset: 128, FindInstBLX: {SymPLT: "QList::append(double const&)"}, ReplaceInstNOP: true} + - ReplaceBytes: {Offset: 188, FindInstBLX: {SymPLT: "QList::append(double const&)"}, ReplaceInstNOP: true} + - ReplaceBytes: {Offset: 290, FindInstBLX: {SymPLT: "QList::append(double const&)"}, ReplaceInstNOP: true} + # 10 values for replacement, change these replace_float values to suit: + # Find the prologue for the values + first subtraction (has been unique in + # every version so far, and is near impossible to change and fail silently): + - FindBaseAddressHex: CDCC CCCC CCCC F03F 1F85 + - ReplaceFloat: {Offset: 0x00, Find: 1.05, Replace: 0.8} + - ReplaceFloat: {Offset: 0x08, Find: 1.07, Replace: 0.85} + - ReplaceFloat: {Offset: 0x10, Find: 1.1, Replace: 0.875} + - ReplaceFloat: {Offset: 0x18, Find: 1.35, Replace: 0.9} + - ReplaceFloat: {Offset: 0x20, Find: 1.7, Replace: 0.925} + - ReplaceFloat: {Offset: 0x28, Find: 1.8, Replace: 0.95} + - ReplaceFloat: {Offset: 0x30, Find: 2.2, Replace: 0.975} + - ReplaceFloat: {Offset: 0x38, Find: 2.4, Replace: 1.0} + - ReplaceFloat: {Offset: 0x40, Find: 2.6, Replace: 1.05} + - ReplaceFloat: {Offset: 0x48, Find: 2.8, Replace: 1.1} + +My 24 line spacing values: + - Enabled: no + - PatchGroup: Line spacing values alternatives + - Description: | + This patch changes the values on the line spacing adjustment slider, + increasing the number of spacing options from 15 to 24, and allowing + much narrower spacing values to be set. + # basically rewrite the entire code starting where values are added: + # save r5, initialise loop counter + - BaseAddress: {Sym: "ReadingSettings::lineHeightScalars() const", Rel: 84} # starting at first QList::append(double const&) + - ReplaceBytes: {Offset: 0, FindInstBLX: {SymPLT: "QList::append(double const&)"}, ReplaceH: A9 46 00 25} # mov sb, r5 mov r5, #0 + - ReplaceBytes: {Offset: 4, FindH: 6D A3, ReplaceH: ED 00} # lsls r5, r5, #3 + # loop to load 14 vals from new table + - ReplaceBytes: {Offset: 6, FindH: D3 E9 00 23 07 F1, ReplaceH: 20 46 04 A1 29 44} # mov r0, r4 adr r1, #0x10 add r1, r5 + - ReplaceBytes: {Offset: 12, FindH: 80 01 20 46, ReplaceInstBLX: {SymPLT: "QList::append(double const&)"}} + - ReplaceBytes: {Offset: 16, FindH: 61 E9 1C 23, ReplaceH: 08 35 70 2D} # add r5, #8 cmp r5, 112 ## NOTE: 14*8=112 + - ReplaceBytes: {Offset: 20, FindInstBLX: {SymPLT: "QList::append(double const&)"}, ReplaceH: 00 00 00 00} # clear out the BLX in the way of the next two replacements + - ReplaceBytes: {Offset: 20, FindH: 00 00, ReplaceH: F7 D1} # bne #-10 + # jump over new table + - ReplaceBytes: {Offset: 22, FindH: 00 00 6A A3 D3 E9, ReplaceH: 7C E0 00 BF 00 BF} # b #0xFC + # new table: 14 8-aligned doubles + - BaseAddress: {Sym: "ReadingSettings::lineHeightScalars() const", Rel: 112} # right after previous instruction + - ReplaceBytes: {Offset: 12, FindInstBLX: {SymPLT: "QList::append(double const&)"}, ReplaceH: 00 00 00 00} # first, clear out the BLXs in the way + - ReplaceBytes: {Offset: 32, FindInstBLX: {SymPLT: "QList::append(double const&)"}, ReplaceH: 00 00 00 00} + - ReplaceBytes: {Offset: 58, FindInstBLX: {SymPLT: "QList::append(double const&)"}, ReplaceH: 00 00 00 00} + - ReplaceBytes: {Offset: 78, FindInstBLX: {SymPLT: "QList::append(double const&)"}, ReplaceH: 00 00 00 00} + - ReplaceBytes: {Offset: 100, FindInstBLX: {SymPLT: "QList::append(double const&)"}, ReplaceH: 00 00 00 00} + - ReplaceBytes: {Offset: 0, FindH: 00 23 07 F1 80 01 20 46, ReplaceH: 00 00 00 00 00 00 F0 3F} # table of 1.0f values, to be replaced later + - ReplaceBytes: {Offset: 8, FindH: 61 E9 1A 23 00 00 00 00, ReplaceH: 00 00 00 00 00 00 F0 3F} + - ReplaceBytes: {Offset: 16, FindH: 67 A3 D3 E9 00 23 07 F1, ReplaceH: 00 00 00 00 00 00 F0 3F} + - ReplaceBytes: {Offset: 24, FindH: 80 01 20 46 61 E9 18 23, ReplaceH: 00 00 00 00 00 00 F0 3F} + - ReplaceBytes: {Offset: 32, FindH: 00 00 00 00 43 F2 33 33, ReplaceH: 00 00 00 00 00 00 F0 3F} + - ReplaceBytes: {Offset: 40, FindH: 4F F0 33 32 C3 F6 F3 73, ReplaceH: 00 00 00 00 00 00 F0 3F} + - ReplaceBytes: {Offset: 48, FindH: 07 F1 80 01 20 46 61 E9, ReplaceH: 00 00 00 00 00 00 F0 3F} + - ReplaceBytes: {Offset: 56, FindH: 16 23 00 00 00 00 5E A3, ReplaceH: 00 00 00 00 00 00 F0 3F} + - ReplaceBytes: {Offset: 64, FindH: D3 E9 00 23 07 F1 80 01, ReplaceH: 00 00 00 00 00 00 F0 3F} + - ReplaceBytes: {Offset: 72, FindH: 20 46 61 E9 14 23 00 00, ReplaceH: 00 00 00 00 00 00 F0 3F} + - ReplaceBytes: {Offset: 80, FindH: 00 00 00 23 00 22 C3 F6, ReplaceH: 00 00 00 00 00 00 F0 3F} + - ReplaceBytes: {Offset: 88, FindH: F8 73 07 F1 80 01 20 46, ReplaceH: 00 00 00 00 00 00 F0 3F} + - ReplaceBytes: {Offset: 96, FindH: 61 E9 12 23 00 00 00 00, ReplaceH: 00 00 00 00 00 00 F0 3F} + - ReplaceBytes: {Offset: 104, FindH: 55 A3 D3 E9 00 23 07 F1, ReplaceH: 00 00 00 00 00 00 F0 3F} + # jump target after table + - BaseAddress: {Sym: "ReadingSettings::lineHeightScalars() const", Rel: 356} # starting at first QList::append(double const&) + # initialise loop counter + - ReplaceBytes: {Offset: 0, FindH: 00 23 00 22, ReplaceH: 00 BF 00 25} # nop movs r5, #0 + # loop to load 10 vals from old table + - ReplaceBytes: {Offset: 4, FindH: C4 F2 08 03 07 F1, ReplaceH: 20 46 29 A1 29 44} # mov r0, r4 adr r1, #0xA4 add r1, r5 ## NOTE: adr r1, #0xA4 sets r1 to the beginning of the old table + - ReplaceBytes: {Offset: 10, FindH: 80 01 20 46, ReplaceInstBLX: {SymPLT: "QList::append(double const&)"}} + - ReplaceBytes: {Offset: 18, FindInstBLX: {SymPLT: "QList::append(double const&)"}, ReplaceH: 00 00 00 00} # clear out the BLX in the way of the next two replacements + - ReplaceBytes: {Offset: 14, FindH: 61 E9 02 23 00 00, ReplaceH: 08 35 50 2D F7 D1} # adds r5, #8 cmp r5, #80 bne #-10 ## NOTE: 8*10=80 + # restore r5 + - ReplaceBytes: {Offset: 20, FindH: 00 00, ReplaceH: 4D 46} # mov r5, sb + # finished replacements + - BaseAddress: 0 + # + # Replacement value: the number of initial line spacing values to exclude from + # the line spacing slider; minimum 0, maximum 13. E.g. 9 will result in a + # slider with 15 positions, starting from the 10th replace_float value below. + - BaseAddress: {Sym: "ReadingSettings::lineHeightScalars() const", Rel: 86} # starting at first QList::append(double const&) + - ReplaceInt: {Find: 0, Replace: 0} # the value from the MOV instruction at the beginning of this patch + # 24 replacement line spacing values: change these replace_float values to suit + # your device and preferences: + - BaseAddress: {Sym: "ReadingSettings::lineHeightScalars() const", Rel: 112} # beginning of new table from above + - ReplaceFloat: {Offset: 0, Find: 1.0, Replace: 0.75} + - ReplaceFloat: {Offset: 8, Find: 1.0, Replace: 0.78} + - ReplaceFloat: {Offset: 16, Find: 1.0, Replace: 0.8} + - ReplaceFloat: {Offset: 24, Find: 1.0, Replace: 0.82} + - ReplaceFloat: {Offset: 32, Find: 1.0, Replace: 0.84} + - ReplaceFloat: {Offset: 40, Find: 1.0, Replace: 0.86} + - ReplaceFloat: {Offset: 48, Find: 1.0, Replace: 0.88} + - ReplaceFloat: {Offset: 56, Find: 1.0, Replace: 0.9} + - ReplaceFloat: {Offset: 64, Find: 1.0, Replace: 0.92} + - ReplaceFloat: {Offset: 72, Find: 1.0, Replace: 0.94} + - ReplaceFloat: {Offset: 80, Find: 1.0, Replace: 0.96} + - ReplaceFloat: {Offset: 88, Find: 1.0, Replace: 0.98} + - ReplaceFloat: {Offset: 96, Find: 1.0, Replace: 1.0} + - ReplaceFloat: {Offset: 104, Find: 1.0, Replace: 1.02} + - FindBaseAddressHex: CDCC CCCC CCCC F03F 1F85 # beginning of old table + - ReplaceFloat: {Offset: 0, Find: 1.05, Replace: 1.05} + - ReplaceFloat: {Offset: 8, Find: 1.07, Replace: 1.07} + - ReplaceFloat: {Offset: 16, Find: 1.1, Replace: 1.1} + - ReplaceFloat: {Offset: 24, Find: 1.35, Replace: 1.15} + - ReplaceFloat: {Offset: 32, Find: 1.7, Replace: 1.2} + - ReplaceFloat: {Offset: 40, Find: 1.8, Replace: 1.25} + - ReplaceFloat: {Offset: 48, Find: 2.2, Replace: 1.3} + - ReplaceFloat: {Offset: 56, Find: 2.4, Replace: 1.35} + - ReplaceFloat: {Offset: 64, Find: 2.6, Replace: 1.4} + - ReplaceFloat: {Offset: 72, Find: 2.8, Replace: 1.5} + # The first 14 replace_float values above should allow the line spacing to be + # adjusted in increments of one pixel when using a medium sized font on a high + # resolution device. If you use a smaller font size and/or a lower resolution + # device you might find that increasing the slider one step at a time doesn't + # always result in a line spacing increase at each step. In that case, you + # might want to use replacement values that are not quite so close together. + # + # For example: (I use these values on my 758x1024 Glo) + # + # 0.7 0.725 0.75 0.775 0.8 0.825 0.85 0.875 0.9 0.925 0.95 0.975 1.0 1.025 ... + # + # or: (these might better suit the 600x800 Touch) + # + # 0.6 0.633 0.667 0.7 0.733 0.767 0.8 0.833 0.867 9.0 9.33 9.67 1.0 1.025 ... + +Custom left & right margins: + - Enabled: no + - Description: | + This patch sets the size of the margins added by the margins + adjustment slider, as a percentage of screen width. + - FindBaseAddressString: "\0\0\0\0\x02\0\0\0\x04\0\0\0\x06\0\0\0\x08\0\0\0\x0A\0\0\0\x0C\0\0\0\x0E\0\0\0\x10\0\0\0" + # 9 values for replacement: + - ReplaceInt: {Offset: 0x00, Find: 0, Replace: 0} + - ReplaceInt: {Offset: 0x04, Find: 2, Replace: 1} + - ReplaceInt: {Offset: 0x08, Find: 4, Replace: 2} + - ReplaceInt: {Offset: 0x0C, Find: 6, Replace: 3} + - ReplaceInt: {Offset: 0x10, Find: 8, Replace: 4} + - ReplaceInt: {Offset: 0x14, Find: 10, Replace: 5} + - ReplaceInt: {Offset: 0x18, Find: 12, Replace: 6} + - ReplaceInt: {Offset: 0x1C, Find: 14, Replace: 7} + - ReplaceInt: {Offset: 0x20, Find: 16, Replace: 8} + +Custom font sizes: + - Enabled: no + - Description: | + Changes the range of sizes on the font size slider so that there are more of + the small sizes and fewer of the large sizes. + With this patch enabled you will not be able to select the very large font + sizes, but will be able to make finer adjustment to the smaller sizes. + # Font sizes depend on the device's screen density. Unpatched, the sizes + # increase in steps of 1 from the smallest size up to size 22, then in steps + # of 2 up to size 50, then in steps of 4 up to the largest size: + # + # AuraOne/Forma: 18px - 194px (55 sizes) + # GloHD/ClaraHD/Libra: 14px - 150px (48 sizes) + # AuraHD/H2O: 12px - 150px (50 sizes) + # Glo/Aura: 12px - 122px (43 sizes) + # Touch/Mini: 12px - 90px (35 sizes) + # + # The example replacement values in this patch result in the following ranges, + # with increases in steps of 1 from the smallest size up to size 44, then + # steps of 2 up to size 68, then steps of 4 up to the largest size: + # + # AuraOne/Forma: 18px - 132px (55 sizes) + # GloHD/ClaraHD/Libra: 14px - 108px (53 sizes) + # AuraHD/H2O: 12px - 108px (55 sizes) + # Glo/Aura: 12px - 88px (50 sizes) + # Touch/Mini: 12px - 80px (48 sizes) + # + # Note (geek1011): The device values can be determined with info from + # https://gist.github.com/geek1011/613b34c23f026f7c39c50ee32f5e167e and + # the Device::is* calls. + # + # Initial font size: + - ReplaceInt: {Offset: 0x9345B4, Find: 18, Replace: 18} # AuraOne/Forma + - ReplaceInt: {Offset: 0x934448, Find: 14, Replace: 14} # GloHD/ClaraHD/Libra + - ReplaceInt: {Offset: 0x93459C, Find: 12, Replace: 12} # Others + # Increment: + - ReplaceInt: {Offset: 0x934470, Find: 21, Replace: 43} # Add font sizes in increments of 1 until this size exceeded} + - ReplaceInt: {Offset: 0x934478, Find: 22, Replace: 44} # Continue from this font size} + - ReplaceInt: {Offset: 0x934518, Find: 49, Replace: 67} # Add font sizes in increments of 2 until this size exceeded} + - ReplaceInt: {Offset: 0x93451E, Find: 50, Replace: 68} # Continue from this font size} + # Now increment by +4 until final font size: + - ReplaceInt: {Offset: 0x9345B8, Find: 195, Replace: 132} # AuraOne/Forma + - ReplaceInt: {Offset: 0x934458, Find: 150, Replace: 108} # AuraHD/H2O/GloHD/ClaraHD/Libra + - ReplaceInt: {Offset: 0x9345D6, Find: 122, Replace: 88} # Glo/Aura + - ReplaceInt: {Offset: 0x9345D2, Find: 90, Replace: 80} # Touch/Mini + +ePub fixed top/bottom margins: + - Enabled: no + - PatchGroup: ePub padding-bottom alternatives + - Description: + This patch sets the @page margin sizes in epubs to fixed custom values, + overriding any @page margin set in the book's CSS stylesheet. (But beware + that some books also set page margins in an XPGT stylesheet which are added + to any CSS @page margins, and those will not be affected by this patch). + # padding-bottom: %1em !important;\n + # --> }@page{margin:00px 00px 00px}body{ + - FindReplaceString: + Find: "\x20padding-bottom: %1em !important;\n" + Replace: "}@page{margin:00px 00px 00px}body{" + # *** Replacement values start here, don't change anything above *** + - ReplaceString: {Offset: 0x0E, Find: "00px", Replace: "00px", MustMatchLength: yes} # TOP MARGIN: Replacement value is the margin size (two digits) in pixels: + - ReplaceString: {Offset: 0x18, Find: "00px", Replace: "00px", MustMatchLength: yes} # BOTTOM MARGIN: Replacement value is the margin size (two digits) in pixels: + # + # Minimum LEFT/RIGHT MARGIN: (This margin will overlap the left/right margin + # set with the adjustment slider, not add to it.) Replacement value is margin + # size (two digits) in pixels: + - ReplaceString: {Offset: 0x13, Find: "00px", Replace: "00px", MustMatchLength: yes} + +ePub disable built-in body padding-bottom: + - Enabled: no + - PatchGroup: ePub padding-bottom alternatives + - Description: | + The built-in ePub stylesheet adds a line of padding at the bottom of the + body element, to prevent the chapter ending on the last line of a page. + This patch disables that stylesheet entry. + + This patch is not compatible with `ePub fixed/adjustable top/bottom margins` + patch, which already removes this stylesheet entry to make room for other + things. + # padding-bottom: %1em !important;\n + # --> _adding-bottom: %1em !important;\n + - FindBaseAddressString: "\x20padding-bottom: %1em" + - ReplaceString: {Offset: 1, Find: "p", Replace: "_"} + +Custom kepub default margins: + - Enabled: no + - Description: | + Sets the built-in minimum margin for KePub books and Pocket articles to + zero, the same as it is in ePub books. This only affects left/right margins + in normal reading mode, but all four margins in full-screen mode. + - BaseAddress: "ContentSettingManager::readerDefaultMargins(Device const&, bool)" + - ReplaceInt: {Offset: 52, Find: 60, Replace: 0} # Device = AuraOne, Type = Japanese kepub + - ReplaceInt: {Offset: 54, Find: 32, Replace: 0} # Device = AuraOne, Type = pocket article or non-Japanese kepub + - ReplaceInt: {Offset: 58, Find: 20, Replace: 0} # Device = Touch/Mini, Type = Any + - ReplaceInt: {Offset: 20, Find: 45, Replace: 0} # Device = Other, Type = Japanese kepub + - ReplaceInt: {Offset: 22, Find: 25, Replace: 0} # Device = Other, Type = pocket article or non-Japanese kepub + +Block WiFi firmware upgrade: + - Enabled: no + - PatchGroup: Firmware upgrade options + - Description: | + WARNING! THIS IS A DANGEROUS PATCH! READ THE INFORMATION BELOW CAREFULLY! + + THIS PATCH IS UNTESTED, as there is no way to be sure it still works until + the next firmware version is released. If it works then the firmware will + not be upgraded during a WiFi sync, but you will still be able to upgrade + manually or by syncing with the Kobo desktop. + + THIS PATCH COULD RESULT IN A BOOT LOOP when signing out of your Kobo account + (Settings > Accounts > Sign out) or when invoking a factory reset from the + device information menu (Settings > Device information > Factory reset). + REMOVE THIS PATCH BEFORE USING EITHER OF THOSE OPTIONS. + A factory reset invoked using the hardware methods (such as holding down the + light button while switching on) should not be affected. + - FindReplaceString: + Find: "UpgradeCheck/%1/%2/%3/%4/%5" + Replace: "UpgradeCheck/%1/%2/k/99.9/5" + +Custom Sleep/Power-off timeouts: + - Enabled: no + - PatchGroup: Sleep/Power-off timeouts + - Description: | + Changes the Sleep/Power-off timeout menu options from 5,10,15,30,45,60 + minutes to 10,20,30,60,120,240 minutes. + # Values displayed on both menus + - FindBaseAddressString: "5 mins\0" + - ReplaceString: {Offset: 0, Find: "5 mins\0", Replace: "10 mins"} + - ReplaceString: {Offset: 8, Find: "10 mins", Replace: "20 mins"} + - ReplaceString: {Offset: 16, Find: "15 mins", Replace: "30 mins"} + - ReplaceString: {Offset: 24, Find: "30 mins", Replace: "1 hour"} + - ReplaceString: {Offset: 32, Find: "45 mins", Replace: "2 hours"} + - ReplaceString: {Offset: 38, Find: "60 mins", Replace: "4 hours"} + # Replace values MOVed then added to the list in N3SettingsPowerView::initChoices: + # Actual values used for sleep menu + - BaseAddress: {Sym: "N3SettingsPowerView::initChoices()", Rel: 12} + - ReplaceInt: {Offset: 0, Find: 5, Replace: 10} + - ReplaceInt: {Offset: 88, Find: 10, Replace: 20} + - ReplaceInt: {Offset: 148, Find: 15, Replace: 30} + - ReplaceInt: {Offset: 208, Find: 30, Replace: 60} + - ReplaceInt: {Offset: 268, Find: 45, Replace: 120} + - ReplaceInt: {Offset: 328, Find: 60, Replace: 240} + # Actual values used for power menu + - BaseAddress: {Sym: "N3SettingsPowerView::initChoices()", Rel: 466} + - ReplaceInt: {Offset: 0, Find: 5, Replace: 10} + - ReplaceInt: {Offset: 60, Find: 10, Replace: 20} + - ReplaceInt: {Offset: 118, Find: 15, Replace: 30} + - ReplaceInt: {Offset: 176, Find: 30, Replace: 60} + - ReplaceInt: {Offset: 234, Find: 45, Replace: 120} + - ReplaceInt: {Offset: 290, Find: 60, Replace: 240} + +Set KePub hyphenation: + - Enabled: no + - Description: | + The built-in KePub stylesheet has a line * { -webkit-hyphens: auto; } + to turn on hyphenation, but it is only used if the device's justification + button is set to full justification. With this patch enabled hyphenation + will always be turned on, regardless of justification button setting. + + (The publisher can still turn hyphenation off/on in the book's stylesheet.) + - ReplaceBytes: {Offset: 0xB2216A, FindInstBLX: {SymPLT: "QString::operator==(QLatin1String) const"}, ReplaceH: 01 20 01 20} # Alternative 1: Always turn KePub hyphenation on +# - ReplaceBytes: {Offset: 0xB2216A, FindInstBLX: {SymPLT: "QString::operator==(QLatin1String) const"}, ReplaceH: 00 20 00 20} # Alternative 2: Never turn KePub hyphenation on + +Force user line spacing in KePubs: + - Enabled: no + - Description: | + This patch will allow the line spacing set by the slider to take effect + in some problem KePub books with fixed linespacing (including ones where the + publisher has used
instead of

for paragraphs, or wrapped each + paragraph in a and set the line-height on the span.) However it might + also override some line spacing that would better be left fixed, e.g. it can + cause problems with the spacing of paragraphs that begin with a raise-cap. + # body, p { line-height: %1 ... } --> body * { line-height: %1 ... } + - FindBaseAddressString: "body, p { line-height: %1" + - ReplaceString: {Find: "body, p {", Replace: "body * {", MustMatchLength: yes} + # + # Option: Comment out the replace_string line above and uncomment the one below + # for a less forceful version of this patch that has fewer side effects and + # should still work for most problem books, but not the ones where the publisher + # has set the line-height at level. + # + # body, p { line-height: %1 ... } --> body,div,p{line-height:%1 ... } +# - ReplaceString: {Find: "body, p { line-height: %", Replace: "body,div,p{line-height:%"} + +Force user line spacing in ePubs (part 1 of 2): + - Enabled: no + - Description: | + This is part 1 of 2. Also enable part 2 in librmsdk.so.1.0.0.patch + This patch prevents any line-height style set in the book's stylesheet from + being recognised. It will spoil the formatting of some books, but will + ensure that the line spacing set with the adjustment slider takes effect. + - FindBaseAddressString: "\0\0\x20line-height: %1" + - ReplaceString: {Offset: 3, Find: "l", Replace: "_"} + +Un-force font-family override p tags (std epubs): + - Enabled: no + - PatchGroup: ePub force font alternatives + - Description: | + This patch allows the font set for paragraphs by the publisher in the epub + stylesheet to override the font selected by the reader from the device. + # body, p { font-family: -ua-default !important; } + # --> body { font-family: -ua-default !important; } + - FindBaseAddressString: "body, p { font-family: -ua" + - ReplaceString: {Find: "body, p", Replace: "body \x20", MustMatchLength: yes} + +Force user font-family in ePubs (Part 1 of 2): + - Enabled: no + - PatchGroup: ePub force font alternatives + - Description: | + This is part 1 of 2. Also enable part 2 in librmsdk.so.1.0.0.yaml. + This patch prevents any font-family style set in the book's stylesheet from + being recognised. It might spoil the style of books which use multiple fonts, + but will ensure that the font-family set from the device menu takes effect. + - FindBaseAddressString: "font-family: -ua-default; font-style: normal; font-weight: normal;" + - ReplaceString: {Find: "f", Replace: "_"} + - FindBaseAddressString: "font-family: -ua-default; font-style: italic; font-weight: normal;" + - ReplaceString: {Find: "f", Replace: "_"} + - FindBaseAddressString: "font-family: -ua-default; font-style: italic; font-weight: bold;" + - ReplaceString: {Find: "f", Replace: "_"} + - FindBaseAddressString: "font-family: -ua-default; font-style: normal; font-weight: bold;" + - ReplaceString: {Find: "f", Replace: "_"} + - FindBaseAddressString: "font-family: -ua-default !important;" + - ReplaceString: {Find: "f", Replace: "_"} + +ePub constant font sharpness: + - Enabled: no + - Description: | + With this patch the ePub reader will use a constant sharpness value of 0.2, + instead of the value set by the advanced font sharpness/weight slider. The + slider sharpness values range from -0.4(min.) to 0.2(max.), default -0.0666. + # -kobo-font-sharpness: %1; --> -kobo-font-sharpness:0.2; + - FindBaseAddressString: "\0\0 -kobo-font-sharpness: %1;" + - ReplaceString: {Offset: 3, Find: "-kobo-font-sharpness: %1", Replace: "-kobo-font-sharpness:0.2", MustMatchLength: yes} + +KePub constant font sharpness: + - Enabled: no + - Description: | + With this patch the KePub reader will use a constant sharpness value of 0.2, + instead of the value set by the advanced font sharpness/weight slider. The + slider sharpness values range from -0.4(min.) to 0.2(max.), default -0.0666. + # body { -kobo-font-sharpness: %1; -kobo-font-thickness: %2; }\n + # --> body{-kobo-font-sharpness:0.0/*%1*/;-kobo-font-thickness:%2}\n + - FindReplaceString: + Find: "body { -kobo-font-sharpness: %1; -kobo-font-thickness: %2; }\n" + Replace: "body{-kobo-font-sharpness:0.0/*%1*/;-kobo-font-thickness:%2}\n" + MustMatchLength: yes + - ReplaceString: + Offset: 5 + Find: "-kobo-font-sharpness:0.0" + Replace: "-kobo-font-sharpness:0.2" # Replacement sharpness value + MustMatchLength: yes + +Un-Force user text-align in div,p tags in KePubs: + - Enabled: no + - Description: | + This patch allows the text alignment set by the publisher in the kepub + stylesheet to override the alignment selected by the reader from the device. + # div, p { text-align: %1 !important; } + # --> body { text-align: %1 !important; } + - FindBaseAddressString: "div, p { text-align: %1" + - ReplaceString: + Find: "div, p {" + Replace: "body {" + MustMatchLength: yes + +Un-Force user font-family in KePubs: + - Enabled: no + - Description: | + The KePub reader uses a very heavy-handed method of setting the font selected + by the user, overriding all fonts set by the publisher in the book unless + "Publisher Default" is selected. + This patch lets the font-family set by the publisher in the KePub stylesheet + override the font-family selected by the reader from the device in some + cases, which allows a mix of user-selected and publisher-selected fonts. + Alternatives 1-3 give increasing preference to the publisher-selected fonts. + - FindBaseAddressString: "* { font-family: %1 !important; }\n" + # + # Alternative 1: + # * { font-family: %1 !important; }\n + # --> div,p{font-family:%1!important; }\n + - ReplaceString: + Find: "* { font-family: %1 !important; }\n" + Replace: "div,p{font-family:%1!important; }\n" + MustMatchLength: yes + # + # Alternative 2: (Similar to ePub default) + # * { font-family: %1 !important; }\n + # --> body,p{font-family:%1!important;}\n +# - ReplaceString: +# Offset: 0 +# Find: "* { font-family: %1 !important; }\n" +# Replace: "body,p{font-family:%1!important;}\n" +# MustMatchLength: yes + # + # Alternative 3: (similar to ePub with `Un-force font-family override p tags`) + # * { font-family: %1 !important; }\n + # --> body{font-family:%1 !important; }\n +# - ReplaceString: +# Offset: 0 +# Find: "* { font-family: %1 !important; }\n" +# Replace: "body{font-family:%1 !important; }\n" +# MustMatchLength: yes + +Un-force link decoration in KePubs: + - Enabled: no + - Description: Disables the following link decoration CSS in the KePub stylesheet. + # a:link, a:visited, a:hover, a:active { + # border-bottom: 1px dotted black !important; + # color: #696969 !important; + # } + - FindBaseAddressString: "a:link, a:visited, a:hover, a:active {" + - ReplaceString: {Offset: 0x27, Find: "b", Replace: "_"} # Disable border-bottom style + - ReplaceString: {Offset: 0x53, Find: "c", Replace: "_"} # Disable color style + +KePub stylesheet additions: + - Enabled: no + - Description: Makes room to add some additional CSS to the default KePub stylesheet. + # See replacement CSS below for examples. + - FindBaseAddressString: ".KBHighlighting, .KBSearchResult {" + - ReplaceString: {Offset: 0, Find: ".KBHighlighting, .KBSearchResult { background-color: #C6C6C6 !important; } \t", Replace: ".KBHighlighting,.KBSearchResult{background-color:#C6C6C6!important}.KBSearch", MustMatchLength: yes} + - ReplaceString: {Offset: 76, Find: ".KBSearchResult, .KBAnnotation, .KBHighlighting { font-size: 100% !important; -webkit-text-combine: inherit !important; } \t", Replace: "Result,.KBAnnotation,.KBHighlighting{font-size:100%!important;-webkit-text-combine:inherit!important}.KBAnnotation[writingM", MustMatchLength: yes} + - ReplaceString: {Offset: 199, Find: ".KBAnnotation[writingMode=\"horizontal-tb\"] { border-bottom: 2px solid black !important; } \t", Replace: "ode=\"horizontal-tb\"]{border-bottom:2px solid black!important}.KBAnnotation[writingMode=\"ver", MustMatchLength: yes} + - ReplaceString: {Offset: 290, Find: ".KBAnnotation[writingMode=\"vertical-rl\"] { border-right: 2px solid black !important; } \t", Replace: "tical-rl\"]{border-right:2px solid black!important}.KBAnnotation[writingMode=\"vertical-lr", MustMatchLength: yes} + - ReplaceString: {Offset: 378, Find: ".KBAnnotation[writingMode=\"vertical-lr\"] { border-left: 2px solid black !important; }", Replace: "\"]{border-left:2px solid black!important}/******************************************/", MustMatchLength: yes} + # + # Replacement value: CSS string of exactly 44 characters in length: + # + # Example 1: Make full justification the default: +# - FindReplaceString: {Find: "/******************************************/", Replace: "body{text-align:justify }", MustMatchLength: yes} + # + # Example 2: text-rendering:optimizeSpeed: Disables kerning, but fixes some + # rendering problems that affect fully justified text. +# - FindReplaceString: {Find: "/******************************************/", Replace: "body{text-rendering:optimizeSpeed }", MustMatchLength: yes} + # + # Example 3: text-rendering:optimizeLegibility: Enables ligatures, but causes + # some additional rendering problems for fully justified text. +# - FindReplaceString: {Find: "/******************************************/", Replace: "body{text-rendering:optimizeLegibility }", MustMatchLength: yes} + # + # Example 4: Make KePub font sizes match ePub font sizes: ePubs render with + # 1.5 times the font size of KePubs by default. With this enabled they match. +# - FindReplaceString: {Find: "/******************************************/", Replace: "#book-inner{font-size:1.5em }", MustMatchLength: yes} + +Allow searches on Extra dictionaries: + - Enabled: no + # See https://pgaskin.net/dictutil/dicthtml/install + - FindBaseAddressString: "\0Extra:\x20" + - ReplaceString: {Offset: 7, Find: "\x20", Replace: "_"} + +Ignore .otf fonts: + - Enabled: no + - Description: + Ignores all sideloaded and pre-installed .otf fonts. + (Currently the only pre-installed .otf font is OpenDyslexic.) + Embedded .otf fonts should continue to work as normal. + - FindReplaceString: {Find: "*.otf", Replace: "_.otf"} + +ePub uniform font scale: + - Enabled: no + - Description: | + Unlike the KePub reader, the ePub reader uses a ~50% larger font scale on + dragon (AuraHD/H2O/GloHD/H2O2/Clara/Libra) devices. This patch changes + changes the ePub reader to match the KePub reader in having the same font + scale on all devices. + - FindBaseAddressHex: 00 00 C0 42 00 00 10 43 + - ReplaceBytes: {Offset: 6, FindH: 10 43, ReplaceH: C0 42} + +Set font scale factor: + - Enabled: no + - Description: | + This patch sets the font scale factor for ePub and KePub readers. + + See also `ePub uniform font scale` and `Custom font sizes` patches. + Note: This patch can be at the same time as the others. + # Font scale factor is calculated as (font size slider) / (X+32) + # Original value X=14, so original scale factor is (font size slider) / 46. + # Allowed replacement values for X: 0-15 (smaller X --> larger scale factor) + - ReplaceInt: {Offset: 0x546926, Find: 14, Replace: 4} # ePub + - ReplaceInt: {Offset: 0xB21D4A, Find: 14, Replace: 4} # KePub +# The following patch(es) were made by jackie_w + +Dictionary text font-family/font-size/line-height: + - Enabled: no + - Description: | + This patch allows you to to customise the appearance of the text + in the pop-up and full-screen dictionary widgets. + 4.17.13651: improved to also reduce the blank lines displayed in many + sideloaded custom dictionaries which contain

. + . + See https://www.mobileread.com/forums/showpost.php?p=3521137&postcount=48 + for screenshots + . + You can change one or more of the following properties: + - font-family + - font-size + - line-height + . + These are the Kobo defaults + Glo - Georgia 23px 1.4em + H2O - Georgia 29px 1.4em + GloHD - Georgia 32px 1.4em + AuraONE - Georgia 42px 1.4em + # + # Stage 1: Change DictionaryView to remove %variables + # from: + # * { font: %1px %2; line-height: 1.4em; } + # div.descriptionFont { font-family: %3; } + # ol { font-size: %1px; font-weight: bold; margin-left: %4em; margin-top: 0px; } + # ol p { font-size: %1px; font-weight:normal; } + # to: + # * { font-size: %1px; line-height: 1.40em;font-family: Georgia ;} + # ol {margin-left:1em; margin-top:0} + # blockquote {margin:0.3em 0 0.3em 1em} blockquote>blockquote {margin:-0.3em 0 0 2em} + # + # ##### N.B. Do not change the next 4 lines ##### + - FindReplaceString: + Find: "* { font: %1px %2; line-height: 1.4em; }\ndiv.descriptionFont { font-family: %3; }\nol { font-size: %1px; font-weight: bold; margin-left: %4em; margin-top: 0px; }\nol p { font-size: %1px; font-weight:normal; }\n" + Replace: "* { font-size: %1px; line-height: 1.40em;font-family: Georgia ;}\n\nol {margin-left:1em; margin-top:0}\nblockquote {margin:0.3em 0 0.3em 1em} blockquote>blockquote {margin:-0.3em 0 0 2em}\n" + MustMatchLength: yes + # ##### N.B. Do not change anything above this line ##### + # + # Stage 2: N.B. You MUST keep old and new strings EXACTLY the same length + # + # Notes for changing font-family: + # 1. Pad the shorter of the old/new strings with spaces to + # keep same length for both strings (see examples below) + # + # 2. If the new font-family name (max. 29 chars) contains any spaces it + # should be wrapped in 'single quotes' (see examples 2, 3) + # + # 3. To change from Georgia to the Kobo default sans-serif font, Avenir, + # use either one of the following to achieve the same result: + # - sans-serif + # - 'Avenir Next Medium' + # + # Un-comment ONE ONLY of the following ReplaceString examples + # to change dictionary font-family from default Georgia: + # - to a different built-in font + # - to one of your sideloaded custom fonts + # + #- ReplaceString: {Offset: 54, Find: "Georgia ", Replace: "sans-serif", MustMatchLength: yes} + #- ReplaceString: {Offset: 54, Find: "Georgia ", Replace: "'Gill Sans'", MustMatchLength: yes} + #- ReplaceString: {Offset: 54, Find: "Georgia ", Replace: "'Kobo Nickel'", MustMatchLength: yes} + #- ReplaceString: {Offset: 54, Find: "Georgia ", Replace: "Bookerly", MustMatchLength: yes} + # + # Un-comment and edit next line to change font-size + #- ReplaceString: {Offset: 15, Find: "%1px", Replace: "32px", MustMatchLength: yes} + # + # Un-comment and edit next line to change line spacing + #- ReplaceString: {Offset: 34, Find: "1.40em", Replace: "1.30em", MustMatchLength: yes} + +Custom navigation menu page number text: + - Enabled: no + - Description: Changes the page number text format in the reading navigation menu + - FindReplaceString: {Find: "Page %1 of %2", Replace: "%1 / %2"} +# The following patch(es) are ported from jcn363's patches + +Shorten dictionary entry not found message: + - Enabled: no + - Description: | + Idea by pakoe + cf. https://www.mobileread.com/forums/showpost.php?p=3043631&postcount=111 + - FindReplaceString: + Find: "Your search for “%1” did not match any words in the dictionary. The closest match was “%2”." + Replace: "No match for “%1”, closest match was “%2”." + +Change Wikipedia search language: + - Enabled: no + - Description: | + The patch set the search language in Wikipedia. + Replace the "en" (in both the replace_string lines) to language code you want. + For example English is "en" (set as default), for German is "de", for Russian is "ru". + - FindReplaceString: + Find: "\0https://%1.m.wikipedia.org/wiki/Special:Search\0" + Replace: "\0https://es.m.wikipedia.org/wiki/Special:Search\0" + - FindReplaceString: + Find: "\0https://%1.wikipedia.org/wiki/Special:Search\0" + Replace: "\0https://es.wikipedia.org/wiki/Special:Search\0" +# The following keyboard patches were originally by GeoffR and updated by various users. + +Cyrillic Keyboard (GloHD/ClaraHD/AuraOne/H2O2): + # Updated by Bald Eagle for 4.18.13737 (https://www.mobileread.com/forums/showpost.php?p=3894655&postcount=84) + - Enabled: no + - PatchGroup: Keyboard alternatives + - Description: | + Replaces keys on the Extended Latin keypad with Cyrillic alternatives. + + Note that after the device boots, the keypad might just show blank squares + until after the first book has been opened. + Also note that long-pressing keys on the base keypad will no longer show + the appropriate list of Extended Latin keys. + # Replace layout sign + - FindBaseAddressString: "ÉÀÇ" + - ReplaceString: {Offset: 0, Find: "ÉÀÇ", Replace: "АБВ"} + # Change keyboard layout + - FindBaseAddressString: "ý\0\0ÿ\0\0š\0\0ž\0\0" + # Top row, left to right (10 keys): + - ReplaceString: {Offset: 0x00, Find: "ý\0", Replace: "ё"} + - ReplaceString: {Offset: 0x04, Find: "ÿ\0", Replace: "э"} + - ReplaceString: {Offset: 0x08, Find: "š\0", Replace: "ä"} + - ReplaceString: {Offset: 0x0C, Find: "ž\0", Replace: "ö"} + - ReplaceString: {Offset: 0x10, Find: "æ\0", Replace: "ü"} + - ReplaceString: {Offset: 0x14, Find: "œ\0", Replace: "µ"} + - ReplaceString: {Offset: 0x18, Find: "þ\0", Replace: "ю"} + #- ReplaceString: {Offset: -56, Find: "ß\0", Replace: ","} + - ReplaceString: {Offset: 0x1C, Find: "ij\0", Replace: "х"} + - ReplaceString: {Offset: 0x20, Find: "ŀ\0", Replace: "ъ"} + # Second row, left to right (10 keys): + - ReplaceString: {Offset: 0x28, Find: "à\0", Replace: "й"} + - ReplaceString: {Offset: 0x2C, Find: "á\0", Replace: "ц"} + - ReplaceString: {Offset: 0x30, Find: "â\0", Replace: "у"} + - ReplaceString: {Offset: 0x34, Find: "ä\0", Replace: "к"} + - ReplaceString: {Offset: 0x38, Find: "ã\0", Replace: "е"} + - ReplaceString: {Offset: 0x3C, Find: "å\0", Replace: "н"} + - ReplaceString: {Offset: 0x40, Find: "è\0", Replace: "г"} + - ReplaceString: {Offset: 0x44, Find: "é\0", Replace: "ш"} + - ReplaceString: {Offset: 0x48, Find: "ê\0", Replace: "щ"} + - ReplaceString: {Offset: 0x4C, Find: "ë\0", Replace: "з"} + # Third row, left to right (10 keys): + - ReplaceString: {Offset: 0x50, Find: "ò\0", Replace: "ф"} + - ReplaceString: {Offset: 0x54, Find: "ó\0", Replace: "ы"} + - ReplaceString: {Offset: 0x58, Find: "ô\0", Replace: "в"} + - ReplaceString: {Offset: 0x5C, Find: "ö\0", Replace: "а"} + - ReplaceString: {Offset: 0x60, Find: "õ\0", Replace: "п"} + - ReplaceString: {Offset: 0x64, Find: "ø\0", Replace: "р"} + - ReplaceString: {Offset: 0x68, Find: "ì\0", Replace: "о"} + - ReplaceString: {Offset: 0x6C, Find: "í\0", Replace: "л"} + - ReplaceString: {Offset: 0x70, Find: "î\0", Replace: "д"} + - ReplaceString: {Offset: 0x74, Find: "ï\0", Replace: "ж"} + # Fourth row, left to right (8 keys): + - ReplaceString: {Offset: 0x78, Find: "ù\0", Replace: "я"} + - ReplaceString: {Offset: 0x7C, Find: "ú\0", Replace: "ч"} + - ReplaceString: {Offset: 0x80, Find: "û\0", Replace: "с"} + - ReplaceString: {Offset: 0x84, Find: "ü\0", Replace: "м"} + - ReplaceString: {Offset: 0x88, Find: "ñ\0", Replace: "и"} + - ReplaceString: {Offset: 0x8C, Find: "ç\0", Replace: "т"} + - ReplaceString: {Offset: 0x90, Find: "đ\0", Replace: "ь"} + - ReplaceString: {Offset: 0x94, Find: "ł\0", Replace: "б"} + +Greek Keyboard (GloHD/ClaraHD/AuraOne/H2O2): + # Updated by Bald Eagle for 4.18.13737 (https://www.mobileread.com/forums/showpost.php?p=3895481&postcount=125) + - Enabled: no + - PatchGroup: Keyboard alternatives + - Description: | + Replaces keys on the Extended Latin keypad with Cyrillic alternatives. + + Note that after the device boots, the keypad might just show blank squares + until after the first book has been opened. + Also note that long-pressing keys on the base keypad will no longer show + the appropriate list of Extended Latin keys. + # Replace layout sign Greek + - FindBaseAddressString: "ÉÀÇ" + - ReplaceString: {Offset: 0, Find: "ÉÀÇ", Replace: "ελ"} + # Change keyboard layout + - FindBaseAddressString: "ý\0\0ÿ\0\0š\0\0ž\0\0" + # Top row, left to right (10 keys): + - ReplaceString: {Offset: 0x00, Find: "ý\0", Replace: "ό"} + - ReplaceString: {Offset: 0x04, Find: "ÿ\0", Replace: "ύ"} + - ReplaceString: {Offset: 0x08, Find: "š\0", Replace: "ϋ"} + - ReplaceString: {Offset: 0x0C, Find: "ž\0", Replace: ":"} + - ReplaceString: {Offset: 0x10, Find: "æ\0", Replace: "ά"} + - ReplaceString: {Offset: 0x14, Find: "œ\0", Replace: "έ"} + - ReplaceString: {Offset: 0x18, Find: "þ\0", Replace: "ί"} + - ReplaceString: {Offset: 0x1C, Find: "ij\0", Replace: "-"} + - ReplaceString: {Offset: 0x20, Find: "ŀ\0", Replace: "_"} + # Second row, left to right (10 keys): + - ReplaceString: {Offset: 0x28, Find: "à\0", Replace: ";"} + - ReplaceString: {Offset: 0x2C, Find: "á\0", Replace: "ς"} + - ReplaceString: {Offset: 0x30, Find: "â\0", Replace: "ε"} + - ReplaceString: {Offset: 0x34, Find: "ä\0", Replace: "ρ"} + - ReplaceString: {Offset: 0x38, Find: "ã\0", Replace: "τ"} + - ReplaceString: {Offset: 0x3C, Find: "å\0", Replace: "υ"} + - ReplaceString: {Offset: 0x40, Find: "è\0", Replace: "θ"} + - ReplaceString: {Offset: 0x44, Find: "é\0", Replace: "ι"} + - ReplaceString: {Offset: 0x48, Find: "ê\0", Replace: "ο"} + - ReplaceString: {Offset: 0x4C, Find: "ë\0", Replace: "π"} + # Third row, left to right (10 keys): + - ReplaceString: {Offset: 0x50, Find: "ò\0", Replace: "α"} + - ReplaceString: {Offset: 0x54, Find: "ó\0", Replace: "σ"} + - ReplaceString: {Offset: 0x58, Find: "ô\0", Replace: "δ"} + - ReplaceString: {Offset: 0x5C, Find: "ö\0", Replace: "φ"} + - ReplaceString: {Offset: 0x60, Find: "õ\0", Replace: "γ"} + - ReplaceString: {Offset: 0x64, Find: "ø\0", Replace: "η"} + - ReplaceString: {Offset: 0x68, Find: "ì\0", Replace: "ξ"} + - ReplaceString: {Offset: 0x6C, Find: "í\0", Replace: "κ"} + - ReplaceString: {Offset: 0x70, Find: "î\0", Replace: "λ"} + - ReplaceString: {Offset: 0x74, Find: "ï\0", Replace: ","} + # Fourth row, left to right (8 keys): + - ReplaceString: {Offset: 0x78, Find: "ù\0", Replace: "ζ"} + - ReplaceString: {Offset: 0x7C, Find: "ú\0", Replace: "χ"} + - ReplaceString: {Offset: 0x80, Find: "û\0", Replace: "ψ"} + - ReplaceString: {Offset: 0x84, Find: "ü\0", Replace: "ω"} + - ReplaceString: {Offset: 0x88, Find: "ñ\0", Replace: "β"} + - ReplaceString: {Offset: 0x8C, Find: "ç\0", Replace: "ν"} + - ReplaceString: {Offset: 0x90, Find: "đ\0", Replace: "μ"} + - ReplaceString: {Offset: 0x94, Find: "ł\0", Replace: "."} +# The following patch(es) are maintained by NiLuJe + +# This is a simple conversion of @frostschutz MiniClock patch +# c.f., https://github.com/frostschutz/Kobo/blob/13a274f582e1e70cc8f865347f1bf113209f8320/MiniClock/usr/local/MiniClock/miniclock.sh#L179-L197 +# It simply prevents Nickel from grabbing exclusive access to the synthetic NTX input device, +# which MiniClock may want to have acccess to in order to catch page turn buttons on devices who happen to feature such buttons ;). +Don't grab exclusive access to event0: + - Enabled: no + - Description: Allows third-party tools to read the event0 input device + - FindReplaceString: {Find: "/dev/input/event0:keymap=keys/device.qmap:grab=1", Replace: "/dev/input/event0:keymap=keys/device.qmap:grab=0"} diff --git a/src/librmsdk.so.1.0.0.yaml b/src/librmsdk.so.1.0.0.yaml new file mode 100644 index 0000000..72b8798 --- /dev/null +++ b/src/librmsdk.so.1.0.0.yaml @@ -0,0 +1,134 @@ +# The following patch(es) are ported from GeoffR's patch zips + +Disable orphans/widows avoidance: + - Enabled: no + - Description: Enable this patch to avoid blank lines at the bottom of pages in ePub books. + # The default values of orphans:2; widows:2; cause extra blank lines to be added + # to some pages to avoid leaving isolated lines of a paragraph at the top or + # bottom of a page. Enabling this patch effectively forces orphans:1; widows:1;, + # overriding the defaults and the book's stylesheet. + # + # Beware that this patch might(?) intefere with related CSS properties such as + # page-break-after:avoid; or page-break-inside:avoid;. A better solution would + # be to edit the book's stylesheet to set orphans:1; widows:1;. + - ReplaceBytes: {Offset: 0x2972E4, FindH: E6 D0, ReplaceH: E6 E7} + +Default ePub serif font (Amasis): + - Enabled: no + - Description: This patch changes the default ePub serif font from Georgia to Amasis. + # To use a different font, change "Amasis" in each of the replacement strings + # to another font name prefix (7 letters max.). For example, change "Amasis" + # to "Times" to use a sideloaded Times New Roman font. + - FindReplaceString: {Find: "/normal/georgia", Replace: "/normal/Amasis"} + - FindReplaceString: {Find: "/bold/georgia", Replace: "/bold/Amasis"} + - FindReplaceString: {Find: "/italic/georgia", Replace: "/italic/Amasis"} + - FindReplaceString: {Find: "/bolditalic/georgia", Replace: "/bolditalic/Amasis"} + +Default ePub sans-serif font (Gill Sans): + - Enabled: no + - Description: This patch changes the default ePub sans-serif font from Avenir to Gill Sans. + # To use a different font, change "Gill" in the replacement string to another + # font name prefix (6 letters max.). For example change "Gill" to "Trebuc" to + # use a sideloaded Trebuchet font. + - FindReplaceString: {Find: "/normal/Avenir", Replace: "/normal/Gill"} + - FindReplaceString: {Find: "/bold/Avenir", Replace: "/bold/Gill"} + - FindReplaceString: {Find: "/italic/Avenir", Replace: "/italic/Gill"} + - FindReplaceString: {Find: "/bolditalic/Avenir", Replace: "/bolditalic/Gill"} + +Default ePub symbol font (Symbol): + - Enabled: no + - Description: Sets the ePub default symbol font? I Don't know what this does! + - FindReplaceString: {Find: "/SymbolStd.otf", Replace: "/normal/Symbol"} + +Force user line spacing in ePubs (Part 2 of 2): + - Enabled: no + - Description: | + This is part 2 of 2. Also enable part 1 in libnickel.so.1.0.0.patch + This patch prevents any line-height style set in the book's stylesheet from + being recognised. It will spoil the formatting of some books, but will ensure + that the line spacing set with the adjustment slider takes effect. (Unless + the publisher has used the font shorthand style; see option below.) + - FindBaseAddressString: "\0line-height\0" + - ReplaceString: {Offset: 1, Find: "l", Replace: "_"} + # Uncomment the following two lines to also prevent the font shorthand style + # from being recognised. The font shorthand style is not very common in ePubs, + # but where used it can also prevent the line spacing from being adjusted. + # Beware that this option will likely have much bigger side-effects on the + # book's formatting, because the font shorthand style is used to set the + # font-size, font family, and other styles in addition to line-height. +# - ReplaceString: {Offset: 1, Find: "f", Replace: "_"} +# - FindBaseAddressString: "\0font\0" + +Force user font-family in ePubs (Part 2 of 2): + - Enabled: no + - Description: | + This is part 2 of 2. Also enable part 1 in libnickel.so.1.0.0.patch + This patch prevents any font-family style set in the book's stylesheet from + being recognised. It might spoil the style of books which use multiple fonts, + but will ensure that the font-family set from the device menu takes effect. + (Unless the publisher has used the font shorthand style; see option below.) + - FindBaseAddressString: "\0font-family\0" + - ReplaceString: {Offset: 1, Find: "f", Replace: "_"} + # Uncomment the following two lines to also prevent the font shorthand style + # from being recognised. The font shorthand style is not very common in ePubs, + # but where used it can also prevent the font-family from being adjusted. + # Beware that this option will likely have much bigger side-effects on those + # book's formatting, because the font shorthand style is used to set the + # font-size, line-height, and other styles in addition to font-family. +# - ReplaceString: {Offset: 1, Find: "f", Replace: "_"} +# - FindBaseAddressString: "\0font\0" + +Ignore ePub book Adobe XPGT stylesheet (page-template.xpgt): + - Enabled: no + - Description: | + Not all ePubs have an Adobe XPGT stylesheet, and the ones that do often use + it mainly to set the page margins. Unfortunately those margins are added to + the page margins set via @page in the CSS stylesheet, and cannot be overidden + by the `ePub fixed/ajustable top/bottom margins` patch. + This patch should cause any Adobe XPGT stylesheet in the book to be ignored, + but for the book's CSS stylesheet still to be used as normal. + (You might prefer to remove the margins from the book's XPGT stylesheet + before sideloading, instead of using this patch. Calibre's Modify ePub plugin + has a useful option for doing this.) + - FindBaseAddressString: "\0template\0" + - ReplaceString: {Offset: 1, Find: "t", Replace: "_"} + +# The following two patches will not be useful to most people, don't enable them unless you are sure you need them. +Ignore ePub book CSS and Adobe XPGT stylesheets: + - Enabled: no + - FindBaseAddressString: "\0stylesheet\0" + - ReplaceString: {Offset: 1, Find: "s", Replace: "_"} + - FindBaseAddressString: "\0style-sheet\0" + - ReplaceString: {Offset: 1, Find: "s", Replace: "_"} + +Ignore ePub TOC navpoints: + - Enabled: no + - FindBaseAddressString: "\0navPoint\0" + - ReplaceString: {Offset: 1, Find: "n", Replace: "_"} +# The following patches are by jackie_w. + +Default ePub monospace font: + - Enabled: no + - Description: | + Updated for fw 4.19.14123: + This patch only affects standard ePub, not kepub. + + The Kobo firmware doesn't include a monospace font, you need to sideload one. + If the book's stylesheet specifies font-family:monospace; + then the ePub reader will try to use the "Courier" font. + + Unpatched the EPUB reader will now use any installed font with + a name beginning "Courier" as the default monospace font. + e.g. CourierStd or + Courier Prime, available at http://quoteunquoteapps.com/courierprime) + + If your sideloaded monospace fontname does not start with "Courier" then + enable this patch and change "Courier" in the replacement string to + another font name prefix (7 letters max.). For example, change + `normal/Courier` to `normal/Dark`, `bold/Courier` to `bold/Dark`, etc. to + use HP's Dark Courier font available at + http://h20000.www2.hp.com/hpsc/swd/public/detail?swItemId=lj611en + - FindReplaceString: {Find: "/normal/Courier", Replace: "/normal/Dark"} + - FindReplaceString: {Find: "/bold/Courier", Replace: "/bold/Dark"} + - FindReplaceString: {Find: "/italic/Courier", Replace: "/italic/Dark"} + - FindReplaceString: {Find: "/bolditalic/Courier", Replace: "/bolditalic/Dark"} diff --git a/src/nickel.yaml b/src/nickel.yaml new file mode 100644 index 0000000..9680145 --- /dev/null +++ b/src/nickel.yaml @@ -0,0 +1,569 @@ +# The following patch(es) are by geek1011 + +Show all games: + - Enabled: no + - Description: | + Shows all games in beta features. Sone firmware 4.20.14601, this patch is + not needed if you have developer mode enabled (search + devmodeon/devmodeoff). + - FindZlib: "#boggleContainer[devModeOn=false][qApp_deviceIsPika=true]" + - ReplaceZlib: {Find: "qproperty-visible: false;", Replace: "qproperty-visible: true;"} + +Remove forgot pin button from lock screen: + - Enabled: no + - Description: | + Removes the Forgot PIN -> Sign Out button from the lock screen. + If this is enabled and you forget your pin, you will need to + hard reset your Kobo. + - BaseAddress: 0x14405F3 + - ReplaceZlib: + Find: "#lblForgotPin[qApp_deviceIsDragon=true],\n#lblSignOut[qApp_deviceIsDragon=true] {\n font-size: 26px;\n}" + Replace: "#lblForgotPin,#lblSignOut{qproperty-visible:false;}" + - BaseAddress: 0x14459B0 + - ReplaceZlib: + Find: "#lblForgotPin[qApp_deviceIsDragon=true],\n#lblSignOut[qApp_deviceIsDragon=true] {\n font-size: 26px;\n}" + Replace: "#lblForgotPin,#lblSignOut{qproperty-visible:false;}" + +Increase size of kepub chapter progress chart: + - Enabled: no + - Description: Originally by oren64, rewritten for 4.16.13337 by geek1011. + - FindZlib: "#chapterSizes" + - ReplaceZlibGroup: + Replacements: + # Top padding is aready set to 15px, 25px, 33px, vertical aligned to middle. + # Progress chart bar sizes: + - Find: "#chapterSizes[qApp_deviceIsTrilogy=true] {\n max-height: 56px;\n min-height: 56px;\n}" + Replace: "#chapterSizes[qApp_deviceIsTrilogy=true] {\n max-height: 90px;\n min-height: 90px;\n min-width: 385px;\n max-width: 385px;\n}" + - Find: "#chapterSizes[qApp_deviceIsPhoenix=true] {\n max-height: 70px;\n min-height: 70px;\n}" + Replace: "#chapterSizes[qApp_deviceIsPhoenix=true] {\n max-height: 130px;\n min-height: 130px;\n min-width: 495px;\n max-width: 495px;\n}" + - Find: "#chapterSizes[qApp_deviceIsDragon=true] {\n max-height: 100px;\n min-height: 100px;\n}" + Replace: "#chapterSizes[qApp_deviceIsDragon=true] {\n max-height: 170px;\n min-height: 170px;\n min-width: 678px;\n max-width: 678px;\n}" + - Find: "#chapterSizes[qApp_deviceIsDaylight=true] {\n max-height: 130px;\n min-height: 130px;\n}" + Replace: "#chapterSizes[qApp_deviceIsDaylight=true] {\n max-height: 215px;\n min-height: 215px;\n min-width: 865px;\n max-width: 865px;\n}" +# The following patch(es) are ported from GeoffR's patch zips + +Reduce top/bottom page spacer: + - Enabled: no + - Description: | + Reduces the blank space that remains at the top/bottom of the page when + the "Chapter progress" / "Book progress" reading settings options are set to Off. + Spacer height is halved, customise by changing the min-height + max-height + values in the Replace lines below. Affects both ePub and KePub books. + - FindZlib: "MediumVertSpacer" + - ReplaceZlibGroup: + Replacements: + # Touch/Mini: 24px --> 12px + - Find: "MediumVertSpacer[qApp_deviceIsTrilogy=true] {\n min-height: 24px;\n max-height: 24px;\n}" + Replace: "MediumVertSpacer[qApp_deviceIsTrilogy=true] {\n min-height: 12px;\n max-height: 12px;\n}" + # Glo/Aura/Aura2ed: 32px --> 16px + - Find: "MediumVertSpacer[qApp_deviceIsPhoenix=true] {\n min-height: 32px;\n max-height: 32px;\n}" + Replace: "MediumVertSpacer[qApp_deviceIsPhoenix=true] {\n min-height: 16px;\n max-height: 16px;\n}" + # AuraHD/H2O/GloHD/ClaraHD: 44px --> 22px + - Find: "MediumVertSpacer[qApp_deviceIsDragon=true] {\n min-height: 44px;\n max-height: 44px;\n}" + Replace: "MediumVertSpacer[qApp_deviceIsDragon=true] {\n min-height: 22px;\n max-height: 22px;\n}" + # AuraOne/Forma: 56px --> 28px + - Find: "MediumVertSpacer[qApp_deviceIsDaylight=true] {\n min-height: 56px;\n max-height: 56px;\n}" + Replace: "MediumVertSpacer[qApp_deviceIsDaylight=true] {\n min-height: 28px;\n max-height: 28px;\n}" + # LibraH2O: 50px --> 25px + - Find: "MediumVertSpacer[qApp_deviceIsStorm=true] {\n min-height: 50px;\n max-height: 50px;\n}" + Replace: "MediumVertSpacer[qApp_deviceIsStorm=true] {\n min-height: 25px;\n max-height: 25px;\n}" + +Custom synopsis details line spacing: + - Enabled: no + - Description: Sets the line spacing for Book details synopsis. + - FindZlib: "body[qApp_deviceIsTrilogy=true] {\n line-height: 1.45em;" + - ReplaceZlibGroup: + Replacements: + # Touch/Mini (Trilogy) + - {Find: "line-height: 1.45em;", Replace: "line-height: 1.3em;"} + # Glo/Aura/Aura2E (Phoenix) + - {Find: "line-height: 1.4em;", Replace: "line-height: 1.3em;"} + # AuraHD/H2O/GloHD/ClaraHD (Dragon) and + # AuraOne (Daylight) and LibraH2O (Storm) + - {Find: "line-height: 1.35em;", Replace: "line-height: 1.3em;"} + +Custom synopsis font size: + - Enabled: no + - Description: Increase synopsis font size + - FindZlib: "body[qApp_deviceIsTrilogy=true] {\n font-size: 19px;" + - ReplaceZlibGroup: + Replacements: + - {Find: "font-size: 19px;", Replace: "font-size: 20px;"} # Touch/Mini (Trilogy) + - {Find: "font-size: 23px;", Replace: "font-size: 25px;"} # Glo/Aura/Aura2E (Phoenix) + - {Find: "font-size: 29px;", Replace: "font-size: 32px;"} # AuraHD/H2O (Dragon) + - {Find: "font-size: 32px;", Replace: "font-size: 35px;"} # GloHD/ClaraHD (Alyssum, Nova) + - {Find: "font-size: 34px;", Replace: "font-size: 37px;"} # LibraH2O (Storm) + - {Find: "font-size: 37px;", Replace: "font-size: 40px;"} # AuraONE/Forma (Daylight) + +Increase home screen cover size: + - Enabled: no + - PatchGroup: Home screen layout tweaks + - Description: Reduces the home screen margins, allowing larger cover images. + - FindZlib: "#row1col2" + - ReplaceZlibGroup: + Replacements: + # Touch/Mini (Trilogy) + - {Find: "qproperty-leftMargin: 26;", Replace: "qproperty-leftMargin: 10;"} + - {Find: "qproperty-rightMargin: 26;", Replace: "qproperty-rightMargin: 10;"} + # Glo/Aura/Aura2E (Phoenix) + - {Find: "qproperty-leftMargin: 36;", Replace: "qproperty-leftMargin: 12;"} + - {Find: "qproperty-rightMargin: 36;", Replace: "qproperty-rightMargin: 12;"} + # AuraHD/H2O/GloHD/ClaraHD (Dragon) + - {Find: "qproperty-leftMargin: 50;", Replace: "qproperty-leftMargin: 16;"} + - {Find: "qproperty-rightMargin: 50;", Replace: "qproperty-rightMargin: 16;"} + # AuraOne/Forma (Daylight) + - {Find: "qproperty-leftMargin: 65;", Replace: "qproperty-leftMargin: 20;"} + - {Find: "qproperty-rightMargin: 65;", Replace: "qproperty-rightMargin: 20;"} + # LibraH2O (Storm) + - {Find: "qproperty-leftMargin: 56;", Replace: "qproperty-leftMargin: 18;"} + - {Find: "qproperty-rightMargin: 56;", Replace: "qproperty-rightMargin: 18;"} +# The following patch(es) are ported from jackie_w's patches + +Dictionary pop-up - increase available text area: + - Enabled: no + - Description: | + Increase the area available for dictionary definitions in the dictionary pop-up + by reducing some of the excess whitespace used (header, footer, margins). + This patch was formerly known as 'Dictionary pop-up frame size increase', but in + fw 4.10.11591, Kobo removed access to the code which specifies pop-up frame size. + fw 4.12.12111, Kobo removed access to the code which could reduce footer size. + fw 4.20.14601 Kobo added new DictionaryViewFooter CSS stream to control footer height again. + # Part 1 + - FindZlib: "#InlineDictionaryView" + - ReplaceZlibGroup: + Replacements: + # Part 1a: #dictionary - reduce top/left margins + # Touch/Mini + - Find: "#dictionary[qApp_deviceIsTrilogy=true] {\n margin-top: 20px;\n margin-left: 10px;\n}" + Replace: "#dictionary[qApp_deviceIsTrilogy=true] {\n margin-top: 5px;\n margin-left: 0px;\n}" + # Glo/Aura/Aura2 + - Find: "#dictionary[qApp_deviceIsPhoenix=true] {\n margin-top: 20px;\n margin-left: 20px;\n}" + Replace: "#dictionary[qApp_deviceIsPhoenix=true] {\n margin-top: 7px;\n margin-left: 0px;\n}" + # AuraHD/H2O/H2O2/GloHD/ClaraHD + - Find: "#dictionary[qApp_deviceIsDragon=true] {\n margin-top: 30px;\n margin-left: 30px;\n}" + Replace: "#dictionary[qApp_deviceIsDragon=true] {\n margin-top: 10px;\n margin-left: 0px;\n}" + # AuraOne/Forma + - Find: "#dictionary[qApp_deviceIsDaylight=true] {\n margin-top: 42px;\n margin-left: 42px;\n}" + Replace: "#dictionary[qApp_deviceIsDaylight=true] {\n margin-top: 14px;\n margin-left: 0px;\n}" + # + # Part 1b: #header - reduce header height + # Touch/Mini + - Find: "#header[qApp_deviceIsTrilogy=true] {\n max-height: 46px;\n min-height: 46px;\n}" + Replace: "#header[qApp_deviceIsTrilogy=true] {\n max-height: 46px;\n min-height: 46px;\n}" + # Glo/Aura/Aura2 + - Find: "#header[qApp_deviceIsPhoenix=true] {\n max-height: 60px;\n min-height: 60px;\n}" + Replace: "#header[qApp_deviceIsPhoenix=true] {\n max-height: 50px;\n min-height: 50px;\n}" + # AuraHD/H2O/H2O2/GloHD/ClaraHD/LibraH2O + - Find: "#header[qApp_deviceIsDragon=true] {\n max-height: 90px;\n min-height: 90px;\n}" + Replace: "#header[qApp_deviceIsDragon=true] {\n max-height: 70px;\n min-height: 70px;\n}" + # AuraOne/Forma + - Find: "#header[qApp_deviceIsDaylight=true] {\n max-height: 120px;\n min-height: 120px;\n}" + Replace: "#header[qApp_deviceIsDaylight=true] {\n max-height: 90px;\n min-height: 90px;\n}" + # + # Part 1c: #mainContainer - reduce left/right margins + # Touch/Mini + - Find: "#mainContainer[qApp_deviceIsTrilogy=true] {\n qproperty-leftMargin: 12px;\n qproperty-rightMargin: 12px;\n}" + Replace: "#mainContainer[qApp_deviceIsTrilogy=true] {\n qproperty-leftMargin: 6px;\n qproperty-rightMargin: 6px;\n}" + # Glo/Aura/Aura2 + - Find: "#mainContainer[qApp_deviceIsPhoenix=true] {\n qproperty-leftMargin: 16px;\n qproperty-rightMargin: 16px;\n}" + Replace: "#mainContainer[qApp_deviceIsPhoenix=true] {\n qproperty-leftMargin: 8px;\n qproperty-rightMargin: 8px;\n}" + # AuraHD/H2O/H2O2/GloHD/ClaraHD + - Find: "#mainContainer[qApp_deviceIsDragon=true] {\n qproperty-leftMargin: 22px;\n qproperty-rightMargin: 22px;\n}" + Replace: "#mainContainer[qApp_deviceIsDragon=true] {\n qproperty-leftMargin: 11px;\n qproperty-rightMargin: 11px;\n}" + # AuraOne/Forma + - Find: "#mainContainer[qApp_deviceIsDaylight=true] {\n qproperty-leftMargin: 28px;\n qproperty-rightMargin: 28px;\n}" + Replace: "#mainContainer[qApp_deviceIsDaylight=true] {\n qproperty-leftMargin: 14px;\n qproperty-rightMargin: 14px;\n}" + # LibraH2O + - Find: "#mainContainer[qApp_deviceIsStorm=true] {\n qproperty-leftMargin: 25px;\n qproperty-rightMargin: 25px;\n}" + Replace: "#mainContainer[qApp_deviceIsStorm=true] {\n qproperty-leftMargin: 12px;\n qproperty-rightMargin: 12px;\n}" + # + # Part 2: DictionaryViewFooter - Reduce vertical height of footer + # Touch/Mini + - FindReplaceString: + Find: "DictionaryViewFooter[qApp_deviceIsTrilogy=true] {\n max-height: 46px;\n min-height: 46px;\n}" + Replace: "DictionaryViewFooter[qApp_deviceIsTrilogy=true] {\n max-height: 40px;\n min-height: 40px;\n}" + MustMatchLength: yes + # Glo/Aura/Aura2 + - FindReplaceString: + Find: "DictionaryViewFooter[qApp_deviceIsPhoenix=true] {\n max-height: 60px;\n min-height: 60px;\n}" + Replace: "DictionaryViewFooter[qApp_deviceIsPhoenix=true] {\n max-height: 50px;\n min-height: 50px;\n}" + MustMatchLength: yes + # AuraHD/H2O/H2O2/GloHD/ClaraHD/LibraH2O + - FindReplaceString: + Find: "DictionaryViewFooter[qApp_deviceIsDragon=true] {\n max-height: 90px;\n min-height: 90px;\n}" + Replace: "DictionaryViewFooter[qApp_deviceIsDragon=true] {\n max-height: 60px;\n min-height: 60px;\n}" + MustMatchLength: yes + # AuraOne/Forma + - FindReplaceString: + Find: "DictionaryViewFooter[qApp_deviceIsDaylight=true] {\n max-height: 120px;\n min-height: 120px;\n}" + Replace: "DictionaryViewFooter[qApp_deviceIsDaylight=true] {\n max-height: 80px;\n min-height: 80px;\n}" + MustMatchLength: yes + +Increase Book Details synopsis area: + - Enabled: no + - Description: | + Book details page + - Increase height of bottom half (Synopsis) by + decreasing height of top half (Cover, Title, Author, Series) + - See https://www.mobileread.com/forums/showpost.php?p=3311354&postcount=134 + - fw 4.12/4.16 - rewritten by jackie_w to replace oren64's patch + - FindZlib: "#bookInfoWidget" + - ReplaceZlibGroup: + Replacements: + # Portrait mode: #bookInfoWidget[isLandscape=false]: + - {Find: "height: 300px;", Replace: "height: 200px;"} #Touch/Mini + - {Find: "height: 390px;", Replace: "height: 230px;"} #Glo/Aura/Aura2 + - {Find: "height: 550px;", Replace: "height: 370px;"} #AuraHD/H2O/H2O2/GloHD/ClaraHD + - {Find: "height: 642px;", Replace: "height: 425px;"} #LibraH2O (*untested) + - {Find: "height: 715px;", Replace: "height: 500px;"} #AuraOne/Forma + # Landscape mode: #bookInfoWidget[isLandscape=true]: + - {Find: "height: 210px;", Replace: "height: 200px;"} #Touch/Mini + - {Find: "height: 265px;", Replace: "height: 230px;"} #Glo/Aura/Aura2 + - {Find: "height: 420px;", Replace: "height: 370px;"} #AuraHD/H2O/H2O2/GloHD/ClaraHD + - {Find: "height: 490px;", Replace: "height: 425px;"} #LibraH2O (*untested) + - {Find: "height: 540px;", Replace: "height: 500px;"} #AuraOne/Forma + +Increase library cover size: + - Enabled: no + - Description: | + Increase the cover thumbnail size in My Books main book list + See screenshots - https://www.mobileread.com/forums/showpost.php?p=3241532&postcount=82 + N.B. Settings for LibraH2O are an initial guess. User testing required. + fw 4.17 - rewritten by jackie_w to replace oren64's patch + - FindZlib: "#coverPixmapView" + - ReplaceZlibGroup: + Replacements: + # coverPixmapView increase cover thumbnail width/height: + # Touch/Mini (Trilogy) + - {Find: "width: 60px;", Replace: "width: 85px;"} + - {Find: "height: 90px;", Replace: "height: 100px;"} + # Glo/Aura/Aura2 (Phoenix) + - {Find: "width: 70px;", Replace: "width: 100px;"} + - {Find: "height: 110px;", Replace: "height: 130px;"} + # AuraHD/H2O/H2O2/GloHD/ClaraHD (Dragon) + - {Find: "width: 108px;", Replace: "width: 140px;"} + - {Find: "height: 168px;", Replace: "height: 190px;"} + # AuraOne/Forma (Daylight) + - {Find: "width: 140px;", Replace: "width: 190px;"} + - {Find: "height: 218px;", Replace: "height: 255px;"} + # LibraH2O (Storm) *untested* + - {Find: "width: 126px;", Replace: "width: 165px;"} + - {Find: "height: 196px;", Replace: "height: 225px;"} + +Custom collection/author header title font: + - Enabled: no + - Description: | + Change font appearance in Collection and Author list header + See https://www.mobileread.com/forums/showpost.php?p=3520879&postcount=42 + fw 4.17.13694 rewritten by jackie_w to replace + oren64's patch "Custom font to collection and author titles" + # First set: + - FindZlib: "#header,\n#backButton,\n#moreLink {" + - ReplaceZlibGroup: + Replacements: + # #header #headerTitle Change font-family, case, font-size + # + # Un-comment next line to un-force UPPERCASE + #- {Find: "text-transform: uppercase", Replace: "text-transform: none;"} + # + # Change font-family. + # Note: If new font-family name contains spaces wrap in 'single quotes' + # e.g. 'Kobo Nickel' + # Un-comment & edit next line to change font-family + #- {Find: "font-family: Avenir;", Replace: "font-family: 'Kobo Nickel';"} + # + # Increase font-size. + # Touch/Mini (Trilogy) + - {Find: "font-size: 16px;", Replace: "font-size: 28px;"} + # Glo/Aura/Aura2 (Phoenix) + - {Find: "font-size: 20px;", Replace: "font-size: 36px;"} + # AuraHD/H2O/H2O2/GloHD/ClaraHD (Dragon) + - {Find: "font-size: 28px;", Replace: "font-size: 42px;"} + # LibraH2O (Storm) + - {Find: "font-size: 32px;", Replace: "font-size: 46px;"} + # AuraOne/Forma (Daylight) + - {Find: "font-size: 36px;", Replace: "font-size: 50px;"} + # Second set (do the same thing as above): + - FindZlib: "#header,\n#backButton {" + - ReplaceZlibGroup: + Replacements: + - {Find: "font-size: 16px;", Replace: "font-size: 28px;"} + - {Find: "font-size: 20px;", Replace: "font-size: 36px;"} + - {Find: "font-size: 28px;", Replace: "font-size: 42px;"} + - {Find: "font-size: 32px;", Replace: "font-size: 46px;"} + - {Find: "font-size: 36px;", Replace: "font-size: 50px;"} + +Reduce new header/footer height: + - Enabled: no + - Description: | + Reduce new reading header/footer heights when they are enabled. + Affects both ePubs and KePubs. + This patch may be of interest to those who used to enable the old + "Custom menubar - reduce height by 33%" + - FindZlib: "ReadingFooter" + - ReplaceZlibGroup: + # Adjust the Replace values of min-height/max-height as you wish. + # Keep min-height=max-height + Replacements: + # ReadingFooter Reduce min/max height by 33% + # Touch/Mini (Trilogy) + - Find: "ReadingFooter[qApp_deviceIsTrilogy=true] {\n min-height: 56;\n max-height: 56px;\n}" + Replace: "ReadingFooter[qApp_deviceIsTrilogy=true] {\n min-height: 37px;\n max-height: 37px;\n}" + # Glo/Aura/Aura2E (Phoenix) + - Find: "ReadingFooter[qApp_deviceIsPhoenix=true] {\n min-height: 71px;\n max-height: 71px;\n}" + Replace: "ReadingFooter[qApp_deviceIsPhoenix=true] {\n min-height: 47px;\n max-height: 47px;\n}" + # AuraHD/H2O/GloHD/ClaraHD (Dragon) + - Find: "ReadingFooter[qApp_deviceIsDragon=true] {\n min-height: 101px;\n max-height: 101px;\n}" + Replace: "ReadingFooter[qApp_deviceIsDragon=true] {\n min-height: 66px;\n max-height: 66px;\n}" + # AuraOne/Forma (Daylight) + - Find: "ReadingFooter[qApp_deviceIsDaylight=true] {\n min-height: 131px;\n max-height: 131px;\n}" + Replace: "ReadingFooter[qApp_deviceIsDaylight=true] {\n min-height: 86px;\n max-height: 86px;\n}" + # LibraH2O (Storm) + - Find: "ReadingFooter[qApp_deviceIsStorm=true] {\n min-height: 118px;\n max-height: 118px;\n}" + Replace: "ReadingFooter[qApp_deviceIsStorm=true] {\n min-height: 78px;\n max-height: 78px;\n}" + +Custom new header/footer font: + - Enabled: no + - Description: | + This patch allows you to change font-family and/or font-size in the + new header/footer. They will automatically be a matched pair. Full details & screenshots at + https://www.mobileread.com/forums/showpost.php?p=3897175&postcount=4 + N.B: This patch is not suitable for Japanese/Chinese locale users + + - FindZlib: "ReadingFooter" + - ReplaceZlibGroup: + Replacements: + # Part 1. Customise font-family (built-in or sideloaded font) + # Please see notes at + # https://www.mobileread.com/forums/showpost.php?p=3896190&postcount=2 + # for general considerations whenever you change font-family in the Kobo GUI + + # #caption[newHeader=true] and #caption[newFooter=true] + # N.B: If new font-family contains spaces wrap in 'single quotes', e.g. 'Kobo Nickel' + + # Un-comment and edit replacement font-family to change header/footer font + #- {Find: "font-family: Avenir;", Replace: "font-family:Avenir;"} + + + # Part 2. + # 2a. Customise font-size for header/footer + # 2b. (optional) Fine-tune footer text position to avoid cutting bottom progressbar + # (optional) Fine-tune header text position to avoid possible shadow from top bezel + # May be useful to those who have also enabled patch 'Reduce new header/footer height' + # and have customised it to aggressively reduce header/footer height. + + # 2a. Change font-size for models other than Touch/Mini (header & footer simultaneously) + # #caption[newHeader=true] & #caption[newFooter=true] + # Glo/Aura/Aura2E (Phoenix) + - Find: "[qApp_deviceIsPhoenix=true] {\n font-size: 16px;\n}" + Replace: "[qApp_deviceIsPhoenix=true] {\n font-size: 16px;\n}" + # AuraHD/H2O (Dragon) + - Find: "[qApp_deviceIsDragon=true] {\n font-size: 21px;\n}" + Replace: "[qApp_deviceIsDragon=true] {\n font-size: 21px;\n}" + # GloHD (Alyssum) + - Find: "[qApp_deviceIsAlyssum=true] {\n font-size: 23px;\n}" + Replace: "[qApp_deviceIsAlyssum=true] {\n font-size: 23px;\n}" + # ClaraHD (Nova) + - Find: "[qApp_deviceIsNova=true] {\n font-size: 23px;\n}" + Replace: "[qApp_deviceIsNova=true] {\n font-size: 23px;\n}" + # LibraH2O (Storm) + - Find: "[qApp_deviceIsStorm=true] {\n font-size: 25px;\n}" + Replace: "[qApp_deviceIsStorm=true] {\n font-size: 25px;\n}" + # AuraOne/Forma (Daylight) + - Find: "[qApp_deviceIsDaylight=true] {\n font-size: 27px;\n}" + Replace: "[qApp_deviceIsDaylight=true] {\n font-size: 27px;\n}" + + # N.B: If you do not have a Touch/Mini and your header/footer + # positions are exactly as you like them you do not need the + # next 3 Find/Replace pairs. + # Leave them as-is or comment them out entirely and forget about them. + + # Don't change the following pair. It exists to split the header/footer styles + # which were merged in 4.19.14123. + - Find: "#caption[newHeader=true][qApp_deviceIsTrilogy=true],\n#caption[newFooter=true][qApp_deviceIsTrilogy=true] {\n font-size: 13px;\n}" + Replace: "#caption[newHeader=true][qApp_deviceIsTrilogy=true] {\n font-size: 13px;\n}\n#caption[newFooter=true][qApp_deviceIsTrilogy=true] {\n font-size: 13px;\n}" + + # 2a. Touch/Mini users only: Adjust footer font-size as required. + # 2b. All models (optional): Fine-tune footer position by adjusting margin-top value + # A negative margin-top (e.g -10px) moves the footer text slightly upwards + # further from the bottom bezel/progressbar, closer to the page content + - Find: "#caption[newFooter=true][qApp_deviceIsTrilogy=true] {\n font-size: 13px;\n}" + Replace: "#caption[newFooter=true] {\n font-size: 13px; margin-top: 0px;}" + + # 2a. Touch/Mini users only: Adjust header font-size as required. + # 2b. All models (optional): Fine-tune header position by adjusting margin-bottom value. + # A negative margin-bottom (e.g -10px) moves the header text slightly downwards + # further from the top bezel, closer to the page content + - Find: "#caption[newHeader=true][qApp_deviceIsTrilogy=true] {\n font-size: 13px;\n}" + Replace: "#caption[newHeader=true] {\n font-size: 13px; margin-bottom: 0px;}" + + # Don't change anything below. It exists to free up some space for + # your changes above by removing Japanese/Chinese-specific CSS code blocks + # so that kobopatch will run without giving some kind of 'too long' error message. + - {Find: "#caption[newHeader=true][localeName=\"ja\"],\n#caption[newFooter=true][localeName=\"ja\"] {\n font-family: Sans-SerifJP, sans-serif;\n font-style: normal;\n}\n", Replace: "\n"} + - {Find: "#caption[newHeader=true][localeName=\"zh\"],\n#caption[newFooter=true][localeName=\"zh\"] {\n font-family: Sans-SerifZH-Simplified, sans-serif;\n font-style: normal;\n}\n", Replace: "\n"} + - {Find: "#caption[newHeader=true][localeName=\"zh-HK\"],\n#caption[newFooter=true][localeName=\"zh-HK\"] {\n font-family: Sans-SerifZH-Traditional, sans-serif;\n font-style: normal;\n}\n", Replace: "\n"} + - {Find: "#caption[newHeader=true][localeName=\"zh-TW\"],\n#caption[newFooter=true][localeName=\"zh-TW\"] {\n font-family: Sans-SerifZH-Traditional, sans-serif;\n font-style: normal;\n}\n", Replace: "\n"} + +Custom page navigation scrubber: + - Enabled: no + - Description: | + This patch allows you to customise various parts of the new 'scrubber'. Full details & screenshots at: + https://www.mobileread.com/forums/showpost.php?p=3897174&postcount=3 + N.B: This patch is not suitable for Japanese/Chinese locale users + + - FindZlib: "#scrubberContainer" + - ReplaceZlibGroup: + Replacements: + # Part 1. Customise all 3 of these buttons + # - Left & Right 'Back to page nnn' (#revertLeft, #revertRight) + # - Current chapter name (#chapter) + + # 1a. Customise font-size for desired model(s): + # Touch/Mini (Trilogy) + - Find: "[qApp_deviceIsTrilogy=true] {\n font-size: 19px;" + Replace: "[qApp_deviceIsTrilogy=true] {\n font-size: 19px;" + # Glo/Aura/Aura2E (Phoenix) + - Find: "[qApp_deviceIsPhoenix=true] {\n font-size: 23px;" + Replace: "[qApp_deviceIsPhoenix=true] {\n font-size: 23px;" + # AuraHD/H2O (Dragon) + - Find: "[qApp_deviceIsDragon=true] {\n font-size: 29px;" + Replace: "[qApp_deviceIsDragon=true] {\n font-size: 29px;" + # GloHD (Alyssum) + - Find: "[qApp_deviceIsAlyssum=true] {\n font-size: 32px;" + Replace: "[qApp_deviceIsAlyssum=true] {\n font-size: 32px;" + # ClaraHD (Nova) + - Find: "[qApp_deviceIsNova=true] {\n font-size: 32px;" + Replace: "[qApp_deviceIsNova=true] {\n font-size: 32px;" + # LibraH2O (Storm) + - Find: "[qApp_deviceIsStorm=true] {\n font-size: 34px;" + Replace: "[qApp_deviceIsStorm=true] {\n font-size: 34px;" + # AuraOne/Forma (Daylight) + - Find: "[qApp_deviceIsDaylight=true] {\n font-size: 37px;" + Replace: "[qApp_deviceIsDaylight=true] {\n font-size: 37px;" + + # 1b. Customise other font properties of these 3 buttons (all models): + # - font-family (built-in or sideloaded font) + # NB: If new font-family name contains spaces, wrap in 'single quotes', + # e.g. font-family:'Kobo Nickel'; + # - font-weight (bold or normal) + # - font-style (italic or normal) + - Find: "{\n font-family: Avenir;\n font-weight: bold;\n font-style: normal;\n}" + Replace: "{font-family:Avenir; font-weight:bold; font-style:normal;}" + # Users with CSS knowledge can add extra style properties as desired, + # e.g. to make them look more like buttons and less like labels, + # use this Replace instead. If it can be done with CSS you can do it here. + #Replace: "{font-family:Avenir; font-weight:normal; font-style:normal; background-color:#ddd;}" + + + # Part 2. Customise the central 'Page x of y' label (#page) + # Provided for those who want to create a uniform look & feel + # 2a. Customise font-size for desired model(s): + # Touch/Mini (Trilogy) + - Find: "#page[qApp_deviceIsTrilogy=true] {\n font-size: 17px;" + Replace: "#page[qApp_deviceIsTrilogy=true] {\n font-size: 17px;" + # Glo/Aura/Aura2E (Phoenix) + - Find: "#page[qApp_deviceIsPhoenix=true] {\n font-size: 22px;" + Replace: "#page[qApp_deviceIsPhoenix=true] {\n font-size: 22px;" + # AuraHD/H2O (Dragon) + - Find: "#page[qApp_deviceIsDragon=true] {\n font-size: 26px;" + Replace: "#page[qApp_deviceIsDragon=true] {\n font-size: 26px;" + # GloHD (Alyssum) + - Find: "#page[qApp_deviceIsAlyssum=true] {\n font-size: 30px;" + Replace: "#page[qApp_deviceIsAlyssum=true] {\n font-size: 30px;" + # ClaraHD (Nova) + - Find: "#page[qApp_deviceIsNova=true] {\n font-size: 30px;" + Replace: "#page[qApp_deviceIsNova=true] {\n font-size: 30px;" + # LibraH2O (Storm) + - Find: "#page[qApp_deviceIsStorm=true] {\n font-size: 30px;" + Replace: "#page[qApp_deviceIsStorm=true] {\n font-size: 30px;" + # AuraOne/Forma (Daylight) + - Find: "#page[qApp_deviceIsDaylight=true] {\n font-size: 34px;" + Replace: "#page[qApp_deviceIsDaylight=true] {\n font-size: 34px;" + + # 2b. Customise other font properties of 'Page x of y' label (all models) + # e.g. text-transform (uppercase or none) + # font-family, font-weight, font-style, etc. + # Un-comment next 2 lines and change Replace CSS as desired + #- Find: "#page {\n padding-left: 0px;\n}" + # Replace: "#page {padding-left: 0px; font-family:Georgia; text-transform:none;}" + +Customise Header back button: + - Enabled: no + - Description: | + Customise in-book button (top left corner) for 'Back to Home', 'Back to My Books' etc + - FindZlib: "#ReadingMenuView" + - ReplaceZlibGroup: + Replacements: + # 'Back to Home' button un-bolded + - Find: "#backLabel #label {\n font-family: Avenir;\n font-style: normal;\n font-weight: bold;" + Replace: "#backLabel #label {\n font-family:Avenir;\n font-style:normal;\n font-weight:normal;" +# The following patch(es) are ported from oren64's patches + +Increase headlines font: + - Enabled: no + - Description: | + Increase the font-size of the tab header labels in My Books, Activity, Bookstore... + See https://www.mobileread.com/forums/showpost.php?p=3931942&postcount=183 + - FindZlib: "#tabContainer > N3TabItem" + - ReplaceZlib: + Find: "#tabContainer > N3TabItem[qApp_deviceIsTrilogy=true] {\n font-size: 16px;\n}" + Replace: "#tabContainer > N3TabItem[qApp_deviceIsTrilogy=true] {\n font-size: 28px;\n}" + - ReplaceZlib: + Find: "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n font-size: 20px;\n}" + Replace: "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n font-size: 36px;\n}" + - ReplaceZlib: + Find: "#tabContainer > N3TabItem[qApp_deviceIsDragon=true] {\n font-size: 28px;\n}" + Replace: "#tabContainer > N3TabItem[qApp_deviceIsDragon=true] {\n font-size: 42px;\n}" + - ReplaceZlib: + Find: "#tabContainer > N3TabItem[qApp_deviceIsStorm=true] {\n font-size: 32px;\n}" + Replace: "#tabContainer > N3TabItem[qApp_deviceIsStorm=true] {\n font-size: 46px;\n}" + - ReplaceZlib: + Find: "#tabContainer > N3TabItem[qApp_deviceIsDaylight=true] {\n font-size: 36px;\n}" + Replace: "#tabContainer > N3TabItem[qApp_deviceIsDaylight=true] {\n font-size: 50px;\n}" + +New home screen subtitle custom font: + - Enabled: no + - Description: | + Increase subtitle font size, font color black. Works best when used + with with patch `New home screen increasing cover size` + - FindZlib: "MetaDataLabel {\n color: #666666;\n qproperty-indent: 0;\n}" + - ReplaceZlib: {Find: "MetaDataLabel {\n color: #666666;\n qproperty-indent: 0;\n}", Replace: "MetaDataLabel {\n color: #000000;\n qproperty-indent: 0;\n}"} + - ReplaceZlib: + Find: "MetaDataLabel[qApp_deviceIsTrilogy=true] {\n font-size: 13px;\n}" + Replace: "MetaDataLabel[qApp_deviceIsTrilogy=true] {\n font-size: 14px;\n}" + - ReplaceZlib: + Find: "MetaDataLabel[qApp_deviceIsPhoenix=true] {\n font-size: 17px;\n}" + Replace: "MetaDataLabel[qApp_deviceIsPhoenix=true] {\n font-size: 18px;\n}" + - ReplaceZlib: + Find: "MetaDataLabel[qApp_deviceIsDragon=true] {\n font-size: 24px;\n}" + Replace: "MetaDataLabel[qApp_deviceIsDragon=true] {\n font-size: 26px;\n}" + - ReplaceZlib: + Find: "MetaDataLabel[qApp_deviceIsDaylight=true] {\n font-size: 31px;\n}" + Replace: "MetaDataLabel[qApp_deviceIsDaylight=true] {\n font-size: 34px;\n}" + +Remove footer (row3) and increase cover size on new home screen: + - Enabled: no + - PatchGroup: Home screen layout tweaks + - FindZlib: "#mainContainer[qApp_deviceIsTrilogy=true] {\n qproperty-leftMargin: 26;" + - ReplaceZlibGroup: + Replacements: + - Find: "#mainContainer[qApp_deviceIsTrilogy=true] {\n qproperty-leftMargin: 26;\n qproperty-rightMargin: 26;\n qproperty-topMargin: 96;\n qproperty-bottomMargin: 26;\n qproperty-spacing: 10;\n}" + Replace: "#mainContainer[qApp_deviceIsTrilogy=true] {\n qproperty-leftMargin: 10;\n qproperty-rightMargin: 10;\n qproperty-topMargin: 96;\n qproperty-bottomMargin: 26;\n qproperty-spacing: 10;\n}" + - Find: "#mainContainer[qApp_deviceIsPhoenix=true] {\n qproperty-leftMargin: 36;\n qproperty-rightMargin: 36;\n qproperty-topMargin: 126;\n qproperty-bottomMargin: 36;\n qproperty-spacing: 14;\n}" + Replace: "#mainContainer[qApp_deviceIsPhoenix=true] {\n qproperty-leftMargin: 12;\n qproperty-rightMargin: 12;\n qproperty-topMargin: 126;\n qproperty-bottomMargin: 36;\n qproperty-spacing: 14;\n}" + - Find: "#mainContainer[qApp_deviceIsDragon=true] {\n qproperty-leftMargin: 50;\n qproperty-rightMargin: 50;\n qproperty-topMargin: 170;\n qproperty-bottomMargin: 50;\n qproperty-spacing: 20;\n}" + Replace: "#mainContainer[qApp_deviceIsDragon=true] {\n qproperty-leftMargin: 16;\n qproperty-rightMargin: 16;\n qproperty-topMargin: 170;\n qproperty-bottomMargin: 50;\n qproperty-spacing: 20;\n}" + - Find: "#mainContainer[qApp_deviceIsDaylight=true] {\n qproperty-leftMargin: 65;\n qproperty-rightMargin: 65;\n qproperty-topMargin: 220;\n qproperty-bottomMargin: 65;\n qproperty-spacing: 26;\n}" + Replace: "#mainContainer[qApp_deviceIsDaylight=true] {\n qproperty-leftMargin: 20;\n qproperty-rightMargin: 20;\n qproperty-topMargin: 220;\n qproperty-bottomMargin: 65;\n qproperty-spacing: 26;\n}" + # Note: this shouldn't conflict with the below patch, as the original row1col2 rule is kept intact, and there's no harm in duplicate rules. + - Find: "#row1col2 {\n qproperty-visible: false;\n}" + Replace: "#row1col2 {\n qproperty-visible: false;\n}\n#row3 {\n qproperty-visible: false;\n}" + +Remove footer (row3) on new home screen: + - Enabled: no + - PatchGroup: Home screen visibility tweaks + - FindZlib: "#row1col2" + - ReplaceZlib: + Find: "#row1col2 {\n qproperty-visible: false;\n}" + Replace: "#row1col2 {\n qproperty-visible: false;\n}\n#row3 {\n qproperty-visible: false;\n}"