shadowsocks / shadowsocks-android

A shadowsocks client for Android
Other
35.25k stars 11.57k forks source link

Failed to import ss:// (ssurl bug or Android app bug?) #3135

Open brianwoo opened 1 year ago

brianwoo commented 1 year ago

Please read contributing guidelines. Thanks.

Describe the bug Unable to import ss:// into the Android App. I am unsure if this is a ssurl bug or the Android app.

To Reproduce Steps to reproduce the behavior:

  1. Generate a password with ssservice genkey

    /opt/shadowsocks/ssservice genkey --encrypt-method "2022-blake3-chacha20-poly1305"
    F6BY4IwbXB5Juobo2aofoJ6P86G/yBYJO3pJzcMIUOU=
  2. Create a json file with all the configuration

    cat ~/Downloads/client.json 
    {
    "server": "1.2.3.4",
    "server_port": 8400,
    "password": "F6BY4IwbXB5Juobo2aofoJ6P86G/yBYJO3pJzcMIUOU=",
    "method": "2022-blake3-chacha20-poly1305"
    }
  3. Encode the json to an ss:// string

    /opt/shadowsocks/ssurl --encode ~/Downloads/client.json
    ss://2022-blake3-chacha20-poly1305:F6BY4IwbXB5Juobo2aofoJ6P86G%2FyBYJO3pJzcMIUOU%3D@1.2.3.4:8400
  4. If I import this ss:// string into the Android app, I get an error "Failed to import."

  5. If I decode the ss:// string (notice the password has a backslash for escaping the forward slash):

    /opt/shadowsocks/ssurl --decode ss://2022-blake3-chacha20-poly1305:F6BY4IwbXB5Juobo2aofoJ6P86G%2FyBYJO3pJzcMIUOU%3D@1.2.3.4:8400
    {"server":"1.2.3.4","server_port":8400,"password":"F6BY4IwbXB5Juobo2aofoJ6P86G\/yBYJO3pJzcMIUOU=","method":"2022-blake3-chacha20-poly1305","mode":"tcp_and_udp"}

Expected behavior ss:// string should be imported, even with an escape char in the json

Smartphone (please complete the following information):

Configuration Put an x inside the [ ] that applies.

DmitryPogrebnoy commented 9 months ago

I faced the same problem with others AEAD 2022 encryption methods. Without it, it is impossible to use the feature "one port -multiple users".