From f73b95cfd654747fe5517461359f2d754ad2f12a Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Fri, 7 Oct 2022 08:42:03 +0200 Subject: [PATCH] Fix install of language specific split apk We were not able to download language specific split apks so far because they were stored with the "language" key within the bundle. --- .../java/com/android/vending/SplitInstallService.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fake-store/src/main/java/com/android/vending/SplitInstallService.kt b/fake-store/src/main/java/com/android/vending/SplitInstallService.kt index c5524ed..3d209c7 100644 --- a/fake-store/src/main/java/com/android/vending/SplitInstallService.kt +++ b/fake-store/src/main/java/com/android/vending/SplitInstallService.kt @@ -68,7 +68,16 @@ class SplitInstallService : Service() { callback: ISplitInstallServiceCallback ) { for (element in list) { - mSplitInstaller.install(packageName, element.get("module_name").toString()) + val apk = element.getString("module_name") ?: element.getString("language") + apk?.let { + mSplitInstaller.install(packageName, apk) + } ?: logBundleError(element) + } + } + + private fun logBundleError(bundle: Bundle) { + for (entry in bundle.keySet()) { + Log.e(TAG, "Unknown bundle entry: $entry. Value is ${bundle.get(entry)}") } } -- GitLab