Update support lib to 28.0.0-alpha3
This commit is contained in:
@@ -6,7 +6,7 @@ buildscript {
|
|||||||
ext {
|
ext {
|
||||||
androidPluginVersion = '3.1.3'
|
androidPluginVersion = '3.1.3'
|
||||||
kotlinVersion = '1.2.41'
|
kotlinVersion = '1.2.41'
|
||||||
supportLibraryVersion = '27.1.1'
|
supportLibraryVersion = '28.0.0-alpha3'
|
||||||
takisoftFixVersion = '27.1.1.1'
|
takisoftFixVersion = '27.1.1.1'
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import android.preference.PreferenceManager
|
|||||||
import android.support.annotation.StringRes
|
import android.support.annotation.StringRes
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import be.mygod.vpnhotspot.util.Event0
|
import be.mygod.vpnhotspot.util.Event0
|
||||||
|
import be.mygod.vpnhotspot.util.systemService
|
||||||
|
|
||||||
class App : Application() {
|
class App : Application() {
|
||||||
companion object {
|
companion object {
|
||||||
@@ -43,8 +44,8 @@ class App : Application() {
|
|||||||
lateinit var deviceContext: Context
|
lateinit var deviceContext: Context
|
||||||
val handler = Handler()
|
val handler = Handler()
|
||||||
val pref: SharedPreferences by lazy { PreferenceManager.getDefaultSharedPreferences(deviceContext) }
|
val pref: SharedPreferences by lazy { PreferenceManager.getDefaultSharedPreferences(deviceContext) }
|
||||||
val connectivity by lazy { getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager }
|
val connectivity by lazy { systemService<ConnectivityManager>() }
|
||||||
val wifi by lazy { app.getSystemService(Context.WIFI_SERVICE) as WifiManager }
|
val wifi by lazy { systemService<WifiManager>() }
|
||||||
|
|
||||||
val operatingChannel: Int get() {
|
val operatingChannel: Int get() {
|
||||||
val result = pref.getString(KEY_OPERATING_CHANNEL, null)?.toIntOrNull() ?: 0
|
val result = pref.getString(KEY_OPERATING_CHANNEL, null)?.toIntOrNull() ?: 0
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ class RepeaterService : Service(), WifiP2pManager.ChannelListener, SharedPrefere
|
|||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
try {
|
try {
|
||||||
p2pManager = getSystemService(Context.WIFI_P2P_SERVICE) as WifiP2pManager
|
p2pManager = systemService()
|
||||||
onChannelDisconnected()
|
onChannelDisconnected()
|
||||||
app.pref.registerOnSharedPreferenceChangeListener(this)
|
app.pref.registerOnSharedPreferenceChangeListener(this)
|
||||||
} catch (exc: TypeCastException) {
|
} catch (exc: TypeCastException) {
|
||||||
|
|||||||
@@ -8,13 +8,14 @@ import android.os.Build
|
|||||||
import android.support.v4.app.NotificationCompat
|
import android.support.v4.app.NotificationCompat
|
||||||
import android.support.v4.content.ContextCompat
|
import android.support.v4.content.ContextCompat
|
||||||
import be.mygod.vpnhotspot.App.Companion.app
|
import be.mygod.vpnhotspot.App.Companion.app
|
||||||
|
import be.mygod.vpnhotspot.util.systemService
|
||||||
|
|
||||||
object ServiceNotification {
|
object ServiceNotification {
|
||||||
private const val CHANNEL = "tethering"
|
private const val CHANNEL = "tethering"
|
||||||
private const val CHANNEL_ID = 1
|
private const val CHANNEL_ID = 1
|
||||||
|
|
||||||
private val deviceCountsMap = HashMap<Service, Map<String, Int>>()
|
private val deviceCountsMap = HashMap<Service, Map<String, Int>>()
|
||||||
private val manager = app.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
private val manager = app.systemService<NotificationManager>()
|
||||||
|
|
||||||
private fun buildNotification(context: Context): Notification {
|
private fun buildNotification(context: Context): Notification {
|
||||||
val builder = NotificationCompat.Builder(context, CHANNEL)
|
val builder = NotificationCompat.Builder(context, CHANNEL)
|
||||||
|
|||||||
@@ -18,14 +18,14 @@ import be.mygod.vpnhotspot.preference.SharedPreferenceDataStore
|
|||||||
import be.mygod.vpnhotspot.util.loggerSuStream
|
import be.mygod.vpnhotspot.util.loggerSuStream
|
||||||
import be.mygod.vpnhotspot.util.put
|
import be.mygod.vpnhotspot.util.put
|
||||||
import com.crashlytics.android.Crashlytics
|
import com.crashlytics.android.Crashlytics
|
||||||
import com.takisoft.fix.support.v7.preference.PreferenceFragmentCompatDividers
|
import com.takisoft.fix.support.v7.preference.PreferenceFragmentCompat
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.PrintWriter
|
import java.io.PrintWriter
|
||||||
import java.net.NetworkInterface
|
import java.net.NetworkInterface
|
||||||
import java.net.SocketException
|
import java.net.SocketException
|
||||||
|
|
||||||
class SettingsPreferenceFragment : PreferenceFragmentCompatDividers() {
|
class SettingsPreferenceFragment : PreferenceFragmentCompat() {
|
||||||
private val customTabsIntent by lazy {
|
private val customTabsIntent by lazy {
|
||||||
CustomTabsIntent.Builder()
|
CustomTabsIntent.Builder()
|
||||||
.setToolbarColor(ContextCompat.getColor(requireContext(), R.color.colorPrimary))
|
.setToolbarColor(ContextCompat.getColor(requireContext(), R.color.colorPrimary))
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import be.mygod.vpnhotspot.databinding.ListitemInterfaceBinding
|
|||||||
import be.mygod.vpnhotspot.net.TetherType
|
import be.mygod.vpnhotspot.net.TetherType
|
||||||
import be.mygod.vpnhotspot.util.ServiceForegroundConnector
|
import be.mygod.vpnhotspot.util.ServiceForegroundConnector
|
||||||
import be.mygod.vpnhotspot.util.formatAddresses
|
import be.mygod.vpnhotspot.util.formatAddresses
|
||||||
|
import be.mygod.vpnhotspot.util.systemService
|
||||||
import com.crashlytics.android.Crashlytics
|
import com.crashlytics.android.Crashlytics
|
||||||
import java.net.NetworkInterface
|
import java.net.NetworkInterface
|
||||||
|
|
||||||
@@ -51,7 +52,7 @@ class LocalOnlyHotspotManager(private val parent: TetheringFragment) : Manager()
|
|||||||
if (if (Build.VERSION.SDK_INT < 28) @Suppress("DEPRECATION") {
|
if (if (Build.VERSION.SDK_INT < 28) @Suppress("DEPRECATION") {
|
||||||
Settings.Secure.getInt(view.context.contentResolver, Settings.Secure.LOCATION_MODE,
|
Settings.Secure.getInt(view.context.contentResolver, Settings.Secure.LOCATION_MODE,
|
||||||
Settings.Secure.LOCATION_MODE_OFF) == Settings.Secure.LOCATION_MODE_OFF
|
Settings.Secure.LOCATION_MODE_OFF) == Settings.Secure.LOCATION_MODE_OFF
|
||||||
} else !context.getSystemService(LocationManager::class.java).isLocationEnabled) {
|
} else !context.systemService<LocationManager>().isLocationEnabled) {
|
||||||
Toast.makeText(view.context, R.string.tethering_temp_hotspot_location, Toast.LENGTH_LONG).show()
|
Toast.makeText(view.context, R.string.tethering_temp_hotspot_location, Toast.LENGTH_LONG).show()
|
||||||
try {
|
try {
|
||||||
view.context.startActivity(Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS))
|
view.context.startActivity(Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS))
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import android.content.*
|
|||||||
import android.databinding.BindingAdapter
|
import android.databinding.BindingAdapter
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.support.annotation.DrawableRes
|
import android.support.annotation.DrawableRes
|
||||||
|
import android.support.v4.content.ContextCompat
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
@@ -29,6 +30,8 @@ fun intentFilter(vararg actions: String): IntentFilter {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline fun <reified T> Context.systemService() = ContextCompat.getSystemService(this, T::class.java)!!
|
||||||
|
|
||||||
fun Bundle.put(key: String, map: Array<String>): Bundle {
|
fun Bundle.put(key: String, map: Array<String>): Bundle {
|
||||||
putStringArray(key, map)
|
putStringArray(key, map)
|
||||||
return this
|
return this
|
||||||
|
|||||||
9
mobile/src/main/res/drawable/ic_action_bug_report.xml
Normal file
9
mobile/src/main/res/drawable/ic_action_bug_report.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M20,8h-2.81c-0.45,-0.78 -1.07,-1.45 -1.82,-1.96L17,4.41 15.59,3l-2.17,2.17C12.96,5.06 12.49,5 12,5c-0.49,0 -0.96,0.06 -1.41,0.17L8.41,3 7,4.41l1.62,1.63C7.88,6.55 7.26,7.22 6.81,8L4,8v2h2.09c-0.05,0.33 -0.09,0.66 -0.09,1v1L4,12v2h2v1c0,0.34 0.04,0.67 0.09,1L4,16v2h2.81c1.04,1.79 2.97,3 5.19,3s4.15,-1.21 5.19,-3L20,18v-2h-2.09c0.05,-0.33 0.09,-0.66 0.09,-1v-1h2v-2h-2v-1c0,-0.34 -0.04,-0.67 -0.09,-1L20,10L20,8zM14,16h-4v-2h4v2zM14,12h-4v-2h4v2z"/>
|
||||||
|
</vector>
|
||||||
9
mobile/src/main/res/drawable/ic_action_dns.xml
Normal file
9
mobile/src/main/res/drawable/ic_action_dns.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M20,13H4c-0.55,0 -1,0.45 -1,1v6c0,0.55 0.45,1 1,1h16c0.55,0 1,-0.45 1,-1v-6c0,-0.55 -0.45,-1 -1,-1zM7,19c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM20,3H4c-0.55,0 -1,0.45 -1,1v6c0,0.55 0.45,1 1,1h16c0.55,0 1,-0.45 1,-1V4c0,-0.55 -0.45,-1 -1,-1zM7,9c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z"/>
|
||||||
|
</vector>
|
||||||
5
mobile/src/main/res/drawable/ic_action_pan_tool.xml
Normal file
5
mobile/src/main/res/drawable/ic_action_pan_tool.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<vector android:autoMirrored="true" android:height="24dp"
|
||||||
|
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#FF000000" android:pathData="M23,5.5V20c0,2.2 -1.8,4 -4,4h-7.3c-1.08,0 -2.1,-0.43 -2.85,-1.19L1,14.83s1.26,-1.23 1.3,-1.25c0.22,-0.19 0.49,-0.29 0.79,-0.29 0.22,0 0.42,0.06 0.6,0.16 0.04,0.01 4.31,2.46 4.31,2.46V4c0,-0.83 0.67,-1.5 1.5,-1.5S11,3.17 11,4v7h1V1.5c0,-0.83 0.67,-1.5 1.5,-1.5S15,0.67 15,1.5V11h1V2.5c0,-0.83 0.67,-1.5 1.5,-1.5s1.5,0.67 1.5,1.5V11h1V5.5c0,-0.83 0.67,-1.5 1.5,-1.5s1.5,0.67 1.5,1.5z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M14,12c0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2 0.9,2 2,2 2,-0.9 2,-2zM12,3c-4.97,0 -9,4.03 -9,9L0,12l4,4 4,-4L5,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.51,0 -2.91,-0.49 -4.06,-1.3l-1.42,1.44C8.04,20.3 9.94,21 12,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M7.77,6.76L6.23,5.48 0.82,12l5.41,6.52 1.54,-1.28L3.42,12l4.35,-5.24zM7,13h2v-2L7,11v2zM17,11h-2v2h2v-2zM11,13h2v-2h-2v2zM17.77,5.48l-1.54,1.28L20.58,12l-4.35,5.24 1.54,1.28L23.18,12l-5.41,-6.52z"/>
|
||||||
|
</vector>
|
||||||
9
mobile/src/main/res/drawable/ic_image_looks_6.xml
Normal file
9
mobile/src/main/res/drawable/ic_image_looks_6.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M11,15h2v-2h-2v2zM19,3L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM15,9h-4v2h2c1.1,0 2,0.89 2,2v2c0,1.11 -0.9,2 -2,2h-2c-1.1,0 -2,-0.89 -2,-2L9,9c0,-1.11 0.9,-2 2,-2h4v2z"/>
|
||||||
|
</vector>
|
||||||
9
mobile/src/main/res/drawable/ic_toggle_star.xml
Normal file
9
mobile/src/main/res/drawable/ic_toggle_star.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
|
||||||
|
</vector>
|
||||||
@@ -4,22 +4,27 @@
|
|||||||
android:title="@string/settings_service">
|
android:title="@string/settings_service">
|
||||||
<Preference
|
<Preference
|
||||||
android:key="service.clean"
|
android:key="service.clean"
|
||||||
|
android:icon="@drawable/ic_action_settings_backup_restore"
|
||||||
android:title="@string/settings_service_clean"/>
|
android:title="@string/settings_service_clean"/>
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="service.repeater.strict"
|
android:key="service.repeater.strict"
|
||||||
|
android:icon="@drawable/ic_action_pan_tool"
|
||||||
android:title="@string/settings_service_repeater_strict"
|
android:title="@string/settings_service_repeater_strict"
|
||||||
android:summary="@string/settings_service_repeater_strict_summary"/>
|
android:summary="@string/settings_service_repeater_strict_summary"/>
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="service.disableIpv6"
|
android:key="service.disableIpv6"
|
||||||
|
android:icon="@drawable/ic_image_looks_6"
|
||||||
android:title="@string/settings_service_disable_ipv6"
|
android:title="@string/settings_service_disable_ipv6"
|
||||||
android:summary="@string/settings_service_disable_ipv6_summary"/>
|
android:summary="@string/settings_service_disable_ipv6_summary"/>
|
||||||
<AutoSummaryEditTextPreference
|
<AutoSummaryEditTextPreference
|
||||||
android:key="service.dns"
|
android:key="service.dns"
|
||||||
|
android:icon="@drawable/ic_action_dns"
|
||||||
android:title="@string/settings_service_dns"
|
android:title="@string/settings_service_dns"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:defaultValue="8.8.8.8"/>
|
android:defaultValue="8.8.8.8"/>
|
||||||
<be.mygod.vpnhotspot.preference.AlwaysAutoCompleteEditTextPreference
|
<be.mygod.vpnhotspot.preference.AlwaysAutoCompleteEditTextPreference
|
||||||
android:key="service.upstream"
|
android:key="service.upstream"
|
||||||
|
android:icon="@drawable/ic_action_settings_ethernet"
|
||||||
android:title="@string/settings_service_upstream"
|
android:title="@string/settings_service_upstream"
|
||||||
android:summary="@string/settings_service_upstream_auto"
|
android:summary="@string/settings_service_upstream_auto"
|
||||||
android:hint="@string/settings_service_upstream_auto"
|
android:hint="@string/settings_service_upstream_auto"
|
||||||
@@ -29,10 +34,12 @@
|
|||||||
android:title="@string/settings_misc">
|
android:title="@string/settings_misc">
|
||||||
<Preference
|
<Preference
|
||||||
android:key="misc.logcat"
|
android:key="misc.logcat"
|
||||||
|
android:icon="@drawable/ic_action_bug_report"
|
||||||
android:title="@string/settings_misc_logcat"
|
android:title="@string/settings_misc_logcat"
|
||||||
android:summary="@string/settings_misc_logcat_summary"/>
|
android:summary="@string/settings_misc_logcat_summary"/>
|
||||||
<Preference
|
<Preference
|
||||||
android:key="misc.source"
|
android:key="misc.source"
|
||||||
|
android:icon="@drawable/ic_toggle_star"
|
||||||
android:title="@string/settings_misc_source"
|
android:title="@string/settings_misc_source"
|
||||||
android:summary="@string/settings_misc_source_summary"/>
|
android:summary="@string/settings_misc_source_summary"/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|||||||
Reference in New Issue
Block a user