- Renamed project namespace to hanson.xyz.vpnhotspotmod

- Added BroadcastReceiver to recive intents to start wifi and bluetooth tether options via tasker
- Modified TetherService to run sticky
- Modified TetherManager to 'monitor' all new interfaces as soon as they are created
This commit is contained in:
Brian Hanson
2023-06-22 13:34:13 -05:00
parent a21f3c307e
commit cdf6094579
110 changed files with 661 additions and 572 deletions

View File

@@ -1,5 +1,5 @@
plugins {
id("com.android.application") version "8.2.0-alpha07" apply false
id("com.android.application") version "8.0.2" apply false
id("com.github.ben-manes.versions") version "0.47.0"
id("org.jetbrains.kotlin.android") version "1.8.21" apply false
}

0
gradlew vendored Executable file → Normal file
View File

View File

@@ -9,7 +9,7 @@ plugins {
}
android {
namespace = "be.mygod.vpnhotspot"
namespace = "hanson.xyz.vpnhotspotmod"
val javaVersion = 11
buildToolsVersion = "34.0.0"
@@ -24,7 +24,6 @@ android {
}
compileSdk = 34
defaultConfig {
applicationId = "be.mygod.vpnhotspot"
minSdk = 28
targetSdk = 34
resourceConfigurations.addAll(arrayOf("it", "pt-rBR", "ru", "zh-rCN", "zh-rTW"))
@@ -36,6 +35,7 @@ android {
put("room.incremental", "true")
put("room.schemaLocation", "$projectDir/schemas")
}
applicationId = "hanson.xyz.vpnhotspotmod"
}
buildFeatures {
buildConfig = true

View File

@@ -10,7 +10,7 @@
"client_info": {
"mobilesdk_app_id": "1:13108846109:android:63120dcb2e900ed0",
"android_client_info": {
"package_name": "be.mygod.vpnhotspot"
"package_name": "hanson.xyz.vpnhotspotmod"
}
},
"oauth_client": [

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.room
package hanson.xyz.vpnhotspotmod.room
import androidx.room.testing.MigrationTestHelper
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory

View File

@@ -1,10 +1,10 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import android.app.Activity
import android.net.Uri
import androidx.core.content.edit
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.BuildConfig
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.BuildConfig
import kotlinx.coroutines.currentCoroutineContext
import kotlinx.coroutines.delay
import kotlinx.coroutines.ensureActive

View File

@@ -1,8 +1,8 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import android.app.Activity
import android.net.Uri
import be.mygod.vpnhotspot.App.Companion.app
import hanson.xyz.vpnhotspotmod.App.Companion.app
import com.google.android.play.core.appupdate.AppUpdateManagerFactory
import com.google.android.play.core.install.InstallException
import com.google.android.play.core.install.model.InstallErrorCode
@@ -23,7 +23,7 @@ object UpdateChecker {
} catch (e: Exception) {
Timber.w(e)
app.customTabsIntent.launchUrl(activity,
Uri.parse("https://play.google.com/store/apps/details?id=be.mygod.vpnhotspot"))
Uri.parse("https://play.google.com/store/apps/details?id=hanson.xyz.vpnhotspotmod"))
}
}
private class UpdateDownloading(private val update: AppUpdateResult.InProgress) : AppUpdate {

View File

@@ -214,9 +214,18 @@
</intent-filter>
</receiver>
<receiver android:name=".MyBroadcastReceiver" android:exported="true">
<intent-filter>
<action android:name="hanson.xyz.vpnhotspotmod.WIFI_TETHER_START" />
<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" />
</intent-filter>
</receiver>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="be.mygod.vpnhotspot.log"
android:authorities="hanson.xyz.vpnhotspotmod.log"
android:exported="false"
android:grantUriPermissions="true">
<meta-data

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot
package hanson.xyz.vpnhotspotmod
import android.app.Activity
import android.content.DialogInterface

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot
package hanson.xyz.vpnhotspotmod
import android.annotation.SuppressLint
import android.app.Application
@@ -18,12 +18,12 @@ import androidx.browser.customtabs.CustomTabsIntent
import androidx.core.content.getSystemService
import androidx.preference.PreferenceManager
import be.mygod.librootkotlinx.NoShellException
import be.mygod.vpnhotspot.net.DhcpWorkaround
import be.mygod.vpnhotspot.room.AppDatabase
import be.mygod.vpnhotspot.root.RootManager
import be.mygod.vpnhotspot.util.DeviceStorageApp
import be.mygod.vpnhotspot.util.Services
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.net.DhcpWorkaround
import hanson.xyz.vpnhotspotmod.room.AppDatabase
import hanson.xyz.vpnhotspotmod.root.RootManager
import hanson.xyz.vpnhotspotmod.util.DeviceStorageApp
import hanson.xyz.vpnhotspotmod.util.Services
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import com.google.firebase.analytics.ktx.ParametersBuilder
import com.google.firebase.analytics.ktx.analytics
import com.google.firebase.crashlytics.FirebaseCrashlytics

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot
package hanson.xyz.vpnhotspotmod
import android.content.BroadcastReceiver
import android.content.ComponentName
@@ -8,7 +8,7 @@ import android.content.pm.PackageManager
import android.os.Parcelable
import be.mygod.librootkotlinx.toByteArray
import be.mygod.librootkotlinx.toParcelable
import be.mygod.vpnhotspot.App.Companion.app
import hanson.xyz.vpnhotspotmod.App.Companion.app
import kotlinx.parcelize.Parcelize
import timber.log.Timber
import java.io.DataInputStream

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot
package hanson.xyz.vpnhotspotmod
import android.os.Bundle
import android.view.LayoutInflater
@@ -7,10 +7,10 @@ import android.view.ViewGroup
import android.widget.ArrayAdapter
import androidx.appcompat.app.AppCompatDialogFragment
import androidx.lifecycle.lifecycleScope
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.databinding.FragmentEbegBinding
import be.mygod.vpnhotspot.util.launchUrl
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.databinding.FragmentEbegBinding
import hanson.xyz.vpnhotspotmod.util.launchUrl
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import com.android.billingclient.api.BillingClient
import com.android.billingclient.api.BillingClientStateListener
import com.android.billingclient.api.BillingFlowParams

View File

@@ -1,8 +1,8 @@
package be.mygod.vpnhotspot
package hanson.xyz.vpnhotspotmod
import android.app.Service
import be.mygod.vpnhotspot.net.IpNeighbour
import be.mygod.vpnhotspot.net.monitor.IpNeighbourMonitor
import hanson.xyz.vpnhotspotmod.net.IpNeighbour
import hanson.xyz.vpnhotspotmod.net.monitor.IpNeighbourMonitor
import java.net.Inet4Address
abstract class IpNeighbourMonitoringService : Service(), IpNeighbourMonitor.Callback {

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot
package hanson.xyz.vpnhotspotmod
import android.content.Context
import android.content.Intent
@@ -7,21 +7,21 @@ import android.net.wifi.WifiManager
import android.os.Build
import androidx.annotation.RequiresApi
import be.mygod.librootkotlinx.RootServer
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.net.IpNeighbour
import be.mygod.vpnhotspot.net.monitor.IpNeighbourMonitor
import be.mygod.vpnhotspot.net.monitor.TetherTimeoutMonitor
import be.mygod.vpnhotspot.net.wifi.SoftApConfigurationCompat
import be.mygod.vpnhotspot.net.wifi.SoftApConfigurationCompat.Companion.toCompat
import be.mygod.vpnhotspot.net.wifi.WifiApManager
import be.mygod.vpnhotspot.net.wifi.WifiApManager.wifiApState
import be.mygod.vpnhotspot.root.LocalOnlyHotspotCallbacks
import be.mygod.vpnhotspot.root.RootManager
import be.mygod.vpnhotspot.root.WifiApCommands
import be.mygod.vpnhotspot.util.Services
import be.mygod.vpnhotspot.util.StickyEvent1
import be.mygod.vpnhotspot.util.broadcastReceiver
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.net.IpNeighbour
import hanson.xyz.vpnhotspotmod.net.monitor.IpNeighbourMonitor
import hanson.xyz.vpnhotspotmod.net.monitor.TetherTimeoutMonitor
import hanson.xyz.vpnhotspotmod.net.wifi.SoftApConfigurationCompat
import hanson.xyz.vpnhotspotmod.net.wifi.SoftApConfigurationCompat.Companion.toCompat
import hanson.xyz.vpnhotspotmod.net.wifi.WifiApManager
import hanson.xyz.vpnhotspotmod.net.wifi.WifiApManager.wifiApState
import hanson.xyz.vpnhotspotmod.root.LocalOnlyHotspotCallbacks
import hanson.xyz.vpnhotspotmod.root.RootManager
import hanson.xyz.vpnhotspotmod.root.WifiApCommands
import hanson.xyz.vpnhotspotmod.util.Services
import hanson.xyz.vpnhotspotmod.util.StickyEvent1
import hanson.xyz.vpnhotspotmod.util.broadcastReceiver
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.*
import kotlinx.parcelize.Parcelize
import timber.log.Timber

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot
package hanson.xyz.vpnhotspotmod
import android.os.Bundle
import android.view.MenuItem
@@ -12,17 +12,17 @@ import androidx.fragment.app.Fragment
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import be.mygod.vpnhotspot.client.ClientViewModel
import be.mygod.vpnhotspot.client.ClientsFragment
import be.mygod.vpnhotspot.databinding.ActivityMainBinding
import be.mygod.vpnhotspot.manage.TetheringFragment
import be.mygod.vpnhotspot.net.IpNeighbour
import be.mygod.vpnhotspot.net.wifi.WifiDoubleLock
import be.mygod.vpnhotspot.util.AppUpdate
import be.mygod.vpnhotspot.util.ServiceForegroundConnector
import be.mygod.vpnhotspot.util.Services
import be.mygod.vpnhotspot.util.UpdateChecker
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.client.ClientViewModel
import hanson.xyz.vpnhotspotmod.client.ClientsFragment
import hanson.xyz.vpnhotspotmod.databinding.ActivityMainBinding
import hanson.xyz.vpnhotspotmod.manage.TetheringFragment
import hanson.xyz.vpnhotspotmod.net.IpNeighbour
import hanson.xyz.vpnhotspotmod.net.wifi.WifiDoubleLock
import hanson.xyz.vpnhotspotmod.util.AppUpdate
import hanson.xyz.vpnhotspotmod.util.ServiceForegroundConnector
import hanson.xyz.vpnhotspotmod.util.Services
import hanson.xyz.vpnhotspotmod.util.UpdateChecker
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import com.google.android.material.badge.BadgeDrawable
import com.google.android.material.navigation.NavigationBarView
import kotlinx.coroutines.launch

View File

@@ -0,0 +1,53 @@
package hanson.xyz.vpnhotspotmod
import android.bluetooth.BluetoothManager
import android.content.*
import android.graphics.drawable.Icon
import android.os.Build
import android.os.IBinder
import android.service.quicksettings.Tile
import android.widget.Toast
import androidx.annotation.RequiresApi
import androidx.core.content.ContextCompat
import androidx.core.content.getSystemService
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.TetheringService
import hanson.xyz.vpnhotspotmod.manage.BluetoothTethering
import hanson.xyz.vpnhotspotmod.net.TetherType
import hanson.xyz.vpnhotspotmod.net.TetheringManager
import hanson.xyz.vpnhotspotmod.net.TetheringManager.tetheredIfaces
import hanson.xyz.vpnhotspotmod.net.wifi.WifiApManager
import hanson.xyz.vpnhotspotmod.util.broadcastReceiver
import hanson.xyz.vpnhotspotmod.util.readableMessage
import hanson.xyz.vpnhotspotmod.util.stopAndUnbind
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import timber.log.Timber
import android.content.Context
import android.content.Intent
import android.os.Handler
import android.os.Looper
// added by hansonxyz
class MyBroadcastReceiver : BroadcastReceiver(), TetheringManager.StartTetheringCallback {
private val handler = Handler(Looper.getMainLooper())
override fun onReceive(context: Context, intent: Intent) {
if (intent.action.toString().contains("BT_TETHER_START")) {
TetheringManager.startTethering(TetheringManager.TETHERING_BLUETOOTH, false, this)
}
if (intent.action.toString().contains("BT_TETHER_STOP")) {
TetheringManager.stopTethering(TetheringManager.TETHERING_BLUETOOTH)
}
if (intent.action.toString().contains("WIFI_TETHER_START")) {
TetheringManager.startTethering(TetheringManager.TETHERING_WIFI, false, this)
}
if (intent.action.toString().contains("WIFI_TETHER_STOP")) {
TetheringManager.stopTethering(TetheringManager.TETHERING_WIFI)
}
}
}

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot
package hanson.xyz.vpnhotspotmod
import android.annotation.SuppressLint
import android.annotation.TargetApi
@@ -18,27 +18,27 @@ import android.provider.Settings
import androidx.annotation.RequiresApi
import androidx.annotation.StringRes
import androidx.core.content.edit
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.net.MacAddressCompat
import be.mygod.vpnhotspot.net.MacAddressCompat.Companion.toLong
import be.mygod.vpnhotspot.net.monitor.TetherTimeoutMonitor
import be.mygod.vpnhotspot.net.wifi.SoftApConfigurationCompat
import be.mygod.vpnhotspot.net.wifi.VendorElements
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.deletePersistentGroup
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.requestConnectionInfo
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.requestDeviceAddress
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.requestGroupInfo
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.requestP2pState
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.requestPersistentGroupInfo
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.setVendorElements
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.setWifiP2pChannels
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.startWps
import be.mygod.vpnhotspot.net.wifi.WifiSsidCompat
import be.mygod.vpnhotspot.root.RepeaterCommands
import be.mygod.vpnhotspot.root.RootManager
import be.mygod.vpnhotspot.util.*
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.net.MacAddressCompat
import hanson.xyz.vpnhotspotmod.net.MacAddressCompat.Companion.toLong
import hanson.xyz.vpnhotspotmod.net.monitor.TetherTimeoutMonitor
import hanson.xyz.vpnhotspotmod.net.wifi.SoftApConfigurationCompat
import hanson.xyz.vpnhotspotmod.net.wifi.VendorElements
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.deletePersistentGroup
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.requestConnectionInfo
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.requestDeviceAddress
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.requestGroupInfo
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.requestP2pState
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.requestPersistentGroupInfo
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.setVendorElements
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.setWifiP2pChannels
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.startWps
import hanson.xyz.vpnhotspotmod.net.wifi.WifiSsidCompat
import hanson.xyz.vpnhotspotmod.root.RepeaterCommands
import hanson.xyz.vpnhotspotmod.root.RootManager
import hanson.xyz.vpnhotspotmod.util.*
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.*
import kotlinx.parcelize.Parcelize
import timber.log.Timber

View File

@@ -1,11 +1,11 @@
package be.mygod.vpnhotspot
package hanson.xyz.vpnhotspotmod
import android.os.Build
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.net.Routing
import be.mygod.vpnhotspot.net.TetherType
import be.mygod.vpnhotspot.net.wifi.WifiDoubleLock
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.net.Routing
import hanson.xyz.vpnhotspotmod.net.TetherType
import hanson.xyz.vpnhotspotmod.net.wifi.WifiDoubleLock
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.runBlocking
import timber.log.Timber

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot
package hanson.xyz.vpnhotspotmod
import android.app.*
import android.content.Context
@@ -6,7 +6,7 @@ import android.content.Intent
import android.content.pm.ServiceInfo
import android.os.Build
import androidx.core.content.getSystemService
import be.mygod.vpnhotspot.App.Companion.app
import hanson.xyz.vpnhotspotmod.App.Companion.app
import java.util.*
object ServiceNotification {

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot
package hanson.xyz.vpnhotspotmod
import android.content.Intent
import android.os.Build
@@ -8,21 +8,21 @@ import androidx.lifecycle.lifecycleScope
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.TwoStatePreference
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.net.TetherOffloadManager
import be.mygod.vpnhotspot.net.monitor.FallbackUpstreamMonitor
import be.mygod.vpnhotspot.net.monitor.IpMonitor
import be.mygod.vpnhotspot.net.monitor.UpstreamMonitor
import be.mygod.vpnhotspot.net.wifi.WifiDoubleLock
import be.mygod.vpnhotspot.preference.AutoCompleteNetworkPreferenceDialogFragment
import be.mygod.vpnhotspot.preference.SharedPreferenceDataStore
import be.mygod.vpnhotspot.preference.SummaryFallbackProvider
import be.mygod.vpnhotspot.root.Dump
import be.mygod.vpnhotspot.root.RootManager
import be.mygod.vpnhotspot.util.Services
import be.mygod.vpnhotspot.util.launchUrl
import be.mygod.vpnhotspot.util.showAllowingStateLoss
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.net.TetherOffloadManager
import hanson.xyz.vpnhotspotmod.net.monitor.FallbackUpstreamMonitor
import hanson.xyz.vpnhotspotmod.net.monitor.IpMonitor
import hanson.xyz.vpnhotspotmod.net.monitor.UpstreamMonitor
import hanson.xyz.vpnhotspotmod.net.wifi.WifiDoubleLock
import hanson.xyz.vpnhotspotmod.preference.AutoCompleteNetworkPreferenceDialogFragment
import hanson.xyz.vpnhotspotmod.preference.SharedPreferenceDataStore
import hanson.xyz.vpnhotspotmod.preference.SummaryFallbackProvider
import hanson.xyz.vpnhotspotmod.root.Dump
import hanson.xyz.vpnhotspotmod.root.RootManager
import hanson.xyz.vpnhotspotmod.util.Services
import hanson.xyz.vpnhotspotmod.util.launchUrl
import hanson.xyz.vpnhotspotmod.util.showAllowingStateLoss
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
import com.google.android.material.snackbar.Snackbar
import kotlinx.coroutines.CancellationException
@@ -120,7 +120,7 @@ class SettingsPreferenceFragment : PreferenceFragmentCompat() {
.setType("text/x-log")
.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
.putExtra(Intent.EXTRA_STREAM,
FileProvider.getUriForFile(context, "be.mygod.vpnhotspot.log", logFile)),
FileProvider.getUriForFile(context, "hanson.xyz.vpnhotspotmod.log", logFile)),
context.getString(androidx.appcompat.R.string.abc_shareactionprovider_share_with)))
}
true

View File

@@ -1,14 +1,16 @@
package be.mygod.vpnhotspot
package hanson.xyz.vpnhotspotmod
import android.content.Context
import android.content.Intent
import android.os.Handler
import android.os.Looper
import androidx.annotation.RequiresApi
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.net.Routing
import be.mygod.vpnhotspot.net.TetheringManager
import be.mygod.vpnhotspot.net.monitor.IpNeighbourMonitor
import be.mygod.vpnhotspot.util.Event0
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.net.Routing
import hanson.xyz.vpnhotspotmod.net.TetheringManager
import hanson.xyz.vpnhotspotmod.net.monitor.IpNeighbourMonitor
import hanson.xyz.vpnhotspotmod.util.Event0
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.*
import kotlinx.parcelize.Parcelize
import timber.log.Timber
@@ -24,14 +26,15 @@ class TetheringService : IpNeighbourMonitoringService(), TetheringManager.Tether
inner class Binder : android.os.Binder() {
val routingsChanged = Event0()
val monitoredIfaces get() = downstreams.values.filter { it.monitor }.map { it.downstream }
val monitoredIfaces get() = downstreams.values.map { it.downstream }
fun isActive(iface: String) = downstreams.containsKey(iface)
fun isInactive(iface: String) = downstreams[iface]?.run { !started && monitor }
fun monitored(iface: String) = downstreams[iface]?.monitor
}
private class Downstream(caller: Any, downstream: String, var monitor: Boolean = false) :
// hansonxyz - changed monitor default to true
private class Downstream(caller: Any, downstream: String, var monitor: Boolean = true) :
RoutingManager(caller, downstream) {
override fun Routing.configure() {
forward()
@@ -133,7 +136,7 @@ class TetheringService : IpNeighbourMonitoringService(), TetheringManager.Tether
onDownstreamsChangedLocked()
} else if (downstreams.isEmpty()) stopSelf(startId)
}
return START_NOT_STICKY
return START_STICKY //hansonxyz changed to sticky
}
override fun onDestroy() {

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.client
package hanson.xyz.vpnhotspotmod.client
import android.net.MacAddress
import android.text.SpannableStringBuilder
@@ -6,15 +6,15 @@ import android.text.Spanned
import android.text.style.StrikethroughSpan
import androidx.lifecycle.map
import androidx.recyclerview.widget.DiffUtil
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.net.InetAddressComparator
import be.mygod.vpnhotspot.net.IpNeighbour
import be.mygod.vpnhotspot.net.TetherType
import be.mygod.vpnhotspot.room.AppDatabase
import be.mygod.vpnhotspot.room.ClientRecord
import be.mygod.vpnhotspot.util.makeIpSpan
import be.mygod.vpnhotspot.util.makeMacSpan
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.net.InetAddressComparator
import hanson.xyz.vpnhotspotmod.net.IpNeighbour
import hanson.xyz.vpnhotspotmod.net.TetherType
import hanson.xyz.vpnhotspotmod.room.AppDatabase
import hanson.xyz.vpnhotspotmod.room.ClientRecord
import hanson.xyz.vpnhotspotmod.util.makeIpSpan
import hanson.xyz.vpnhotspotmod.util.makeMacSpan
import java.net.InetAddress
import java.util.*

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.client
package hanson.xyz.vpnhotspotmod.client
import android.content.ComponentName
import android.content.IntentFilter
@@ -13,18 +13,18 @@ import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.RepeaterService
import be.mygod.vpnhotspot.net.IpNeighbour
import be.mygod.vpnhotspot.net.TetherType
import be.mygod.vpnhotspot.net.TetheringManager
import be.mygod.vpnhotspot.net.TetheringManager.localOnlyTetheredIfaces
import be.mygod.vpnhotspot.net.TetheringManager.tetheredIfaces
import be.mygod.vpnhotspot.net.monitor.IpNeighbourMonitor
import be.mygod.vpnhotspot.net.wifi.WifiApManager
import be.mygod.vpnhotspot.net.wifi.WifiClient
import be.mygod.vpnhotspot.root.WifiApCommands
import be.mygod.vpnhotspot.util.broadcastReceiver
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.RepeaterService
import hanson.xyz.vpnhotspotmod.net.IpNeighbour
import hanson.xyz.vpnhotspotmod.net.TetherType
import hanson.xyz.vpnhotspotmod.net.TetheringManager
import hanson.xyz.vpnhotspotmod.net.TetheringManager.localOnlyTetheredIfaces
import hanson.xyz.vpnhotspotmod.net.TetheringManager.tetheredIfaces
import hanson.xyz.vpnhotspotmod.net.monitor.IpNeighbourMonitor
import hanson.xyz.vpnhotspotmod.net.wifi.WifiApManager
import hanson.xyz.vpnhotspotmod.net.wifi.WifiClient
import hanson.xyz.vpnhotspotmod.root.WifiApCommands
import hanson.xyz.vpnhotspotmod.util.broadcastReceiver
class ClientViewModel : ViewModel(), ServiceConnection, IpNeighbourMonitor.Callback, DefaultLifecycleObserver,
WifiApManager.SoftApCallbackCompat {

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.client
package hanson.xyz.vpnhotspotmod.client
import android.content.DialogInterface
import android.net.MacAddress
@@ -26,22 +26,22 @@ import androidx.recyclerview.widget.DefaultItemAnimator
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import be.mygod.vpnhotspot.AlertDialogFragment
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.Empty
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.databinding.FragmentClientsBinding
import be.mygod.vpnhotspot.databinding.ListitemClientBinding
import be.mygod.vpnhotspot.net.TetherType
import be.mygod.vpnhotspot.net.monitor.IpNeighbourMonitor
import be.mygod.vpnhotspot.net.monitor.TrafficRecorder
import be.mygod.vpnhotspot.room.AppDatabase
import be.mygod.vpnhotspot.room.ClientStats
import be.mygod.vpnhotspot.room.TrafficRecord
import be.mygod.vpnhotspot.util.format
import be.mygod.vpnhotspot.util.showAllowingStateLoss
import be.mygod.vpnhotspot.util.toPluralInt
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.AlertDialogFragment
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.Empty
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.databinding.FragmentClientsBinding
import hanson.xyz.vpnhotspotmod.databinding.ListitemClientBinding
import hanson.xyz.vpnhotspotmod.net.TetherType
import hanson.xyz.vpnhotspotmod.net.monitor.IpNeighbourMonitor
import hanson.xyz.vpnhotspotmod.net.monitor.TrafficRecorder
import hanson.xyz.vpnhotspotmod.room.AppDatabase
import hanson.xyz.vpnhotspotmod.room.ClientStats
import hanson.xyz.vpnhotspotmod.room.TrafficRecord
import hanson.xyz.vpnhotspotmod.util.format
import hanson.xyz.vpnhotspotmod.util.showAllowingStateLoss
import hanson.xyz.vpnhotspotmod.util.toPluralInt
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope

View File

@@ -1,13 +1,13 @@
package be.mygod.vpnhotspot.client
package hanson.xyz.vpnhotspotmod.client
import android.content.Context
import android.net.MacAddress
import androidx.annotation.MainThread
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.room.AppDatabase
import be.mygod.vpnhotspot.util.connectCancellable
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.room.AppDatabase
import hanson.xyz.vpnhotspotmod.util.connectCancellable
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.Dispatchers

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.manage
package hanson.xyz.vpnhotspotmod.manage
import android.annotation.SuppressLint
import android.bluetooth.BluetoothAdapter
@@ -8,11 +8,11 @@ import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.net.TetheringManager
import be.mygod.vpnhotspot.util.broadcastReceiver
import be.mygod.vpnhotspot.util.readableMessage
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.net.TetheringManager
import hanson.xyz.vpnhotspotmod.util.broadcastReceiver
import hanson.xyz.vpnhotspotmod.util.readableMessage
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import timber.log.Timber
import java.lang.reflect.InvocationTargetException

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.manage
package hanson.xyz.vpnhotspotmod.manage
import androidx.databinding.BaseObservable

View File

@@ -1,13 +1,13 @@
package be.mygod.vpnhotspot.manage
package hanson.xyz.vpnhotspotmod.manage
import android.content.Intent
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.TetheringService
import be.mygod.vpnhotspot.databinding.ListitemInterfaceBinding
import be.mygod.vpnhotspot.net.TetherType
import be.mygod.vpnhotspot.util.formatAddresses
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.TetheringService
import hanson.xyz.vpnhotspotmod.databinding.ListitemInterfaceBinding
import hanson.xyz.vpnhotspotmod.net.TetherType
import hanson.xyz.vpnhotspotmod.util.formatAddresses
import java.util.*
class InterfaceManager(private val parent: TetheringFragment, val iface: String) : Manager() {
@@ -28,9 +28,10 @@ class InterfaceManager(private val parent: TetheringFragment, val iface: String)
.putExtra(TetheringService.EXTRA_ADD_INTERFACES, arrayOf(iface)))
}
}
private inner class Data : be.mygod.vpnhotspot.manage.Data() {
private inner class Data : hanson.xyz.vpnhotspotmod.manage.Data() {
override val icon get() = TetherType.ofInterface(iface).icon
override val title get() = if (parent.binder?.monitored(iface) == true) {
// override val title get() = if (true) {
parent.getString(R.string.tethering_state_monitored, iface)
} else iface
override val text get() = addresses

View File

@@ -1,10 +1,10 @@
package be.mygod.vpnhotspot.manage
package hanson.xyz.vpnhotspotmod.manage
import android.service.quicksettings.Tile
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.net.IpNeighbour
import be.mygod.vpnhotspot.net.monitor.IpNeighbourMonitor
import be.mygod.vpnhotspot.util.KillableTileService
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.net.IpNeighbour
import hanson.xyz.vpnhotspotmod.net.monitor.IpNeighbourMonitor
import hanson.xyz.vpnhotspotmod.util.KillableTileService
import java.net.Inet4Address
abstract class IpNeighbourMonitoringTileService : KillableTileService(), IpNeighbourMonitor.Callback {

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.manage
package hanson.xyz.vpnhotspotmod.manage
import android.Manifest
import android.content.ComponentName
@@ -8,12 +8,12 @@ import android.os.Build
import android.os.IBinder
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.LocalOnlyHotspotService
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.databinding.ListitemInterfaceBinding
import be.mygod.vpnhotspot.util.ServiceForegroundConnector
import be.mygod.vpnhotspot.util.formatAddresses
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.LocalOnlyHotspotService
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.databinding.ListitemInterfaceBinding
import hanson.xyz.vpnhotspotmod.util.ServiceForegroundConnector
import hanson.xyz.vpnhotspotmod.util.formatAddresses
import java.net.NetworkInterface
class LocalOnlyHotspotManager(private val parent: TetheringFragment) : Manager(), ServiceConnection {
@@ -38,7 +38,7 @@ class LocalOnlyHotspotManager(private val parent: TetheringFragment) : Manager()
if (binder?.iface == null) manager.parent.startLocalOnlyHotspot.launch(permission) else binder.stop()
}
}
private inner class Data : be.mygod.vpnhotspot.manage.Data() {
private inner class Data : hanson.xyz.vpnhotspotmod.manage.Data() {
private val lookup: Map<String, NetworkInterface> get() = parent.ifaceLookup
override val icon get() = R.drawable.ic_action_perm_scan_wifi

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.manage
package hanson.xyz.vpnhotspotmod.manage
import android.content.ComponentName
import android.content.Context
@@ -6,9 +6,9 @@ import android.content.Intent
import android.graphics.drawable.Icon
import android.os.IBinder
import android.service.quicksettings.Tile
import be.mygod.vpnhotspot.LocalOnlyHotspotService
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.util.stopAndUnbind
import hanson.xyz.vpnhotspotmod.LocalOnlyHotspotService
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.util.stopAndUnbind
class LocalOnlyHotspotTileService : IpNeighbourMonitoringTileService() {
private val tile by lazy { Icon.createWithResource(application, R.drawable.ic_action_perm_scan_wifi) }

View File

@@ -1,13 +1,13 @@
package be.mygod.vpnhotspot.manage
package hanson.xyz.vpnhotspotmod.manage
import android.content.Context
import android.content.Intent
import android.view.View
import androidx.databinding.BaseObservable
import androidx.recyclerview.widget.RecyclerView
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.databinding.ListitemManageBinding
import be.mygod.vpnhotspot.net.TetherOffloadManager
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.databinding.ListitemManageBinding
import hanson.xyz.vpnhotspotmod.net.TetherOffloadManager
object ManageBar : Manager() {
private const val TAG = "ManageBar"

View File

@@ -1,13 +1,13 @@
package be.mygod.vpnhotspot.manage
package hanson.xyz.vpnhotspotmod.manage
import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import be.mygod.vpnhotspot.databinding.ListitemInterfaceBinding
import be.mygod.vpnhotspot.databinding.ListitemManageBinding
import be.mygod.vpnhotspot.databinding.ListitemRepeaterBinding
import hanson.xyz.vpnhotspotmod.databinding.ListitemInterfaceBinding
import hanson.xyz.vpnhotspotmod.databinding.ListitemManageBinding
import hanson.xyz.vpnhotspotmod.databinding.ListitemRepeaterBinding
abstract class Manager {
companion object DiffCallback : DiffUtil.ItemCallback<Manager>() {

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.manage
package hanson.xyz.vpnhotspotmod.manage
import android.Manifest
import android.content.ComponentName
@@ -24,21 +24,21 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.withStarted
import androidx.recyclerview.widget.RecyclerView
import be.mygod.vpnhotspot.AlertDialogFragment
import be.mygod.vpnhotspot.BR
import be.mygod.vpnhotspot.Empty
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.RepeaterService
import be.mygod.vpnhotspot.databinding.ListitemRepeaterBinding
import be.mygod.vpnhotspot.net.wifi.P2pSupplicantConfiguration
import be.mygod.vpnhotspot.net.wifi.SoftApConfigurationCompat
import be.mygod.vpnhotspot.net.wifi.WifiApDialogFragment
import be.mygod.vpnhotspot.net.wifi.WifiApManager
import be.mygod.vpnhotspot.net.wifi.WifiSsidCompat
import be.mygod.vpnhotspot.util.ServiceForegroundConnector
import be.mygod.vpnhotspot.util.formatAddresses
import be.mygod.vpnhotspot.util.showAllowingStateLoss
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.AlertDialogFragment
import hanson.xyz.vpnhotspotmod.BR
import hanson.xyz.vpnhotspotmod.Empty
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.RepeaterService
import hanson.xyz.vpnhotspotmod.databinding.ListitemRepeaterBinding
import hanson.xyz.vpnhotspotmod.net.wifi.P2pSupplicantConfiguration
import hanson.xyz.vpnhotspotmod.net.wifi.SoftApConfigurationCompat
import hanson.xyz.vpnhotspotmod.net.wifi.WifiApDialogFragment
import hanson.xyz.vpnhotspotmod.net.wifi.WifiApManager
import hanson.xyz.vpnhotspotmod.net.wifi.WifiSsidCompat
import hanson.xyz.vpnhotspotmod.util.ServiceForegroundConnector
import hanson.xyz.vpnhotspotmod.util.formatAddresses
import hanson.xyz.vpnhotspotmod.util.showAllowingStateLoss
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.manage
package hanson.xyz.vpnhotspotmod.manage
import android.content.ComponentName
import android.content.Context
@@ -7,11 +7,11 @@ import android.graphics.drawable.Icon
import android.net.wifi.p2p.WifiP2pGroup
import android.os.IBinder
import android.service.quicksettings.Tile
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.RepeaterService
import be.mygod.vpnhotspot.util.KillableTileService
import be.mygod.vpnhotspot.util.Services
import be.mygod.vpnhotspot.util.stopAndUnbind
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.RepeaterService
import hanson.xyz.vpnhotspotmod.util.KillableTileService
import hanson.xyz.vpnhotspotmod.util.Services
import hanson.xyz.vpnhotspotmod.util.stopAndUnbind
class RepeaterTileService : KillableTileService() {
private val tile by lazy { Icon.createWithResource(application, R.drawable.ic_action_settings_input_antenna) }

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.manage
package hanson.xyz.vpnhotspotmod.manage
import android.Manifest
import android.annotation.TargetApi
@@ -19,16 +19,16 @@ import androidx.core.view.updatePaddingRelative
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.recyclerview.widget.RecyclerView
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.MainActivity
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.databinding.ListitemInterfaceBinding
import be.mygod.vpnhotspot.net.TetherType
import be.mygod.vpnhotspot.net.TetheringManager
import be.mygod.vpnhotspot.net.wifi.*
import be.mygod.vpnhotspot.root.WifiApCommands
import be.mygod.vpnhotspot.util.*
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.MainActivity
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.databinding.ListitemInterfaceBinding
import hanson.xyz.vpnhotspotmod.net.TetherType
import hanson.xyz.vpnhotspotmod.net.TetheringManager
import hanson.xyz.vpnhotspotmod.net.wifi.*
import hanson.xyz.vpnhotspotmod.root.WifiApCommands
import hanson.xyz.vpnhotspotmod.util.*
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
@@ -78,7 +78,7 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(),
/**
* A convenient class to delegate stuff to BaseObservable.
*/
inner class Data : be.mygod.vpnhotspot.manage.Data() {
inner class Data : hanson.xyz.vpnhotspotmod.manage.Data() {
override val icon get() = tetherType.icon
override val title get() = this@TetherManager.title
override val text get() = this@TetherManager.text

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.manage
package hanson.xyz.vpnhotspotmod.manage
import android.annotation.TargetApi
import android.bluetooth.BluetoothManager
@@ -21,22 +21,22 @@ import androidx.recyclerview.widget.DefaultItemAnimator
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import be.mygod.vpnhotspot.*
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.databinding.FragmentTetheringBinding
import be.mygod.vpnhotspot.net.TetherType
import be.mygod.vpnhotspot.net.TetheringManager
import be.mygod.vpnhotspot.net.TetheringManager.localOnlyTetheredIfaces
import be.mygod.vpnhotspot.net.TetheringManager.tetheredIfaces
import be.mygod.vpnhotspot.net.monitor.TetherTimeoutMonitor
import be.mygod.vpnhotspot.net.wifi.SoftApConfigurationCompat
import be.mygod.vpnhotspot.net.wifi.SoftApConfigurationCompat.Companion.toCompat
import be.mygod.vpnhotspot.net.wifi.WifiApDialogFragment
import be.mygod.vpnhotspot.net.wifi.WifiApManager
import be.mygod.vpnhotspot.root.RootManager
import be.mygod.vpnhotspot.root.WifiApCommands
import be.mygod.vpnhotspot.util.*
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.*
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.databinding.FragmentTetheringBinding
import hanson.xyz.vpnhotspotmod.net.TetherType
import hanson.xyz.vpnhotspotmod.net.TetheringManager
import hanson.xyz.vpnhotspotmod.net.TetheringManager.localOnlyTetheredIfaces
import hanson.xyz.vpnhotspotmod.net.TetheringManager.tetheredIfaces
import hanson.xyz.vpnhotspotmod.net.monitor.TetherTimeoutMonitor
import hanson.xyz.vpnhotspotmod.net.wifi.SoftApConfigurationCompat
import hanson.xyz.vpnhotspotmod.net.wifi.SoftApConfigurationCompat.Companion.toCompat
import hanson.xyz.vpnhotspotmod.net.wifi.WifiApDialogFragment
import hanson.xyz.vpnhotspotmod.net.wifi.WifiApManager
import hanson.xyz.vpnhotspotmod.root.RootManager
import hanson.xyz.vpnhotspotmod.root.WifiApCommands
import hanson.xyz.vpnhotspotmod.util.*
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import com.google.android.material.snackbar.Snackbar
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CompletableDeferred

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.manage
package hanson.xyz.vpnhotspotmod.manage
import android.bluetooth.BluetoothManager
import android.content.ComponentName
@@ -12,14 +12,14 @@ import android.service.quicksettings.Tile
import android.widget.Toast
import androidx.annotation.RequiresApi
import androidx.core.content.getSystemService
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.TetheringService
import be.mygod.vpnhotspot.net.TetherType
import be.mygod.vpnhotspot.net.TetheringManager
import be.mygod.vpnhotspot.net.TetheringManager.tetheredIfaces
import be.mygod.vpnhotspot.util.broadcastReceiver
import be.mygod.vpnhotspot.util.readableMessage
import be.mygod.vpnhotspot.util.stopAndUnbind
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.TetheringService
import hanson.xyz.vpnhotspotmod.net.TetherType
import hanson.xyz.vpnhotspotmod.net.TetheringManager
import hanson.xyz.vpnhotspotmod.net.TetheringManager.tetheredIfaces
import hanson.xyz.vpnhotspotmod.util.broadcastReceiver
import hanson.xyz.vpnhotspotmod.util.readableMessage
import hanson.xyz.vpnhotspotmod.util.stopAndUnbind
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

View File

@@ -1,11 +1,11 @@
package be.mygod.vpnhotspot.net
package hanson.xyz.vpnhotspotmod.net
import android.content.SharedPreferences
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.net.Routing.Companion.IP
import be.mygod.vpnhotspot.root.RoutingCommands
import be.mygod.vpnhotspot.util.RootSession
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.net.Routing.Companion.IP
import hanson.xyz.vpnhotspotmod.root.RoutingCommands
import hanson.xyz.vpnhotspotmod.util.RootSession
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.net
package hanson.xyz.vpnhotspotmod.net
import java.net.InetAddress

View File

@@ -1,13 +1,13 @@
package be.mygod.vpnhotspot.net
package hanson.xyz.vpnhotspotmod.net
import android.net.MacAddress
import android.os.Build
import android.system.ErrnoException
import android.system.Os
import android.system.OsConstants
import be.mygod.vpnhotspot.root.ReadArp
import be.mygod.vpnhotspot.root.RootManager
import be.mygod.vpnhotspot.util.parseNumericAddress
import hanson.xyz.vpnhotspotmod.root.ReadArp
import hanson.xyz.vpnhotspotmod.root.RootManager
import hanson.xyz.vpnhotspotmod.util.parseNumericAddress
import kotlinx.coroutines.CancellationException
import timber.log.Timber
import java.io.File

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.net
package hanson.xyz.vpnhotspotmod.net
import android.net.MacAddress
import java.nio.ByteBuffer

View File

@@ -1,22 +1,22 @@
package be.mygod.vpnhotspot.net
package hanson.xyz.vpnhotspotmod.net
import android.net.LinkProperties
import android.net.MacAddress
import android.net.RouteInfo
import android.system.Os
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.net.monitor.FallbackUpstreamMonitor
import be.mygod.vpnhotspot.net.monitor.IpNeighbourMonitor
import be.mygod.vpnhotspot.net.monitor.TrafficRecorder
import be.mygod.vpnhotspot.net.monitor.UpstreamMonitor
import be.mygod.vpnhotspot.room.AppDatabase
import be.mygod.vpnhotspot.root.RootManager
import be.mygod.vpnhotspot.root.RoutingCommands
import be.mygod.vpnhotspot.util.RootSession
import be.mygod.vpnhotspot.util.allInterfaceNames
import be.mygod.vpnhotspot.util.allRoutes
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.net.monitor.FallbackUpstreamMonitor
import hanson.xyz.vpnhotspotmod.net.monitor.IpNeighbourMonitor
import hanson.xyz.vpnhotspotmod.net.monitor.TrafficRecorder
import hanson.xyz.vpnhotspotmod.net.monitor.UpstreamMonitor
import hanson.xyz.vpnhotspotmod.room.AppDatabase
import hanson.xyz.vpnhotspotmod.root.RootManager
import hanson.xyz.vpnhotspotmod.root.RoutingCommands
import hanson.xyz.vpnhotspotmod.util.RootSession
import hanson.xyz.vpnhotspotmod.util.allInterfaceNames
import hanson.xyz.vpnhotspotmod.util.allRoutes
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.CancellationException
import timber.log.Timber
import java.io.BufferedWriter

View File

@@ -1,8 +1,8 @@
package be.mygod.vpnhotspot.net
package hanson.xyz.vpnhotspotmod.net
import android.provider.Settings
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.root.SettingsGlobalPut
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.root.SettingsGlobalPut
/**
* It's hard to change tethering rules with Tethering hardware acceleration enabled for now.

View File

@@ -1,13 +1,13 @@
package be.mygod.vpnhotspot.net
package hanson.xyz.vpnhotspotmod.net
import android.content.res.Resources
import android.os.Build
import androidx.annotation.DrawableRes
import androidx.annotation.RequiresApi
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.util.Event0
import be.mygod.vpnhotspot.util.findIdentifier
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.util.Event0
import hanson.xyz.vpnhotspotmod.util.findIdentifier
import timber.log.Timber
import java.util.regex.Pattern

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.net
package hanson.xyz.vpnhotspotmod.net
import android.annotation.SuppressLint
import android.annotation.TargetApi
@@ -12,14 +12,18 @@ import android.net.Network
import android.os.Build
import android.os.DeadObjectException
import android.os.Handler
import android.os.Looper
import androidx.annotation.RequiresApi
import androidx.core.content.ContextCompat.startActivity
import androidx.core.os.ExecutorCompat
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.root.RootManager
import be.mygod.vpnhotspot.root.StartTethering
import be.mygod.vpnhotspot.root.StopTethering
import be.mygod.vpnhotspot.util.*
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.root.RootManager
import hanson.xyz.vpnhotspotmod.root.StartTethering
import hanson.xyz.vpnhotspotmod.root.StopTethering
import hanson.xyz.vpnhotspotmod.util.*
import com.android.dx.stock.ProxyBuilder
import hanson.xyz.vpnhotspotmod.App
import hanson.xyz.vpnhotspotmod.TetheringService
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
@@ -335,7 +339,7 @@ object TetheringManager {
rootCache.mkdirs()
check(rootCache.exists()) { "Creating root cache dir failed" }
RootManager.use {
it.execute(be.mygod.vpnhotspot.root.StartTetheringLegacy(
it.execute(hanson.xyz.vpnhotspotmod.root.StartTetheringLegacy(
rootCache, type, showProvisioningUi))
}.value
} catch (eRoot: Exception) {
@@ -447,7 +451,9 @@ object TetheringManager {
* multiple times later upon changes.
* @param interfaces The list of tetherable interface names.
*/
fun onTetherableInterfacesChanged(interfaces: List<String?>) {}
fun onTetherableInterfacesChanged(interfaces: List<String?>) {
//hansonxyz
}
/**
* Called when there was a change in the list of tethered interfaces.
@@ -554,10 +560,27 @@ object TetheringManager {
@Suppress("UNCHECKED_CAST")
callback?.onTetherableInterfacesChanged(args!![0] as List<String?>)
}
// modified by hansonxyz
method.matches1<java.util.List<*>>("onTetheredInterfacesChanged") -> {
@Suppress("UNCHECKED_CAST")
callback?.onTetheredInterfacesChanged(args!![0] as List<String?>)
val tetheredInterfaces = args!![0] as List<String?>
callback?.onTetheredInterfacesChanged(tetheredInterfaces)
// hansonxyz
tetheredInterfaces?.let {
for (iface in it) {
App.app.startForegroundService(
Intent(App.app, TetheringService::class.java)
.putExtra(
TetheringService.EXTRA_ADD_INTERFACES,
arrayOf(iface)
)
)
}
}
}
method.matches("onError", String::class.java, Integer.TYPE) -> {
callback?.onError(args!![0] as String, args[1] as Int)
}

View File

@@ -1,12 +1,12 @@
package be.mygod.vpnhotspot.net.monitor
package hanson.xyz.vpnhotspotmod.net.monitor
import android.net.ConnectivityManager
import android.net.LinkProperties
import android.net.Network
import android.net.NetworkCapabilities
import android.os.Build
import be.mygod.vpnhotspot.util.Services
import be.mygod.vpnhotspot.util.globalNetworkRequestBuilder
import hanson.xyz.vpnhotspotmod.util.Services
import hanson.xyz.vpnhotspotmod.util.globalNetworkRequestBuilder
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

View File

@@ -1,7 +1,7 @@
package be.mygod.vpnhotspot.net.monitor
package hanson.xyz.vpnhotspotmod.net.monitor
import android.content.SharedPreferences
import be.mygod.vpnhotspot.App.Companion.app
import hanson.xyz.vpnhotspotmod.App.Companion.app
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

View File

@@ -1,12 +1,12 @@
package be.mygod.vpnhotspot.net.monitor
package hanson.xyz.vpnhotspotmod.net.monitor
import android.net.ConnectivityManager
import android.net.LinkProperties
import android.net.Network
import android.net.NetworkCapabilities
import be.mygod.vpnhotspot.util.Services
import be.mygod.vpnhotspot.util.allInterfaceNames
import be.mygod.vpnhotspot.util.globalNetworkRequestBuilder
import hanson.xyz.vpnhotspotmod.util.Services
import hanson.xyz.vpnhotspotmod.util.allInterfaceNames
import hanson.xyz.vpnhotspotmod.util.globalNetworkRequestBuilder
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import timber.log.Timber

View File

@@ -1,17 +1,17 @@
package be.mygod.vpnhotspot.net.monitor
package hanson.xyz.vpnhotspotmod.net.monitor
import android.os.Build
import androidx.core.content.edit
import be.mygod.librootkotlinx.RootServer
import be.mygod.librootkotlinx.isEBADF
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.net.Routing
import be.mygod.vpnhotspot.root.ProcessData
import be.mygod.vpnhotspot.root.ProcessListener
import be.mygod.vpnhotspot.root.RootManager
import be.mygod.vpnhotspot.root.RoutingCommands
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.net.Routing
import hanson.xyz.vpnhotspotmod.root.ProcessData
import hanson.xyz.vpnhotspotmod.root.ProcessListener
import hanson.xyz.vpnhotspotmod.root.RootManager
import hanson.xyz.vpnhotspotmod.root.RoutingCommands
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.ReceiveChannel
import kotlinx.coroutines.channels.consumeEach

View File

@@ -1,7 +1,7 @@
package be.mygod.vpnhotspot.net.monitor
package hanson.xyz.vpnhotspotmod.net.monitor
import be.mygod.vpnhotspot.net.IpDev
import be.mygod.vpnhotspot.net.IpNeighbour
import hanson.xyz.vpnhotspotmod.net.IpDev
import hanson.xyz.vpnhotspotmod.net.IpNeighbour
import kotlinx.collections.immutable.PersistentMap
import kotlinx.collections.immutable.persistentMapOf
import kotlinx.collections.immutable.toPersistentMap

View File

@@ -1,13 +1,13 @@
package be.mygod.vpnhotspot.net.monitor
package hanson.xyz.vpnhotspotmod.net.monitor
import android.content.res.Resources
import android.os.Build
import android.provider.Settings
import androidx.annotation.RequiresApi
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.net.wifi.WifiApManager
import be.mygod.vpnhotspot.root.SettingsGlobalPut
import be.mygod.vpnhotspot.util.findIdentifier
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.net.wifi.WifiApManager
import hanson.xyz.vpnhotspotmod.root.SettingsGlobalPut
import hanson.xyz.vpnhotspotmod.util.findIdentifier
import kotlinx.coroutines.*
import timber.log.Timber
import kotlin.coroutines.CoroutineContext

View File

@@ -1,16 +1,16 @@
package be.mygod.vpnhotspot.net.monitor
package hanson.xyz.vpnhotspotmod.net.monitor
import android.net.MacAddress
import androidx.collection.LongSparseArray
import androidx.collection.set
import be.mygod.vpnhotspot.net.IpDev
import be.mygod.vpnhotspot.net.Routing.Companion.IPTABLES
import be.mygod.vpnhotspot.room.AppDatabase
import be.mygod.vpnhotspot.room.TrafficRecord
import be.mygod.vpnhotspot.util.Event2
import be.mygod.vpnhotspot.util.RootSession
import be.mygod.vpnhotspot.util.parseNumericAddress
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.net.IpDev
import hanson.xyz.vpnhotspotmod.net.Routing.Companion.IPTABLES
import hanson.xyz.vpnhotspotmod.room.AppDatabase
import hanson.xyz.vpnhotspotmod.room.TrafficRecord
import hanson.xyz.vpnhotspotmod.util.Event2
import hanson.xyz.vpnhotspotmod.util.RootSession
import hanson.xyz.vpnhotspotmod.util.parseNumericAddress
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.GlobalScope

View File

@@ -1,8 +1,8 @@
package be.mygod.vpnhotspot.net.monitor
package hanson.xyz.vpnhotspotmod.net.monitor
import android.content.SharedPreferences
import android.net.LinkProperties
import be.mygod.vpnhotspot.App.Companion.app
import hanson.xyz.vpnhotspotmod.App.Companion.app
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

View File

@@ -1,11 +1,11 @@
package be.mygod.vpnhotspot.net.monitor
package hanson.xyz.vpnhotspotmod.net.monitor
import android.net.ConnectivityManager
import android.net.LinkProperties
import android.net.Network
import android.net.NetworkCapabilities
import be.mygod.vpnhotspot.util.Services
import be.mygod.vpnhotspot.util.globalNetworkRequestBuilder
import hanson.xyz.vpnhotspotmod.util.Services
import hanson.xyz.vpnhotspotmod.util.globalNetworkRequestBuilder
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import timber.log.Timber

View File

@@ -1,11 +1,11 @@
package be.mygod.vpnhotspot.net.wifi
package hanson.xyz.vpnhotspotmod.net.wifi
import android.net.MacAddress
import android.net.wifi.p2p.WifiP2pGroup
import be.mygod.vpnhotspot.RepeaterService
import be.mygod.vpnhotspot.net.MacAddressCompat
import be.mygod.vpnhotspot.root.RepeaterCommands
import be.mygod.vpnhotspot.root.RootManager
import hanson.xyz.vpnhotspotmod.RepeaterService
import hanson.xyz.vpnhotspotmod.net.MacAddressCompat
import hanson.xyz.vpnhotspotmod.root.RepeaterCommands
import hanson.xyz.vpnhotspotmod.root.RootManager
import com.google.firebase.crashlytics.FirebaseCrashlytics
/**

View File

@@ -1,11 +1,11 @@
package be.mygod.vpnhotspot.net.wifi
package hanson.xyz.vpnhotspotmod.net.wifi
import android.annotation.TargetApi
import android.os.Build
import android.os.Parcelable
import androidx.annotation.RequiresApi
import be.mygod.vpnhotspot.util.LongConstantLookup
import be.mygod.vpnhotspot.util.UnblockCentral
import hanson.xyz.vpnhotspotmod.util.LongConstantLookup
import hanson.xyz.vpnhotspotmod.util.UnblockCentral
import timber.log.Timber
@JvmInline

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.net.wifi
package hanson.xyz.vpnhotspotmod.net.wifi
import android.annotation.SuppressLint
import android.annotation.TargetApi
@@ -10,12 +10,12 @@ import android.os.Build
import android.os.Parcelable
import android.util.SparseIntArray
import androidx.annotation.RequiresApi
import be.mygod.vpnhotspot.net.monitor.TetherTimeoutMonitor
import be.mygod.vpnhotspot.net.wifi.SoftApConfigurationCompat.Companion.requireSingleBand
import be.mygod.vpnhotspot.net.wifi.SoftApConfigurationCompat.Companion.setChannel
import be.mygod.vpnhotspot.net.wifi.WifiSsidCompat.Companion.toCompat
import be.mygod.vpnhotspot.util.ConstantLookup
import be.mygod.vpnhotspot.util.UnblockCentral
import hanson.xyz.vpnhotspotmod.net.monitor.TetherTimeoutMonitor
import hanson.xyz.vpnhotspotmod.net.wifi.SoftApConfigurationCompat.Companion.requireSingleBand
import hanson.xyz.vpnhotspotmod.net.wifi.SoftApConfigurationCompat.Companion.setChannel
import hanson.xyz.vpnhotspotmod.net.wifi.WifiSsidCompat.Companion.toCompat
import hanson.xyz.vpnhotspotmod.util.ConstantLookup
import hanson.xyz.vpnhotspotmod.util.UnblockCentral
import kotlinx.parcelize.Parcelize
import timber.log.Timber
import java.lang.reflect.InvocationTargetException

View File

@@ -1,11 +1,11 @@
package be.mygod.vpnhotspot.net.wifi
package hanson.xyz.vpnhotspotmod.net.wifi
import android.annotation.TargetApi
import android.net.MacAddress
import android.os.Parcelable
import androidx.annotation.RequiresApi
import be.mygod.vpnhotspot.util.ConstantLookup
import be.mygod.vpnhotspot.util.UnblockCentral
import hanson.xyz.vpnhotspotmod.util.ConstantLookup
import hanson.xyz.vpnhotspotmod.util.UnblockCentral
import timber.log.Timber
@JvmInline

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.net.wifi
package hanson.xyz.vpnhotspotmod.net.wifi
import android.net.wifi.ScanResult
import androidx.annotation.RequiresApi

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.net.wifi
package hanson.xyz.vpnhotspotmod.net.wifi
import android.annotation.SuppressLint
import android.content.ClipData
@@ -26,17 +26,17 @@ import androidx.core.os.persistableBundleOf
import androidx.core.view.isGone
import be.mygod.librootkotlinx.toByteArray
import be.mygod.librootkotlinx.toParcelable
import be.mygod.vpnhotspot.AlertDialogFragment
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.RepeaterService
import be.mygod.vpnhotspot.databinding.DialogWifiApBinding
import be.mygod.vpnhotspot.net.monitor.TetherTimeoutMonitor
import be.mygod.vpnhotspot.util.QRCodeDialog
import be.mygod.vpnhotspot.util.RangeInput
import be.mygod.vpnhotspot.util.Services
import be.mygod.vpnhotspot.util.readableMessage
import be.mygod.vpnhotspot.util.showAllowingStateLoss
import hanson.xyz.vpnhotspotmod.AlertDialogFragment
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.RepeaterService
import hanson.xyz.vpnhotspotmod.databinding.DialogWifiApBinding
import hanson.xyz.vpnhotspotmod.net.monitor.TetherTimeoutMonitor
import hanson.xyz.vpnhotspotmod.util.QRCodeDialog
import hanson.xyz.vpnhotspotmod.util.RangeInput
import hanson.xyz.vpnhotspotmod.util.Services
import hanson.xyz.vpnhotspotmod.util.readableMessage
import hanson.xyz.vpnhotspotmod.util.showAllowingStateLoss
import com.google.android.material.textfield.TextInputLayout
import kotlinx.parcelize.Parcelize
import timber.log.Timber

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.net.wifi
package hanson.xyz.vpnhotspotmod.net.wifi
import android.annotation.TargetApi
import android.content.Intent
@@ -11,8 +11,8 @@ import android.os.Build
import android.os.Handler
import android.os.Parcelable
import androidx.annotation.RequiresApi
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.util.*
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.util.*
import timber.log.Timber
import java.lang.reflect.InvocationHandler
import java.lang.reflect.Method

View File

@@ -1,10 +1,10 @@
package be.mygod.vpnhotspot.net.wifi
package hanson.xyz.vpnhotspotmod.net.wifi
import android.annotation.TargetApi
import android.net.MacAddress
import android.os.Parcelable
import androidx.annotation.RequiresApi
import be.mygod.vpnhotspot.util.UnblockCentral
import hanson.xyz.vpnhotspotmod.util.UnblockCentral
import timber.log.Timber
@JvmInline

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.net.wifi
package hanson.xyz.vpnhotspotmod.net.wifi
import android.annotation.SuppressLint
import android.content.SharedPreferences
@@ -12,8 +12,8 @@ import androidx.core.content.edit
import androidx.core.content.getSystemService
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.util.Services
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.util.Services
/**
* This mechanism is used to maximize profit. Source: https://stackoverflow.com/a/29657230/2245107

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.net.wifi
package hanson.xyz.vpnhotspotmod.net.wifi
import android.annotation.SuppressLint
import android.net.MacAddress
@@ -8,10 +8,10 @@ import android.net.wifi.p2p.WifiP2pGroup
import android.net.wifi.p2p.WifiP2pInfo
import android.net.wifi.p2p.WifiP2pManager
import androidx.annotation.RequiresApi
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.net.MacAddressCompat
import be.mygod.vpnhotspot.util.callSuper
import be.mygod.vpnhotspot.util.matches
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.net.MacAddressCompat
import hanson.xyz.vpnhotspotmod.util.callSuper
import hanson.xyz.vpnhotspotmod.util.matches
import kotlinx.coroutines.CompletableDeferred
import java.lang.reflect.InvocationHandler
import java.lang.reflect.Method

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.net.wifi
package hanson.xyz.vpnhotspotmod.net.wifi
import android.net.wifi.WifiSsid
import android.os.Parcelable

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.preference
package hanson.xyz.vpnhotspotmod.preference
import android.content.Context
import android.net.ConnectivityManager
@@ -12,11 +12,11 @@ import androidx.core.os.bundleOf
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.withStarted
import androidx.preference.EditTextPreferenceDialogFragmentCompat
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.util.Services
import be.mygod.vpnhotspot.util.allInterfaceNames
import be.mygod.vpnhotspot.util.globalNetworkRequestBuilder
import be.mygod.vpnhotspot.widget.AlwaysAutoCompleteEditText
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.util.Services
import hanson.xyz.vpnhotspotmod.util.allInterfaceNames
import hanson.xyz.vpnhotspotmod.util.globalNetworkRequestBuilder
import hanson.xyz.vpnhotspotmod.widget.AlwaysAutoCompleteEditText
import kotlinx.coroutines.launch
class AutoCompleteNetworkPreferenceDialogFragment : EditTextPreferenceDialogFragmentCompat() {

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.preference
package hanson.xyz.vpnhotspotmod.preference
import android.content.SharedPreferences
import androidx.core.content.edit

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.preference
package hanson.xyz.vpnhotspotmod.preference
import androidx.preference.EditTextPreference
import androidx.preference.Preference

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.preference
package hanson.xyz.vpnhotspotmod.preference
import android.content.Context
import android.graphics.Typeface
@@ -10,12 +10,12 @@ import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.lifecycleScope
import androidx.preference.Preference
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.net.monitor.FallbackUpstreamMonitor
import be.mygod.vpnhotspot.net.monitor.UpstreamMonitor
import be.mygod.vpnhotspot.util.allRoutes
import be.mygod.vpnhotspot.util.format
import be.mygod.vpnhotspot.util.parseNumericAddress
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.net.monitor.FallbackUpstreamMonitor
import hanson.xyz.vpnhotspotmod.net.monitor.UpstreamMonitor
import hanson.xyz.vpnhotspotmod.util.allRoutes
import hanson.xyz.vpnhotspotmod.util.format
import hanson.xyz.vpnhotspotmod.util.parseNumericAddress
import kotlinx.coroutines.launch
import timber.log.Timber

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.room
package hanson.xyz.vpnhotspotmod.room
import androidx.room.Database
import androidx.room.Room
@@ -6,7 +6,7 @@ import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
import be.mygod.vpnhotspot.App.Companion.app
import hanson.xyz.vpnhotspotmod.App.Companion.app
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

View File

@@ -1,10 +1,10 @@
package be.mygod.vpnhotspot.room
package hanson.xyz.vpnhotspotmod.room
import android.net.MacAddress
import androidx.lifecycle.LiveData
import androidx.lifecycle.map
import androidx.room.*
import be.mygod.vpnhotspot.net.MacAddressCompat.Companion.toLong
import hanson.xyz.vpnhotspotmod.net.MacAddressCompat.Companion.toLong
@Entity
data class ClientRecord(@PrimaryKey

View File

@@ -1,11 +1,11 @@
package be.mygod.vpnhotspot.room
package hanson.xyz.vpnhotspotmod.room
import android.net.MacAddress
import android.text.TextUtils
import androidx.room.TypeConverter
import be.mygod.librootkotlinx.useParcel
import be.mygod.vpnhotspot.net.MacAddressCompat
import be.mygod.vpnhotspot.net.MacAddressCompat.Companion.toLong
import hanson.xyz.vpnhotspotmod.net.MacAddressCompat
import hanson.xyz.vpnhotspotmod.net.MacAddressCompat.Companion.toLong
import timber.log.Timber
import java.net.InetAddress

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.room
package hanson.xyz.vpnhotspotmod.room
import android.net.MacAddress
import android.os.Parcelable

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.root
package hanson.xyz.vpnhotspotmod.root
import android.net.wifi.SoftApConfiguration
import android.os.Parcelable

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.root
package hanson.xyz.vpnhotspotmod.root
import android.content.Context
import android.os.Parcelable
@@ -6,11 +6,11 @@ import android.os.RemoteException
import android.provider.Settings
import androidx.annotation.RequiresApi
import be.mygod.librootkotlinx.*
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.net.Routing.Companion.IP
import be.mygod.vpnhotspot.net.Routing.Companion.IPTABLES
import be.mygod.vpnhotspot.net.TetheringManager
import be.mygod.vpnhotspot.util.Services
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.net.Routing.Companion.IP
import hanson.xyz.vpnhotspotmod.net.Routing.Companion.IPTABLES
import hanson.xyz.vpnhotspotmod.net.TetheringManager
import hanson.xyz.vpnhotspotmod.util.Services
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.onClosed
import kotlinx.coroutines.channels.onFailure

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.root
package hanson.xyz.vpnhotspotmod.root
import android.net.MacAddress
import android.net.wifi.ScanResult
@@ -10,12 +10,12 @@ import android.system.OsConstants
import android.text.TextUtils
import androidx.annotation.RequiresApi
import be.mygod.librootkotlinx.*
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.deletePersistentGroup
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.requestDeviceAddress
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.requestPersistentGroupInfo
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.setVendorElements
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.setWifiP2pChannels
import be.mygod.vpnhotspot.util.Services
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.deletePersistentGroup
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.requestDeviceAddress
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.requestPersistentGroupInfo
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.setVendorElements
import hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.setWifiP2pChannels
import hanson.xyz.vpnhotspotmod.util.Services
import kotlinx.parcelize.Parcelize
import java.io.File
import java.io.IOException

View File

@@ -1,12 +1,12 @@
package be.mygod.vpnhotspot.root
package hanson.xyz.vpnhotspotmod.root
import android.annotation.SuppressLint
import android.os.Parcelable
import android.util.Log
import be.mygod.librootkotlinx.*
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.util.Services
import be.mygod.vpnhotspot.util.UnblockCentral
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.util.Services
import hanson.xyz.vpnhotspotmod.util.UnblockCentral
import com.google.firebase.crashlytics.FirebaseCrashlytics
import kotlinx.parcelize.Parcelize
import timber.log.Timber

View File

@@ -1,9 +1,9 @@
package be.mygod.vpnhotspot.root
package hanson.xyz.vpnhotspotmod.root
import android.os.Parcelable
import be.mygod.librootkotlinx.RootCommand
import be.mygod.librootkotlinx.RootCommandNoResult
import be.mygod.vpnhotspot.net.Routing
import hanson.xyz.vpnhotspotmod.net.Routing
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.coroutineScope

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.root
package hanson.xyz.vpnhotspotmod.root
import android.annotation.TargetApi
import android.content.ClipData
@@ -10,11 +10,11 @@ import androidx.annotation.RequiresApi
import be.mygod.librootkotlinx.ParcelableBoolean
import be.mygod.librootkotlinx.RootCommand
import be.mygod.librootkotlinx.RootCommandChannel
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.net.wifi.WifiApManager
import be.mygod.vpnhotspot.net.wifi.WifiClient
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.R
import hanson.xyz.vpnhotspotmod.net.wifi.WifiApManager
import hanson.xyz.vpnhotspotmod.net.wifi.WifiClient
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.*
import kotlinx.parcelize.Parcelize

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import android.app.Activity

View File

@@ -1,10 +1,10 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import android.os.Build
import androidx.collection.LongSparseArray
import androidx.collection.SparseArrayCompat
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.R
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.R
import timber.log.Timber
class ConstantLookup(private val prefix: String, private val lookup29: Array<out String?>,

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import android.text.style.URLSpan
import android.view.View

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import android.annotation.SuppressLint
import android.app.Application

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import java.util.concurrent.ConcurrentHashMap

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import android.content.ComponentName
import android.content.Intent
@@ -8,7 +8,7 @@ import android.os.DeadObjectException
import android.os.IBinder
import android.service.quicksettings.Tile
import android.service.quicksettings.TileService
import be.mygod.vpnhotspot.BootReceiver
import hanson.xyz.vpnhotspotmod.BootReceiver
abstract class KillableTileService : TileService(), ServiceConnection {
protected var tapPending = false

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import android.graphics.Bitmap
import android.graphics.Color
@@ -9,7 +9,7 @@ import android.widget.ImageView
import android.widget.Toast
import androidx.core.os.bundleOf
import androidx.fragment.app.DialogFragment
import be.mygod.vpnhotspot.R
import hanson.xyz.vpnhotspotmod.R
import com.google.zxing.BarcodeFormat
import com.google.zxing.EncodeHintType
import com.google.zxing.MultiFormatWriter

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
object RangeInput {
fun toString(input: IntArray) = StringBuilder().apply {

View File

@@ -1,8 +1,8 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import be.mygod.librootkotlinx.RootServer
import be.mygod.vpnhotspot.root.RootManager
import be.mygod.vpnhotspot.root.RoutingCommands
import hanson.xyz.vpnhotspotmod.root.RootManager
import hanson.xyz.vpnhotspotmod.root.RoutingCommands
import kotlinx.coroutines.runBlocking
import timber.log.Timber
import java.util.*

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import android.app.Service
import android.content.Context

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import android.content.Context
import android.net.ConnectivityManager

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import android.annotation.SuppressLint
import android.net.MacAddress

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.util
package hanson.xyz.vpnhotspotmod.util
import android.annotation.SuppressLint
import android.annotation.TargetApi
@@ -22,9 +22,9 @@ import androidx.core.view.isVisible
import androidx.databinding.BindingAdapter
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.FragmentManager
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.net.MacAddressCompat
import be.mygod.vpnhotspot.widget.SmartSnackbar
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.net.MacAddressCompat
import hanson.xyz.vpnhotspotmod.widget.SmartSnackbar
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.widget
package hanson.xyz.vpnhotspotmod.widget
import android.content.Context
import android.graphics.Rect

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.widget
package hanson.xyz.vpnhotspotmod.widget
import android.content.Context
import android.util.AttributeSet

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.widget
package hanson.xyz.vpnhotspotmod.widget
import android.content.Context
import android.text.method.LinkMovementMethod

View File

@@ -1,4 +1,4 @@
package be.mygod.vpnhotspot.widget
package hanson.xyz.vpnhotspotmod.widget
import android.annotation.SuppressLint
import android.os.Looper
@@ -8,8 +8,8 @@ import androidx.annotation.StringRes
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.findViewTreeLifecycleOwner
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.util.readableMessage
import hanson.xyz.vpnhotspotmod.App.Companion.app
import hanson.xyz.vpnhotspotmod.util.readableMessage
import com.google.android.material.snackbar.Snackbar
import java.util.concurrent.atomic.AtomicReference

View File

Some files were not shown because too many files have changed in this diff Show More