github RushB-fr/freekiosk v2.1.0-beta.3
FreeKiosk v2.1.0-beta.3 - Half-Size APK, Local Files, Pull to Refresh & Many Fixes

pre-release42 minutes ago

Added

  • ☁️ "Pause the page while the screen is off" travels with the cloud config (#215). The option added in #403 stays a device choice until now: it is exported in general.pausePageWhenScreenOff and imported from it, like pauseWebMediaWhenHidden next to it, so FreeKiosk Cloud can show it and change it once its editor has the key. A config that does not carry the key (an older cloud, or a profile that has never been opened in the editor) leaves the device's own choice alone. Covered by Jest tests (default off, import and export back, switching it off, a config without the key). The cloud ignores a key it does not know yet and keeps it in the stored config, so nothing breaks before the cloud knows the key (read from its config sync code).
  • 🔄 Pull down to refresh. Settings > Display > Page Edges > Pull Down to Refresh (WebView mode, off by default). A drag down from the top of the page reloads the page currently shown, as in a browser, with an arrow that follows the finger and turns blue once letting go will reload. It does nothing when the page, or a list under the finger, is scrolled (Home Assistant scrolls a list inside the page while the page itself stays at the top), when the page takes the gesture itself (a map, a slider), when the page opts out with overscroll-behavior-y, for a sideways drag or with two fingers. react-native-webview's own pull to refresh is iOS only, so the gesture is handled by a script injected into the main frame; it does not work inside an iframe from another site. Also available over ADB (pull_to_refresh), and part of the config export/import (display.pullToRefresh) and the backup. Covered by Jest tests of the gesture (10 cases) and of the config export/import.
  • 💤 An option to pause the page while the screen is off (#215). A page kept running with the screen off: a slideshow went on fetching its images all night. Checked with a page that sends a request every second: 10 requests in 10 s with the screen off, after a screen-off command and after a lock alike. WebView.onPause(), which Pause audio/video when hidden uses, does not stop a page's timers; Settings > Display > Web Media playback > Pause the page while the screen is off (off by default, ADB pause_page_screen_off) now calls pauseTimers() when Android turns the screen off and lifts it when the screen turns on, when the app resumes, and never while the option is off. It is native, so it holds when the JavaScript side is frozen, and the REST API, MQTT and the cloud heartbeat, which do not run in the page, keep working, so a remote wake still lands. It applies to a screen that is really off (screen-off command on a Device Owner device, lock, power button, schedule), not to a dimmed screensaver or to the fallback that only dims. Part of the device backup; not in the cloud config editor yet. Checked on an Android 15 tablet emulator: option off, 10 requests in 10 s with the screen off as before; option on, 0 requests while it is off and 8 in 8 s again after it wakes, also after a REST wake; the switch shows the stored value and saves its change, and the ADB key writes it. Not checked: a physical device, a Device Owner-less device, a page with WebRTC or sound while the screen is off.
  • 🆔 A stable identifier per tablet in the local REST API and in the cloud (#300). GET /api/info and GET /api/status now carry androidId (Settings.Secure.ANDROID_ID), and FreeKiosk sends it to the cloud as android_id: in device_info at enrolment (manual and QR) and in system at every heartbeat, so a tablet can be matched with its entry in FreeKiosk Cloud. On Android 8+ the value is scoped to FreeKiosk's signing key and the user, so it is not the one adb shell settings get secure android_id prints; it survives reboots and updates and changes after a factory reset. It is left out when Android does not give it, and FreeKiosk Cloud already stores it (Device.android_id, not unique since a factory reset changes it, shown on the device page, listed in the privacy page; freekiosk-cloud #214, live on beta), so the tablet and its cloud entry can be matched as soon as an app with this change is enrolled or sends a heartbeat. A cloud without that change ignores the key. The REST documentation lists the fields of /api/info that the code returns (manufacturer, model, androidVersion, apiLevel, processor, deviceName, product, uptime), which the examples of /api/info and /api/status had left out. Covered by Jest tests of the enrolment and heartbeat payloads (with and without the identifier) and checked on an Android 15 tablet emulator: both endpoints return d35dfe61302ccc85, the value Android keeps for com.freekiosk in its settings_ssaid file, unchanged after the app was killed and restarted. Not checked: a real tablet's value reaching the cloud end to end (production shows 0 of 551 devices with an android_id until an app with this change connects; the cloud accepts the 16-character value format, checked on its code and on production), Android 7 and below, a physical device.
  • 📂 A local file as the kiosk page: any path, or a document picked on the device (#385). Until now only a file:// address in FreeKiosk's own folder worked, and the rest of the storage answered ERR_ACCESS_DENIED. Three ways, all behind the existing local files switch (General > PDF Viewer > Inline PDF Viewer): (1) a path typed as /storage/emulated/0/news/news001.html, or file:// with a slash too few, becomes a file:/// address when you save; (2) a file outside FreeKiosk's folder needs Android's All files access: Settings now says so and opens that Android screen (adb shell appops set com.freekiosk MANAGE_EXTERNAL_STORAGE allow over ADB), instead of leaving a loading error to explain it; (3) Choose a local HTML file under the website URL opens Android's document picker and keeps a persistent read permission on the page, so it needs no extra permission, survives a restart and is read where it is, a page another app rewrites showing fresh. The images and scripts next to a picked page do not load (use one self-contained file); the app folder keeps loading its neighbours. MANAGE_EXTERNAL_STORAGE is not in Play Store builds (-Pplaystore strips it, the BuildConfig flag ENABLE_ALL_FILES_ACCESS is false and the settings say that files outside the app folder are unavailable there); the picker, which needs no such permission, stays. A content:// document is allowed by a new line in the react-native-webview patch (content access follows the file access switch). Covered by Jest tests (path forms, own folders, WebView origins) and checked on an Android 15 tablet emulator: a typed shared-storage path answered Access to all files is needed, opened the Android screen and loaded once granted; a picked file loaded with the access left off, showed its new content after the file was rewritten and the app killed, and a script next to it did not load while one next to a page in the app folder did; the merged manifest and BuildConfig of a -Pplaystore build carry neither the permission nor the flag. Not checked: Android 10 and below, a physical device, a TV (no document picker there), a Fire tablet.

Changed

  • 📄 Third-party notices, inside the repository and inside the APK. THIRD-PARTY-NOTICES.md lists what FreeKiosk redistributes under its own licenses, with the copyright notices and license texts they ask to be passed on: PDF.js 3.11.174 (Apache-2.0; the two bundled files were compared with pdfjs-dist@3.11.174 and are byte for byte unmodified), the Material Design Icons font (Apache-2.0), the 17 production JavaScript libraries (MIT), NanoHTTPD (BSD-3-Clause), the HiveMQ MQTT client and Netty (Apache-2.0), AndroidX, and the Google ML Kit and Play Services libraries that the QR scanner pulls in, which are under Google's terms and not an open source license. The 600 npm packages and the 178 Android libraries of the release were scanned: none is GPL, LGPL, AGPL or MPL, and every license found allows commercial use. Gradle copies the file into the APK's assets at build time (assets/THIRD-PARTY-NOTICES.md, checked identical to the repository file, also with -Pplaystore and -Pcloudprovi), and the README links to it. Documentation and packaging only: no code changes. Not legal advice: Google's terms for ML Kit and Play Services were not read in full.
  • 📦 The APK is half the size (64 MB down to 30 MB). The native libraries were stored uncompressed, so all four processor architectures went into the download at full size. They are compressed now, and the installer unpacks only the one the device uses, so the app also takes less space once installed. QR provisioning downloads half as much. Play Store builds are unchanged: Play already delivers one architecture per device.
  • 📦 1.4 MB less: only the icon font FreeKiosk uses is packaged. All 19 fonts of react-native-vector-icons were included, the app only draws Material Design Icons.
  • 📦 Five unused dependencies removed, two of them native modules that were set up at every start: @react-native-picker/picker, react-native-brightness-newarch, react-native-gesture-handler, @react-navigation/stack and @react-native/new-app-screen.
  • 📦 Strings of the Android libraries only in the app's 9 languages, instead of about 80.

Fixed

  • 🔆 /api/brightness no longer reports 1 after the screensaver goes off (found testing 2.1.0-beta.3 on a tablet, #407). The brightness the REST API and MQTT report is read back from the native side when the screensaver goes on or off, and when it went off that read ran at the same moment as the restore of the default brightness, so it could still see the screensaver's dim level: /api/brightness answered 1 while the display was back at 80 %. A second read 800 ms later reports the real level. Checked on an Android 14 tablet with a dimming screensaver: after a screensaver on and off the API answered 1 three times out of three while dumpsys display said 0.8; with the change it answers 80 three times out of three. Covered by a Jest test that fails without the change (it reports 1). Not checked: an MQTT client reading the value, auto-brightness.
  • 🔔 The "Waking screen" notification is taken down when the app comes to the front (#407). turnScreenOn() cancels it after 3 s with a timer that dies with the process, so a restart inside those 3 s could leave it on the screen: it stayed up for more than twenty minutes on a tablet during testing. This is a safeguard, not shown to be needed: the cause was not reproduced in five attempts afterwards (force-stop, a restart by an ADB config, a crash, each within 3 s of a wake). A wake still works with it (three wakes in a row, no notification left, no crash).
  • 📚 Docs: a picked file replaced by delete and create needs picking again, and enrolling by ADB resets the settings (#407). A document picked with Choose a local HTML file is tied to that file: after adb push over it the page failed with net::ERR_FILE_NOT_FOUND until it was picked again, whereas a file rewritten in place loaded again after a reload. And cloud_token resets all local settings (the Settings screen warns about it, the ADB guide did not say so): a URL and the REST API settings sent in the same command were gone after enrolment. Checked on an Android 14 tablet.
  • 🌐 An address without a dot is accepted (#385). myserver:1124, localhost:3000 or an intranet name such as homeassistant was refused as Invalid URL in Settings (website URL), in a dashboard tile and in the URL rotation list, because the check asked for a dot; a person had to type myserver:1124/#. to get past it. A host name needs no dot. The check now accepts a host name, an IPv6 address in brackets, an optional port and path, with or without http://; everything the dot rule accepted is still accepted, so no address that worked stops working. As before, https:// is added to an address typed without a scheme, and the message that says so shows the result, so type http:// for a server that has no certificate. Covered by Jest tests (30 cases) and checked on an Android 15 tablet emulator: typing myserver:1124 in Settings now answers https:// added to your URL: https://myserver:1124 instead of Invalid URL. The second half of the request, local files, is not part of this change.
  • 🚧 The URL filter says so when it blocks the page itself (#366). With the filter in whitelist mode, an address that redirects outside the list (a login, an SSO or a CDN host) was cancelled silently and the WebView stayed on a blank view. When the main page is blocked and nothing is shown, the error screen now reads Reason: Blocked by the URL filter: (without the host when Hide the URL on the error screen is on) and retries like any other failure, in the 9 app languages. Android sends no top-frame flag for this request, so the notice waits for the load event it fires with the blocked address when it cancels the main page: a blocked frame inside a page, or a link blocked from a page that is already shown, leaves the page as it was, with no notice. Checked with Jest tests (12 cases) and on an Android 15 tablet emulator with a whitelist: an address redirecting to a host outside it shows the notice and keeps retrying; an allowed page loads, and clicking a blocked link or a link that redirects outside the list leaves the page on screen as before. Not checked: a blacklist, a physical device, a blocked page that redirects after a long first load.
  • 📺 Android TV: an alert opens with a button focused (#365). React Native's alerts (Invalid URL, Leave settings?...) are native dialogs, and the system leaves their buttons unfocused: with a remote, OK did nothing until DOWN had moved the focus onto a button, and Back is ignored by an alert that cannot be cancelled, so a message looked stuck. On a TV the dialog now takes the focus on its negative button when it has one (Stay, Cancel), otherwise on its only button, so OK closes a message at once and never confirms a destructive choice by accident: Leave without saving still needs RIGHT first. Back still does not close an alert (unchanged). Nothing changes on a tablet or a phone. Checked on an Android 16 TV emulator with a remote's keys: before, Invalid URL stayed open after OK and Back and closed only after DOWN then OK; with the change OK closes it, Leave settings? opens on Stay and OK stays in the settings, RIGHT then OK leaves. Not checked on a physical TV or Fire TV, and not with a dialog that has three buttons.
  • ⏰ A Screen Scheduler wake restores the activity flags again (#364). The wake receiver reached the activity through ReactNativeHost, which throws under the New Architecture (You should not use ReactNativeHost directly in the New Architecture, the same defect #317 fixed for Auto Wake), so the show-when-locked, turn-screen-on, keep-screen-on and brightness restore code never ran; only the wake lock turned the screen on. MainActivity now keeps a weak reference to itself while it is alive and the receiver uses it. Checked on an Android 15 tablet emulator by sending the scheduled-wake broadcast with the screen off: before, the log showed the ReactNativeHost error and no flags; with the change it logs Activity flags restored: KEEP_SCREEN_ON, brightness, keyguard dismissed. With the app process killed (no activity) the wake still turns the screen on, logs that no activity is available, and nothing crashes. Not checked: a real alarm at the scheduled time (the same receiver code is reached by the broadcast), a locked screen with a PIN, a physical device.
  • 🛠️ scripts/set-device-owner.ps1 and scripts/install-boot-autostart.ps1 parse again on Windows PowerShell 5.1 (#381). Both were saved as UTF-8 without a byte order mark and held em dashes; Windows PowerShell 5.1, the version shipped with Windows 10 and 11, reads such a file in the ANSI code page, the dash became characters that broke a string, and the script failed before running anything (2 syntax errors in the first, 10 in the second). The dashes are now plain hyphens in both. Checked with the PowerShell 5.1 parser (0 errors in both, 2 and 10 before) and by running set-device-owner.ps1 -Serial against the tablet emulator, which now reaches its preflight checks. install-boot-autostart.ps1 was only parsed, not run: it changes /system.
  • 🔎 The loading error screen says why the page failed (#143). Every failure read the same Loading Error, whether the host name did not resolve, nothing answered on the port, the server returned 5xx, or the certificate was expired or did not match the host (FreeKiosk only offers its accept this certificate dialog for a certificate from an unknown authority), and the cause stayed in the logs. The screen now adds a line such as Reason: net::ERR_NAME_NOT_RESOLVED, Reason: SSL error: The date of the certificate is invalid or Reason: HTTP 503, in the 9 app languages. It carries no address, so Hide the URL on the error screen still hides it. Nothing else changes: the same screen, the same reload and the same certificate dialog. Covered by Jest tests (a failed load, an HTTP error, no description, the hidden URL) and checked on an Android 15 tablet emulator: unresolvable host, closed port, HTTP 503, expired certificate and hidden URL show their reason, a self-signed certificate still opens the dialog and loads once accepted, and a working page shows no error. Not checked on Android 10, nor with the certificate that the report of #143 involves.
  • 🛠️ ADB guide: a third-party keyboard can undo keyboard_mode none (#148). On a Huawei MediaPad M5 Lite with SwiftKey, the on-screen keyboard stayed closed but SwiftKey still showed its suggestion bar and capitalized the first character of each barcode scan. The reporter fixed it by installing a blank input method ("Null Keyboard") as the default, keeping SwiftKey enabled to type the PIN; the guide now says so. Documentation only: the workaround was checked by the reporter, not by us.
  • 📷 /api/camera/photo says why it failed (#375). Every failure answered the same 503 “Check camera permission and hardware”, so a camera in use (live stream, motion detection, another app) read as a permission problem. The error now names the cause: permission, camera in use, disabled by a device policy, no camera, or a timeout. The status code is unchanged. Checked that a normal photo still works on a tablet emulator; the failure messages themselves were not reproduced there.
  • 📚 ADB docs: screensaver_delay is in milliseconds, not seconds (#362). The table said seconds while the value is stored in milliseconds (the JSON example already used 300000), so sending 300 gave a 0.3 s delay. Docs only; the code keeps milliseconds so existing setups keep working.
  • 🗂️ Backups record the real app version (#363). The file always said 1.3.0, so the restore dialog showed the wrong version whatever app wrote it. It now holds the version of the running app (unknown if the native side cannot say; the backup is written anyway). Covered by a test.
  • 📱 Multi-app: opening an app from the home grid brings it back as it was left (#377). The launch added FLAG_ACTIVITY_CLEAR_TOP to the app's root activity, which finished every activity above it: an app left deep in its screens, or past its login, came back on its first screen although its process was still running. The task is now brought to the front as it was, like a stock launcher. An app that is not running starts on its first screen as before. Checked on a tablet emulator with the Messages app (same process, same screen before and after; cold start unchanged); not checked on a physical tablet.
  • 🔌 MQTT and the REST API come back by themselves after the process dies while the screen is off (#376). After the Android System WebView updated overnight, Android stopped FreeKiosk; the process came back with the watchdog only, MainActivity (which starts MQTT and REST) was never recreated, and the tablet stayed unreachable until someone opened the app. When the system restarts the watchdog and MainActivity has not run in the new process, the watchdog now launches it, only if Lock Mode, MQTT or a cloud enrolment is on, only while the screen is off (a user in another app is never interrupted, #234), and at most once every 5 minutes. The screen lights up once, because MainActivity turns it on. Reproduced and checked on a tablet emulator (kill with the screen off: REST back after about 4 s; screen on with another app in front: nothing launched; second death within 5 minutes: nothing launched; app update with the screen off: one launch); not checked on a real tablet, nor with the actual WebView update.
  • 🔎 Page zoom below 100 % fills the screen instead of leaving white space (#382). The zoom was a CSS zoom, which does not change the viewport units: a page laid out with height: 100vh (Home Assistant dashboards, most single-page apps) stayed at 50 % of the screen height with white below it. Below 100 % the page now gets a mobile viewport 1/zoom times larger, so it lays itself out on the whole screen. 100 % and above are unchanged. Checked on a tablet emulator at 50 %, 75 % and 150 %, with and without Disable user zoom, on a test page, then on the Home Assistant demo (50 %, 75 %, 150 %) and a Wikipedia article (60 %, Disable user zoom on); not checked on a physical tablet.
  • 🏠 REST /api/remote/home says when it cannot work instead of answering success (#379). Without the FreeKiosk accessibility service (absent from the cloud and Play Store builds, to be enabled on the GitHub APK) the Home key only reached FreeKiosk's own screen and nothing happened, yet the answer was executed: true. It now answers 400 with the reason.
  • 🔆 Turning auto-brightness off over REST or MQTT restores the configured brightness, not 50 %. The REST/MQTT handlers are set up once when the app starts and kept reading the brightness settings of that moment, before they were loaded. Turning auto-brightness on saved 50 % as the level to go back to, so Home Assistant's Auto Brightness switch (or POST /api/autoBrightness/enable then /disable) left the screen at 50 % whatever Settings > Display said, until the next restart. For the same reason, setting a brightness over REST or MQTT did not turn off an auto-brightness that was already on when the app started, and the light sensor overrode the new level at once. Both now use the current settings. Covered by a test of the Kiosk screen (the saved level is the configured one; a set brightness turns off auto-brightness that was on at startup).
  • 🔒 A Keystore that cannot be read no longer turns the PIN back into 1234. When the Keystore threw on reading the PIN (#258, #200) and no AsyncStorage copy existed, FreeKiosk could not tell this from a device that never had a PIN and accepted the default 1234. A flag (not a secret) now records that a PIN was set: with it, a PIN that cannot be read is refused with The saved PIN cannot be read, and 1234 only opens the settings on a device that never had a PIN, or after the PIN was removed. A PIN set before this change gets the flag the next time it is entered. To get back in, send any ADB config with the PIN (see docs/adb-configuration.md): it saves the PIN again, into the AsyncStorage copy if the Keystore still fails. The PIN screen now shows that message instead of 0 attempts remaining. Covered by a unit test (no PIN ever set, PIN set, PIN from before the flag, PIN removed).
  • 🔒 PDF Viewer: a crafted PDF can no longer run code in the viewer (CVE-2024-4367). The bundled pdf.js 3.11.174 compiles font glyph outlines with new Function(), and a font crafted for it runs code of its own (fixed upstream in pdf.js 4.2.67). The viewer is a file:// page with universal file access, so that code could have read FreeKiosk's own files and sent them off. The viewer now sets pdf.js's isEvalSupported: false, which draws glyphs without compiling anything; PDFs show as before, glyph drawing is a little slower. Only devices with the PDF Viewer on were exposed. Upgrading pdf.js itself is still worth doing.
  • 🔋 REST API and MQTT no longer keep sensors and text-to-speech running while they are off. Both connected their own text-to-speech engine and listened to the light, proximity and acceleration sensors from the moment the app started, whether they were switched on or not: two TTS connections and up to six sensor listeners, all day. The sensors now run only while the REST server or the MQTT client runs. Text-to-speech connects when something is first spoken, and web pages no longer connect it on every load just to list the voices (the speechSynthesis polyfill now asks for them on first use, as browsers do).
  • 🗣️ The first text-to-speech request after a start is no longer lost. Over MQTT a tts message that arrived before the engine was ready was dropped, over REST it was retried once after a second. Both now wait until the engine is ready. A REST request for a voice that is not installed falls back to a voice for the language again, instead of keeping whatever voice was used last.
  • 🌐 REST API: a server that failed to start can be started again. When the port was taken (another app on 8080, or the old server not gone yet), the failed server stayed registered: every later start, including the one at app launch, answered Server is already running while nothing listened, and the wake lock and WiFi lock taken for it were never released, which drained the battery. A failed start now drops the server and releases both locks, so the next start, or switching the API off and on, tries again.
  • ☁️ FreeKiosk Cloud: a command the device could not carry out is reported as failed. Commands the app runs natively (reboot, lock, speak, remote and keyboard keys, sound) were reported as a success whenever the native side answered, including when it answered that it had not done it: a reboot on a device without Device Owner, a lock with neither Device Owner nor the accessibility service, an unknown key. The cloud now gets an error with the device's reason, e.g. Reboot requires Device Owner mode. Covered by a unit test.
  • 🕖 A time typed with one hour digit no longer breaks the screen schedule and the URL planner. The time fields accept 7:00 and only turned it into 07:00 when the field lost focus, so tapping Save straight after typing stored 7:00. Both features compare times as text, where 22:00 comes before 7:00: a 22:00 to 7:00 sleep rule then never turned the screen off after midnight, and planner events with such a time started or ended at the wrong moment. The fields now hand out 07:00 as soon as the time is complete. Times already saved as 7:00 stay as they are until the rule or event is opened and saved again. Covered by a test of the time field.
  • 📅 URL Planner: a one-time event over several days can run overnight. The times of a one-time event are a daily window on each day of its date range, and the editor accepts an end before the start when the event spans several days, but such an event (say 18:00 to 10:00 from the 10th to the 12th) never became active: every day was checked for 18:00 ≤ now < 10:00. It now runs like an overnight recurring event, from 18:00 on each day of the range until 10:00 the next morning, the morning after the end date included, as docs/adb-configuration.md already described. Windows within a day and all-day events are unchanged. Covered by a unit test.
  • 💬 MQTT: a toast shows once, not twice. A message on .../set/toast was shown by the MQTT client itself, so it also appears while the app's JavaScript is paused, and then passed to the app, which showed it a second time. It is no longer passed on. REST's /api/toast is unchanged.
  • 🔑 Starting the app no longer reads the Keystore for the HTTP Basic Auth password when no Basic Auth username is set. The password is only ever sent with a username, but it was read at every start, before Lock Mode, the blocking overlays and the external app were set up. A Keystore read is slow on cheap devices and throws on broken ones (#258). Covered by a test of the Kiosk screen.

Don't miss a new freekiosk release

NewReleases is sending notifications on new releases.