-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for running xochitl using the client. #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, nice work!
i'm fine with checking libfrida-gum.a in to repo, wonder if its standard to do so though
src/client/main.cpp
Outdated
bool FIRST_ALLOC = true; | ||
void _ZN6QImageC1EiiNS_6FormatE(void *that, int x, int y, int f) { | ||
if (IN_XOCHITL && x == swtfb::WIDTH && y == swtfb::HEIGHT && FIRST_ALLOC) { | ||
fprintf(stderr, "REPLACING THE IMAGE with /dev/shm/xofb \n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the right path? isn't it placed in /dev/shm/swtfb.01 or something? you can probably delete this line print line if the info is printed elsewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, copied :)
src/client/main.cpp
Outdated
auto *update_fn = swtfb::locate_signature( | ||
argv[0], "\x10\xd0\x4d\xe2\x7b\xc5\x00\xe3", 8) + | ||
4; | ||
auto *create_threads_fn = | ||
swtfb::locate_signature( | ||
argv[0], "\xc0\x64\x11\x00\x70\x40\x2d\xe9\x00\x40\xa0\xe1", 12) + | ||
8; | ||
|
||
auto *wait_fn = swtfb::locate_signature( | ||
argv[0], "\x40\x6c\x11\x00\x10\x40\x2d\xe9", 8) + | ||
8; | ||
|
||
auto *shutdown_fn = swtfb::locate_signature( | ||
argv[0], "\x70\x57\x16\x00\x70\x40\x2d\xe9", 8) + | ||
8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should verify these are robust. if finding signature fails, it should error and print out the binary name and its hash (sha256sum or md5sum) with a message telling the user to look at github issues #18
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checked with an older xochitl version and updated them. But they'll need to be maintained for future updates as this is fragile. I'll think about a better way to get these.
if (strcmp(name, "QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS") == 0) { | ||
return orig_fn(name, touchArgs); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found some minor fixes for log strings
src/client/main.cpp
Outdated
auto *create_threads_fn = swtfb::locate_signature( | ||
argv[0], "\x00\x40\xa0\xe1\x10\x52\x9f\xe5\x6b\x0d\xa0\xe3", 12); | ||
if (create_threads_fn == nullptr) { | ||
std::cerr << "Unable to find update fn" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad copy/paste here
src/client/main.cpp
Outdated
auto *shutdown_fn = | ||
swtfb::locate_signature(argv[0], "\x01\x50\xa0\xe3\x44\x40\x9f\xe5", 8); | ||
if (shutdown_fn == nullptr) { | ||
std::cerr << "Unable to find update fn" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
src/client/main.cpp
Outdated
auto *wait_fn = | ||
swtfb::locate_signature(argv[0], "\x01\x30\xa0\xe3\x30\x40\x9f\xe5", 8); | ||
if (wait_fn == nullptr) { | ||
std::cerr << "Unable to find update fn" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
|
argv[0], "\xc0\x64\x11\x00\x70\x40\x2d\xe9\x00\x40\xa0\xe1", 12) + | ||
8; | ||
auto *update_fn = | ||
swtfb::locate_signature(argv[0], "\x54\x40\x8d\xe2\x10\x50\x8d\xe2", 8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the signature isn't found, it should point people to issue #18
I tested this with the following apps and things work quite well!
with retris, there is one problem which is retris sends over waveform 4 which gets thrown away. i think if an app sends over waveform > 3 inside the mxcfb_update struct, we need to snap it down to 2 or 3 (like in the previous version). |
Any chance you could test with oxide? v2.0.1 is in toltec's testing branch and has input support. |
I tried yesterday but I wasn't able to get it to work reliably. It seems that the LD_PRELOAD didn't get propagated to xochitl by the process manager . But I was able to run oxide though but it overdrew xochitl on start. I also don't like how it stops the wifi on start so I lose ssh access 😄 |
You should be able to fix the pass through here https://github.com/Eeems/oxide/blob/master/applications/system-service/application.h#L53-L69 (Since I don't have an rM2 I can't do this myself). I'm also surprised to hear that it stops wifi on start, it shouldn't do so. Could you open an issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just this one last change for clamping waveform > 3 for waveforms in mxcfb_update. (if waveform > 3, it should be clamped to 2 or 3)
Hi raisjn! Thank you for your continued work on this! Does your post above mean that draft will effectively not work at all on an rm2 or is there some form of input that actually works and allows a user to select the app to run? Thanks! |
I believe that pen input never worked in draft, even on the rM1. Touch input works though. |
Thank you for the quick reply! I'm a brand new user of the reMarkable devices (got an rm2 a week ago) and have been trying out hacks. I definitely want to try out rm2fb with draft initially and then later try oxide when v2.0.2-beta (or whatever release is next that deals with the toolchain mismatch) is released. Thanks again! |
This uses frida gum to hook some function if the client detects it's running in xochitl.
The hooked
update
function sends the update to the message queue.The other hooked functions do nothing, they prevent the creation of the swtcon threads.
Resolves #24