Update dependencies

This commit is contained in:
Mygod
2018-08-08 15:12:48 +08:00
parent edede5793e
commit b0d2db2d2d
9 changed files with 17 additions and 16 deletions

View File

@@ -6,7 +6,7 @@ buildscript {
ext {
androidPluginVersion = '3.2.0-beta05'
kotlinVersion = '1.2.60'
androidxVersion = '1.0.0-beta01'
androidxVersion = '1.0.0-rc01'
}
repositories {
google()

View File

@@ -4,7 +4,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
buildToolsVersion "28.0.1"
buildToolsVersion "28.0.2"
compileSdkVersion 28
defaultConfig {
applicationId "be.mygod.vpnhotspot"

View File

@@ -21,8 +21,9 @@ class ClientMonitorService : Service(), ServiceConnection, IpNeighbourMonitor.Ca
private var tetheredInterfaces = emptySet<String>()
private val receiver = broadcastReceiver { _, intent ->
tetheredInterfaces = TetheringManager.getTetheredIfaces(intent.extras).toSet() +
TetheringManager.getLocalOnlyTetheredIfaces(intent.extras)
val extras = intent.extras!!
tetheredInterfaces = TetheringManager.getTetheredIfaces(extras).toSet() +
TetheringManager.getLocalOnlyTetheredIfaces(extras)
populateClients()
}

View File

@@ -92,7 +92,7 @@ class RepeaterManager(private val parent: TetheringFragment) : Manager(), Servic
.setNegativeButton(android.R.string.cancel, null)
.setNeutralButton(R.string.repeater_wps_dialog_pbc) { _, _ -> binder?.startWps(null) }
.create()
dialog.window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
dialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
dialog.show()
}

View File

@@ -113,6 +113,7 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(),
TetheringManager.TETHER_ERROR_ENABLE_NAT_ERROR -> "TETHER_ERROR_ENABLE_NAT_ERROR"
TetheringManager.TETHER_ERROR_DISABLE_NAT_ERROR -> "TETHER_ERROR_DISABLE_NAT_ERROR"
TetheringManager.TETHER_ERROR_IFACE_CFG_ERROR -> "TETHER_ERROR_IFACE_CFG_ERROR"
TetheringManager.TETHER_ERROR_PROVISION_FAILED -> "TETHER_ERROR_PROVISION_FAILED"
else -> app.getString(R.string.failure_reason_unknown, error)
}
} catch (e: SecurityException) {

View File

@@ -88,9 +88,10 @@ class TetheringFragment : Fragment(), ServiceConnection {
var tetheringBinder: TetheringService.Binder? = null
val adapter = ManagerAdapter()
private val receiver = broadcastReceiver { _, intent ->
adapter.update(TetheringManager.getTetheredIfaces(intent.extras),
TetheringManager.getLocalOnlyTetheredIfaces(intent.extras),
intent.extras.getStringArrayList(TetheringManager.EXTRA_ERRORED_TETHER))
val extras = intent.extras!!
adapter.update(TetheringManager.getTetheredIfaces(extras),
TetheringManager.getLocalOnlyTetheredIfaces(extras),
extras.getStringArrayList(TetheringManager.EXTRA_ERRORED_TETHER)!!)
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {

View File

@@ -63,12 +63,10 @@ data class IpNeighbour(val ip: String, val dev: String, val lladdr: String, val
private var arpCacheTime = -ARP_CACHE_EXPIRE
private fun arp(): List<List<String>> {
if (System.nanoTime() - arpCacheTime >= ARP_CACHE_EXPIRE) try {
arpCache = File("/proc/net/arp").bufferedReader().useLines {
it.map { it.split(spaces) }
arpCache = File("/proc/net/arp").bufferedReader().readLines()
.map { it.split(spaces) }
.drop(1)
.filter { it.size >= 6 && mac.matcher(it[ARP_HW_ADDRESS]).matches() }
.toList()
}
} catch (e: IOException) {
e.printStackTrace()
Crashlytics.logException(e)

View File

@@ -55,7 +55,7 @@ class WifiP2pDialogFragment : DialogFragment(), TextWatcher, DialogInterface.OnC
setNegativeButton(context.getString(R.string.wifi_cancel), this@WifiP2pDialogFragment)
setNeutralButton(context.getString(R.string.repeater_reset_credentials), this@WifiP2pDialogFragment)
val arguments = arguments!!
configurer = arguments.getParcelable(KEY_CONFIGURER)
configurer = arguments.getParcelable(KEY_CONFIGURER)!!
val mWifiConfig = arguments.getParcelable<WifiConfiguration>(KEY_CONFIGURATION)
if (mWifiConfig != null) {
mSsid.text = mWifiConfig.SSID