Skip to content
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

Contacts and shared folders support? Usage of owner IDs? Errors with attribute deserialization! #231

Open
plrusek opened this issue Jul 28, 2023 · 1 comment

Comments

@plrusek
Copy link

plrusek commented Jul 28, 2023

Hello, I've been looking to implement the ability to get shared folders and files from those shared folders from contacts that any Mega.io user can have in my own app, similar to how Mega does it on their website:
image
I noticed that these files are most probably appearing anyway using GetNodes(), mainly because the Owner for them is different than all the other files. However, there seems to be an issue with these Nodes that make it hard to exactly identify:
image
There's an exception in the Name field for these kind of files. Also, I've been wondering - is there any use for the Owner ID? I've searched the repo but didn't find any on my own. Most ideally I would wish to use it to get more information about the owner of that file, like their e-mail address or maybe even name since Mega does display this information on their website. Is it possible using the "g.api.mega.co.nz"?

@plrusek
Copy link
Author

plrusek commented Jul 31, 2023

I've debugged using dnSpy what's happening inside Node in OnDeserialized function. It seems the key for decrypting the attributes before they're about to be deserialized is wrong for files and folders shared from a different owner. The "SerializedKey" property (which in mega.nz's JSON response is "k") for my own files are always structured like this: "(Owner):(Key)", as opposed to these files from a different owner, where the key ("k") is structured like this: "(ParentId):(Key)". It doesn't seem to matter in code because there's a substring after the ":" char anyway, but I thought maybe something about it could help in fixing this issue of not being able to deserialize attributes properly.

Maybe the SharedKey has to be used?

EDIT: I just noticed that in Node class, SharedKey is supposed to be deserialized from the field named "sk" in mega.nz's JSON response. However, there is not a single "sk" present in that response - none of the Nodes have a SharedKey (it's all null).

@plrusek plrusek changed the title Contacts and shared folders support? Usage of owner IDs? Contacts and shared folders support? Usage of owner IDs? Errors with deserialization! Jul 31, 2023
@plrusek plrusek changed the title Contacts and shared folders support? Usage of owner IDs? Errors with deserialization! Contacts and shared folders support? Usage of owner IDs? Errors with attribute deserialization! Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@plrusek and others