-
Notifications
You must be signed in to change notification settings - Fork 4
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
Custom HTML using the stock, out-of-the-box firmware #24
Comments
I ended up with a version of
|
Are you sure you're still running the stock, out-of-the-box firmware? I believe stock is version 6.3.29, whereas the final versions were 8.2.5 or 8.3.6, maybe? If there's a |
It seemed like extra hassle to have to update the firmware just to run a custom webapp, so here's the minimum amount of JavaScript to initialize the stock, OOTB Superbird so you can see your own HTML on it.
Unlike the Chromium in later firmware, the stock Superbird is running QtWebEngine 5.12.7, equivalent to Chromium 69.0.3497.113 (although its User-Agent reports 69.0.3497.128). The webapp is built into the
qt-superbird-app
, embedded as Qt resources. It can be extracted from the binary using Ghidra and the scripts described in @gipi's article, Reversing C++, Qt based applications using Ghidra, available in their repo at https://github.com/gipi/ghidra_scripts.There's no "Control WebSocket" in the stock app when it first launches, it instead initially uses a QWebChannel, and there appear to be a few initialization commands sent back from the webapp to
qt-superbird-app
before it will start rendering HTML and provide messages over the QWebChannel. Not all the initialization commands are necessary to start rendering HTML, and the status messages that come in regularly over the QWebChannel can be ignored.QtWebEngine heavily caches all the files it accesses, and manually emptying the cache(s) between runs will spare a lot of headaches when testing.
Assuming you've followed in the instructions in @frederic's https://github.com/frederic/superbird-bulkcmd repo to enable ADB (or equivalent), you can do something like this to stop the existing processes, upload an
example.html
, clear the caches, and launchqt-superbird-app
manually using the same configuration as specified forsupervisord
plus a Chrome remote debugging port:You can also run your webapp on your local machine and reverse the port to the Superbird using ADB, replacing
--url file:///tmp/webapp/example.html
above with--url http://localhost:8000/example.html
:Here's the contents of
example.html
, themeta
elements are from the stock webapp,qwebchannel.js
is built-in, thehandleResponse
function overloads the stock one to not delete the callbacks once they're executed to avoid some JS warnings, and thesignalEmitted
function is where you'd go to see the status messages coming in over the channel:When run, it looks like this:
The text was updated successfully, but these errors were encountered: