Add kernel version and patch tool version log information
- Should fix the 5.10 bug where you can't swipe write Signed-off-by: ShirkNeko 109797057+ShirkNeko@users.noreply.github.com
This commit is contained in:
BIN
manager/app/src/main/assets/5_10-mkbootfs
Normal file
BIN
manager/app/src/main/assets/5_10-mkbootfs
Normal file
Binary file not shown.
@@ -196,9 +196,17 @@ class HorizonKernelWorker(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun patch() {
|
private fun patch() {
|
||||||
val mkbootfsPath = "${context.filesDir.absolutePath}/mkbootfs"
|
val kernelVersion = runCommandGetOutput(true, "cat /proc/version")
|
||||||
AssetsUtil.exportFiles(context, "mkbootfs", mkbootfsPath)
|
val versionRegex = """\d+\.\d+\.\d+""".toRegex()
|
||||||
runCommand(false, "sed -i '/chmod -R 755 tools bin;/i cp -f $mkbootfsPath \$AKHOME/tools;' $binaryPath")
|
val version = versionRegex.find(kernelVersion)?.value ?: ""
|
||||||
|
val toolName = when {
|
||||||
|
version.startsWith("5.10.") -> "5_10"
|
||||||
|
else -> "5_15+"
|
||||||
|
}
|
||||||
|
val toolPath = "${context.filesDir.absolutePath}/mkbootfs"
|
||||||
|
AssetsUtil.exportFiles(context, "$toolName-mkbootfs", toolPath)
|
||||||
|
state.addLog("${context.getString(R.string.kernel_version_log, version)} ${context.getString(R.string.tool_version_log, toolName)}")
|
||||||
|
runCommand(false, "sed -i '/chmod -R 755 tools bin;/i cp -f $toolPath \$AKHOME/tools;' $binaryPath")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun flash() {
|
private fun flash() {
|
||||||
|
|||||||
@@ -295,4 +295,6 @@
|
|||||||
<!-- lkm/gki install -->
|
<!-- lkm/gki install -->
|
||||||
<string name="Lkm_install_methods">LKM修补/安装</string>
|
<string name="Lkm_install_methods">LKM修补/安装</string>
|
||||||
<string name="GKI_install_methods">GKI安装</string>
|
<string name="GKI_install_methods">GKI安装</string>
|
||||||
|
<string name="kernel_version_log">内核版本:%1$s</string>
|
||||||
|
<string name="tool_version_log">使用修补工具:%1$s</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -299,4 +299,6 @@
|
|||||||
<!-- lkm/gki install -->
|
<!-- lkm/gki install -->
|
||||||
<string name="Lkm_install_methods">LKM repair/installation</string>
|
<string name="Lkm_install_methods">LKM repair/installation</string>
|
||||||
<string name="GKI_install_methods">GKI installation</string>
|
<string name="GKI_install_methods">GKI installation</string>
|
||||||
|
<string name="kernel_version_log">Kernel version:%1$s</string>
|
||||||
|
<string name="tool_version_log">Using the patching tool:%1$s</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user