Skip to content

Commit 249a427

Browse files
committed
fix: Allow root mount when only versionCode differs from patched APK (#760)
1 parent 24b540d commit 249a427

4 files changed

Lines changed: 19 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [1.24.2](https://github.com/MorpheApp/morphe-manager/compare/v1.24.1...v1.24.2) (2026-07-23)
2+
3+
4+
### Bug Fixes
5+
6+
* Crash opening bundle patches list due to duplicate LazyColumn keys ([77e4c72](https://github.com/MorpheApp/morphe-manager/commit/77e4c7271b949d756dacba895b617dfd66b7bea9))
7+
18
## [1.24.1](https://github.com/MorpheApp/morphe-manager/compare/v1.24.0...v1.24.1) (2026-07-23)
29

310

app-release.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"created_at": "2026-07-23T11:47:40",
3-
"description": "## [1.24.1](https://github.com/MorpheApp/morphe-manager/compare/v1.24.0...v1.24.1) (2026-07-23)\n\n\n### Bug Fixes\n\n* Crash opening patch list due to duplicate LazyColumn keys ([02e874a](https://github.com/MorpheApp/morphe-manager/commit/02e874aee03791b2ed606b191cb7b7ae62a173cb))",
4-
"download_url": "https://github.com/MorpheApp/morphe-manager/releases/download/v1.24.1/morphe-manager-1.24.1.apk",
5-
"signature_download_url": "https://github.com/MorpheApp/morphe-manager/releases/download/v1.24.1/morphe-manager-1.24.1.apk.asc",
6-
"version": "1.24.1"
2+
"created_at": "2026-07-23T12:09:14",
3+
"description": "## [1.24.2](https://github.com/MorpheApp/morphe-manager/compare/v1.24.1...v1.24.2) (2026-07-23)\n\n\n### Bug Fixes\n\n* Crash opening bundle patches list due to duplicate LazyColumn keys ([77e4c72](https://github.com/MorpheApp/morphe-manager/commit/77e4c7271b949d756dacba895b617dfd66b7bea9))",
4+
"download_url": "https://github.com/MorpheApp/morphe-manager/releases/download/v1.24.2/morphe-manager-1.24.2.apk",
5+
"signature_download_url": "https://github.com/MorpheApp/morphe-manager/releases/download/v1.24.2/morphe-manager-1.24.2.apk.asc",
6+
"version": "1.24.2"
77
}

app/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = 1.24.1
1+
version = 1.24.2

app/src/main/java/app/morphe/manager/ui/viewmodel/InstallViewModel.kt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -834,19 +834,18 @@ class InstallViewModel : ViewModel(), KoinComponent {
834834
var stockInfo = inputs.installedInfo
835835
val label = with(pm) { packageInfo.label() }
836836
val patchedVersion = packageInfo.versionName?.takeUnless { it.isBlank() } ?: "unknown"
837-
val patchedVersionCode = pm.getVersionCode(packageInfo)
837+
// Bind mount only replaces the APK file, so matching versionName is enough;
838+
// versionCodes routinely differ across split-APK variants of the same release.
838839
fun PackageInfo.matchesPatched() =
839840
packageName == this.packageName &&
840-
versionName == patchedVersion &&
841-
pm.getVersionCode(this) == patchedVersionCode
841+
versionName == patchedVersion
842842
fun MountStockCandidate.matchesPatched() =
843843
info.matchesPatched()
844844

845845
if (waitForStockInstall && stockInfo != null && !stockInfo.matchesPatched()) {
846846
stockInfo = waitForMatchingInstalledStock(
847847
packageName = packageName,
848-
versionName = patchedVersion,
849-
versionCode = patchedVersionCode
848+
versionName = patchedVersion
850849
) ?: stockInfo
851850
}
852851

@@ -1295,17 +1294,15 @@ class InstallViewModel : ViewModel(), KoinComponent {
12951294

12961295
private suspend fun waitForMatchingInstalledStock(
12971296
packageName: String,
1298-
versionName: String,
1299-
versionCode: Long
1297+
versionName: String
13001298
): PackageInfo? {
13011299
var matchingInfo: PackageInfo? = null
13021300
withTimeoutOrNull(STOCK_INSTALL_SETTLE_TIMEOUT) {
13031301
while (matchingInfo == null) {
13041302
val info = withContext(Dispatchers.IO) { pm.getPackageInfo(packageName) }
13051303
if (info != null &&
13061304
info.packageName == packageName &&
1307-
info.versionName == versionName &&
1308-
pm.getVersionCode(info) == versionCode
1305+
info.versionName == versionName
13091306
) {
13101307
matchingInfo = info
13111308
} else {

0 commit comments

Comments
 (0)