Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-12-2018, 10:16 PM   #256
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,356
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by ColFormi View Post
Thank you, David. I get the idea now.
The kobopatch.yaml looks so neat!
But one more question. Suppose I have edited my kobopatch.yaml, do I need to copy it to the src file to let it take effect?
The kobopatch.yaml remains in it's original location.
DNSB is offline   Reply With Quote
Old 11-12-2018, 10:23 PM   #257
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,356
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
It looks as if the mass of bytes written to the screen when an error occurred has been suppressed. Makes it a lot easier to see where the error occurred. Thanks!
DNSB is offline   Reply With Quote
Old 11-13-2018, 08:18 PM   #258
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by geek1011 View Post
The issue is with your yaml. When doing finds for bytes, you should use FindBaseAddressHex, so it doesn't get interpreted as a UTF-8 string and get all mangled. Also, it allows you to make the hex more readable.

Here is a fixed version:
Thanks. There was another mistake in the patch which would prevent it working even once it applied, I've fixed it in my original post, perhaps you could edit your post too, just in case someone uses it?

The line with the mistake is:
- ReplaceBytes: {Offset: 0x14, FindH: 20 46, ReplaceH: 04 E0}
It should be:
- ReplaceBytes: {Offset: 0x14, FindH: 20 46 61 E9 1E 89, ReplaceH: 7B 60 03 E0 00 BF}

(BTW I'm not sure whether it is worth using this multi-version patch or not, although it doesn't need updating so long as the code doesn't change, once the code changes it may be more difficult to update than the original.)
GeoffR is offline   Reply With Quote
Old 11-13-2018, 08:28 PM   #259
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,733
Karma: 6987557
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by GeoffR View Post
Thanks. There was another mistake in the patch which would prevent it working even once it applied, I've fixed it in my original post, perhaps you could edit your post too, just in case someone uses it?

The line with the mistake is:
- ReplaceBytes: {Offset: 0x14, FindH: 20 46, ReplaceH: 04 E0}
It should be:
- ReplaceBytes: {Offset: 0x14, FindH: 20 46 61 E9 1E 89, ReplaceH: 7B 60 03 E0 00 BF}

(BTW I'm not sure whether it is worth using this multi-version patch or not, although it doesn't need updating so long as the code doesn't change, once the code changes it may be more difficult to update than the original.)
Done. As for your second point, I do agree with it, mainly because even just changing the order of the appends would silently break it. The main reasoning I use when deciding whether to make a patch generic is:
- How unique are the finds
- What is the chance of it breaking silently (I like to be able to mostly depend on my automated testing)
- If the patch breaks, will it prevent connecting to a computer and require a reset (as in, are the instructions reached right after booting)

One thing I'm experimenting with right now is automated patch updates on a slightly higher level (based on finding/replacing instructions). This would then generate ordinary patches.
geek1011 is offline   Reply With Quote
Old 11-16-2018, 07:54 PM   #260
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,733
Karma: 6987557
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
There is now a new kobopatch request thread, which consolidates all the requests for patches and major kobopatch features.

I have tried my best to collect all the requests from before scattered around the threads, and if I missed anything, please tell me.
geek1011 is offline   Reply With Quote
Old 11-21-2018, 12:23 PM   #261
jcn363
absolute beginner
jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.
 
jcn363's Avatar
 
Posts: 323
Karma: 1750999
Join Date: May 2017
Location: Go with the wind (43°19'17.7"N 2°00'19.4"W)
Device: ka1

Code:
Patching ./usr/local/Kobo/nickel
  Applying overrides
    DISABLE `Reduce reading footer and quit caption`
    ENABLE  `Custom font-size nozlib`
    ENABLE  `Custom font-size zlib`
    DISABLE `Only Reading and My Books`
    DISABLE `Remove Footer and Recommendations`
Error: could not apply patches: invalid patch file 'src/nickel-363.yaml': i286: internal error while validating `Custom font-size zlib` (you should report this as a bug)
Attached Files
File Type: zip nickel-363.yaml.zip (6.5 KB, 219 views)

Last edited by jcn363; 11-21-2018 at 12:28 PM.
jcn363 is offline   Reply With Quote
Old 11-21-2018, 01:36 PM   #262
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,733
Karma: 6987557
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by jcn363 View Post

Code:
Patching ./usr/local/Kobo/nickel
  Applying overrides
    DISABLE `Reduce reading footer and quit caption`
    ENABLE  `Custom font-size nozlib`
    ENABLE  `Custom font-size zlib`
    DISABLE `Only Reading and My Books`
    DISABLE `Remove Footer and Recommendations`
Error: could not apply patches: invalid patch file 'src/nickel-363.yaml': i286: internal error while validating `Custom font-size zlib` (you should report this as a bug)
I can't test it completely right now, as I don't have access to my computer, but I think it's the ' in the description of the zlib font size patch. Try removing it and see if it works. BTW, the error is because it found 0 instructions in the patch.

EDIT: I had another look, actually, I think this is a bug in the validation. I will look into this later (I probably forgot to incremented the counter for one of the zlib instructions).

Last edited by geek1011; 11-21-2018 at 01:51 PM.
geek1011 is offline   Reply With Quote
Old 11-21-2018, 01:46 PM   #263
jcn363
absolute beginner
jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.
 
jcn363's Avatar
 
Posts: 323
Karma: 1750999
Join Date: May 2017
Location: Go with the wind (43°19'17.7"N 2°00'19.4"W)
Device: ka1

Sorry, my fault. There was a - ReplaceZlib: free.
Good luck.
jcn363 is offline   Reply With Quote
Old 11-21-2018, 01:56 PM   #264
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,733
Karma: 6987557
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by jcn363 View Post

Sorry, my fault. There was a - ReplaceZlib: free.
Good luck.
OK
geek1011 is offline   Reply With Quote
Old 11-21-2018, 02:13 PM   #265
jcn363
absolute beginner
jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.
 
jcn363's Avatar
 
Posts: 323
Karma: 1750999
Join Date: May 2017
Location: Go with the wind (43°19'17.7"N 2°00'19.4"W)
Device: ka1
When you try recursively a simple change (same length string) the error raises immediately.
Spoiler:
Code:
          |   applying patch `Custom font-size zlib1`
          | looping over instructions
          |   skipping non-instruction Enabled(), PatchGroup() or Description()
          |   skipping non-instruction Enabled(), PatchGroup() or Description()
          |   FindZlib("reader_head") | hex:7265616465725f68656164
          |   ReplaceZlib(0, "font-size: 36px", "font-size: 39px")
          |   ReplaceZlib(0, "font-size: 28px", "font-size: 32px")
          |   ReplaceZlib(0, "font-size: 23px", "font-size: 27px")
          |   FindZlib("QWidget[small") | hex:515769646765745b736d616c6c
          |   ReplaceZlib(0, "font-size: 91px", "font-size: 91px")
          |   ReplaceZlib(0, "font-size: 77px", "font-size: 77px")
          |   ReplaceZlib(0, "font-size: 74px", "font-size: 74px")
          |   ReplaceZlib(0, "font-size: 71px", "font-size: 71px")
          |   ReplaceZlib(0, "font-size: 62px", "font-size: 62px")
          |   ReplaceZlib(0, "font-size: 60px", "font-size: 60px")
          |   ReplaceZlib(0, "font-size: 57px", "font-size: 59px")
          |   ReplaceZlib(0, "font-size: 55px", "font-size: 57px")
          |   ReplaceZlib(0, "font-size: 50px", "font-size: 53px")
          |   ReplaceZlib(0, "font-size: 47px", "font-size: 50px")
          |   ReplaceZlib(0, "font-size: 46px", "font-size: 49px")
          | could not apply patch: i18: ReplaceZlib: new compressed data is 2 bytes longer than old data (try removing whitespace or unnecessary css)
        --> ReplaceZlib: new compressed data is 2 bytes longer than old data (try removing whitespace or unnecessary css)

If you remove the space the error raises before.
Spoiler:
Code:
          |   applying patch `Custom font-size zlib1`
          | looping over instructions
          |   skipping non-instruction Enabled(), PatchGroup() or Description()
          |   skipping non-instruction Enabled(), PatchGroup() or Description()
          |   FindZlib("reader_head") | hex:7265616465725f68656164
          |   ReplaceZlib(0, "font-size: 36px", "font-size:39px")
          |   ReplaceZlib(0, "font-size: 28px", "font-size:32px")
          |   ReplaceZlib(0, "font-size: 23px", "font-size:27px")
          |   FindZlib("QWidget[small") | hex:515769646765745b736d616c6c
          |   ReplaceZlib(0, "font-size: 91px", "font-size:91px")
          |   ReplaceZlib(0, "font-size: 77px", "font-size:77px")
          |   ReplaceZlib(0, "font-size: 74px", "font-size:74px")
          |   ReplaceZlib(0, "font-size: 71px", "font-size:71px")
          |   ReplaceZlib(0, "font-size: 62px", "font-size:62px")
          |   ReplaceZlib(0, "font-size: 60px", "font-size:60px")
          |   ReplaceZlib(0, "font-size: 57px", "font-size:59px")
          |   ReplaceZlib(0, "font-size: 55px", "font-size:57px")
          | could not apply patch: i15: ReplaceZlib: new compressed data is 1 bytes longer than old data (try removing whitespace or unnecessary css)
        --> ReplaceZlib: new compressed data is 1 bytes longer than old data (try removing whitespace or unnecessary css)


Perhaps I'm doing something bad or you should flush memory, redo loops or something, because I think this is really simple.
Good luck.
jcn363 is offline   Reply With Quote
Old 11-21-2018, 09:23 PM   #266
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,733
Karma: 6987557
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by jcn363 View Post
Perhaps I'm doing something bad or you should flush memory, redo loops or something, because I think this is really simple.
Good luck.
This is happening because it is being re-compressed after every replace (not just the final one). Thus, the compression ratio may differ each time. A possible workaround would be to try playing around with the order of the replacements. I will implement a new ReplaceZlibGroup instruction later this week to solve this issue completely.
geek1011 is offline   Reply With Quote
Old 11-26-2018, 11:04 PM   #267
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,733
Karma: 6987557
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by jcn363 View Post
When you try recursively a simple change (same length string) the error raises immediately.
Spoiler:
Code:
          |   applying patch `Custom font-size zlib1`
          | looping over instructions
          |   skipping non-instruction Enabled(), PatchGroup() or Description()
          |   skipping non-instruction Enabled(), PatchGroup() or Description()
          |   FindZlib("reader_head") | hex:7265616465725f68656164
          |   ReplaceZlib(0, "font-size: 36px", "font-size: 39px")
          |   ReplaceZlib(0, "font-size: 28px", "font-size: 32px")
          |   ReplaceZlib(0, "font-size: 23px", "font-size: 27px")
          |   FindZlib("QWidget[small") | hex:515769646765745b736d616c6c
          |   ReplaceZlib(0, "font-size: 91px", "font-size: 91px")
          |   ReplaceZlib(0, "font-size: 77px", "font-size: 77px")
          |   ReplaceZlib(0, "font-size: 74px", "font-size: 74px")
          |   ReplaceZlib(0, "font-size: 71px", "font-size: 71px")
          |   ReplaceZlib(0, "font-size: 62px", "font-size: 62px")
          |   ReplaceZlib(0, "font-size: 60px", "font-size: 60px")
          |   ReplaceZlib(0, "font-size: 57px", "font-size: 59px")
          |   ReplaceZlib(0, "font-size: 55px", "font-size: 57px")
          |   ReplaceZlib(0, "font-size: 50px", "font-size: 53px")
          |   ReplaceZlib(0, "font-size: 47px", "font-size: 50px")
          |   ReplaceZlib(0, "font-size: 46px", "font-size: 49px")
          | could not apply patch: i18: ReplaceZlib: new compressed data is 2 bytes longer than old data (try removing whitespace or unnecessary css)
        --> ReplaceZlib: new compressed data is 2 bytes longer than old data (try removing whitespace or unnecessary css)

If you remove the space the error raises before.
Spoiler:
Code:
          |   applying patch `Custom font-size zlib1`
          | looping over instructions
          |   skipping non-instruction Enabled(), PatchGroup() or Description()
          |   skipping non-instruction Enabled(), PatchGroup() or Description()
          |   FindZlib("reader_head") | hex:7265616465725f68656164
          |   ReplaceZlib(0, "font-size: 36px", "font-size:39px")
          |   ReplaceZlib(0, "font-size: 28px", "font-size:32px")
          |   ReplaceZlib(0, "font-size: 23px", "font-size:27px")
          |   FindZlib("QWidget[small") | hex:515769646765745b736d616c6c
          |   ReplaceZlib(0, "font-size: 91px", "font-size:91px")
          |   ReplaceZlib(0, "font-size: 77px", "font-size:77px")
          |   ReplaceZlib(0, "font-size: 74px", "font-size:74px")
          |   ReplaceZlib(0, "font-size: 71px", "font-size:71px")
          |   ReplaceZlib(0, "font-size: 62px", "font-size:62px")
          |   ReplaceZlib(0, "font-size: 60px", "font-size:60px")
          |   ReplaceZlib(0, "font-size: 57px", "font-size:59px")
          |   ReplaceZlib(0, "font-size: 55px", "font-size:57px")
          | could not apply patch: i15: ReplaceZlib: new compressed data is 1 bytes longer than old data (try removing whitespace or unnecessary css)
        --> ReplaceZlib: new compressed data is 1 bytes longer than old data (try removing whitespace or unnecessary css)


Perhaps I'm doing something bad or you should flush memory, redo loops or something, because I think this is really simple.
Good luck.
Done the new ReplaceZlibGroup instruction.
geek1011 is offline   Reply With Quote
Old 11-26-2018, 11:09 PM   #268
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,733
Karma: 6987557
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
I have released kobopatch v0.11.0 (which will be included in the next release of the patches).

This release adds a new ReplaceZlibGroup (as requested by jcn363). This instruction replaces multiple strings in a zlib string, then compresses the result (instead of compressing at each replacement). This is useful when making many tiny changes to a zlib stream, and one temporarily makes the stream too long.

Usage example for ReplaceZlibGroup:
Code:
Example for ReplaceZlibGroup:
  - Enabled: yes
  - Description: An example patch for the new ReplaceZlibGroup instruction.
  - FindZlib: "#someRandomID"
  - ReplaceZlibGroup:
      Offset: 0
      Replacements:
        - {Find: "#someRandomID", Replace: "#someRandomIDThatMakesTheZlibStreamTooLongWhichWouldHaveErroredWithReplaceZlib"}
        - {Find: "#someRandomIDThatMakesTheZlibStreamTooLongWhichWouldHaveErroredWithReplaceZlib", Replace: "#someRandomIDThatIsNowShortEnough"}

Last edited by geek1011; 11-26-2018 at 11:14 PM.
geek1011 is offline   Reply With Quote
Old 11-27-2018, 10:23 AM   #269
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: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
@geek1011,

Re: ReplaceZlibGroup

Please can you also show an example of how to use this for the occasions when I prefer to have the Find: and Replace: statements on separate lines to facilitate comparing the find/replace strings.

ETA: Ideally, I'd like to be able to mix and match Find/Replace one-liners and multi-liners in the same ReplaceZlibGroup

Here's an extract from a very large patch that I have. How would I use ReplaceZlibGroup to group these 4 find/replace together without losing the last 2 as multi-liners?

Spoiler:
Code:
jackie_w General GUI:
  - Enabled: no
  - Description: General GUI
  - FindZlib: "HeaderSmallElidedLabel"
  #
  # popup footnote header (HeaderMediumElidedLabel,HeaderMediumTouchLabel,HeaderMediumLabel ???)
  # free some space
  - ReplaceZlib: {Offset: 0, Find: "HeaderMediumElidedLabel[qApp_localeName=\"ja_JP\"],\nHeaderMediumTouchLabel[qApp_localeName=\"ja_JP\"],\nHeaderMediumLabel[qApp_localeName=\"ja_JP\"] {\n  font-family: Sans-SerifJP, sans-serif;\n  font-style: normal;\n}\nHeaderSmallLabel", Replace: "HeaderSmallLabel"}
  - ReplaceZlib: {Offset: 0, Find: "HeaderSmallLabel[qApp_localeName=\"ja_JP\"] {\n  font-family: Sans-SerifJP, sans-serif;\n  font-style: normal;\n}\nHeaderSmallElidedLabel", Replace: "HeaderSmallElidedLabel"}
  #
  # Book Title in Book list (HeaderSmallElidedLabel): reduce font-size and to sans-serif, bold
  - ReplaceZlib:
      Offset: 0
      Find:    "HeaderSmallElidedLabel,\nHeaderSmallItalicLabel {\n  font-family: Georgia;\n  font-style: italic;\n  font-size: 23px;\n  padding-left: 12px;\n  padding-right: 12px;\n  qproperty-alignment: 'AlignLeft|AlignVCenter';\n}"
      Replace: "HeaderSmallElidedLabel,\nHeaderSmallItalicLabel {\n  font-family: Trebuchet, Avenir;\n  font-weight: bold;\n  font-size: 23px;\n  padding-left: 12px;\n  padding-right: 12px;\n  qproperty-alignment: 'AlignLeft|AlignVCenter';\n}"
  - ReplaceZlib:
      Offset: 0
      Find:    "HeaderSmallElidedLabel[qApp_deviceIsDragon=true],\nHeaderSmallItalicLabel[qApp_deviceIsDragon=true] {\n  font-size: 36px;\n  padding-left: 20px;\n  padding-right: 20px;\n}\nHeaderSmallElidedLabel[qApp_deviceIsAlyssum=true],\nHeaderSmallItalicLabel[qApp_deviceIsAlyssum=true] {\n  font-size: 39px;\n}\nHeaderSmallElidedLabel[qApp_deviceIsNova=true],\nHeaderSmallItalicLabel[qApp_deviceIsNova=true] {\n  font-size: 39px;\n}\nHeaderSmallElidedLabel[qApp_deviceIsDaylight=true],\nHeaderSmallItalicLabel[qApp_deviceIsDaylight=true] {\n  font-size: 47px;\n  padding-left: 26px;\n  padding-right: 26px;\n}\nHeaderSmallElidedLabel[qApp_localeName=\"ja_JP\"],\nHeaderSmallItalicLabel[qApp_localeName=\"ja_JP\"] {\n  font-family: Sans-SerifJP, sans-serif;\n  font-style: normal;\n  qproperty-forceLeading: 5;\n}"
      Replace: "HeaderSmallElidedLabel[qApp_deviceIsDragon=true],\nHeaderSmallItalicLabel[qApp_deviceIsDragon=true] {\n  font-size: 32px;\n  padding-left: 20px;\n  padding-right: 20px;\n}\nHeaderSmallElidedLabel[qApp_deviceIsAlyssum=true],\nHeaderSmallItalicLabel[qApp_deviceIsAlyssum=true] {\n  font-size: 36px;\n}\nHeaderSmallElidedLabel[qApp_deviceIsNova=true],\nHeaderSmallItalicLabel[qApp_deviceIsNova=true] {\n  font-size: 36px;\n}\nHeaderSmallElidedLabel[qApp_deviceIsDaylight=true],\nHeaderSmallItalicLabel[qApp_deviceIsDaylight=true] {\n  font-size: 40px;\n  padding-left: 26px;\n  padding-right: 26px;\n}"
  #

Last edited by jackie_w; 11-27-2018 at 11:02 AM. Reason: ETA
jackie_w is offline   Reply With Quote
Old 11-27-2018, 01:47 PM   #270
jcn363
absolute beginner
jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.
 
jcn363's Avatar
 
Posts: 323
Karma: 1750999
Join Date: May 2017
Location: Go with the wind (43°19'17.7"N 2°00'19.4"W)
Device: ka1
Quote:
Originally Posted by geek1011 View Post
Done the new ReplaceZlibGroup instruction.
jcn363 is offline   Reply With Quote
Reply

Tags
kobo, kobopatch, patch, patch32lsb


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
kobopatch - A new (WIP) patching system geek1011 Kobo Developer's Corner 93 05-27-2018 03:04 PM
Patching H2O Maillemom Kobo Developer's Corner 8 10-19-2016 09:58 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.8.0 GeoffR Kobo Developer's Corner 92 10-22-2014 07:22 AM
how to clean more disk space in root file system to upgrade system chinaet iRex 1 12-18-2006 03:54 PM


All times are GMT -4. The time now is 02:49 AM.


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