@@ -50,7 +50,7 @@ class VpnclientEngineFlutterPlugin :
50
50
try {
51
51
singboxCore = SingBoxCore (config)
52
52
} catch (e: Exception ) {
53
- Log .e(packageName, " Failed to initialize sing-box" , e)
53
+ Log .e(context. packageName, " Failed to initialize sing-box" , e)
54
54
}
55
55
}
56
56
@@ -69,7 +69,7 @@ class VpnclientEngineFlutterPlugin :
69
69
singboxCore?.start()
70
70
result.success(true )
71
71
} catch (e: Exception ) {
72
- Log .e(packageName, " Failed to start sing-box" , e)
72
+ Log .e(context. packageName, " Failed to start sing-box" , e)
73
73
result.error(" START_ERROR" , " Failed to start sing-box" , e.message)
74
74
}
75
75
}
@@ -87,7 +87,7 @@ class VpnclientEngineFlutterPlugin :
87
87
singboxCore = null // Release sing-box instance after stopping
88
88
result.success(true )
89
89
} catch (e: Exception ) {
90
- Log .e(packageName, " Failed to stop sing-box" , e)
90
+ Log .e(context. packageName, " Failed to stop sing-box" , e)
91
91
result.error(" STOP_ERROR" , " Failed to stop sing-box" , e.message)
92
92
}
93
93
}
@@ -100,7 +100,7 @@ class VpnclientEngineFlutterPlugin :
100
100
val status = singboxCore?.getStatus() ? : " stopped"
101
101
result.success(status)
102
102
} catch (e: Exception ) {
103
- Log .e(packageName, " Failed to get sing-box status" , e)
103
+ Log .e(context. packageName, " Failed to get sing-box status" , e)
104
104
result.error(
105
105
" STATUS_ERROR" ,
106
106
" Failed to get sing-box status" ,
@@ -128,7 +128,7 @@ class SingBoxCore(
128
128
// Load the sing-box configuration from the provided string
129
129
Singbox .setConfig(config)
130
130
} catch (e: Exception ) {
131
- Log .e(packageName, " Error initializing SingBox: ${e.message} " )
131
+ Log .e(context. packageName, " Error initializing SingBox: ${e.message} " )
132
132
throw e
133
133
}
134
134
}
@@ -145,7 +145,7 @@ class SingBoxCore(
145
145
throw Exception (" Error starting SingBox: $err " )
146
146
}
147
147
} catch (e: Exception ) {
148
- Log .e(packageName, " Error starting SingBox: ${e.message} " )
148
+ Log .e(context. packageName, " Error starting SingBox: ${e.message} " )
149
149
throw e
150
150
}
151
151
}
@@ -159,7 +159,7 @@ class SingBoxCore(
159
159
// Stop the SingBox core
160
160
Singbox .stop()
161
161
} catch (e: Exception ) {
162
- Log .e(packageName, " Error stopping SingBox: ${e.message} " )
162
+ Log .e(context. packageName, " Error stopping SingBox: ${e.message} " )
163
163
throw e
164
164
}
165
165
}
0 commit comments