Update dependencies

This commit is contained in:
Mygod
2019-01-03 23:22:28 +08:00
parent 32c5973cdc
commit b00791d644
11 changed files with 125 additions and 105 deletions

View File

@@ -43,6 +43,7 @@ class Routing(val downstream: String, ownerAddress: InterfaceAddress? = null) :
* Source: https://android.googlesource.com/platform/external/iptables/+/android-5.0.0_r1/iptables/iptables.c#1574
*/
val IPTABLES = if (Build.VERSION.SDK_INT >= 26) "iptables -w 1" else "iptables -w"
const val KEY_DNS = "service.dns"
fun clean() {
TrafficRecorder.clean()
@@ -212,7 +213,7 @@ class Routing(val downstream: String, ownerAddress: InterfaceAddress? = null) :
private var currentDns: DnsRoute? = null
private fun updateDnsRoute() {
var dns = (upstream.dns + fallbackUpstream.dns).firstOrNull { it is Inet4Address }?.hostAddress
?: app.pref.getString("service.dns", null)
?: app.pref.getString(KEY_DNS, null)
if (dns.isNullOrBlank()) dns = "8.8.8.8"
if (dns != currentDns?.dns) {
currentDns?.transaction?.revert()

View File

@@ -61,9 +61,7 @@ class WifiP2pDialogFragment : AlertDialogFragment(), TextWatcher, DialogInterfac
mPassword.addTextChangedListener(this@WifiP2pDialogFragment)
}
override val data get() = Intent().apply {
putExtra(KEY_CONFIGURATION, config)
}
override val data get() = Intent().putExtra(KEY_CONFIGURATION, config)
override fun onStart() {
super.onStart()