Add native HTTP server, CLI scripts and docs

Implement a native macOS HTTP server for RMHook and wire it into the app. Adds HttpServer.h/.mm (CFSocket-based) with start/stop/isRunning APIs, broadcasts incoming POST /exportFile and /documentAccepted requests to the QML MessageBroker, and starts the server on port 8080 from reMarkable.m. Update CMakeLists to include HttpServer.mm and link Qt Qml when building qmlrebuild mode. Add documentation (docs/HTTP_SERVER.md) and QML snippets for MessageBroker integration, plus Python helper scripts (scripts/http_server.py and scripts/test_http_server.py) for invoking the endpoints. Also add small MessageBroker examples (src/utils/mb.m, src/utils/mb.qml) and update ResourceUtils to include additional QML resources.
This commit is contained in:
√(noham)²
2026-02-02 19:52:58 +01:00
parent 3e89d8118e
commit 400e698765
12 changed files with 1163 additions and 2 deletions

View File

@@ -9,6 +9,7 @@
#endif
#ifdef BUILD_MODE_QMLREBUILD
#import "MessageBroker.h"
#import "HttpServer.h"
#endif
#import <objc/runtime.h>
#import <Cocoa/Cocoa.h>
@@ -314,6 +315,13 @@ static inline bool shouldPatchURL(const QString &host) {
NSLogger(@"[reMarkable] Native callback received signal '%s' with value '%s'", signal, value);
});
// Start HTTP server for export requests
if (httpserver::start(8080)) {
NSLogger(@"[reMarkable] HTTP server started on http://localhost:8080");
} else {
NSLogger(@"[reMarkable] Failed to start HTTP server");
}
[MemoryUtils hookSymbol:@"QtCore"
symbolName:@"__Z21qRegisterResourceDataiPKhS0_S0_"
hookFunction:(void *)hooked_qRegisterResourceData