mirror of
https://github.com/ovrport/app.git
synced 2026-10-26 19:19:56 -04:00
fix: Fix patch Fix Unreal Engine 4 crash
This commit is contained in:
1 parent
5fc0e8fef4
commit
c4fc748024
2 files changed
+7
-4
No files matched your search
@@ -14,8 +14,8 @@ class FileTransformer(val file: File) {
|
||||
file.writeText(Regex(input, RegexOption.DOT_MATCHES_ALL).replace(file.readText(), output))
|
||||
}
|
||||
|
||||
fun find(input: String): Boolean {
|
||||
return Regex(input, RegexOption.DOT_MATCHES_ALL).find(file.readText()) != null
|
||||
fun readText(): String {
|
||||
return file.readText()
|
||||
}
|
||||
|
||||
fun append(line: String) {
|
||||
@@ -158,7 +158,10 @@ class PatchExecutor(private val workingDir: File) {
|
||||
it ?: workingDir.resolve("smali/classes").apply { mkdirs() }
|
||||
}
|
||||
.resolve("${fileName}.smali")
|
||||
.apply { createNewFile() }
|
||||
.apply {
|
||||
parentFile?.mkdirs()
|
||||
createNewFile()
|
||||
}
|
||||
.run {
|
||||
if (exists()) {
|
||||
FileTransformer(this).block()
|
||||
|
||||
@@ -216,7 +216,7 @@ object PatchStore {
|
||||
}
|
||||
PATCHES += Patch("Fix Unreal Engine 4 crash") {
|
||||
createSmali("com/unity3d/player/UnityPlayer") {
|
||||
if (!find(".*")) {
|
||||
if (readText().isBlank()) {
|
||||
append(".class public Lcom/unity3d/player/UnityPlayer;")
|
||||
append(".super Ljava/lang/Object;")
|
||||
append(".field public static currentActivity:Landroid/app/Activity;")
|
||||
|
||||
Reference in new issue
Block a user