VP8 pacing + traffic obfuscation in headless
This commit is contained in:
1 parent
deb1625617
commit
b48b0cb927
34 files changed
+936
-218
No files matched your search
@@ -118,6 +118,10 @@ class HeadlessRelayController(
|
||||
put("joinLink", joinLink)
|
||||
put("displayName", displayName)
|
||||
put("tunnelMode", tunnelMode)
|
||||
if (bypass.whitelist.util.Prefs.vp8PacingEnabled) {
|
||||
put("vp8Fps", bypass.whitelist.util.Prefs.vp8Fps)
|
||||
put("vp8Batch", bypass.whitelist.util.Prefs.vp8Batch)
|
||||
}
|
||||
}
|
||||
writeStdin("AUTH:$json")
|
||||
}
|
||||
|
||||
@@ -41,6 +41,10 @@ class HeadlessTelemostFragment : Fragment() {
|
||||
val params = JSONObject().apply {
|
||||
put("joinLink", joinLink)
|
||||
put("displayName", displayName)
|
||||
if (Prefs.vp8PacingEnabled) {
|
||||
put("vp8Fps", Prefs.vp8Fps)
|
||||
put("vp8Batch", Prefs.vp8Batch)
|
||||
}
|
||||
}
|
||||
relay.sendJoinParams(params.toString())
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ class SettingsDialogFragment : DialogFragment() {
|
||||
val splitTunnelingAppsItem = view.findViewById<TextView>(R.id.splitTunnelingAppsItem)
|
||||
val proxyItem = view.findViewById<TextView>(R.id.proxyItem)
|
||||
val dnsItem = view.findViewById<TextView>(R.id.dnsItem)
|
||||
val vp8PacingItem = view.findViewById<TextView>(R.id.vp8PacingItem)
|
||||
val autoclickItem = view.findViewById<TextView>(R.id.autoclickItem)
|
||||
val headlessCheckbox = view.findViewById<CheckBox>(R.id.headlessCheckbox)
|
||||
val reconnectCheckbox = view.findViewById<CheckBox>(R.id.reconnectOnStartCheckbox)
|
||||
@@ -101,6 +102,10 @@ class SettingsDialogFragment : DialogFragment() {
|
||||
DnsSettingsDialogFragment().show(childFragmentManager, DnsSettingsDialogFragment.TAG)
|
||||
}
|
||||
|
||||
vp8PacingItem.setOnClickListener {
|
||||
Vp8PacingSettingsDialogFragment().show(childFragmentManager, Vp8PacingSettingsDialogFragment.TAG)
|
||||
}
|
||||
|
||||
autoclickItem.setOnClickListener {
|
||||
showAutoclickSettingsDialog()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package bypass.whitelist.ui
|
||||
|
||||
import android.app.Dialog
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.CheckBox
|
||||
import android.widget.EditText
|
||||
import android.widget.LinearLayout
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import bypass.whitelist.R
|
||||
import bypass.whitelist.util.Prefs
|
||||
import bypass.whitelist.util.VP8Defaults
|
||||
|
||||
class Vp8PacingSettingsDialogFragment : DialogFragment() {
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val view = layoutInflater.inflate(R.layout.dialog_vp8_pacing_settings, null)
|
||||
|
||||
val enabledCheckbox = view.findViewById<CheckBox>(R.id.vp8PacingEnabledCheckbox)
|
||||
val inputsContainer = view.findViewById<LinearLayout>(R.id.vp8PacingInputs)
|
||||
val fpsInput = view.findViewById<EditText>(R.id.vp8FpsInput)
|
||||
val batchInput = view.findViewById<EditText>(R.id.vp8BatchInput)
|
||||
|
||||
enabledCheckbox.isChecked = Prefs.vp8PacingEnabled
|
||||
inputsContainer.visibility = if (Prefs.vp8PacingEnabled) View.VISIBLE else View.GONE
|
||||
fpsInput.setText(Prefs.vp8Fps.toString())
|
||||
batchInput.setText(Prefs.vp8Batch.toString())
|
||||
|
||||
enabledCheckbox.setOnCheckedChangeListener { _, checked ->
|
||||
inputsContainer.visibility = if (checked) View.VISIBLE else View.GONE
|
||||
}
|
||||
|
||||
return AlertDialog.Builder(requireContext())
|
||||
.setTitle(R.string.vp8_pacing_title)
|
||||
.setView(view)
|
||||
.setPositiveButton(android.R.string.ok) { _, _ ->
|
||||
Prefs.vp8PacingEnabled = enabledCheckbox.isChecked
|
||||
if (enabledCheckbox.isChecked) {
|
||||
val fps = fpsInput.text.toString().toIntOrNull()
|
||||
if (fps != null && fps in 1..240) {
|
||||
Prefs.vp8Fps = fps
|
||||
}
|
||||
val batch = batchInput.text.toString().toIntOrNull()
|
||||
if (batch != null && batch in 1..256) {
|
||||
Prefs.vp8Batch = batch
|
||||
}
|
||||
}
|
||||
}
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.create()
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG = "Vp8PacingSettingsDialog"
|
||||
|
||||
fun defaults(): Pair<Int, Int> = VP8Defaults.FPS to VP8Defaults.BATCH
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,14 @@ object PrefsKeys {
|
||||
const val DNS_MODE = "dns_mode"
|
||||
const val DNS_PRIMARY = "dns_primary"
|
||||
const val DNS_SECONDARY = "dns_secondary"
|
||||
const val VP8_PACING_ENABLED = "vp8_pacing_enabled"
|
||||
const val VP8_FPS = "vp8_fps"
|
||||
const val VP8_BATCH = "vp8_batch"
|
||||
}
|
||||
|
||||
object VP8Defaults {
|
||||
const val FPS = 24
|
||||
const val BATCH = 30
|
||||
}
|
||||
|
||||
const val BLANK_URL = "about:blank"
|
||||
|
||||
@@ -109,4 +109,16 @@ object Prefs {
|
||||
var dnsSecondary: String
|
||||
get() = prefs.getString(PrefsKeys.DNS_SECONDARY, Vpn.DNS_SECONDARY)!!
|
||||
set(value) = prefs.edit { putString(PrefsKeys.DNS_SECONDARY, value) }
|
||||
|
||||
var vp8PacingEnabled: Boolean
|
||||
get() = prefs.getBoolean(PrefsKeys.VP8_PACING_ENABLED, false)
|
||||
set(value) = prefs.edit { putBoolean(PrefsKeys.VP8_PACING_ENABLED, value) }
|
||||
|
||||
var vp8Fps: Int
|
||||
get() = prefs.getInt(PrefsKeys.VP8_FPS, VP8Defaults.FPS)
|
||||
set(value) = prefs.edit { putInt(PrefsKeys.VP8_FPS, value) }
|
||||
|
||||
var vp8Batch: Int
|
||||
get() = prefs.getInt(PrefsKeys.VP8_BATCH, VP8Defaults.BATCH)
|
||||
set(value) = prefs.edit { putInt(PrefsKeys.VP8_BATCH, value) }
|
||||
}
|
||||
Reference in new issue
Block a user