Commit f870093c authored by Max Lv's avatar Max Lv

Fix EBADF error with proguard

parent f4e5a958
......@@ -23,6 +23,8 @@
-keepattributes *DatabaseField*
-keepattributes *DatabaseTable*
-keepattributes *SerializedName*
-keepattributes Exceptions, InnerClasses
-keep class com.j256.**
-keepclassmembers class com.j256.** { *; }
-keep enum com.j256.**
......
......@@ -54,16 +54,26 @@ abstract class LocalSocketListener(private val tag: String) : Thread() {
while (true) {
val serverSocket = serverSocket.get() ?: return
try {
val socket = serverSocket.accept()
try {
serverSocket.accept()
accept(socket)
} catch (e: Exception) {
Log.e(tag, "Error when recv traffic stat", e)
app.track(e)
}
try {
socket.close()
} catch (e: IOException) {
Log.e(tag, "Error when accept socket", e)
Log.e(tag, "Error when closing the local socket", e)
app.track(e)
null
}?.use(this::accept)
} catch (e: Exception) {
Log.e(tag, "Error when recv traffic stat", e)
}
} catch (e: IOException) {
Log.e(tag, "Error when accept socket", e)
app.track(e)
return
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment