This commit is contained in:
arm64v8a 2023-04-14 14:40:16 +09:00
parent 3a41a6dd25
commit a0a51bbf30
2 changed files with 18 additions and 10 deletions

View File

@ -10,6 +10,7 @@ import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.ScrollView
import android.widget.Toast import android.widget.Toast
import androidx.activity.result.component1 import androidx.activity.result.component1
import androidx.activity.result.component2 import androidx.activity.result.component2
@ -355,7 +356,10 @@ abstract class ProfileSettingsActivity<T : AbstractBean>(
} }
} }
} }
MaterialAlertDialogBuilder(activity).setView(view).show() val scrollView = ScrollView(context).apply {
addView(view)
}
MaterialAlertDialogBuilder(activity).setView(scrollView).show()
true true
} }
else -> false else -> false

View File

@ -59,6 +59,7 @@ object SendLog {
// Get log bytes from neko.log // Get log bytes from neko.log
fun getNekoLog(max: Long): ByteArray { fun getNekoLog(max: Long): ByteArray {
return try {
val file = File( val file = File(
SagerNet.application.cacheDir, SagerNet.application.cacheDir,
"neko.log" "neko.log"
@ -68,6 +69,9 @@ object SendLog {
if (max in 1 until len) { if (max in 1 until len) {
stream.skip(len - max) // TODO string? stream.skip(len - max) // TODO string?
} }
return stream.use { it.readBytes() } stream.use { it.readBytes() }
} catch (e: Exception) {
e.stackTraceToString().toByteArray()
}
} }
} }