pajowu / superbird-custom-webapp

92 stars 1 forks source link

`/usr/share/qt-superbird-app/webapp` does not exist #5

Open H4CK3RxDE opened 1 year ago

H4CK3RxDE commented 1 year ago

When I try loading either the WebApp or the react based WebApp, I get the following error: mountpoint: /usr/share/qt-superbird-app/webapp/: No such file or directory After looking into it via ADB it seems this directory (/webapp) does not exist. Any advice?

mogorman commented 1 year ago

I also hit this same issue. I assume its because our devices are booting with not the same version of firmware they are. I think trick will be updating files referenced in ./scripts/upload-kernel.sh but i havent figured out how to do this yet.

mogorman commented 1 year ago

the version VERSION v6.3.29-release-868a461c55a1770b1db1bb226207e8a8540e7282 SHORT_VERSION v6.3.29-release GIT_HASH 868a461c55a1770b1db1bb226207e8a8540e7282

seems to have the webapp embedded in the binary from what i can tell by strings the binary. but it also has a flag -u,--url TEXT Url from where to load webapp that when set always just renders a white screen for me. i have tried many permutations trying to point to /tmp/webapp/index.html with no luck yet.

ivybowman commented 1 year ago

I haven't been able to get the url parameter to work either, I wonder if there is a whitelist of urls. I would prefer to find a way to just replace qt-super-bird-app entirely though.

lmore377 commented 1 year ago

Not sure when the switch was made but at some point spotify decided to repurpose qt-superbird-app into a daemon of sorts and just drop in a very slim wayland compositor (weston) and a copy of chromium that just autolaunches into a web app stored in /usr/share/qt-superbird-app/webapp. If you're on the latest version of the firmware you can just edit /etc/supervisord.conf to disable qt-superbird-app and change the chromium launch flags to whatever you want.

Merlin04 commented 1 year ago

Is there any way to update the device without having to use the app? That definitely seems like it would be easier to extend, I'd like to try to get my device running that firmware version

mogorman commented 1 year ago

actually i was able to get the url command to do something. by passing qrc:///build/index.html into it does load the stock app rather than the white screen

lmore377 commented 1 year ago

Is there any way to update the device without having to use the app?

Swupdate is strict and refuses to update if you've modified anything but if you want to try anyways you can push this file over adb to /tmp and run swupdate-client /tmp/superbird-os_8.1.6-release_c47e1676f88ebf61796f940713d0423f.swu to see if it does it. This should be the latest firmware available.

https://mega.nz/file/Yh12UTLY#3jkRy_gS9iJvliPfVghXPoppoTGElycHSGFpawZoEpM

mogorman commented 1 year ago

that update command succeeds but it updates the _b side. do you know how to boot the _b side? or to force it to update the _a side?

lmore377 commented 1 year ago

Try doing phb -s 1 over adb that should force it to slot B

mogorman commented 1 year ago

ran fine

/ # phb -s 1
reading misc partition data...

setting active slot to 1...

writing misc partition data...

done!
/ # reboot

but when i run sudo ./scripts/upload-kernel.sh it still boots the _a. I tried rebuilding it changing _a to _b in the init and changing scripts/env.txt to _b as well with no luck just seems to hang on the spotify hack screen even if adb shell lets me in.

lmore377 commented 1 year ago

Oh upload-kernel.sh uploads an older kernel that doesn't support newer firmwares. You'll need to disable avb and enable adb in the installed firmware. This repo has a good process for enabling it https://github.com/bishopdynamics/superbird-tool

mogorman commented 1 year ago

if i disable avb and enable adb i thought that caused the firmware updates to fail?

lmore377 commented 1 year ago

It does but since the firmware already updated successfully all we need to do is tell the kernel which boot slot to use. The disable-avb2.sh script in superbird-bulkcmd should already be properly set up to boot to slot B

mogorman commented 1 year ago

i tried doing this and now i dont have a booting device. I am able to get it to boot by starting over from the start and then doing the --boot_adb_kernel

lmore377 commented 1 year ago

Give me a bit I'm just going to upload a clean firmware from a new car thing so you can start from scratch. Hopefully no one at spotify gets mad lmao

lmore377 commented 1 year ago

https://github.com/err4o4/spotify-car-thing-reverse-engineering/issues/22

Getting off for tonight but here's this so you can start fresh

mogorman commented 1 year ago

factory resetting it at least gets me back to stock.

ivybowman commented 1 year ago

Not sure when the switch was made but at some point spotify decided to repurpose qt-superbird-app into a daemon of sorts and just drop in a very slim wayland compositor (weston) and a copy of chromium that just autolaunches into a web app stored in /usr/share/qt-superbird-app/webapp. If you're on the latest version of the firmware you can just edit /etc/supervisord.conf to disable qt-superbird-app and change the chromium launch flags to whatever you want.

Can you elaborate how to do this?

lmore377 commented 1 year ago
  1. Ensure that you're on a firmware version that made the switch to chromium (there should be /usr/bin/chromium-browser). If not, just update the firmware with the spotify app (just leave it connected for ~10-15 minutes then reboot car thing) or try using the .swu file linked above
  2. Enable adb using whichever method you like (I like the one here under the example usage section)
  3. After enabling adb and rebooting, remount / as rw (mount -o remount,rw /)
  4. In /etc/supervisiord.conf, go to the program:superbird section and change autostart to false. While you're here you can also change --app under the chromium section to something else if you don't want to override the default webapp
  5. Just reboot and now it shouldn't connect to your phone and if you put your own webapp it'll auto launch it
lmore377 commented 1 year ago

For anyone having issues with getting to the latest firmware, I made a dump of it with some changes added to make tinkering easier. Linked it here https://github.com/err4o4/spotify-car-thing-reverse-engineering/issues/22

mogorman commented 1 year ago

using the latest image linked by lmore377 solves the problem. if you change the ./scripts/load_webapp.sh to restart chromium instead of superbird

vitorio commented 1 year ago

If you don't want to flash an updated firmware, I've documented the necessary JavaScript to initialize the stock Superbird here: https://github.com/err4o4/spotify-car-thing-reverse-engineering/issues/24

Note that there's still no "path" to the existing webapp, since it's embedded as QtResources in the qt-superbird-app binary, and it'll have to be extracted with a decompiler.

ivybowman commented 1 year ago

Honestly my recommendation to people as someone who has used both firmwares, is to just flash the update as it's so much easier to work with. Additionally it's a very simple update process.

lmore377 commented 1 year ago

Another thing, I don't know if it's just me but it feels like the automatic brightness has a better algorithm and the web app feels smoother on new versions