Skip to content

Commit 42f8b5a

Browse files
authored
Merge pull request #335 from OpenHub-Store/stabiliity-impr
2 parents 0ffe3fb + 6bef2aa commit 42f8b5a

73 files changed

Lines changed: 962 additions & 362 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

composeApp/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ kotlin {
7070
implementation(libs.jetbrains.compose.material.icons.extended)
7171

7272
implementation(libs.touchlab.kermit)
73+
implementation(libs.kotlinx.collections.immutable)
7374

7475
implementation(compose.runtime)
7576
implementation(compose.foundation)

composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/AppNavigation.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ fun AppNavigation(navController: NavHostController) {
7171
onNavigateToApps = {
7272
navController.navigate(GithubStoreGraph.AppsScreen)
7373
},
74-
onNavigateToDetails = { repo ->
74+
onNavigateToDetails = { repoId ->
7575
navController.navigate(
7676
GithubStoreGraph.DetailsScreen(
77-
repositoryId = repo.id,
77+
repositoryId = repoId,
7878
),
7979
)
8080
},
@@ -93,10 +93,10 @@ fun AppNavigation(navController: NavHostController) {
9393
onNavigateBack = {
9494
navController.navigateUp()
9595
},
96-
onNavigateToDetails = { repo ->
96+
onNavigateToDetails = { repoId ->
9797
navController.navigate(
9898
GithubStoreGraph.DetailsScreen(
99-
repositoryId = repo.id,
99+
repositoryId = repoId,
100100
),
101101
)
102102
},

core/data/src/androidMain/kotlin/zed/rainxch/core/data/services/AutoUpdateWorker.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,18 @@ class AutoUpdateWorker(
154154
installer.getApkInfoExtractor().extractPackageInfo(filePath)
155155
?: throw IllegalStateException("Failed to extract APK info for ${app.appName}")
156156

157+
// Validate package name matches
158+
if (apkInfo.packageName != app.packageName) {
159+
Logger.e {
160+
"AutoUpdateWorker: Package name mismatch for ${app.appName}! " +
161+
"Expected: ${app.packageName}, got: ${apkInfo.packageName}. " +
162+
"Skipping auto-update."
163+
}
164+
throw IllegalStateException(
165+
"Package name mismatch for ${app.appName}: expected ${app.packageName}, got ${apkInfo.packageName}",
166+
)
167+
}
168+
157169
val currentApp = installedAppsRepository.getAppByPackage(app.packageName)
158170

159171
if (currentApp?.signingFingerprint != null) {

core/presentation/build.gradle.kts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,13 @@ kotlin {
1515

1616
implementation(libs.jetbrains.lifecycle.compose)
1717
implementation(libs.kotlinx.datetime)
18+
implementation(libs.kotlinx.collections.immutable)
1819

1920
implementation(compose.components.resources)
2021

2122
implementation(libs.androidx.compose.ui.tooling.preview)
2223
}
2324
}
24-
25-
androidMain {
26-
dependencies {
27-
}
28-
}
29-
30-
jvmMain {
31-
dependencies {
32-
}
33-
}
3425
}
3526
}
3627

core/presentation/src/commonMain/composeResources/values-ar/strings-ar.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<string name="cannot_launch">تعذر تشغيل %1$s</string>
1313
<string name="failed_to_open">فشل فتح %1$s</string>
1414
<string name="failed_to_update">فشل تحديث %1$s: %2$s</string>
15+
<string name="update_failed">فشل التحديث</string>
1516
<string name="update_all_failed">فشل تحديث الكل: %1$s</string>
1617
<string name="all_apps_updated_successfully">تم تحديث جميع التطبيقات بنجاح</string>
1718
<string name="no_updates_available">لا توجد تحديثات متاحة</string>
@@ -580,4 +581,6 @@
580581
<string name="translation_error_retry">إعادة المحاولة</string>
581582
<string name="translated_from">اكتشاف تلقائي: %1$s</string>
582583
<string name="select_language">اختر اللغة</string>
584+
<string name="update_package_mismatch">عدم تطابق الحزمة: ملف APK هو %1$s، لكن التطبيق المثبت هو %2$s. تم حظر التحديث.</string>
585+
<string name="update_signing_key_mismatch">عدم تطابق مفتاح التوقيع: تم توقيع التحديث بواسطة مطور مختلف. تم حظر التحديث.</string>
583586
</resources>

core/presentation/src/commonMain/composeResources/values-bn/strings-bn.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<string name="cannot_launch">%1$s চালু করা যায়নি</string>
1313
<string name="failed_to_open">%1$s খুলতে ব্যর্থ</string>
1414
<string name="failed_to_update">%1$s আপডেট করতে ব্যর্থ: %2$s</string>
15+
<string name="update_failed">আপডেট ব্যর্থ</string>
1516
<string name="update_all_failed">সব আপডেট ব্যর্থ হয়েছে: %1$s</string>
1617
<string name="all_apps_updated_successfully">সব অ্যাপ সফলভাবে আপডেট হয়েছে</string>
1718
<string name="no_updates_available">কোনো আপডেট পাওয়া যায়নি</string>
@@ -579,4 +580,6 @@
579580
<string name="translation_error_retry">পুনরায় চেষ্টা</string>
580581
<string name="translated_from">স্বয়ংক্রিয়ভাবে শনাক্ত: %1$s</string>
581582
<string name="select_language">ভাষা নির্বাচন করুন</string>
583+
<string name="update_package_mismatch">প্যাকেজ অমিল: APK হলো %1$s, কিন্তু ইনস্টল করা অ্যাপ হলো %2$s। আপডেট ব্লক করা হয়েছে।</string>
584+
<string name="update_signing_key_mismatch">সাইনিং কী অমিল: আপডেটটি একজন ভিন্ন ডেভেলপার দ্বারা সাইন করা হয়েছে। আপডেট ব্লক করা হয়েছে।</string>
582585
</resources>

core/presentation/src/commonMain/composeResources/values-es/strings-es.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<string name="cannot_launch">No se puede iniciar %1$s</string>
99
<string name="failed_to_open">No se pudo abrir %1$s</string>
1010
<string name="failed_to_update">Error al actualizar %1$s: %2$s</string>
11+
<string name="update_failed">Error en la actualización</string>
1112
<string name="update_all_failed">Error al actualizar todo: %1$s</string>
1213
<string name="all_apps_updated_successfully">Todas las aplicaciones se actualizaron correctamente</string>
1314
<string name="no_updates_available">No hay actualizaciones disponibles</string>
@@ -540,4 +541,6 @@
540541
<string name="translation_error_retry">Reintentar</string>
541542
<string name="translated_from">Detectado automáticamente: %1$s</string>
542543
<string name="select_language">Seleccionar idioma</string>
544+
<string name="update_package_mismatch">Paquete no coincide: el APK es %1$s, pero la aplicación instalada es %2$s. Actualización bloqueada.</string>
545+
<string name="update_signing_key_mismatch">Clave de firma no coincide: la actualización fue firmada por un desarrollador diferente. Actualización bloqueada.</string>
543546
</resources>

core/presentation/src/commonMain/composeResources/values-fr/strings-fr.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<string name="cannot_launch">Impossible de lancer %1$s</string>
99
<string name="failed_to_open">Impossible d’ouvrir %1$s</string>
1010
<string name="failed_to_update">Échec de la mise à jour de %1$s : %2$s</string>
11+
<string name="update_failed">Échec de la mise à jour</string>
1112
<string name="update_all_failed">Échec de la mise à jour globale : %1$s</string>
1213
<string name="all_apps_updated_successfully">Toutes les applications ont été mises à jour</string>
1314
<string name="no_updates_available">Aucune mise à jour disponible</string>
@@ -541,4 +542,6 @@
541542
<string name="translation_error_retry">Réessayer</string>
542543
<string name="translated_from">Détection automatique : %1$s</string>
543544
<string name="select_language">Sélectionner la langue</string>
545+
<string name="update_package_mismatch">Incompatibilité de paquet : l\'APK est %1$s, mais l\'application installée est %2$s. Mise à jour bloquée.</string>
546+
<string name="update_signing_key_mismatch">Incompatibilité de clé de signature : la mise à jour a été signée par un développeur différent. Mise à jour bloquée.</string>
544547
</resources>

core/presentation/src/commonMain/composeResources/values-hi/strings-hi.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<string name="cannot_launch">%1$s को लॉन्च नहीं किया जा सकता</string>
1313
<string name="failed_to_open">%1$s को खोलने में विफल रहा</string>
1414
<string name="failed_to_update">%1$s अपडेट करने में विफल रहा: %2$s</string>
15+
<string name="update_failed">अपडेट विफल</string>
1516
<string name="update_all_failed">सभी अपडेट विफल रहे: %1$s</string>
1617
<string name="all_apps_updated_successfully">सभी ऐप्स सफलतापूर्वक अपडेट हो गए</string>
1718
<string name="no_updates_available">कोई अपडेट उपलब्ध नहीं</string>
@@ -579,4 +580,6 @@
579580
<string name="translation_error_retry">पुनः प्रयास</string>
580581
<string name="translated_from">स्वतः पहचाना गया: %1$s</string>
581582
<string name="select_language">भाषा चुनें</string>
583+
<string name="update_package_mismatch">पैकेज मेल नहीं खाता: APK %1$s है, लेकिन इंस्टॉल किया गया ऐप %2$s है। अपडेट ब्लॉक किया गया।</string>
584+
<string name="update_signing_key_mismatch">साइनिंग कुंजी मेल नहीं खाती: अपडेट किसी अन्य डेवलपर द्वारा साइन किया गया था। अपडेट ब्लॉक किया गया।</string>
582585
</resources>

core/presentation/src/commonMain/composeResources/values-it/strings-it.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<string name="cannot_launch">Impossibile lanciare %1$s</string>
1313
<string name="failed_to_open">Impossibile aprire %1$s</string>
1414
<string name="failed_to_update">Impossibile aggiornare %1$s: %2$s</string>
15+
<string name="update_failed">Aggiornamento fallito</string>
1516
<string name="update_all_failed">Aggiornamento generale fallito: %1$s</string>
1617
<string name="all_apps_updated_successfully">Tutte le app sono state aggiornate con successo</string>
1718
<string name="no_updates_available">Nessun aggiornamento disponibile</string>
@@ -579,4 +580,6 @@
579580
<string name="translation_error_retry">Riprova</string>
580581
<string name="translated_from">Rilevato automaticamente: %1$s</string>
581582
<string name="select_language">Seleziona lingua</string>
583+
<string name="update_package_mismatch">Pacchetto non corrispondente: l\'APK è %1$s, ma l\'app installata è %2$s. Aggiornamento bloccato.</string>
584+
<string name="update_signing_key_mismatch">Chiave di firma non corrispondente: l\'aggiornamento è stato firmato da uno sviluppatore diverso. Aggiornamento bloccato.</string>
582585
</resources>

0 commit comments

Comments
 (0)