chore: auto-merge develop → main
Triggered by: 15e1dfb fix(kiosk): STATUS_FAILURE=1 (wrong package) + issue version-guard bypass
This commit is contained in:
+7
-1
@@ -5643,7 +5643,13 @@ function reportError(): void {
|
|||||||
|
|
||||||
// ── Version guard: skip GitHub issue if client is not on latest release ─
|
// ── Version guard: skip GitHub issue if client is not on latest release ─
|
||||||
// Avoids noise from bugs already fixed in a newer version.
|
// Avoids noise from bugs already fixed in a newer version.
|
||||||
if (!_isLatestVersion($version)) {
|
// Exception: install/update errors are ALWAYS reported regardless of version,
|
||||||
|
// because a device that is failing to install the update is by definition on
|
||||||
|
// an old version — suppressing the issue is the opposite of useful.
|
||||||
|
$installErrorTypes = ['install_download_failed', 'install_failure', 'install_packager_exception'];
|
||||||
|
$bypassVersionGuard = in_array($type, $installErrorTypes, true)
|
||||||
|
|| ($context['version_guard_bypass'] ?? false);
|
||||||
|
if (!$bypassVersionGuard && !_isLatestVersion($version)) {
|
||||||
echo json_encode(['ok' => true, 'skipped' => 'outdated_version']);
|
echo json_encode(['ok' => true, 'skipped' => 'outdated_version']);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -993,11 +993,13 @@ class KioskActivity : AppCompatActivity() {
|
|||||||
*/
|
*/
|
||||||
private fun triggerApkDownload(apkUrl: String) {
|
private fun triggerApkDownload(apkUrl: String) {
|
||||||
if (apkUrl.isEmpty()) return
|
if (apkUrl.isEmpty()) return
|
||||||
|
// Always keep this up-to-date so installApk() can derive the target package from the URL.
|
||||||
|
pendingApkDownloadUrl = apkUrl
|
||||||
try {
|
try {
|
||||||
// On Android 8+ check the "install unknown apps" source permission
|
// On Android 8+ check the "install unknown apps" source permission
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
|
||||||
!packageManager.canRequestPackageInstalls()) {
|
!packageManager.canRequestPackageInstalls()) {
|
||||||
pendingApkDownloadUrl = apkUrl
|
// pendingApkDownloadUrl already set above
|
||||||
setInstallUI(
|
setInstallUI(
|
||||||
"\uD83D\uDD12",
|
"\uD83D\uDD12",
|
||||||
getString(R.string.install_perm_detail),
|
getString(R.string.install_perm_detail),
|
||||||
@@ -1113,10 +1115,13 @@ class KioskActivity : AppCompatActivity() {
|
|||||||
runOnUiThread { activeInstallBtn?.text = getString(R.string.install_btn_retry) }
|
runOnUiThread { activeInstallBtn?.text = getString(R.string.install_btn_retry) }
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Derive the package name we are installing from the filename
|
// Derive the target package from the download URL (not the filename, which is always
|
||||||
|
// 'evershelf-update.apk'). The URL contains 'gateway' or 'scale' when installing the
|
||||||
|
// scale gateway; anything else is a kiosk self-update.
|
||||||
val targetPkg = when {
|
val targetPkg = when {
|
||||||
file.name.contains("gateway") || file.name.contains("scale") -> GATEWAY_PACKAGE
|
pendingApkDownloadUrl.contains("gateway", ignoreCase = true) ||
|
||||||
else -> packageName // kiosk self-update
|
pendingApkDownloadUrl.contains("scale", ignoreCase = true) -> GATEWAY_PACKAGE
|
||||||
|
else -> packageName
|
||||||
}
|
}
|
||||||
installWithPackageInstaller(file, targetPkg)
|
installWithPackageInstaller(file, targetPkg)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user