dev7dev/V2ray-Android

vmess to json

Closed this issue · 1 comments

huonie commented

Hello, I want to add a vmess to json class in the app, how to do it, because it is too troublesome to convert to json every time

Hello
Unfortunately, due to busy work, I cannot add this option to the library at the moment.
But I can guide you.
As you probably know, the vmess links are a base64 summary of the outbound part of JSON config.
For example:
this vmess uri :

vmess://eyJhZGQiOiIxLjEuMS4xIiwiYWlkIjoiMCIsImhvc3QiOiIiLCJpZCI6IjkwYTU0NGM2LTcwYjUtNDZjMC1kZGQzLTdkZWQ3ZTBmOTA3MiIsIm5ldCI6ImdycGMiLCJwYXRoIjoiIiwicG9ydCI6IjQ0NCIsInBzIjoiZXhhbXBsZS1ncnBjIiwic2N5IjoiYXV0byIsInNuaSI6IiIsInRscyI6IiIsInR5cGUiOiJub25lIiwidiI6IjIifQ==

have this information:

{
"add":"1.1.1.1",
"aid":"0",
"host":"",
"id":"90a544c6-70b5-46c0-ddd3-7ded7e0f9072",
"net":"grpc",
"path":"",
"port":"444",
"ps":"example-grpc",
"scy":"auto",
"sni":"",
"tls":"",
"type":"none",
"v":"2"
}

Now you can create a complete JSON by combining a raw default JSON that has basic and default information with the same information that was in the vmess link.

If you do this, we will be happy if you push it for us so that others can use it.