Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ object CoreOutboundBuilder {
serverName = sni.nullIfBlank(),
fingerprint = profileItem.fingerPrint.nullIfBlank(),
alpn = profileItem.alpn?.split(",")?.map { it.trim() }?.filter { it.isNotEmpty() }.takeIf { !it.isNullOrEmpty() },
cipherSuites = profileItem.cipherSuites.nullIfBlank(),
echConfigList = profileItem.echConfigList.nullIfBlank(),
verifyPeerCertByName = profileItem.verifyPeerCertByName.nullIfBlank(),
pinnedPeerCertSha256 = profileItem.pinnedCA256.nullIfBlank(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ data class ProfileItem(
var sni: String? = null,
var alpn: String? = null,
var fingerPrint: String? = null,
var cipherSuites: String? = null,
var insecure: Boolean? = null,
var echConfigList: String? = null,
var verifyPeerCertByName: String? = null,
Expand Down
8 changes: 8 additions & 0 deletions V2rayNG/app/src/main/java/com/v2ray/ang/ui/ServerActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ class ServerActivity : BaseActivity() {
private val et_path: EditText? by lazy { findViewById(R.id.et_path) }
private val sp_stream_alpn: Spinner? by lazy { findViewById(R.id.sp_stream_alpn) } //uTLS
private val container_alpn: LinearLayout? by lazy { findViewById(R.id.lay_stream_alpn) }
private val et_cipher_suites: EditText? by lazy { findViewById(R.id.et_cipher_suites) }
private val container_cipher_suites: LinearLayout? by lazy { findViewById(R.id.lay_cipher_suites) }
private val et_public_key: EditText? by lazy { findViewById(R.id.et_public_key) }
private val et_preshared_key: EditText? by lazy { findViewById(R.id.et_preshared_key) }
private val container_public_key: LinearLayout? by lazy { findViewById(R.id.lay_public_key) }
Expand Down Expand Up @@ -298,6 +300,7 @@ class ServerActivity : BaseActivity() {
container_sni,
container_fingerprint,
container_alpn,
container_cipher_suites,
container_allow_insecure,
container_public_key,
container_short_id,
Expand All @@ -315,6 +318,7 @@ class ServerActivity : BaseActivity() {
container_sni,
container_fingerprint,
container_alpn,
container_cipher_suites,
container_allow_insecure,
container_ech_config_list,
container_verify_peer_cert_by_name,
Expand All @@ -336,6 +340,7 @@ class ServerActivity : BaseActivity() {
).forEach { it?.visibility = View.VISIBLE }
listOf(
container_alpn,
container_cipher_suites,
container_allow_insecure,
container_ech_config_list,
container_verify_peer_cert_by_name,
Expand Down Expand Up @@ -424,6 +429,7 @@ class ServerActivity : BaseActivity() {
if (allowinsecure >= 0) {
sp_allow_insecure?.setSelection(allowinsecure)
}
et_cipher_suites?.text = Utils.getEditable(config.cipherSuites)
et_ech_config_list?.text = Utils.getEditable(config.echConfigList)
et_verify_peer_cert_by_name?.text = Utils.getEditable(config.verifyPeerCertByName)
et_pinned_ca256?.text = Utils.getEditable(config.pinnedCA256)
Expand Down Expand Up @@ -628,6 +634,7 @@ class ServerActivity : BaseActivity() {
val shortId = et_short_id?.text?.toString()
val spiderX = et_spider_x?.text?.toString()
val mldsa65Verify = et_mldsa65_verify?.text?.toString()
val cipherSuites = et_cipher_suites?.text?.toString()
val echConfigList = et_ech_config_list?.text?.toString()
val verifyPeerCertByName = et_verify_peer_cert_by_name?.text?.toString()
val pinnedCA256 = et_pinned_ca256?.text?.toString()
Expand All @@ -644,6 +651,7 @@ class ServerActivity : BaseActivity() {
config.sni = sniField
config.fingerPrint = uTlsItems[utlsIndex]
config.alpn = alpns[alpnIndex]
config.cipherSuites = cipherSuites
config.publicKey = publicKey
config.shortId = shortId
config.spiderX = spiderX
Expand Down
21 changes: 21 additions & 0 deletions V2rayNG/app/src/main/res/layout/layout_tls.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,27 @@
android:layout_marginTop="@dimen/padding_spacing_dp8"
android:layout_marginBottom="@dimen/padding_spacing_dp8"
android:entries="@array/streamsecurity_alpn"
android:nextFocusDown="@+id/et_cipher_suites" />

</LinearLayout>

<LinearLayout
android:id="@+id/lay_cipher_suites"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/padding_spacing_dp16"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/server_lab_cipher_suites" />

<EditText
android:id="@+id/et_cipher_suites"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:nextFocusDown="@+id/sp_allow_insecure" />

</LinearLayout>
Expand Down
1 change: 1 addition & 0 deletions V2rayNG/app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<item>qq</item>
<item>random</item>
<item>randomized</item>
<item>unsafe</item>
</string-array>

<string-array name="streamsecurity_alpn" translatable="false">
Expand Down
1 change: 1 addition & 0 deletions V2rayNG/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<string name="server_lab_stream_security">TLS</string>
<string name="server_lab_stream_fingerprint">Fingerprint</string>
<string name="server_lab_stream_alpn">Alpn</string>
<string name="server_lab_cipher_suites">Cipher Suites</string>
<string name="server_lab_allow_insecure">allowInsecure</string>
<string name="server_lab_sni">SNI</string>
<string name="server_lab_address3">address</string>
Expand Down