Rollback partial modification
This commit is contained in:
@@ -44,7 +44,7 @@ object GlobalState {
|
||||
fun initServiceEngine(context: Context) {
|
||||
if (serviceEngine != null) return
|
||||
lock.withLock {
|
||||
if (serviceEngine != null) return
|
||||
destroyServiceEngine()
|
||||
serviceEngine = FlutterEngine(context)
|
||||
serviceEngine?.plugins?.add(ProxyPlugin())
|
||||
serviceEngine?.plugins?.add(AppPlugin())
|
||||
|
||||
@@ -174,16 +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 {
|
||||
CoroutineScope(Dispatchers.Main).launch {
|
||||
GlobalState.getCurrentTitlePlugin()?.handleStop()
|
||||
}
|
||||
try {
|
||||
return super.onTransact(code, data, reply, flags)
|
||||
} 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
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user