chore: add framework version to debug ui
This commit is contained in:
@@ -172,13 +172,7 @@ class TroubleshootFragment : BaseRootLayoutFragment() {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
CategoryItem("调试信息") {
|
CategoryItem("调试信息") {
|
||||||
val statusInfo = "PID: " + android.os.Process.myPid() +
|
description(generateStatusText(), isTextSelectable = true)
|
||||||
", UID: " + android.os.Process.myUid() +
|
|
||||||
", " + (if (android.os.Process.is64Bit()) "64 bit" else "32 bit") + "\n" +
|
|
||||||
"Xposed API version: " + StartupInfo.requireHookBridge().apiLevel + "\n" +
|
|
||||||
"module: " + StartupInfo.getModulePath() + "\n" +
|
|
||||||
"ctx.dataDir: " + hostInfo.application.dataDir
|
|
||||||
description(statusInfo, isTextSelectable = true)
|
|
||||||
description(generateDebugInfo(), isTextSelectable = true)
|
description(generateDebugInfo(), isTextSelectable = true)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -482,6 +476,25 @@ class TroubleshootFragment : BaseRootLayoutFragment() {
|
|||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun generateStatusText(): String {
|
||||||
|
val loader = StartupInfo.getLoaderInfo()
|
||||||
|
val hook = StartupInfo.requireHookBridge()
|
||||||
|
var statusInfo = "PID: " + android.os.Process.myPid() +
|
||||||
|
", UID: " + android.os.Process.myUid() +
|
||||||
|
", " + (if (android.os.Process.is64Bit()) "64 bit" else "32 bit") + "\n" +
|
||||||
|
"Xposed API version: " + hook.apiLevel + "\n" +
|
||||||
|
"module: " + StartupInfo.getModulePath() + "\n" +
|
||||||
|
"ctx.dataDir: " + hostInfo.application.dataDir + "\n"
|
||||||
|
statusInfo += "entry: " + loader.entryPointName + "\n"
|
||||||
|
var xp = loader.queryExtension("GetXposedBridgeClass") as Class<*>?
|
||||||
|
if (xp == null) {
|
||||||
|
xp = loader.queryExtension("GetXposedInterfaceClass") as Class<*>?
|
||||||
|
}
|
||||||
|
statusInfo += "XposedBridge: " + (if (xp != null) xp.name else "null") + "\n"
|
||||||
|
statusInfo += hook.frameworkName + " " + hook.frameworkVersion + " (" + hook.frameworkVersionCode + ")\n"
|
||||||
|
return statusInfo
|
||||||
|
}
|
||||||
|
|
||||||
private fun generateDebugInfo(): CharSequence {
|
private fun generateDebugInfo(): CharSequence {
|
||||||
val ctx = requireContext()
|
val ctx = requireContext()
|
||||||
val colorError: Int = ThemeAttrUtils.resolveColorOrDefaultColorInt(ctx, R.attr.unusableColor, Color.RED)
|
val colorError: Int = ThemeAttrUtils.resolveColorOrDefaultColorInt(ctx, R.attr.unusableColor, Color.RED)
|
||||||
|
|||||||
Reference in New Issue
Block a user