fix(composer_hooks): log crash
This commit is contained in:
@@ -6,6 +6,7 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.ServiceConnection
|
||||
import android.os.*
|
||||
import android.util.Log
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
import me.rhunk.snapenhance.bridge.AccountStorage
|
||||
import me.rhunk.snapenhance.bridge.BridgeInterface
|
||||
@@ -108,6 +109,7 @@ class BridgeClient(
|
||||
return runCatching {
|
||||
block()
|
||||
}.getOrElse {
|
||||
Log.e("SnapEnhance", "service call failed", it)
|
||||
if (it is DeadObjectException) {
|
||||
context.softRestartApp()
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ class ComposerHooks: Feature("ComposerHooks", loadParams = FeatureLoadParams.ACT
|
||||
"log" -> {
|
||||
if (argc < 3) return false
|
||||
val logLevel = composerMarshaller.getUntyped(1) as? String ?: return false
|
||||
val message = composerMarshaller.getUntyped(2) as? String ?: return false
|
||||
val message = (composerMarshaller.getUntyped(2) as? String)?.takeIf { it.length < 1024 * 512 } ?: return false
|
||||
|
||||
val tag = "ComposerLogs"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user