@@ -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