Downgrading suggestion
Currently downgrading via BMBF 2 is handled by Diff patching as far as I can see. That was probably done as logging in with Facebook and getting an Oculus token is pain. But just now I finally managed to do everything from within xamarin.
See commit of QuestAppVersionSwitcher here: https://github.com/ComputerElite/QuestAppVersionSwitcher/commit/f416d58ad4a3accdc42c78ce1498366d824fce80
I'll explain my approach of what you have to do in order to login via facebook: Basic knowledge: After login Oculus sends the token with the html page back to the user. The token can be extracted with following js code:
document.body.innerHTML.substr(document.body.innerHTML.indexOf("accessToken"), 200).split('"')[2]);
Oculus blocks basically all url to post to so you have to do one of 2 things: Either get the result of the js code via C# (this was not possible in the case of QuestAppVersionSwitcher)
or
Connect with a webserver at ws://localhost:*
as that url is allowed to be connected to on oculus.com (probably so it can communicate with the pc app)
Implementation: backend:
- Listen for Websocket connections from localhost.
- If the url is on oculus.com execute following js code:
var ws = new WebSocket('ws://localhost:50001/' + document.body.innerHTML.substr(document.body.innerHTML.indexOf("accessToken"), 200).split('"')[2]);
That will try to connect to the websocket and have the token in the path. Alternitavely connect to the websocket and then send the token as normal message.
- Once the token has been recieved open some page on the BMBF frontend which initiates downloads of beat saber. You can give it the token e. g. via a query parameter
frontend:
- Just have login button which redirects to
https://auth.oculus.com/login/?redirect_uri=https%3A%2F%2Fwww.oculus.com%2Fexperiences%2Fquest%2F
- After you got the token add An iframe to
https://oculusdb.rui2015.me/id/2448060205267927?connected=versions
. Once a user pressed the download button OculusDB is gonna send a message to the parent window with the content:
{
type: "Download",
binaryId: "7416288631778368",
parentId: "2448060205267927",
parentName: "Beat Saber",
version: "1.22.0"
}
(I may add an url value as well) You can listen to that message via:
window.onmessage = (e) => {
vara clickedVersion = JSON.parse(e.data)
}
- With that info BMBF can start the Download of Beat Saber
If anything is unclear just ask