Fix deprecated APIs

This commit is contained in:
Mygod
2020-12-16 06:20:33 +08:00
parent 131cdefcf7
commit 3b7c6f0ebf
14 changed files with 14 additions and 14 deletions

View File

@@ -4,8 +4,8 @@ plugins {
id("com.google.gms.google-services") id("com.google.gms.google-services")
id("com.google.firebase.crashlytics") id("com.google.firebase.crashlytics")
kotlin("android") kotlin("android")
kotlin("android.extensions")
kotlin("kapt") kotlin("kapt")
id("kotlin-parcelize")
} }
android { android {

View File

@@ -2,10 +2,10 @@ package be.mygod.librootkotlinx
import android.os.Parcelable import android.os.Parcelable
import androidx.annotation.MainThread import androidx.annotation.MainThread
import kotlinx.android.parcel.Parcelize
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.channels.ReceiveChannel import kotlinx.coroutines.channels.ReceiveChannel
import kotlinx.parcelize.Parcelize
interface RootCommand<Result : Parcelable?> : Parcelable { interface RootCommand<Result : Parcelable?> : Parcelable {
/** /**

View File

@@ -8,7 +8,7 @@ import android.os.Parcel
import android.os.Parcelable import android.os.Parcelable
import android.util.* import android.util.*
import androidx.annotation.RequiresApi import androidx.annotation.RequiresApi
import kotlinx.android.parcel.Parcelize import kotlinx.parcelize.Parcelize
class NoShellException(cause: Throwable) : Exception("Root missing", cause) class NoShellException(cause: Throwable) : Exception("Root missing", cause)

View File

@@ -10,7 +10,7 @@ import androidx.core.os.bundleOf
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.setFragmentResult import androidx.fragment.app.setFragmentResult
import androidx.fragment.app.setFragmentResultListener import androidx.fragment.app.setFragmentResultListener
import kotlinx.android.parcel.Parcelize import kotlinx.parcelize.Parcelize
/** /**
* Based on: https://android.googlesource.com/platform/packages/apps/ExactCalculator/+/8c43f06/src/com/android/calculator2/AlertDialogFragment.java * Based on: https://android.googlesource.com/platform/packages/apps/ExactCalculator/+/8c43f06/src/com/android/calculator2/AlertDialogFragment.java

View File

@@ -41,8 +41,8 @@ import be.mygod.vpnhotspot.util.SpanFormatter
import be.mygod.vpnhotspot.util.showAllowingStateLoss import be.mygod.vpnhotspot.util.showAllowingStateLoss
import be.mygod.vpnhotspot.util.toPluralInt import be.mygod.vpnhotspot.util.toPluralInt
import be.mygod.vpnhotspot.widget.SmartSnackbar import be.mygod.vpnhotspot.widget.SmartSnackbar
import kotlinx.android.parcel.Parcelize
import kotlinx.coroutines.* import kotlinx.coroutines.*
import kotlinx.parcelize.Parcelize
import java.text.NumberFormat import java.text.NumberFormat
class ClientsFragment : Fragment() { class ClientsFragment : Fragment() {

View File

@@ -33,8 +33,8 @@ import be.mygod.vpnhotspot.util.ServiceForegroundConnector
import be.mygod.vpnhotspot.util.formatAddresses import be.mygod.vpnhotspot.util.formatAddresses
import be.mygod.vpnhotspot.util.showAllowingStateLoss import be.mygod.vpnhotspot.util.showAllowingStateLoss
import be.mygod.vpnhotspot.widget.SmartSnackbar import be.mygod.vpnhotspot.widget.SmartSnackbar
import kotlinx.android.parcel.Parcelize
import kotlinx.coroutines.* import kotlinx.coroutines.*
import kotlinx.parcelize.Parcelize
import timber.log.Timber import timber.log.Timber
import java.net.NetworkInterface import java.net.NetworkInterface
import java.net.SocketException import java.net.SocketException

View File

@@ -10,7 +10,7 @@ import androidx.annotation.RequiresApi
import be.mygod.vpnhotspot.net.MacAddressCompat import be.mygod.vpnhotspot.net.MacAddressCompat
import be.mygod.vpnhotspot.net.MacAddressCompat.Companion.toCompat import be.mygod.vpnhotspot.net.MacAddressCompat.Companion.toCompat
import be.mygod.vpnhotspot.net.monitor.TetherTimeoutMonitor import be.mygod.vpnhotspot.net.monitor.TetherTimeoutMonitor
import kotlinx.android.parcel.Parcelize import kotlinx.parcelize.Parcelize
@Parcelize @Parcelize
data class SoftApConfigurationCompat( data class SoftApConfigurationCompat(

View File

@@ -31,7 +31,7 @@ import be.mygod.vpnhotspot.util.QRCodeDialog
import be.mygod.vpnhotspot.util.readableMessage import be.mygod.vpnhotspot.util.readableMessage
import be.mygod.vpnhotspot.util.showAllowingStateLoss import be.mygod.vpnhotspot.util.showAllowingStateLoss
import be.mygod.vpnhotspot.widget.SmartSnackbar import be.mygod.vpnhotspot.widget.SmartSnackbar
import kotlinx.android.parcel.Parcelize import kotlinx.parcelize.Parcelize
/** /**
* Based on: https://android.googlesource.com/platform/packages/apps/Settings/+/39b4674/src/com/android/settings/wifi/WifiApDialog.java * Based on: https://android.googlesource.com/platform/packages/apps/Settings/+/39b4674/src/com/android/settings/wifi/WifiApDialog.java

View File

@@ -2,7 +2,7 @@ package be.mygod.vpnhotspot.room
import android.os.Parcelable import android.os.Parcelable
import androidx.room.* import androidx.room.*
import kotlinx.android.parcel.Parcelize import kotlinx.parcelize.Parcelize
import java.net.InetAddress import java.net.InetAddress
@Entity(foreignKeys = [ForeignKey(entity = TrafficRecord::class, parentColumns = ["id"], childColumns = ["previousId"], @Entity(foreignKeys = [ForeignKey(entity = TrafficRecord::class, parentColumns = ["id"], childColumns = ["previousId"],

View File

@@ -12,9 +12,9 @@ import be.mygod.vpnhotspot.net.Routing.Companion.IP
import be.mygod.vpnhotspot.net.Routing.Companion.IPTABLES import be.mygod.vpnhotspot.net.Routing.Companion.IPTABLES
import be.mygod.vpnhotspot.net.TetheringManager import be.mygod.vpnhotspot.net.TetheringManager
import be.mygod.vpnhotspot.util.Services import be.mygod.vpnhotspot.util.Services
import kotlinx.android.parcel.Parcelize
import kotlinx.coroutines.* import kotlinx.coroutines.*
import kotlinx.coroutines.channels.produce import kotlinx.coroutines.channels.produce
import kotlinx.parcelize.Parcelize
import java.io.File import java.io.File
import java.io.FileOutputStream import java.io.FileOutputStream
import java.io.InterruptedIOException import java.io.InterruptedIOException

View File

@@ -13,7 +13,7 @@ import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.requestDeviceAddress
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.requestPersistentGroupInfo import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.requestPersistentGroupInfo
import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.setWifiP2pChannels import be.mygod.vpnhotspot.net.wifi.WifiP2pManagerHelper.setWifiP2pChannels
import be.mygod.vpnhotspot.util.Services import be.mygod.vpnhotspot.util.Services
import kotlinx.android.parcel.Parcelize import kotlinx.parcelize.Parcelize
import java.io.File import java.io.File
import java.io.IOException import java.io.IOException

View File

@@ -5,7 +5,7 @@ import android.util.Log
import be.mygod.librootkotlinx.* import be.mygod.librootkotlinx.*
import be.mygod.vpnhotspot.App.Companion.app import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.util.Services import be.mygod.vpnhotspot.util.Services
import kotlinx.android.parcel.Parcelize import kotlinx.parcelize.Parcelize
import timber.log.Timber import timber.log.Timber
object RootManager : RootSession(), Logger { object RootManager : RootSession(), Logger {

View File

@@ -5,11 +5,11 @@ import android.util.Log
import be.mygod.librootkotlinx.RootCommand import be.mygod.librootkotlinx.RootCommand
import be.mygod.librootkotlinx.RootCommandOneWay import be.mygod.librootkotlinx.RootCommandOneWay
import be.mygod.vpnhotspot.net.Routing import be.mygod.vpnhotspot.net.Routing
import kotlinx.android.parcel.Parcelize
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async import kotlinx.coroutines.async
import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import kotlinx.parcelize.Parcelize
object RoutingCommands { object RoutingCommands {
@Parcelize @Parcelize

View File

@@ -9,11 +9,11 @@ import be.mygod.librootkotlinx.RootCommandChannel
import be.mygod.vpnhotspot.net.wifi.SoftApConfigurationCompat import be.mygod.vpnhotspot.net.wifi.SoftApConfigurationCompat
import be.mygod.vpnhotspot.net.wifi.WifiApManager import be.mygod.vpnhotspot.net.wifi.WifiApManager
import be.mygod.vpnhotspot.widget.SmartSnackbar import be.mygod.vpnhotspot.widget.SmartSnackbar
import kotlinx.android.parcel.Parcelize
import kotlinx.coroutines.* import kotlinx.coroutines.*
import kotlinx.coroutines.channels.ReceiveChannel import kotlinx.coroutines.channels.ReceiveChannel
import kotlinx.coroutines.channels.consumeEach import kotlinx.coroutines.channels.consumeEach
import kotlinx.coroutines.channels.produce import kotlinx.coroutines.channels.produce
import kotlinx.parcelize.Parcelize
import timber.log.Timber import timber.log.Timber
object WifiApCommands { object WifiApCommands {