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 08-01-2021, 05:26 PM   #16
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 856
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Don't forget, Nickel is old. I imagine it still carries a lot of baggage from its Qt 4.6 days, despite the fact they're now using Qt 5.2.

As far as styling goes, geek1011 was (I think) referring to stuff like font face and size, as well as border styles etc. Unstyled widgets on Kobo's are... not pretty.
sherman is offline   Reply With Quote
Old 08-02-2021, 12:33 AM   #17
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 856
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
I've done some experimenting today, and managed to subclass a QPushButton and respond to standard QGesture events. Or at least tap events.
sherman is offline   Reply With Quote
Advert
Old 08-03-2021, 09:31 AM   #18
halfdozen
Junior Member
halfdozen began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jul 2021
Device: Kobo Libra H2O
Which signals were you able to see when using a standard widget?

I've not played much more as I've been tidying up how my symbols work, the C code was bugging me some what but now I have an `IconButton` class that behaves as a QObject so I can create a button like a Qt class without passing things into functions (pretty much a shim on top of the NickelHook symbols).

With that and some playing around with the Nickel GenericContainer I've been able to inject some new buttons into the `More` menu.
halfdozen is offline   Reply With Quote
Old 08-03-2021, 05:23 PM   #19
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 856
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
I've been doing some more experimenting and it appears there's at least some support for QTouchEvent as well, if enabled by setting Qt::WA_AcceptTouchEvents attribute on a widget.

I've only ever seen TouchBegin events though.

And I've discovered that Qt gestures are a PITA
sherman is offline   Reply With Quote
Old 11-17-2023, 01:20 AM   #20
lumping-sugar66
Enthusiast
lumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than mom
 
lumping-sugar66's Avatar
 
Posts: 26
Karma: 78045
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
Hello everyone,

Would it be possible for you, any of you, to share a symdump or something similar to help with workong on libnickel in Ghidra? As a decompilation novice, I would take any help I could get to develop mods.

Thanks!
lumping-sugar66 is offline   Reply With Quote
Advert
Old 11-17-2023, 09:51 AM   #21
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,735
Karma: 6990705
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
All the symbols you'll get are in libnickel itself, and should work with most tools. The only other information is the Qt metaobject stuff (see the NickelDBus-related stuff for more about that), and the C++ RTTI. For tail call address extraction, use my symdump tool in the Kobo patch repo. For Qt resources, use my qrc tool, or look in the kobopatch firmware release issues on GitHub.
geek1011 is offline   Reply With Quote
Old 11-27-2023, 10:40 PM   #22
lumping-sugar66
Enthusiast
lumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than mom
 
lumping-sugar66's Avatar
 
Posts: 26
Karma: 78045
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
Thank you @geek1011.

I am making slow progress but I think I'm at a point where I can ask a few questions.

I'm having trouble getting hooks to be established. dlsym grabs are working fine. Here's how I'm configuring.

If I have only the following:
Quote:
typedef QObject OverDriveActionProxy;
void (*OverDriveActionProxy_setShowOverdrive)(OverDrive ActionProxy *_this, bool setShow);

struct nh_dlsym NickelNoteDlsym[] = {
{
.name = "_ZN20OverDriveActionProxy16setShowOverDriveEb ",
.out = nh_symoutptr(OverDriveActionProxy_setShowOverdrive ),
.desc = "OverDriveActionProxy_setShowOverdrive"
},
{0},
};
My init call executes fine (I am logging to a text file)

But, when I switch to a hook instead with the following, my init doesn't work anymore.

Quote:

typedef QObject OverDriveActionProxy;
void (*OverDriveActionProxy_setShowOverdrive)(OverDrive ActionProxy *_this, bool setShow);

extern "C" void _always_show_overdrive(OverDriveActionProxy *_this, bool setShow) {
appendToFile(NICKEL_NOTE_DIR "logs.txt", "Intercepted... _always_show_overdrive");
OverDriveActionProxy_setShowOverdrive(_this, setShow);
}

struct nh_hook NickelNoteHook[] = {

{
.sym = "_ZN20OverDriveActionProxy16setShowOverDriveEb ",
.sym_new = "_always_show_overdrive",
.lib = "libnickel.so.1.0.0",
.out = nh_symoutptr(OverDriveActionProxy_setShowOverdrive ),
.desc = "Always show overdrive"
},
{0}
};
There's literally nothing in the code apart from the NickelHook macro, init and uninstall calls, and I think my function signatures are right. Do you see anything out of place here?

Thanks
lumping-sugar66 is offline   Reply With Quote
Old 11-27-2023, 11:27 PM   #23
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,735
Karma: 6990705
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by lumping-sugar66 View Post
There's literally nothing in the code apart from the NickelHook macro, init and uninstall calls, and I think my function signatures are right. Do you see anything out of place here?
Try adding this after the extern C: __attribute__((visibility("default")))
geek1011 is offline   Reply With Quote
Old 11-27-2023, 11:58 PM   #24
lumping-sugar66
Enthusiast
lumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than mom
 
lumping-sugar66's Avatar
 
Posts: 26
Karma: 78045
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
Quote:
Originally Posted by geek1011 View Post
Try adding this after the extern C: __attribute__((visibility("default")))
Unfortunately didn’t make a difference. I started out with that copying from nickelclock.
lumping-sugar66 is offline   Reply With Quote
Old 11-28-2023, 12:58 AM   #25
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,735
Karma: 6990705
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
I'll take a closer look at it later this week if nobody gets to it first.

Do any log lines appear in the syslog at all?
geek1011 is offline   Reply With Quote
Old 11-28-2023, 11:14 AM   #26
lumping-sugar66
Enthusiast
lumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than mom
 
lumping-sugar66's Avatar
 
Posts: 26
Karma: 78045
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
Thank you.

I've published the complete code here at this repository as well.

https://github.com/onatbas/nickelnote.git

I'm not seeing any logs. I used to get NickelNote_<TIMESTAMP>.txt files generated in the .adds folder when I was setting up the system; I saw fatal errors get captured, but that was an earlier issue. Now, with this one, I'm not getting any files.

I don't have syslog in its usual place (I checked /var/log/syslog and syslog. conf). Is that in a different spot on a kobo?

"find / | grep log" doesn't yield anything useful either.
lumping-sugar66 is offline   Reply With Quote
Old 11-28-2023, 12:57 PM   #27
lumping-sugar66
Enthusiast
lumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than mom
 
lumping-sugar66's Avatar
 
Posts: 26
Karma: 78045
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
I've managed to get some logs, it looks like it fails to find the symbol.

Quote:
Nov 28 12:18:39 nickel: (NickelNote) (NickelHook) checking config
Nov 28 12:18:39 nickel: (NickelNote) (NickelHook) checking for uninstall flag '/mnt/onboard/nn_uninstall'
Nov 28 12:18:39 nickel: (NickelNote) (NickelHook) loading libraries
Nov 28 12:18:39 nickel: (NickelNote) (NickelHook) resolving symbols
Nov 28 12:18:39 nickel: (NickelNote) (NickelHook) applying hooks
Nov 28 12:18:39 nickel: (NickelNote) (NickelHook) info: nh_hook: setting hook on ('libnickel.so.1.0.0', '_ZN20OverDriveActionProxy16setShowOverDriveEb') to (self, '_always_show_overdrive') (desc: Always show overdrive)
Nov 28 12:18:39 nickel: (NickelNote) (NickelHook) ... dlhook: info: lib /usr/local/Kobo/libnickel.so.1 is mapped at 7552b000
Nov 28 12:18:39 nickel: (NickelNote) (NickelHook) ... dlhook: info: DT_DYNAMIC: plt_is_rela=0 plt=0x75b550f4 plt_sz=1991945464 plt_ent_sz=194808 sym=(nil) str=0x8
Nov 28 12:18:39 nickel: (NickelNote) (NickelHook) ... dlhook: error: could not find symbol
Nov 28 12:18:39 nickel: (NickelNote) (NickelHook) ... fatal: could not hook symbol
Nov 28 12:18:39 nickel: (NickelNote) (NickelHook) fatal error
I analyzed the libnickel.so.1.0.0 directly from the device and I seem to have the symbol correct, plus dlsym seem to work well. Does this mean the missing symbol is for _always_show_overdrive?
lumping-sugar66 is offline   Reply With Quote
Old 11-28-2023, 11:13 PM   #28
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,735
Karma: 6990705
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
It's the "logread" command, btw.

The symbol error is coming from the OverDriveActionProxy one. I'll check in an hour or two.
geek1011 is offline   Reply With Quote
Old 11-29-2023, 08:20 PM   #29
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,735
Karma: 6990705
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
I don't see anything obviously incorrect about the code, but do note that you'll want to include the Makefile in the repository. Also, on a side note, the overdrive thing you're doing is better suited as a patch than a hook, though a hook should work fine (I'd hook the getter personally, though).
geek1011 is offline   Reply With Quote
Old 11-29-2023, 11:01 PM   #30
lumping-sugar66
Enthusiast
lumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than momlumping-sugar66 loves his/her reader more than mom
 
lumping-sugar66's Avatar
 
Posts: 26
Karma: 78045
Join Date: Oct 2023
Location: Ontario, Canada
Device: Kobo Aura Edition 2, Kobo Clara 2E
Thanks for checking it. The Makefile is unchanged from what nickelhook generates. I'll commit that, too.

I tried with many other symbols, and I don't seem to be able to hook anything. I will check the ways of implementing it (along with a few other mods I'm planning based on Nickelhook). I didn't see the getter, hah!

I can recompile nickelclock using the same setup, and it works. I used your symdump to ensure the symbols are in place; they are. I checked the NickelHook versions between various projects; the only difference is the readme between my version and others. I'll try uninstalling all other things and check again.
lumping-sugar66 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Kindle Touch] Calibre Kindle Collections Plug-in Hooks sumpin Kindle Developer's Corner 68 11-30-2012 06:20 PM
Finding my posts melmac Feedback 5 08-30-2011 02:34 PM
Need help finding an e-reader please Pica Which one should I buy? 28 12-19-2010 09:26 AM
Hooks, They Ain't That Easy plumboz Writers' Corner 8 05-03-2010 08:28 PM
Need help finding this book Katosen Reading Recommendations 5 09-10-2009 09:42 PM


All times are GMT -4. The time now is 07:08 PM.


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