Skip to content

Instantly share code, notes, and snippets.

@eesheesh
Created January 24, 2021 17:51
Show Gist options
  • Star 32 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save eesheesh/e2da0e61a85e50ebf23651eb1921517f to your computer and use it in GitHub Desktop.
Save eesheesh/e2da0e61a85e50ebf23651eb1921517f to your computer and use it in GitHub Desktop.

There's a workaround that might be useful for some people - use the Shadowsocks app for Android TV. Because that app only accepts a JSON configuration file, you need to convert the Outline key to JSON.

  1. Take the following JSON file template:
    {
        "server":"YOUR-SERVER",
        "server_port":12345,
        "local_port":1080,
        "password":"YOUR-PASSWORD",
        "method":"chacha20-ietf-poly1305",
        "remarks": "Outline Server"
    }
  2. From the Outline key (ss://...), take the server name/IP and port and put them in place of YOUR-SERVER and 12345 (respectively).
  3. Take the base64 part of the Outline key (everything after ss:// and before @) and decode it using a base64 decoder.
  4. The resulting string is the method and password, separated by a colon (e.g. chacha20-ietf-poly1305:56gsef6zr5). Take the password and put it in place of YOUR-PASSWORD in the JSON file. If the method isn't chacha20-ietf-poly1305, update it in the JSON "method" field.
  5. Install the Shadowsocks app for Android TV on your Android TV / Google TV device.
  6. Copy the JSON file to your device. If you don't have a way to do that, there are many file managers available for Android TV. If you already have Kodi installed, it has a built-in file manager in Settings, that can be used to copy from network shares as well.
  7. Open the Shadowsocks app on your device and select "Replace from file".
    • If you get a "No application can handle this action" error, you also need to install a file manager that can handle selecting a file from the file system. Not all file managers can do this. On Chromecast with Google TV, I found that it works after installing this app.
  8. You should now be able to connect to your Outline server from the app.

References: Outline Linux docs, Shadowsocks configuration format.

@sanyakyper
Copy link

Don't work : Libsslocal exist too fast(Exit code:78)

@eesheesh
Copy link
Author

eesheesh commented Jan 5, 2022

@sanyakyper are you seeing this error on Raspberry Pi, or on Android? If you're seeing it on Android, this is probably an issue with your Android app, not with these instructions.

If you're seeing this on Raspberry Pi, it's probably something wrong with the configuration, according to https://docs.rs/exitcode/1.0.1/i686-unknown-linux-gnu/src/exitcode/lib.rs.html#86.

@floud
Copy link

floud commented Mar 27, 2022

It works, thanks a lot!

@diveru4i
Copy link

diveru4i commented Apr 5, 2022

Works like a charm, thanks!

Device: Chromecast with Google TV
File manager: Amaze
Extra app: Downloader

@olegenii
Copy link

Thank you! Its working amazing on my Mi Box S.

@scott1991
Copy link

Works on my SONY google TV!
I use a usb-disk to transfer the file.

@Ne0Wan9
Copy link

Ne0Wan9 commented Aug 23, 2022

It works on my Sony TV! 3Q!

@dmitryd
Copy link

dmitryd commented Oct 28, 2022

Works on Philips Android TV but needs that file manager app. Though beware of traffic: it took about 50 MB right after the connection while being completely idle. I decided to connect only when necessary because the TV seems to use too much traffic when not needed.

@MrAndrewMal
Copy link

Thank you! Working on Xiaomi Mi TV Stick.

@SiavashB
Copy link

SiavashB commented Feb 22, 2023

One part is not clear, when you say server name/ip, do you mean JUST the IP addres portion from the access key (eg 12.34.45.12), or the entire string after ss:// and before the port number? (eg khdsfs78df6s87df7sd6f@12.34.45.12)

Solved: Through trial and error I discovered that its the former, just the ip address alone

@eesheesh
Copy link
Author

One part is not clear, when you say server name/ip, do you mean JUST the IP addres portion from the access key (eg 12.34.45.12), or the entire string after ss:// and before the port number? (eg khdsfs78df6s87df7sd6f@12.34.45.12)

@SiavashB I mean just the IP address portion (e.g. 12.34.45.12), not anything including @ or : (well, technically an IPv6 address would include a :, but that's still quite rare).

@MightyMartyn
Copy link

Thank U much, man!

@denisdenis3000
Copy link

Hi, there!

Device: Xiaomi TV Stick Andriod TV
File manager: X-plore File Manager

X-plore File Manager does not see the *JSON file. Maybe you can describe in more detail how to use another file manager, for example Amaze or AnExplorer?

@eesheesh
Copy link
Author

Hi, there!

Device: Xiaomi TV Stick Andriod TV File manager: X-plore File Manager

X-plore File Manager does not see the *JSON file. Maybe you can describe in more detail how to use another file manager, for example Amaze or AnExplorer?

You can try other file manager apps, they might work. Generally, all you need to do is install them. You should make sure to give the file manager full access to files (not only when the app is running) - this is different between different Android devices.

@lethalarm
Copy link

Guys, is there a video that can explain all this, I'm not familiar with decoding and would like to use the outline app on my TV !
Thanks a lot in advance

@eesheesh
Copy link
Author

@viktorbek I deleted your comment because you posted your key - you should never do it, it's private.

@viktorbek
Copy link

@viktorbekЯ удалил ваш комментарий, потому что вы опубликовали свой ключ — никогда не делайте этого, это конфиденциально.

You shouldn't have, I changed it in some places, it was for an example

@viktorbek
Copy link

@viktorbekЯ удалил ваш комментарий, потому что вы опубликовали свой ключ — никогда не делайте этого, это конфиденциально.

So can you help? My key doesn't have @

@ghajar77
Copy link

ghajar77 commented Oct 27, 2023

thanks it work ..
who can i convert oder lines like v2ray vless or vmess file to .json ?

@ghajar77
Copy link

I made a shadowsocks line and wanted to convert it to a .json file, and I did, but I didn't know what to put the port.
I made it in the Marzban panel. It was connected to the TV in the Shadowsocks program, but it didn't work. I think the problem is with the port.

@eesheesh
Copy link
Author

@viktorbek was the key created by Outline?

The structure of a key is:

ss://<base64>@<ip>:<port>/?outline=1

For example (fake data):

ss://Z2h6JKdfdFdR34eYdh5E=@1.2.3.4:25683/?outline=1

If your key is structured differently, maybe it's some other type of key?

@ghajar77
Copy link

ghajar77 commented Oct 27, 2023

How can I convert Shadowsocks line for Android TV?
or other lines such as vless or vmess
outline has no ip limit.
That's why I want to try to convert other protocols like vless or vmess.

@ghajar77
Copy link

problem was in port .
sloved/
now how can i convert vless or vmess to .json ?

@slavinskiyboris
Copy link

Hey. Thanks. It works on Mi TV stick

@ryudkin777
Copy link

I am getting Libsslocal exist too fast(Exit code:78) on Chromecast for Google TV while trying to connect to Outline VPN server after importing json config in Shadowsocks app. Any ideas?

@nickwe3
Copy link

nickwe3 commented Dec 19, 2023

Amazing, thanks for the tuto.

Works great with Google Chromecast TV

@ghajar77
Copy link

I used this method to convert the outline configuration for the shadowsocks program and it worked. But now, due to severe filtering in my country, I can only use other accounts such as vless along with Fragment.
Is there a way to import Json file with Vless configuration in shadowsocks program? Because the program only accepts the file in the format you described and the configuration is no longer entered into the program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment