wip
This commit is contained in:
@@ -220,6 +220,7 @@
|
||||
<action android:name="hanson.xyz.vpnhotspotmod.WIFI_TETHER_STOP" />
|
||||
<action android:name="hanson.xyz.vpnhotspotmod.BT_TETHER_START" />
|
||||
<action android:name="hanson.xyz.vpnhotspotmod.BT_TETHER_STOP" />
|
||||
<action android:name="android.net.conn.TETHER_STATE_CHANGED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ class MyBroadcastReceiver : BroadcastReceiver(), TetheringManager.StartTethering
|
||||
for (startable in config.startables.values) startable.start(App.app)
|
||||
}
|
||||
TetheringManager.startTethering(TetheringManager.TETHERING_WIFI, false, this)
|
||||
|
||||
Toast.makeText(context, "Started tethering", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
if (intent.action.toString().contains("WIFI_TETHER_STOP")) {
|
||||
TetheringManager.stopTethering(TetheringManager.TETHERING_WIFI)
|
||||
@@ -83,11 +83,13 @@ class MyBroadcastReceiver : BroadcastReceiver(), TetheringManager.StartTethering
|
||||
if (intent.action.toString().contains("android.net.conn.TETHER_STATE_CHANGED")) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val tetheredInterfaces = intent.getStringArrayListExtra("tetherArray")
|
||||
Toast.makeText(context, "Tethering interfaces changed", Toast.LENGTH_SHORT).show()
|
||||
tetheredInterfaces?.forEach { iface ->
|
||||
Intent(context, TetheringService::class.java).apply {
|
||||
putExtra(TetheringService.EXTRA_ADD_INTERFACES, arrayOf(iface))
|
||||
context.startForegroundService(this)
|
||||
}
|
||||
Toast.makeText(context, "Monitoring service called for $iface", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user