Skip to content

Commit 09216e9

Browse files
fix: prevent patch button showing before boot image is ready, bump version to 114237
1 parent 018e812 commit 09216e9

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

app/src/main/java/me/bmax/apatch/ui/screen/Patches.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,8 @@ fun Patches(mode: PatchesViewModel.PatchMode) {
163163
KernelPatchImageView(viewModel.kpimgInfo)
164164
CustomKPImgView(viewModel)
165165

166-
if ((mode == PatchesViewModel.PatchMode.PATCH_ONLY || mode == PatchesViewModel.PatchMode.RESTORE) && selectedBootImage != null && viewModel.kimgInfo.banner.isEmpty()) {
166+
if ((mode == PatchesViewModel.PatchMode.PATCH_ONLY || mode == PatchesViewModel.PatchMode.RESTORE) && selectedBootImage != null && viewModel.kimgInfo.banner.isEmpty() && !viewModel.running) {
167167
viewModel.copyAndParseBootimg(selectedBootImage!!)
168-
// Fix endless loop. It's not normal if (parse done && working thread is not working) but banner still null
169-
// Leave user re-choose
170-
if (!viewModel.running && viewModel.kimgInfo.banner.isEmpty()) {
171-
selectedBootImage = null
172-
}
173168
}
174169

175170
// select boot.img
@@ -269,7 +264,7 @@ fun Patches(mode: PatchesViewModel.PatchMode) {
269264
// patch start
270265
if (mode != PatchesViewModel.PatchMode.UNPATCH && mode != PatchesViewModel.PatchMode.RESTORE) {
271266
val isKeyReady = !needKey || viewModel.superkey.isNotEmpty()
272-
if (isKeyReady) {
267+
if (isKeyReady && viewModel.kimgInfo.banner.isNotEmpty()) {
273268
StartButton(stringResource(id = R.string.patch_start_patch_btn)) {
274269
viewModel.doPatch(mode, needKey)
275270
}

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fun getGitDescribe(): String {
3434
}
3535

3636
fun getVersionCode(): Int {
37-
return 114236
37+
return 114237
3838
}
3939

4040
fun getbranch(): String {

0 commit comments

Comments
 (0)