From cda6c75e6cbffb66ac684eeb5eec3b0934723888 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 30 Oct 2026 09:52:14 +0100 Subject: [PATCH] Read [118, -11] "Author certificate not match" as the certificate mismatch (#45) A 2022 Tizen 6.5 set (QA55S95B) words the mismatch as [118, -11] instead of [118, -12], so 0.3.12 passed it on as a generic failure: no retry with the other profiles, no offer to remove the old copy. Now it is CERT_MISMATCH like the -12 wording. 0.3.13. --- test/refusal.test.js | 3 +++ tizen-app/config.xml | 2 +- tizen-app/js/app.js | 2 +- tizen-app/service/refusal.js | 14 ++++++++------ 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/test/refusal.test.js b/test/refusal.test.js index e12314f..5b71106 100644 --- a/test/refusal.test.js +++ b/test/refusal.test.js @@ -14,6 +14,9 @@ function check(code, reason, entry, wantCode, wantText) { check('118, -12', 'Check certificate error : :Package with the same id and different certificate has been already installed.:<-12>', { name: 'HackTV' }, 'CERT_MISMATCH', 'HackTV is already on this TV'); check('118012', '', { file: 'HackTV.wgt', installed: true }, 'CERT_MISMATCH', 'HackTV is already on this TV'); check('118012', '', { file: 'HackTV.wgt', installed: false }, 'CERT_REJECTED', 'internet during the install'); +// A 2022 Tizen 6.5 set words the mismatch as [118, -11] (#45, Moonfin from a PC). +check('118, -11', 'Author certificate not match :', { name: 'Moonfin', installed: true }, 'CERT_MISMATCH', 'Moonfin is already on this TV'); +check('118011', '', { file: 'Moonfin.wgt', installed: true }, 'CERT_MISMATCH', 'Moonfin is already on this TV'); check('118, -12', 'Check certificate error : :Invalid format of certificate in signature.:<-2>', { installed: true }, 'CERT_REJECTED', 'internet during the install'); check('118, -12', 'Check certificate error : :Certificate in signature is not valid yet.:<-7>', { installed: true }, 'CERT_REJECTED', 'clock is behind'); check('118, -12', 'certificate has expired', {}, 'CERT_REJECTED', 'expired'); diff --git a/tizen-app/config.xml b/tizen-app/config.xml index 88e82ec..f93d08e 100644 --- a/tizen-app/config.xml +++ b/tizen-app/config.xml @@ -1,6 +1,6 @@ + id="https://github.com/Apps2Samsung/TV-Store" version="0.3.13" viewmodes="maximized"> Apps2Samsung TV-Store diff --git a/tizen-app/js/app.js b/tizen-app/js/app.js index 9c9aa4e..040f69e 100644 --- a/tizen-app/js/app.js +++ b/tizen-app/js/app.js @@ -50,7 +50,7 @@ // TV's current IP and loopback too, and keeps whichever answers. var BASE = 'http://127.0.0.1:8077'; var KOFI = 'https://ko-fi.com/patrickst'; - var VERSION = '0.3.12'; + var VERSION = '0.3.13'; var KEY = { LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, ENTER: 13, RETURN: 10009, ESC: 27, BACK: 8 }; // What the manifest providers are called; resolved.json carries only their ids. diff --git a/tizen-app/service/refusal.js b/tizen-app/service/refusal.js index 2830cbb..b4dced1 100644 --- a/tizen-app/service/refusal.js +++ b/tizen-app/service/refusal.js @@ -6,10 +6,12 @@ * [118, -12] the certificate check: with "same id and different certificate" (or, without a * reason, when the page says the package is on the TV) the app was installed with * another author certificate (from a phone or PC, or one since renewed), and the TV - * only updates an app with the certificate it came with: TV-Store can remove that - * copy and install again (CERT_MISMATCH). Otherwise the TV rejects the certificate - * itself: a set without internet during the install (it verifies online), a clock - * that is off, or a certificate past its dates (CERT_REJECTED). + * only updates an app with the certificate it came with: the service tries the other + * profiles it holds, then offers to remove that copy (CERT_MISMATCH). Otherwise the + * TV rejects the certificate itself: a set without internet during the install (it + * verifies online), a clock that is off, or a certificate past its dates (CERT_REJECTED). + * [118, -11] "Author certificate not match": the same mismatch as a 2022 Tizen 6.5 set words it + * (#45, Moonfin installed from a PC). * [118, -19] the installer's "parsing error" on the manifest: in practice a package that asks for * a newer Tizen than the set runs (#44); [118, -4] is the newer sets' spelling of that, * next to "load archive info fail" for a bad package id. @@ -31,8 +33,8 @@ function refusal(code, reason, entry) { if (req) return { code: 'INSTALL_FAILED', message: m + '. It asks for Tizen ' + req + ' or newer' + (tv ? ', and this TV runs Tizen ' + tv : '') + '.' }; return { code: 'INSTALL_FAILED', message: m + '. The TV could not read the package, which usually means it asks for a newer Tizen than this set runs.' }; } - if (/^(118,-12|118012)$/.test(c)) { - if (/same id and different certificate/i.test(why) || (!why && entry.installed)) + if (/^(118,-12|118012|118,-11|118011)$/.test(c)) { + if (/same id and different certificate|author certificate not match/i.test(why) || (!why && entry.installed)) return { code: 'CERT_MISMATCH', message: appName(entry) + ' is already on this TV, signed with another certificate: it was installed from a phone or PC, or with a certificate that has since been renewed. The TV only updates an app with the certificate it came with.' }; if (/not yet valid|not valid yet/i.test(why)) return { code: 'CERT_REJECTED', message: m + '. The TV says the certificate is not valid yet, so its clock is behind: set the TV’s date and time (Settings, General, System Manager, Time) or wait a few minutes, then try again.' };