Skip to content

Commit

Permalink
Fix android vpn issues
Browse files Browse the repository at this point in the history
  • Loading branch information
chen08209 committed Jul 15, 2024
1 parent 1c54db6 commit 5292f34
Showing 1 changed file with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}


Expand All @@ -195,7 +195,6 @@ class FlClashVpnService : VpnService() {
}

override fun onUnbind(intent: Intent?): Boolean {
GlobalState.getCurrentTitlePlugin()?.handleStop()
return super.onUnbind(intent)
}

Expand Down

0 comments on commit 5292f34

Please sign in to comment.