Skip to content

Commit

Permalink
keep url_group
Browse files Browse the repository at this point in the history
  • Loading branch information
xxf098 committed Jan 15, 2020
1 parent 0bf2ab6 commit ec8c3d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/main/scala/com/github/shadowsocks/database/Profile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ class Profile {
this.v_type,
this.v_host,
this.v_path,
this.v_tls)
this.v_tls,
this.url_group)
val vmessJson = new GsonBuilder().setPrettyPrinting().create().toJson(vmessQRCode)
// Log.e("Profile", vmessJson)
return "vmess://" + Base64.encodeToString(
Expand Down
8 changes: 5 additions & 3 deletions src/main/scala/com/github/shadowsocks/database/V2ray.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ case class VmessQRCode(v: String,
`type`: String,
host: String,
path: String,
tls: String
tls: String,
url_group: String
)

case class VmessBean(
Expand All @@ -33,13 +34,14 @@ case class VmessBean(
var configType: Int,
var configVersion: Int,
var testResult: String,
var subid: String
var subid: String,
var url_group: String
)

object VmessBean {
def apply(): VmessBean = {
val guid = UUID.randomUUID().toString.replace("-", "")
VmessBean(guid, "v2ray.com", 10086, "id", 64, "aes-128-cfb", "tcp", "def", "", "", "", "", 1, 2, "", "")
VmessBean(guid, "v2ray.com", 10086, "id", 64, "aes-128-cfb", "tcp", "def", "", "", "", "", 1, 2, "", "", "v2ray")
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/scala/com/github/shadowsocks/utils/Parser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ object Parser {
profile.v_tls = vmessBean.streamSecurity
// common
profile.name = profile.v_ps
profile.url_group = "v2ray"
profile.url_group = vmessBean.url_group
profile
}

Expand Down Expand Up @@ -196,6 +196,7 @@ object Parser {
vmess.path = vmessQRCode.path
vmess.streamSecurity = vmessQRCode.tls
vmess.subid = ""
vmess.url_group = if (TextUtils.isEmpty(vmessQRCode.url_group)) vmess.url_group else vmessQRCode.url_group
Some(vmess)
}

Expand Down

0 comments on commit ec8c3d6

Please sign in to comment.