uwu / neptune

an experimental client mod for TIDAL
Microsoft Public License
116 stars 6 forks source link

neptune.store.getState().session.oAuthAccessToken is null #20

Closed Inrixia closed 5 months ago

Inrixia commented 6 months ago

Unsure if tidal is obscuring these properties now or if its just a change that needs to be fixed on Neptune's end.

If you can give any insight into that and/or any workarounds it would be appreciated.

Inrixia commented 6 months ago

Also having some information around how to have a dev environment for testing changes to Neptune directly would be nice so I could potentially look into some of these issues myself.

twnlink commented 6 months ago

I believe this isn't something neptune itself can fix. To test neptune locally you can install neptune's dependencies with pnpm i, and then launch TIDAL with the NEPTUNE_DIST_PATH environment variable to the resulting file.

Inrixia commented 6 months ago

Yea I was kinda expecting that. Do you know if its possible to hook requests to view their headers or if there is any other tidal internals that could be hooked to look at?

And thanks for the build info

Inrixia commented 6 months ago

Ie being able to view the MessageEvent data being set to the service worker would be very helpful

twnlink commented 6 months ago

You can view TIDAL's native code via unpacking resources/app.asar (I think?) in the TIDAL folder using the asar npm package. There's not much I know about for intercepting data.

Inrixia commented 6 months ago

What are you using to unpack asar files?

twnlink commented 6 months ago

pnpm dlx asar e original.asar folder-name

Inrixia commented 6 months ago

Hmm I think the latest tidal asar file isnt extracting properly. Been getting this error when trying using various methods...

pnpm\store\v3\tmp\dlx-12476\node_modules\.pnpm\asar@3.2.0\node_modules\asar\lib\filesystem.js:132
      return node.files[name]
                       ^

TypeError: Cannot read properties of undefined (reading 'Breakpad')
Inrixia commented 6 months ago

In fact trying to reinstall Neptune seems to not be working either afik

Nevermind had to retry and it worked

Inrixia commented 6 months ago

Do you know if its possible to get a handle on the electron variable from within a plugin?

Inrixia commented 5 months ago

@twnlink Any idea if the above is viable? Electron supports intercepting web requests. If I was able to do that it would make my life a whole lot easier.

twnlink commented 5 months ago

The issue here is that there's two variants of the electron package, one that lives in the main process (the one that summons the BrowserWindow) that you're trying to access, and the one that lives in preload / the renderer (the one that neptune provides access to), one way to solve this problem is to use IPC to take a string to eval in the main process, but neptune doesn't setup IPC in the main process. Right now we don't have a native-side updater, I'm thinking I'll probably push an update that adds this by using the native APIs we do have access to to rewrite old neptune installs (using fs) but currently this isn't a thing.

Inrixia commented 5 months ago

Right. That's understandable.

Having the ability to push code to eval on the main process would be super useful as it would allow any plugin to inject. If you do get around to implementing those updates I'd love it if you could let me know.

Thanks again for all your help and work on this, wouldn't be able to make the plugins I have without it! Ill close this for now :)