Commit 3997896a authored by Mygod's avatar Mygod

Restructure packages

parent 1ec62ae7
package com.github.shadowsocks.utils
package com.github.shadowsocks.net
import java.net.InetAddress
import org.junit.Assert
import org.junit.Test
import java.net.InetAddress
class SubnetTest {
@Test
......
......@@ -44,6 +44,7 @@ import com.github.shadowsocks.aidl.ShadowsocksConnection
import com.github.shadowsocks.core.R
import com.github.shadowsocks.database.Profile
import com.github.shadowsocks.database.ProfileManager
import com.github.shadowsocks.net.TcpFastOpen
import com.github.shadowsocks.preference.DataStore
import com.github.shadowsocks.utils.*
import com.google.firebase.FirebaseApp
......
......@@ -25,8 +25,8 @@ import android.util.Log
import androidx.recyclerview.widget.SortedList
import com.crashlytics.android.Crashlytics
import com.github.shadowsocks.Core
import com.github.shadowsocks.net.Subnet
import com.github.shadowsocks.preference.DataStore
import com.github.shadowsocks.utils.Subnet
import com.github.shadowsocks.utils.asIterable
import java.io.File
import java.io.IOException
......
......@@ -23,6 +23,7 @@ package com.github.shadowsocks.bg
import android.net.LocalSocket
import android.os.SystemClock
import com.github.shadowsocks.aidl.TrafficStats
import com.github.shadowsocks.net.LocalSocketListener
import java.io.File
import java.io.IOException
import java.nio.ByteBuffer
......
......@@ -34,9 +34,11 @@ import com.github.shadowsocks.Core
import com.github.shadowsocks.VpnRequestActivity
import com.github.shadowsocks.acl.Acl
import com.github.shadowsocks.core.R
import com.github.shadowsocks.net.DefaultNetworkListener
import com.github.shadowsocks.net.LocalSocketListener
import com.github.shadowsocks.net.Subnet
import com.github.shadowsocks.preference.DataStore
import com.github.shadowsocks.utils.Key
import com.github.shadowsocks.utils.Subnet
import com.github.shadowsocks.utils.parseNumericAddress
import com.github.shadowsocks.utils.printLog
import kotlinx.coroutines.*
......
......@@ -18,7 +18,7 @@
* *
*******************************************************************************/
package com.github.shadowsocks.bg
package com.github.shadowsocks.net
import android.annotation.TargetApi
import android.net.ConnectivityManager
......
......@@ -18,7 +18,7 @@
* *
*******************************************************************************/
package com.github.shadowsocks.utils
package com.github.shadowsocks.net
import android.os.SystemClock
import androidx.lifecycle.MutableLiveData
......@@ -28,6 +28,8 @@ import com.github.shadowsocks.Core.app
import com.github.shadowsocks.acl.Acl
import com.github.shadowsocks.core.R
import com.github.shadowsocks.preference.DataStore
import com.github.shadowsocks.utils.Key
import com.github.shadowsocks.utils.responseLength
import kotlinx.coroutines.*
import java.io.IOException
import java.net.HttpURLConnection
......
......@@ -18,7 +18,7 @@
* *
*******************************************************************************/
package com.github.shadowsocks.bg
package com.github.shadowsocks.net
import android.net.LocalServerSocket
import android.net.LocalSocket
......
......@@ -18,8 +18,9 @@
* *
*******************************************************************************/
package com.github.shadowsocks.utils
package com.github.shadowsocks.net
import com.github.shadowsocks.utils.parseNumericAddress
import java.net.InetAddress
import java.util.*
......
......@@ -18,7 +18,7 @@
* *
*******************************************************************************/
package com.github.shadowsocks.utils
package com.github.shadowsocks.net
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withTimeoutOrNull
......
......@@ -27,7 +27,7 @@ import com.github.shadowsocks.database.PrivateDatabase
import com.github.shadowsocks.database.PublicDatabase
import com.github.shadowsocks.utils.DirectBoot
import com.github.shadowsocks.utils.Key
import com.github.shadowsocks.utils.TcpFastOpen
import com.github.shadowsocks.net.TcpFastOpen
import com.github.shadowsocks.utils.parsePort
import java.net.NetworkInterface
import java.net.SocketException
......
......@@ -49,8 +49,8 @@ private val parseNumericAddress by lazy {
*
* Bug: https://issuetracker.google.com/issues/123456213
*/
fun String?.parseNumericAddress(): InetAddress? = Os.inet_pton(OsConstants.AF_INET, this) ?:
Os.inet_pton(OsConstants.AF_INET6, this)?.let { parseNumericAddress.invoke(null, this) as InetAddress }
fun String?.parseNumericAddress(): InetAddress? = Os.inet_pton(OsConstants.AF_INET, this)
?: Os.inet_pton(OsConstants.AF_INET6, this)?.let { parseNumericAddress.invoke(null, this) as InetAddress }
fun parsePort(str: String?, default: Int, min: Int = 1025): Int {
val value = str?.toIntOrNull() ?: default
......
......@@ -28,7 +28,7 @@ import com.github.shadowsocks.bg.BaseService
import com.github.shadowsocks.preference.DataStore
import com.github.shadowsocks.utils.DirectBoot
import com.github.shadowsocks.utils.Key
import com.github.shadowsocks.utils.TcpFastOpen
import com.github.shadowsocks.net.TcpFastOpen
import com.github.shadowsocks.utils.remove
import com.takisoft.preferencex.PreferenceFragmentCompat
......
......@@ -42,7 +42,7 @@ import com.github.shadowsocks.MainActivity
import com.github.shadowsocks.R
import com.github.shadowsocks.ToolbarFragment
import com.github.shadowsocks.bg.BaseService
import com.github.shadowsocks.utils.Subnet
import com.github.shadowsocks.net.Subnet
import com.github.shadowsocks.utils.asIterable
import com.github.shadowsocks.utils.resolveResourceId
import com.github.shadowsocks.widget.UndoSnackbarManager
......
......@@ -33,7 +33,7 @@ import androidx.lifecycle.get
import com.github.shadowsocks.MainActivity
import com.github.shadowsocks.R
import com.github.shadowsocks.bg.BaseService
import com.github.shadowsocks.utils.HttpsTest
import com.github.shadowsocks.net.HttpsTest
import com.google.android.material.bottomappbar.BottomAppBar
class StatsBar @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null,
......
......@@ -50,6 +50,8 @@ import com.github.shadowsocks.bg.BaseService
import com.github.shadowsocks.bg.Executable
import com.github.shadowsocks.database.Profile
import com.github.shadowsocks.database.ProfileManager
import com.github.shadowsocks.net.HttpsTest
import com.github.shadowsocks.net.TcpFastOpen
import com.github.shadowsocks.preference.DataStore
import com.github.shadowsocks.preference.OnPreferenceDataStoreChangeListener
import com.github.shadowsocks.utils.*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment