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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-29-2022, 05:00 PM   #31
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 66,877
Karma: 109791295
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
Quote:
Originally Posted by 413Michele View Post
Yeah that would be helpful, thank you. This way I can confirm whether I've made a mistake or this is a bug
PM sent.
JSWolf is offline   Reply With Quote
Old 08-03-2022, 01:46 AM   #32
413Michele
Enthusiast
413Michele began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Jan 2021
Location: Italy
Device: Kindle Paperwhite (1st gen)
Quote:
Originally Posted by JSWolf View Post
PM sent.
Sorry for the delay in the answer, I left for a trip on the 30th and things have been a bit hectic. I flashed your file and the results were the same, so it seems the problem is a device one.

I'll be away for a bit without a PC to make tests, but when I get back I intend to try and downgrade my Libra 2 (if it's possible) to see if the patching works with older versions. In the meantime, thanks for the help!
413Michele is offline   Reply With Quote
Old 08-03-2022, 03:50 AM   #33
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 66,877
Karma: 109791295
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
Quote:
Originally Posted by 413Michele View Post
Sorry for the delay in the answer, I left for a trip on the 30th and things have been a bit hectic. I flashed your file and the results were the same, so it seems the problem is a device one.

I'll be away for a bit without a PC to make tests, but when I get back I intend to try and downgrade my Libra 2 (if it's possible) to see if the patching works with older versions. In the meantime, thanks for the help!
I don't see how my set of patches can be installed and not work. Did you run the KoboRoot.tpz in the .kobo directory? Did it go through the update process and reboot? If so, did you try reading an eBook? You should at least see a change in the header/footer.
JSWolf is offline   Reply With Quote
Old 08-05-2022, 08:58 PM   #34
tinza123
Junior Member
tinza123 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2022
Device: Kobo Libra 2
I tried the "Un-Force user text-align in div,p tags in KePubs" patch, but after enabling that I can't seem to change the alignment anymore in any of the books I own, they just remain the default publisher alignment and won't change. Is that a known issue?
tinza123 is offline   Reply With Quote
Old 08-06-2022, 08:10 AM   #35
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 5,941
Karma: 15110974
Join Date: Sep 2009
Location: UK
Device: Kobo: H2O, GloHD, KA1, ClaraHD, Forma, Libra2
Quote:
Originally Posted by tinza123 View Post
I tried the "Un-Force user text-align in div,p tags in KePubs" patch, but after enabling that I can't seem to change the alignment anymore in any of the books I own, they just remain the default publisher alignment and won't change. Is that a known issue?
Perhaps this is not a suitable patch for you. It's aimed at users who wish to specifically *avoid* Kobo's very aggressive overriding of publisher text alignment in kepubs when they select one of the Justification buttons (left or full) from the Kobo [Aa] menu. The patch simply makes a kepub behave more like an epub would, from a text alignment point-of-view.

Users who *don't* enable this patch shouldn't be surprised when kepub text which the publisher intended to be centre/right-justified no longer is when Kobo Justification is set to anything other than 'Off'.

Users who *do* enable it shouldn't be surprised when the Kobo Justification selection has no effect, because, now, the publisher alignment is no longer being overridden as aggressively as it was without the patch.
jackie_w is offline   Reply With Quote
Old 08-07-2022, 11:26 AM   #36
CyberPaul
Zealot
CyberPaul began at the beginning.
 
CyberPaul's Avatar
 
Posts: 130
Karma: 10
Join Date: Aug 2016
Device: Kindle Voyage - Tolino Vision 4 HD - Kobo Sage
Hi,
I'm trying to create a kobopatch.yaml file but I don't understand how to replace customizable strings like in this example:

Code:
Change Wikipedia search language:
  - Enabled: yes
  - 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://it.m.wikipedia.org/wiki/Special:Search\0"
  - FindReplaceString:
      Find:    "\0https://%1.wikipedia.org/wiki/Special:Search\0"
      Replace: "\0https://it.wikipedia.org/wiki/Special:Search\0"
I need to specify Italian wikipedia url, how can I do it within the kobopatch.yaml file? It looks like overrides works only for enabling/disabling...
CyberPaul is offline   Reply With Quote
Old 08-07-2022, 11:30 AM   #37
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 66,877
Karma: 109791295
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
Quote:
Originally Posted by CyberPaul View Post
Hi,
I'm trying to create a kobopatch.yaml file but I don't understand how to replace customizable strings like in this example:

Code:
Change Wikipedia search language:
  - Enabled: yes
  - 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://it.m.wikipedia.org/wiki/Special:Search\0"
  - FindReplaceString:
      Find:    "\0https://%1.wikipedia.org/wiki/Special:Search\0"
      Replace: "\0https://it.wikipedia.org/wiki/Special:Search\0"
I need to specify Italian wikipedia url, how can I do it within the kobopatch.yaml file? It looks like overrides works only for enabling/disabling...
You cannot do it in the kobopatch.yaml file. You have to do the changes in the yaml file that contains the patches you want to modify.
JSWolf is offline   Reply With Quote
Old 08-07-2022, 11:37 AM   #38
CyberPaul
Zealot
CyberPaul began at the beginning.
 
CyberPaul's Avatar
 
Posts: 130
Karma: 10
Join Date: Aug 2016
Device: Kindle Voyage - Tolino Vision 4 HD - Kobo Sage
Well, that would make kobopatch file totally unhelpful. If I still need to change one of the files, there is no value in using this mechanism.
However I tried the below format and I didn't get any error from the patching process. Are you sure it is not accepted?

Code:
src/libnickel.so.1.0.0.yaml:
    My 24 line spacing values: yes
    Custom font sizes: yes
    Set KePub hyphenation: yes
    Change Wikipedia search language: yes
      - FindReplaceString:
          Find:    "\0https://%1.m.wikipedia.org/wiki/Special:Search\0"
          Replace: "\0https://it.m.wikipedia.org/wiki/Special:Search\0"
      - FindReplaceString:
          Find:    "\0https://%1.wikipedia.org/wiki/Special:Search\0"
          Replace: "\0https://it.wikipedia.org/wiki/Special:Search\0"
    Always show confirmation dialog before upgrading: yes
    Unify font sizes: yes
CyberPaul is offline   Reply With Quote
Old 08-07-2022, 11:52 AM   #39
CyberPaul
Zealot
CyberPaul began at the beginning.
 
CyberPaul's Avatar
 
Posts: 130
Karma: 10
Join Date: Aug 2016
Device: Kindle Voyage - Tolino Vision 4 HD - Kobo Sage
My fault, I was in the wrong folder. I got this error:
Error: could not load config file: error reading kobopatch.yaml: yaml: line 38: mapping values are not allowed in this context
CyberPaul is offline   Reply With Quote
Old 08-07-2022, 02:26 PM   #40
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 66,877
Karma: 109791295
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
What I do is put in a comment that I've customized a patch. So I know to go look at the previous version and the new version to put in the customization in the new patches.

The problem is that even if you were able to put the customized patches in the kobopatch.yaml file, you could still have to redo it if the patch needs to be changed for the latest firmware.
JSWolf is offline   Reply With Quote
Old 08-07-2022, 05:30 PM   #41
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 5,941
Karma: 15110974
Join Date: Sep 2009
Location: UK
Device: Kobo: H2O, GloHD, KA1, ClaraHD, Forma, Libra2
Quote:
Originally Posted by CyberPaul View Post
Hi,
I'm trying to create a kobopatch.yaml file but I don't understand how to replace customizable strings like in this example:

I need to specify Italian wikipedia url, how can I do it within the kobopatch.yaml file? It looks like overrides works only for enabling/disabling...
Let me try to explain the usefulness of kobopatch.yaml using your custom Wikipedia patch as an example.
  1. Create a new empty file libnickel_custom.yaml (filename can be anything you like) in the src subdirectory.
  2. Copy your custom libnickel Wikipedia patch into this file with a new name e.g.
    Code:
    Change Wikipedia search language - CyberPaul:
      - 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://it.m.wikipedia.org/wiki/Special:Search\0"
      - FindReplaceString:
          Find:    "\0https://%1.wikipedia.org/wiki/Special:Search\0"
          Replace: "\0https://it.wikipedia.org/wiki/Special:Search\0"
  3. Now change your kobopatch.yaml file - see the red bits:
    Code:
    ... blah blah ...
    
    patches:
      src/libnickel.so.1.0.0.yaml:  usr/local/Kobo/libnickel.so.1.0.0
      src/libnickel_custom.yaml:    usr/local/Kobo/libnickel.so.1.0.0
    
    ... blah blah ...
    
    overrides:
      src/libnickel.so.1.0.0.yaml:
        My 24 line spacing values: yes
        Custom font sizes: yes
        Set KePub hyphenation: yes
        Always show confirmation dialog before upgrading: yes
        Unify font sizes: yes
      src/libnickel_custom.yaml:
        Change Wikipedia search language - CyberPaul: yes
    
    ... blah blah ...
The benefit of moving your custom patches into a separate libnickel_custom.yaml is that you can keep it from firmware to firmware. It's most useful for custom patches which rarely need to be changed, i.e. those which do not contain hex offsets.

When a new fw is released you can then update the main libnickel.so.1.0.0.yaml file with the new version without worrying about your custom values being overwritten. The only change you'll need to make to kobopatch.yaml is the 2 lines at the top containing fw version number.

... and, just in case you were wondering, you can also use the same approach for custom nickel.yaml patches. Very few nickel patches contain hex offsets, so can often survive, unchanged, for many firmware releases. Some of mine haven't changed for years.

Last edited by jackie_w; 08-07-2022 at 05:33 PM.
jackie_w is offline   Reply With Quote
Old Yesterday, 05:42 AM   #42
CyberPaul
Zealot
CyberPaul began at the beginning.
 
CyberPaul's Avatar
 
Posts: 130
Karma: 10
Join Date: Aug 2016
Device: Kindle Voyage - Tolino Vision 4 HD - Kobo Sage
Great solution! Thanks!
CyberPaul is offline   Reply With Quote
Reply

Tags
kobopatch, patch, patch32lsb, patches, patching

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Instructions for patching firmware 3.18.0 GeoffR Kobo Developer's Corner 151 10-21-2016 06:15 AM
Instructions for patching firmware 3.17.3 GeoffR Kobo Developer's Corner 60 09-17-2015 05:35 PM
Instructions for patching firmware 3.17.0 GeoffR Kobo Developer's Corner 49 08-16-2015 05:20 AM
Instructions for patching firmware 3.16.10 GeoffR Kobo Developer's Corner 12 08-14-2015 03:40 AM
Instructions for patching firmware 3.16.0 GeoffR Kobo Developer's Corner 74 08-12-2015 02:12 PM


All times are GMT -4. The time now is 06:12 AM.


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