Ensure resource is being read from system
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package be.mygod.vpnhotspot.net
|
package be.mygod.vpnhotspot.net
|
||||||
|
|
||||||
import android.content.res.Resources
|
import android.content.res.Resources
|
||||||
import be.mygod.vpnhotspot.App.Companion.app
|
|
||||||
import be.mygod.vpnhotspot.R
|
import be.mygod.vpnhotspot.R
|
||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
|
|
||||||
@@ -31,21 +30,20 @@ enum class TetherType {
|
|||||||
* Source: https://android.googlesource.com/platform/frameworks/base/+/61fa313/core/res/res/values/config.xml#328
|
* Source: https://android.googlesource.com/platform/frameworks/base/+/61fa313/core/res/res/values/config.xml#328
|
||||||
*/
|
*/
|
||||||
init {
|
init {
|
||||||
val appRes = app.resources
|
val system = Resources.getSystem()
|
||||||
val sysRes = Resources.getSystem()
|
usbRegexs = system.getStringArray(system
|
||||||
usbRegexs = appRes.getStringArray(sysRes
|
|
||||||
.getIdentifier("config_tether_usb_regexs", "array", "android"))
|
.getIdentifier("config_tether_usb_regexs", "array", "android"))
|
||||||
.filterNotNull()
|
.filterNotNull()
|
||||||
.map { it.toPattern() }
|
.map { it.toPattern() }
|
||||||
wifiRegexs = appRes.getStringArray(sysRes
|
wifiRegexs = system.getStringArray(system
|
||||||
.getIdentifier("config_tether_wifi_regexs", "array", "android"))
|
.getIdentifier("config_tether_wifi_regexs", "array", "android"))
|
||||||
.filterNotNull()
|
.filterNotNull()
|
||||||
.map { it.toPattern() }
|
.map { it.toPattern() }
|
||||||
wimaxRegexs = appRes.getStringArray(sysRes
|
wimaxRegexs = system.getStringArray(system
|
||||||
.getIdentifier("config_tether_wimax_regexs", "array", "android"))
|
.getIdentifier("config_tether_wimax_regexs", "array", "android"))
|
||||||
.filterNotNull()
|
.filterNotNull()
|
||||||
.map { it.toPattern() }
|
.map { it.toPattern() }
|
||||||
bluetoothRegexs = appRes.getStringArray(sysRes
|
bluetoothRegexs = system.getStringArray(system
|
||||||
.getIdentifier("config_tether_bluetooth_regexs", "array", "android"))
|
.getIdentifier("config_tether_bluetooth_regexs", "array", "android"))
|
||||||
.filterNotNull()
|
.filterNotNull()
|
||||||
.map { it.toPattern() }
|
.map { it.toPattern() }
|
||||||
|
|||||||
Reference in New Issue
Block a user