Fix IOException in direct boot
This commit is contained in:
@@ -116,7 +116,7 @@ object TetheringManager {
|
|||||||
@RequiresApi(24)
|
@RequiresApi(24)
|
||||||
fun start(type: Int, showProvisioningUi: Boolean, callback: OnStartTetheringCallback, handler: Handler? = null) {
|
fun start(type: Int, showProvisioningUi: Boolean, callback: OnStartTetheringCallback, handler: Handler? = null) {
|
||||||
val proxy = ProxyBuilder.forClass(classOnStartTetheringCallback)
|
val proxy = ProxyBuilder.forClass(classOnStartTetheringCallback)
|
||||||
.dexCache(app.cacheDir)
|
.dexCache(app.deviceStorage.cacheDir)
|
||||||
.handler { proxy, method, args ->
|
.handler { proxy, method, args ->
|
||||||
if (args.isNotEmpty()) Timber.w("Unexpected args for ${method.name}: $args")
|
if (args.isNotEmpty()) Timber.w("Unexpected args for ${method.name}: $args")
|
||||||
when (method.name) {
|
when (method.name) {
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class P2pSupplicantConfiguration(private val group: WifiP2pGroup, ownerAddress:
|
|||||||
block[block.ssidLine!!] = "\tssid=" + ssid.toByteArray()
|
block[block.ssidLine!!] = "\tssid=" + ssid.toByteArray()
|
||||||
.joinToString("") { (it.toInt() and 255).toString(16).padStart(2, '0') }
|
.joinToString("") { (it.toInt() and 255).toString(16).padStart(2, '0') }
|
||||||
block[block.pskLine!!] = "\tpsk=\"$psk\"" // no control chars or weird stuff
|
block[block.pskLine!!] = "\tpsk=\"$psk\"" // no control chars or weird stuff
|
||||||
val tempFile = File.createTempFile("vpnhotspot-", ".conf", app.cacheDir)
|
val tempFile = File.createTempFile("vpnhotspot-", ".conf", app.deviceStorage.cacheDir)
|
||||||
try {
|
try {
|
||||||
tempFile.printWriter().use { writer ->
|
tempFile.printWriter().use { writer ->
|
||||||
lines.forEach { writer.println(it) }
|
lines.forEach { writer.println(it) }
|
||||||
|
|||||||
Reference in New Issue
Block a user