diff --git a/android/app/src/main/kotlin/com/follow/clash/services/FlClashVpnService.kt b/android/app/src/main/kotlin/com/follow/clash/services/FlClashVpnService.kt index 0498c90..b304cf7 100644 --- a/android/app/src/main/kotlin/com/follow/clash/services/FlClashVpnService.kt +++ b/android/app/src/main/kotlin/com/follow/clash/services/FlClashVpnService.kt @@ -174,19 +174,19 @@ class FlClashVpnService : VpnService() { inner class LocalBinder : Binder() { fun getService(): FlClashVpnService = this@FlClashVpnService -// override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean { -// try { -// val isSuccess = super.onTransact(code, data, reply, flags) -// if (!isSuccess) { -// CoroutineScope(Dispatchers.Main).launch { -// GlobalState.getCurrentTitlePlugin()?.handleStop() -// } -// } -// return isSuccess -// } catch (e: RemoteException) { -// throw e -// } -// } + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean { + try { + val isSuccess = super.onTransact(code, data, reply, flags) + if (!isSuccess) { + CoroutineScope(Dispatchers.Main).launch { + GlobalState.getCurrentTitlePlugin()?.handleStop() + } + } + return isSuccess + } catch (e: RemoteException) { + throw e + } + } }