Compare commits
No commits in common. "fix/lspatch-injection-and-local-xposed" and "main" have entirely different histories.
fix/lspatc
...
main
3 changed files with 6 additions and 34 deletions
|
|
@ -19,7 +19,7 @@ val gitHasLocalCommits = gitCurrentBranch?.let { providers.execIgnoreCode("git",
|
|||
val gitHasHasLocalChanges = providers.execIgnoreCode("git", "status", "-s").isNotEmpty()
|
||||
|
||||
android {
|
||||
namespace = "dev.goon.manager"
|
||||
namespace = "dev.shiggy.manager"
|
||||
compileSdk = 37
|
||||
|
||||
defaultConfig {
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ import com.aliucord.manager.patcher.steps.base.DownloadStep
|
|||
import dev.goon.manager.R
|
||||
import org.koin.core.component.inject
|
||||
|
||||
import com.aliucord.manager.patcher.steps.base.StepState
|
||||
|
||||
class DownloadShiggyXposedStep : DownloadStep() {
|
||||
private val paths: PathManager by inject()
|
||||
private val shiggyGithubService: ShiggyGithubService by inject()
|
||||
|
|
@ -23,21 +21,6 @@ class DownloadShiggyXposedStep : DownloadStep() {
|
|||
private set
|
||||
|
||||
override suspend fun execute(container: StepRunner) {
|
||||
val localXposed = listOf(
|
||||
paths.shiggyDir.resolve("GoonXposed.apk"),
|
||||
paths.shiggyDir.resolve("wt-xposed.apk")
|
||||
).firstOrNull { it.exists() }
|
||||
|
||||
if (localXposed != null) {
|
||||
container.log("Found local GoonXposed at ${localXposed.absolutePath}")
|
||||
targetVersion = SemVer(99, 0, 0)
|
||||
targetFile.parentFile?.mkdirs()
|
||||
localXposed.copyTo(targetFile, overwrite = true)
|
||||
state = StepState.Skipped
|
||||
container.log("Using local GoonXposed instead of remote download")
|
||||
return
|
||||
}
|
||||
|
||||
val latestRelease = shiggyGithubService.getLatestXposedRelease().getOrThrow()
|
||||
container.log("Latest GoonXposed release is ${latestRelease.name}")
|
||||
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ import org.lsposed.patch.util.Logger
|
|||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
class InjectShiggyXposedStep : Step() {
|
||||
class InjectGoonXposedStep : Step() {
|
||||
override val group: StepGroup = StepGroup.Install
|
||||
override val localizedName: Int = R.string.patch_step_inject_shiggy
|
||||
override val localizedName: Int = R.string.patch_step_inject_goon
|
||||
|
||||
suspend fun patch(
|
||||
container: StepRunner,
|
||||
|
|
@ -92,25 +92,14 @@ class InjectShiggyXposedStep : Step() {
|
|||
baseName,
|
||||
LSPConfig.instance.VERSION_CODE
|
||||
)
|
||||
var patchedApk = File(tempDir, patchedApkName)
|
||||
|
||||
if (!patchedApk.exists()) {
|
||||
val found = tempDir.listFiles()?.firstOrNull {
|
||||
it.extension.equals("apk", ignoreCase = true) && (it.name.contains(baseName) || it.name.contains("lspatched"))
|
||||
} ?: tempDir.listFiles()?.firstOrNull { it.extension.equals("apk", ignoreCase = true) }
|
||||
if (found != null) {
|
||||
patchedApk = found
|
||||
}
|
||||
}
|
||||
val patchedApk = File(tempDir, patchedApkName)
|
||||
|
||||
if (patchedApk.exists()) {
|
||||
patchedApk.copyTo(originalApk, overwrite = true)
|
||||
container.log("Replaced ${originalApk.name} with ${patchedApk.name}")
|
||||
} else {
|
||||
val availableFiles = tempDir.listFiles()?.map { it.name }?.joinToString(", ") ?: "none"
|
||||
val errorMsg = "Could not find patched APK for ${originalApk.name} in ${tempDir.absolutePath} (Found files: $availableFiles)"
|
||||
container.log("Error: $errorMsg")
|
||||
throw IllegalStateException(errorMsg)
|
||||
container.log("Warning: Could not find patched APK for ${originalApk.name}")
|
||||
container.log("Expected patched APK at: ${patchedApk.absolutePath}")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue