kobopatch-conf/src/libnickel.so.1.0.0.yaml

1438 lines
86 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# The following patch(es) were made by GeoffR, and most are updated by pgaskin (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<double>::append(double const&)"}, ReplaceInstNOP: true}
- ReplaceBytes: {Offset: 86, FindInstBLX: {SymPLT: "QList<double>::append(double const&)"}, ReplaceInstNOP: true}
- ReplaceBytes: {Offset: 128, FindInstBLX: {SymPLT: "QList<double>::append(double const&)"}, ReplaceInstNOP: true}
- ReplaceBytes: {Offset: 188, FindInstBLX: {SymPLT: "QList<double>::append(double const&)"}, ReplaceInstNOP: true}
- ReplaceBytes: {Offset: 290, FindInstBLX: {SymPLT: "QList<double>::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<double>::append(double const&)
- ReplaceBytes: {Offset: 0, FindInstBLX: {SymPLT: "QList<double>::append(double const&)"}, ReplaceH: 00 00 00 00} # clear out the BLX
- ReplaceBytes: {Offset: 20, FindInstBLX: {SymPLT: "QList<double>::append(double const&)"}, ReplaceH: 00 00 00 00} # clear out the BLX
- ReplaceBytes: {Offset: 0, FindH: 00 00, ReplaceH: A9 46} # mov sb, r5
- ReplaceBytes: {Offset: 2, FindH: 00 00, ReplaceH: 00 25} # 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, ReplaceH: 20 46} # mov r0, r4
- ReplaceBytes: {Offset: 8, FindH: 00 23, ReplaceH: 04 A1} # adr r1, #0x10
- ReplaceBytes: {Offset: 10, FindH: 07 F1, ReplaceH: 29 44} # add r1, r5
- ReplaceBytes: {Offset: 12, FindH: 80 01 20 46, ReplaceInstBLX: {SymPLT: "QList<double>::append(double const&)"}}
- ReplaceBytes: {Offset: 16, FindH: 61 E9, ReplaceH: 08 35} # add r5, #8 (sizeof(double))
- ReplaceBytes: {Offset: 18, FindH: 1C 23, ReplaceH: 70 2D} # cmp r5, 112 (14*sizeof(double))
- ReplaceBytes: {Offset: 20, FindH: 00 00, ReplaceH: F7 D1} # bne #-10
# jump to the rest of the new code
- ReplaceBytes: {Offset: 22, FindH: 00 00, ReplaceH: 7B E0} # b #250 (356 (84 + 22))
- ReplaceBytes: {Offset: 24, FindH: 6A A3 D3 E9, ReplaceInstNOP: true} # unused
# new table: 14 8-aligned doubles
- BaseAddress: {Sym: "ReadingSettings::lineHeightScalars() const", Rel: 112} # right after previous instruction (84 + 24 + 4)
- ReplaceBytes: {Offset: 12, FindInstBLX: {SymPLT: "QList<double>::append(double const&)"}, ReplaceH: 00 00 00 00} # first, clear out the BLXs in the way
- ReplaceBytes: {Offset: 32, FindInstBLX: {SymPLT: "QList<double>::append(double const&)"}, ReplaceH: 00 00 00 00}
- ReplaceBytes: {Offset: 58, FindInstBLX: {SymPLT: "QList<double>::append(double const&)"}, ReplaceH: 00 00 00 00}
- ReplaceBytes: {Offset: 78, FindInstBLX: {SymPLT: "QList<double>::append(double const&)"}, ReplaceH: 00 00 00 00}
- ReplaceBytes: {Offset: 100, FindInstBLX: {SymPLT: "QList<double>::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 right after the second-last QList<double>::append(double const&)
- ReplaceBytes: {Offset: 18, FindInstBLX: {SymPLT: "QList<double>::append(double const&)"}, ReplaceH: 00 00 00 00} # clear the BLX in the way of the last two replacements
# initialise loop counter
- ReplaceBytes: {Offset: 0, FindH: 00 23, ReplaceH: 00 25} # movs r5, #0
# loop to load 10 vals from old table (CDCC CCCC CCCC F03F 1F85)
- ReplaceBytes: {Offset: 2, FindH: 00 22, ReplaceH: 20 46} # mov r0, r4
- ReplaceBytes: {Offset: 4, FindH: C4 F2 08 03, ReplaceH: 0F F2 A4 01} # adr.w r1, #168 (old_table_start - (356 + 4) = 524 - 360)
- ReplaceBytes: {Offset: 8, FindH: 07 F1, ReplaceH: 29 44} # add r1, r5
- ReplaceBytes: {Offset: 10, FindH: 80 01 20 46, ReplaceInstBLX: {SymPLT: "QList<double>::append(double const&)"}}
- ReplaceBytes: {Offset: 14, FindH: 61 E9, ReplaceH: 08 35} # adds r5, #8 (sizeof(double))
- ReplaceBytes: {Offset: 16, FindH: 02 23, ReplaceH: 50 2D} # cmp r5, #80 (sizeof(double) * 10)
- ReplaceBytes: {Offset: 18, FindH: 00 00, ReplaceH: F6 D1} # bne #-12 (18 - 2)
# 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<double>::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 44, then in steps
# of 2 up to size 68, then in steps of 4 up to the largest size:
#
# Touch/Mini: 8px - 90px (39 steps)
# AuraHD/AuraH2O/Libra2: 8px - 150px (54 steps)
# GloHD/ClaraHD: 10px - 150px (52 steps)
# LibraH2O: 11px - 150px (51 steps)
# AuraOne/Forma/Elipsa/Sage: 14px - 195px (59 steps)
# Aura/Glo/Nia: 8px - 122px (47 steps)
#
# 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:
#
# Touch/Mini: 8px - 80px (52 steps)
# AuraHD/AuraH2O/Libra2: 8px - 108px (59 steps)
# GloHD/ClaraHD: 10px - 108px (57 steps)
# LibraH2O: 11px - 108px (56 steps)
# AuraOne/Forma/Elipsa/Sage: 14px - 132px (59 steps)
# Aura/Glo/Nia: 8px - 88px (54 steps)
#
# Note (pgaskin): The device values can be determined with info from
# https://gist.github.com/pgaskin/613b34c23f026f7c39c50ee32f5e167e and
# the Device::is* calls.
#
# This patch was rewritten for 18220 by @shermp.
#
- BaseAddress: "N3FontTypeUtil::fontSizes()"
# Initial font size:
- ReplaceInt: {Offset: 378, Find: 8, Replace: 8} # Other devices
- ReplaceInt: {Offset: 374, Find: 11, Replace: 11} # LibraH2O (storm)
- ReplaceInt: {Offset: 36, Find: 10, Replace: 10} # GloHD/ClaraHD (alyssum nova)
- ReplaceInt: {Offset: 404, Find: 14, Replace: 14} # Forma/AuraOne/Sage/Elipsa (daylight)
# Increment:
- ReplaceInt: {Offset: 222, Find: 21, Replace: 43} # Add font sizes in increments of 1 until this size exceeded
- ReplaceInt: {Offset: 228, Find: 22, Replace: 44} # Continue from this font size
- ReplaceInt: {Offset: 250, Find: 49, Replace: 67} # Add font sizes in increments of 2 until this size exceeded
- ReplaceInt: {Offset: 256, Find: 50, Replace: 68} # Continue from this font size
# Now increment by +4 until final font size:
- ReplaceInt: {Offset: 420, Find: 90, Replace: 80} # Other devices
- ReplaceInt: {Offset: 422, Find: 122, Replace: 88} # Aura/Glo/Nia (phoenix)
- ReplaceInt: {Offset: 48, Find: 150, Replace: 108} # LibraH2O/AuraHD/ClaraHD/GloHD/AuraH2O/Libra2 (dragon)
- ReplaceInt: {Offset: 400, Find: 195, Replace: 132} # Forma/AuraOne/Sage/Elipsa (daylight)
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:
- BaseAddress: "N3SettingsPowerView::initChoices()"
- ReplaceInt: {Offset: 56, Find: 5, Replace: 10}
- ReplaceInt: {Offset: 118, Find: 10, Replace: 20}
- ReplaceInt: {Offset: 180, Find: 15, Replace: 30}
- ReplaceInt: {Offset: 240, Find: 30, Replace: 60}
- ReplaceInt: {Offset: 300, Find: 45, Replace: 120}
- ReplaceInt: {Offset: 360, 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.)
# == "justify"
- ReplaceBytes: {Base: "KepubBookReader::pageStyleCss(bool)", Offset: 1904, FindInstBLX: {SymPLT: "QString::operator==(QLatin1String) const"}, ReplaceH: 01 20 01 20} # Alternative 1: Always turn KePub hyphenation on
# - ReplaceBytes: {Base: "KepubBookReader::pageStyleCss(bool)", Offset: 1904, 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 <div> instead of <p> for paragraphs, or wrapped each
paragraph in a <span> 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 <span> 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}
# MISSING: KePub constant font sharpness (not enough room for neutralizing the QString arg; we will probably need to patch that one out)
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
# MISSING: Ignore .otf fonts (this will probably need to become a fontickle patch)
# 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 <blockquote>.
4.24.15676: enforced update to accommodate Kobo changes related to new
dictionaries being released Oct 1st 2020
See https://www.mobileread.com/forums/showpost.php?p=3521137&postcount=48
for screenshots
4.32.19501: major font handling changes. Customising font-family now very limited
#
You can change one or more of the following properties:
- font-family (very limited choice from fw >= 4.32.19501)
- font-size
- line-height
#
These are the Kobo defaults
Glo - serif (Georgia) 23px 1.4em
H2O - serif (Georgia) 29px 1.4em
GloHD - serif (Georgia) 32px 1.4em
AuraONE - serif (Georgia) 42px 1.4em
# Stage 1: Change DictionaryView to remove some %variables
# from:
# body { padding-left: %3px; }
# body { font: %1px %4, serif; line-height: 1.4em; }
# span.word { font-weight: bold; font-size: 130%; margin-left: -%3px; }
# div.descriptionFont { font-family: serif; }
# ol { font-size: %1px; margin-left: %2em; margin-top: 0px; }
# ol p { font-size: %1px; }
# i, i * { font-style: italic; }
# b, b * { font-weight: bold; }
# .sc, .sc * { font-variant: small-caps; }
# .block, .border { border-radius: 3px; padding: 0em .2em; font-size: 90%; }
# to:
# body {font-size:%1px; line-height:1.40em; font-family:%4, serif ;}
# body {padding-left:0.5em}
# span.word {font-weight:bold; font-size:130%; margin-left:-0.3em}
# ol {margin-left:1em; margin-top:0}
# blockquote {margin:.3em 0 .3em 1em}
# blockquote>blockquote {margin:-.3em 0 0 2em}
# i, i * {font-style:italic}
# b, b * {font-weight:bold}
# .sc, .sc * {font-variant:small-caps}
# .block, .border {border-radius:3px; padding:0 .2em; font-size:90%}
# ##### N.B. Do not change the next 4 lines #####
- FindReplaceString:
Find: "body { padding-left: %3px; }\nbody { font: %1px %4, serif; line-height: 1.4em; }\nspan.word { font-weight: bold; font-size: 130%; margin-left: -%3px; }\ndiv.descriptionFont { font-family: serif; }\nol { font-size: %1px; margin-left: %2em; margin-top: 0px; }\nol p { font-size: %1px; }\ni, i * { font-style: italic; }\nb, b * { font-weight: bold; }\n.sc, .sc * { font-variant: small-caps; }\n.block, .border { border-radius: 3px; padding: 0em .2em; font-size: 90%; }\n"
Replace: "body {font-size:%1px; line-height:1.40em; font-family:%4, serif ;}\nbody {padding-left:0.5em}\nspan.word {font-weight:bold; font-size:130%; margin-left:-0.3em}\nol {margin-left:1em; margin-top:0}\nblockquote {margin:.3em 0 .3em 1em}\nblockquote>blockquote {margin:-.3em 0 0 2em}\ni, i * {font-style:italic}\nb, b * {font-weight:bold}\n.sc, .sc * {font-variant:small-caps}\n.block, .border {border-radius:3px; padding:0 .2em; font-size:90%}\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
# N.B: From fw 4.32.19508 these are the only customised font-family values reported as having any effect
# The first example will use the default sans-serif font, i.e. Avenir for most non-CJK GUI language locales
# Un-comment ONE ONLY of the following 4 ReplaceString examples
#- ReplaceString: {Offset: 54, Find: "%4, serif ", Replace: "sans-serif", MustMatchLength: yes}
#- ReplaceString: {Offset: 54, Find: "%4, serif ", Replace: "'KBJ-TsukuMin Pr6N RB'", MustMatchLength: yes}
#- ReplaceString: {Offset: 54, Find: "%4, serif ", Replace: "'KBJ-UDKakugo Pr6N M'", MustMatchLength: yes}
#- ReplaceString: {Offset: 54, Find: "%4, serif ", Replace: "'AR UDJingxihei'", MustMatchLength: yes}
# Un-comment and edit next line to change font-size
#- ReplaceString: {Offset: 16, 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 next 2 patches are alternatives. Enable ONE ONLY.
# They have replaced the old patch named 'KePub stylesheet additions'
KePub stylesheet additions - text justify:
- Enabled: no
- PatchGroup: KePub stylesheet additions alternatives
- Description: Make full justification the default in KePubs
- FindBaseAddressString: ".KBSearchResult, .KBAnnotation, .KBHighlighting {"
# *** Don't change anything in the 4 ReplaceString lines below ***
- ReplaceString: {Find: ".KBSearchResult, .KBAnnotation, .KBHighlighting { font-size: 100% !important; -webkit-text-combine: inherit !important; }\n", Replace: ".KBSearchResult,.KBAnnotation,.KBHighlighting{font-size:100%!important;-webkit-text-combine:inherit!important}.KBAnnotatio", MustMatchLength: yes}
- ReplaceString: {Offset: 122, Find: ".KBAnnotation[writingMode=\"horizontal-tb\"] { border-bottom: 2px solid black !important; }\n", Replace: "n[writingMode=\"horizontal-tb\"]{border-bottom:2px solid #000!important}.KBAnnotation[writin", MustMatchLength: yes}
- ReplaceString: {Offset: 212, Find: ".KBAnnotation[writingMode=\"vertical-rl\"] { border-right: 2px solid black !important; }\n", Replace: "gMode=\"vertical-rl\"]{border-right:2px solid #000!important}.KBAnnotation[writingMode=\"v", MustMatchLength: yes}
- ReplaceString: {Offset: 299, Find: ".KBAnnotation[writingMode=\"vertical-lr\"] { border-left: 2px solid black !important; }", Replace: "ertical-lr\"]{border-left:2px solid #000!important}/*********************************/", MustMatchLength: yes}
# *** Don't change anything in the 4 ReplaceString lines above ***
#
- FindReplaceString: {Find: "/*********************************/", Replace: "body{text-align:justify }", MustMatchLength: yes}
KePub stylesheet additions - word-spacing:
- Enabled: no
- PatchGroup: KePub stylesheet additions alternatives
- Description: |
Reduces the space between words in KePubs.
Probably only useful to those who prefer to read KePubs with left/right full justification, i.e. not ragged-right edge.
See https://www.mobileread.com/forums/showpost.php?p=4217711&postcount=28
for screenshots showing the effect of enabling this patch.
- FindBaseAddressString: ".KBSearchResult, .KBAnnotation, .KBHighlighting {"
# *** Don't change anything in the 4 ReplaceString lines below ***
- ReplaceString: {Find: ".KBSearchResult, .KBAnnotation, .KBHighlighting { font-size: 100% !important; -webkit-text-combine: inherit !important; }\n", Replace: ".KBSearchResult,.KBAnnotation,.KBHighlighting{font-size:100%!important;-webkit-text-combine:inherit!important}.KBAnnotatio", MustMatchLength: yes}
- ReplaceString: {Offset: 122, Find: ".KBAnnotation[writingMode=\"horizontal-tb\"] { border-bottom: 2px solid black !important; }\n", Replace: "n[writingMode=\"horizontal-tb\"]{border-bottom:2px solid #000!important}.KBAnnotation[writin", MustMatchLength: yes}
- ReplaceString: {Offset: 212, Find: ".KBAnnotation[writingMode=\"vertical-rl\"] { border-right: 2px solid black !important; }\n", Replace: "gMode=\"vertical-rl\"]{border-right:2px solid #000!important}.KBAnnotation[writingMode=\"v", MustMatchLength: yes}
- ReplaceString: {Offset: 299, Find: ".KBAnnotation[writingMode=\"vertical-lr\"] { border-left: 2px solid black !important; }", Replace: "ertical-lr\"]{border-left:2px solid #000!important}/*********************************/", MustMatchLength: yes}
# *** Don't change anything in the 4 ReplaceString lines above ***
#
# Customise the -0.05 value if you prefer.
# N.B. Be careful, if it's too big some words may get joined together.
- FindReplaceString: {Find: "/*********************************/", Replace: "body{word-spacing:-0.05em }", MustMatchLength: yes}
# KePub stylesheet additions - optimizeSpeed: retired
# KePub stylesheet additions - optimizeLegibility: retired
# Edit Kobo config (.kobo/Kobo/Kobo eReader.conf) to achieve same result.
# For more detail, see MR post https://www.mobileread.com/forums/showpost.php?p=4215805&postcount=40
# 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 &ldquo;%1&rdquo; did not match any words in the dictionary. The closest match was &ldquo;%2&rdquo;."
Replace: "No match for &ldquo;%1&rdquo;, closest match was &ldquo;%2&rdquo;."
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 Greek 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: "."}
Bulgarian Phonetic Keyboard (GloHD/ClaraHD/AuraOne/H2O2/Forma/Libra):
# Created by Svens (https://www.mobileread.com/forums/showpost.php?p=3977092&postcount=51)
- Enabled: no
- PatchGroup: Keyboard alternatives
- Description: |
Replaces keys on the Extended Latin keypad with Bulgarian 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: "."}
# 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: "%0::keymap=keys/device.qmap::grab=1", Replace: "%0::keymap=keys/device.qmap::grab=0"}
# The following patch(es) are by pgaskin (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: 82
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: 564}
- 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.
Increase page navigation history:
- Enabled: no
- Description: Increases the number of dots marking navigation history on the scrubber.
# Replace the immediate value for the cmp r1, #2 before the bgt to the inlined
# QVector::removeFirst() (i.e. QVector::erase(start, start+1)):
- BaseAddress: "BookmarkHistoryMixin::pushBookmark(Bookmark const&)"
- ReplaceInt: {Offset: 24, Find: 2, Replace: 4} # note: you can set the replacement to whatever you want, but it MUST be > 1 or bad things will happen
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. Due to recent firmware changes (since 18220, it is set by the
kobo QPA during initialization), it will only take effect after a reboot.
See https://github.com/pgaskin/NickelMenu/issues/111 for more information.
# Settings page
- BaseAddress: "N3SettingsReadingView::N3SettingsReadingView(QWidget*)"
- ReplaceBytes: {Offset: 890, FindInstBLX: {SymPLT: "ReadingSettings::getShowAdobePageNumbers()"}, ReplaceInstBLX: {SymPLT: "FeatureSettings::invertScreen()"}}
# Settings page controller
- BaseAddress: {Sym: "N3SettingsReadingController::showAdobePageNumbersToggled()"}
- ReplaceBytes: {Offset: 74, FindInstBLX: {SymPLT: "ReadingSettings::getShowAdobePageNumbers()"}, ReplaceInstBLX: {SymPLT: "FeatureSettings::invertScreen()"}}
- ReplaceBytes: {Offset: 86, 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: 1524
FindInstBLX: {SymPLT: "Device::isParentalControlEnabled() const"}
ReplaceH: 4F F0 01 00
- ReplaceBytes:
Base: {Sym: "SelectionMenuController::setupMainOptions()"}
Offset: 308
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::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/pgaskin/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: "Find your next book in Kobo Plus or our store", Replace: "Find your next book in Kobo Plus or our store"}
- ReplaceBytes:
Base: "HomePageView::setOverDriveUser(OverDriveUser const&)"
Offset: 60
FindInstBLX: {SymPLT: "GenericHomeWidget::setTitleText(QString)"}
ReplaceInstNOP: true
# 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"}
Remove line from bottom tab bar:
- Enabled: no
- Description: Removes the line from the top of the bottom tab bar added in 4.23.15505.
# Instead of setting the minimum size of the QFrame for the line, hide it.
- ReplaceBytes:
Base: "Ui_MainNavView::setupUi(QWidget*)"
Offset: 326
FindInstBLX: {SymPLT: "QWidget::setMinimumSize(int, int)"}
ReplaceInstBLX: {SymPLT: "QWidget::hide()"}
## 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: 26
FindInstBW: {SymPLTTail: "DiscoverNavMixin::storefront()"} # Store
ReplaceInstBW: {SymPLTTail: "ReadingLifeNavMixin::chooseActivity()"} # Activity
- ReplaceBytes:
Base: "BrowseKoboWidget::tapped()"
Offset: 36
FindInstBW: {SymPLTTail: "StoreNavMixin::overDriveFeaturedLists()"} # OverDrive
ReplaceInstBW: {SymPLTTail: "ReadingLifeNavMixin::chooseActivity()"} # Activity
- ReplaceBytes:
Base: "BrowseKoboWidget::BrowseKoboWidget(QWidget*)"
Offset: 206
FindInstBLX: {SymPLT: "N3DeviceCharm::shopName()"} # "Shop Kobo" or "Walmart"
ReplaceInstBLX: {SymPLT: "N3DeviceCharm::extrasName()"} # "Activity"
- ReplaceBytes:
Base: "HomePageView::setOverDriveUser(OverDriveUser const&)"
Offset: 114
FindInstBLX: {SymPLT: "GenericHomeWidget::setMetaText(QString)"} # "OverDrive"
ReplaceInstNOP: true
###
### 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
# 8 - OverDrive - overdrive enabled && signed in && have hold - OVERDRIVE: View your public library holds - overdrive holds list
# 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: Upgrade to a Kobo Plus Read & Listen subscription - 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
# 9 - NaturalLight - has light sensor && not viewed tutorial - DEVICE NAME: Learn about the Natural Light feature - rgb front light about
# 10 - QuickTour - quick tour not shown && quick turn tile not visible - GETTING STARTED: Get to know your %0 - quick tour
# 11 - ReadingTour - read a book tour not showed - READING A BOOK: Get quick tips about reading on your eReader - read a book tutorial
# 12 - UserGuide - user guide present && not opened - USER GUIDE: Read the user guide for your %0 - read -> user guide
# 13 - RelatedReads - recent book available from Activity - RELATED READS: Discover books related to the ones you're reading - browse -> similar books
# 14 - Wishlist - no wishlist items || something else - WISHLIST: Create a Wishlist of books you're interested in - browse -> wishlist
# 15 - ReadingSettings - reading settings not changed - READING SETTINGS: Customize the way you read a book - settings -> reading settings
# 16 - 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
# 17 - SuperPoints - participating in super points && points > 2400 - KOBO SUPER POINTS: You have %0 Super Points to redeem - kobo store
# 18 - PocketUser - unread pocket articles > 0 - POCKET: Catch up on the %n article(s) you added recently - library -> pocket
# 19 - Audiobooks - supports audiobooks && audiobooks enabled - AUDIOBOOKS: Get started with Audiobooks on your eReader - kobo store -> audiobooks
#
- 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 12 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 10 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: 310, FindH: 02 23, CheckOnly: true} # MOVS r3, #2
- ReplaceBytes: {Offset: 320, FindInstBLX: {SymPLT: "QVector<SmartLinkType>::append(SmartLinkType const&)"}, ReplaceInstNOP: true}
# NOP wishlist (14):
- ReplaceBytes: {Offset: 284, FindH: 0E 23, CheckOnly: true} # MOVS r3, #14
- ReplaceBytes: {Offset: 294, FindInstBLX: {SymPLT: "QVector<SmartLinkType>::append(SmartLinkType const&)"}, ReplaceInstNOP: true}
# NOP super points (17):
- ReplaceBytes: {Offset: 1514, FindH: 11 23, CheckOnly: true} # MOVS r3, #17
- ReplaceBytes: {Offset: 1526, FindInstBLX: {SymPLT: "QVector<SmartLinkType>::append(SmartLinkType const&)"}, ReplaceInstNOP: true}
###
# Note: The "Increase TOC level indentation" and "Increase TOC level indentation
# and fix extra indentation bug" patches are not necessary anymore in firmware
# 4.24.15672+ and have been removed since the fixes have been integrated into
# the original firmware. The default indentation is now around 3x larger than it
# was before (and it scales for each device), and the firmware will always
# subtract 1 from the depth before applying the indentation (since it's indexed
# from 1+ rather than 0+).
#
# If you are not happy with the new defaults, see the new "Change TOC level
# indentation" patch in nickel.yaml.
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: 190}
- ReplaceBytes: {Offset: 0, FindH: 49 46, ReplaceH: 00 21} # replace MOV r1, sb with MOV r1, #0 (the MOV doesn't matter, but may to be updated to match, ensuring nothing after depends on it)
- 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-21533.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/pgaskin/kobopatch-patches/issues/28#issuecomment-537161827
for more details about this.
# Multipliers
- ReplaceBytes:
Base: "N3PowerWorkflowManager::configureWakeup(AlarmControl*, int, AlarmControlDelegate*)"
Offset: 28
FindH: 03 FB 04 F2 # MUL r2(dest), r3(multiplier), r4(mins)
ReplaceH: 4F EA C4 42 # LSL r2, r4, #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)
- BaseAddress: "N3SettingsPowerView::initChoices()"
- ReplaceInt: {Offset: 56, Find: 5, Replace: 1}
- ReplaceInt: {Offset: 118, Find: 10, Replace: 4}
- ReplaceInt: {Offset: 180, Find: 15, Replace: 7}
- ReplaceInt: {Offset: 240, Find: 30, Replace: 28}
- ReplaceInt: {Offset: 300, Find: 45, Replace: 83}
- ReplaceInt: {Offset: 360, 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 rotatable 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: {Base: "DevSettings::forceAllowLandscape()", Offset: 54, 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: {Base: "ReadingMenuView::updateReadingMenu()", Offset: 236, 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: {Base: "RotatePopup::RotatePopup(QWidget*)", Offset: 190, 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"}
# Percent read text (this string is only used by ReadingView::getChapterPercentProgressText,
# and the home screen one is already lowercase):
- FindReplaceString: {Find: "%1% READ", Replace: "%1% read"}
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"}
- FindReplaceString: {Find: "%1% READ", Replace: "%1% read"}
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: 182
FindH: C0 69 # LDR r0, [r0, #0x1C]
ReplaceH: 00 69 # LDR r0, [r0, #0x10]
- ReplaceBytes:
Base: "ReadingView::updatePercentageFooter(QString const&)"
Offset: 296
FindH: C0 69 # LDR r0, [r0, #0x1C]
ReplaceH: 00 69 # LDR r0, [r0, #0x10]
- ReplaceBytes:
Base: "ReadingView::updatePageFooter(QString const&)"
Offset: 172
FindH: C0 69 # LDR r0, [r0, #0x1C]
ReplaceH: 00 69 # LDR r0, [r0, #0x10]
- ReplaceBytes:
Base: "ReadingView::updateTimeFooter(QString const&)"
Offset: 50 # "Loading..."
FindH: E4 69 # LDR r4, [r4, #0x1C]
ReplaceH: 24 69 # LDR r4, [r4, #0x10]
- ReplaceBytes:
Base: "ReadingView::updateTimeFooter(QString const&)"
Offset: 102 # time estimate
FindH: D3 F8 1C 90 # LDR.W sb, [r3, #0x1C]
ReplaceH: D3 F8 10 90 # LDR.W sb, [r3, #0x10]
- ReplaceBytes:
Base: "ReadingView::updateTimeFooter(QString const&)"
Offset: 240 # pages
FindH: DE F8 1C 40 # LDR.W r4, [lr, #0x1C]
ReplaceH: DE F8 10 40 # LDR.W r4, [lr, #0x10]
# Note: The "Enable advanced settings for all fonts" patch is no longer
# necessary since the advanced font settings are now available for all fonts.
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<QPair<QString, QTime>> with a simple loop.
- BaseAddress: 0xE82E2C # find the base of the unnamed subroutine with the x-ref to _ZN5QTimeC1Eiiii
#
# Change the initial hour / first bedtime dropdown item passed to the QTime
# constructor (mov r1, #21):
- ReplaceInt: {Offset: 22, 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: 122, 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: 78, 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: 696, 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.
- BaseAddress: "BedtimeManager::adjustTemperature()"
#
# 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: 228, 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: 508, 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: 262, 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: 208, 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: {Base: "DevSettings::autoUsbGadget()", Offset: 54, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00}
PowerSettings - UnlockEnabled:
- Enabled: no
- Description: Disables/enables the slide to unlock feature.
- ReplaceBytes: {Base: "PowerSettings::getUnlockEnabled()", Offset: 120, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 00 00} # disable
# - ReplaceBytes: {Base: "PowerSettings::getUnlockEnabled()", Offset: 120, FindInstBLX: {SymPLT: "QVariant::toBool() const"}, ReplaceH: 4F F0 01 00} # enable
# The following patch(es) were made by sherman
Unify font sizes:
- Enabled: no
- Description: |
Attempt to unify the font sizes between epub and kepub. Without this patch
epub font sizes can be much larger than kepub at the same size setting.
# From my current understanding, the final font size for epubs is calculated
# as follows: ( font_size / scale_factor ) * DPI, where 'scale_factor' =
# 25.0. It seems RMSDK must be handling DPI elsewhere however, because the
# DPI multiplication here seems to have a detrimental effect, and behaves
# differently on different devices. This patch changes the 'scale_factor' to
# 2.5, and replaces the call to get DPI with a constant multiplier (16).
# The results of using these values are equivalent to
# ( font_size / 15.0 ) * 96 which is what I suspect the kepub formula is.
# Note, that the replacement values are limited to 0.25 - 31.0 in 0.25
# increments.
#
# Refer to https://github.com/pgaskin/kobopatch-patches/issues/96 for more
# information.
# EPUB settings:
- BaseAddress:
Sym: "AdobeStyling::update(QString const&)"
Rel: 5796 # at ReadingSettings::getReadingFontSizeScaleFactor(float, float)
# Set the scale factor to 2.5
- ReplaceBytes:
Offset: -20
FindH: F3 EE 09 0A # vmov.f32 s1, #25.0
ReplaceH: F0 EE 04 0A # vmov.f32 s1, #2.5
# Replace QScreen::logicalDotsPerInchX() with our own multiplier of 16.0
- ReplaceBytes:
Offset: 26
FindInstBLX: {SymPLT: "QScreen::logicalDotsPerInchX() const"}
ReplaceH: B3 EE 00 0B # vmov.f64 d0, #16.0