docs / models / 75UR9S / V0000.09.60W.Q0624 / findings

04 β€” Overriding TV menu localization (i18n bundle guide)

A reusable guide for changing any label in the TV's menus β€” Settings, Quick Menu, home screen, live-TV UI, browser, error pages. Measured 2026-11-14 over the root SSH lane on 75UR9S / V0000.09.60W.Q0624 (MT9655); the shadow-package override (Β§5.2) measured and cold-reboot-verified 2026-11-18. Reversible; verified boot stays green. Companion to 01 β€” OS exploration, 02 β€” SFTP lane, and 03 β€” Quick Menu reference.

1. TL;DR

2. How the menu gets its strings

The "native" UI is a set of web apps rendered by the cobalt/starboard engine (SystemUI). Each app package ships a language/ directory of i18n bundles. At startup the engine loads the bundle for the active UI language (curLang in the starboard storage, e.g. eng) and resolves each label by key.

Key-scoping trap β€” read this first. Keys are not global. The same key (e.g. ACG0104) exists in several bundles with different values (293 keys overlap between system-ui and operationui, 76 between operationui and hisenseUI). A key resolves within the bundle the rendering context loaded. So: identify which bundle owns the screen you are editing, and scope your search to that bundle. Never assume a key means the same thing everywhere.

The three bundle formats

Format Files Used by
A β€” parallel arrays keys.json = ["K1","K2",…] + language_<loc>.json = ["v1","v2",…], index-aligned hisenseUI, system-ui, operationui
B β€” flat object language_<loc>.json = {"K1":"v1","K2":"v2"} (no keys.json) tvbrowser
C β€” per-locale JS language_<loc>.js = var language = { K1: "v1", … } webengine errorPage

3. All string providers (complete list)

# Package language/ path Fmt FS Keys Menu area served
1 tv.vidaa.app.ui (hisenseUI) /opt/pkgs/tv.vidaa.app.ui/hisenseUI/language A ro (erofs) 535 Home screen / launcher (app tiles, home labels)
2 tv.vidaa.app.ui (system-ui) /opt/pkgs/tv.vidaa.app.ui/system-ui/language A ro (erofs) 3052 Main Settings, on-screen menus, Quick Menu
3 tv.vidaa.app.operationui /APPS/pkgs/tv.vidaa.app.operationui/CHA/language A rw (ext4) 2002 Live-TV operation UI: channel scan, EPG, PVR, inputs
4 tv.vidaa.app.tvbrowser /APPS/pkgs/tv.vidaa.app.tvbrowser/webui/setting/static-browser/language B rw (ext4) 80 TV browser webui (Home page, Exit, Clear Cookies, browser errors)
5 tv.vidaa.res.webengine /APPS/pkgs/tv.vidaa.res.webengine/CHA/resources/errorPage/language C rw (ext4) ~3 Web-engine network-error pages (No Internet / Reconnect)

Notes: - current -> CHA is a symlink (operationui, webengine): the CHA/… path is the live one. - Variant subdirs (Format A only): <language>/VDA, NO-TV, VDA-NO-TV hold sparse per-variant overrides (parallel arrays, same key order as the base). The active variant on this TV is VDA. If the key you are editing is overridden in the active variant, patch the variant file too β€” it wins over the base. - missing_language.json (Format A) sits at the app root (not under language/) and is a shipped per-locale report of entries whose value is the literal "undefined" β€” a translation-QA artifact, not a runtime fallback (measured 2026-11-22; findings 05 Β§3.1). - These five cover all persistent menu/setting labels. Transient OSD elements (volume bar, channel-number overlay) and the power-on logo are rendered by the engine and are not all present in the bundles.

4. Finding the key for a displayed string

  1. Pull the bundle for the screen you are editing (see Β§3 for which one).
  2. Search the value in the locale file β†’ the index (Format A) or the key (Format B/C).
  3. Format A: key = keys.json[index]. Format B/C: the key sits next to the value.
  4. If the same text appears under several keys/bundles, pick the one the target screen actually uses. For menu items, the item registry maps each item to its settingItemTitle key β€” that is the authoritative key (see the Quick Menu findings).

Real examples (English, from the pulled bundles):

Key Value (English) Bundle FS
ACF1357 Sleep Timer operationui rw
ACF1151 Set the sleep timer to automatically turn the device off… system-ui ro
OT0185 Programme Guide Auto Update system-ui ro
ACE0018 The channel list is already up-to-date. Do you wish to continue… system-ui ro
BR0001 Home page tvbrowser rw
BR0016 Clear Cookies tvbrowser rw
BR0257 No Internet Connection webengine rw
BR0259 Reconnect webengine rw

Note ACF1357 ("Sleep Timer", operationui) vs ACF1151 (the sleep-timer description, system-ui): the same concept's label and description live in different bundles. That is the key-scoping trap in action.

5. Applying an override

5.1 Writable bundles β€” edit in place (operationui, tvbrowser, webengine)

Root bypasses the 444 mode bits on the writable /APPS ext4, so edit in place:

L=/APPS/pkgs/tv.vidaa.app.operationui/CHA/language
cp $L/language_eng.json $L/language_eng.json.bak        # backup
# …edit the value (Format A: index; B/C: key)…
# push the edited file back (or edit on the TV directly)

5.2 Read-only bundles β€” shadow package (system-ui, hisenseUI) β€” primary

/opt is erofs + dm-verity β€” it cannot be written. The override is a shadow copy of the whole package in the writable package root: /APPS/pkgs/tv.vidaa.app.ui. The UI launcher (/opt/hisenseUI/startgui.sh) resolves the package via GET_PKG_DEST, which prefers /APPS/pkgs over /opt β€” with the shadow present, SystemUI's environment carries HI_UI_HOME=/APPS/pkgs/tv.vidaa.app.ui and it loads the shadow's bundles at first launch. No mount table, no postinst re-arm, no SystemUI restart at boot.

# 1. Create the shadow (once). ~2429 files. cp reads through any live bind
#    mounts, so a copy made while mounts are active bakes their content in.
cp -a /opt/pkgs/tv.vidaa.app.ui /APPS/pkgs/

# 2. Edit the bundles in place inside the shadow (Format A: index; B/C: key).
#    e.g. /APPS/pkgs/tv.vidaa.app.ui/system-ui/language/language_cze.json

# 3. OWNERSHIP (the trap that costs an evening): vendor language files are
#    uid 305, gid 909, mode 640 (dirs 750). SystemUI runs as uid 311 with 909
#    as a *supplementary group*, and 640 gives "other" nothing β€” a file you
#    create as root (root:root, 640) is a hard EACCES for the UI process and
#    the engine renders the RAW KEY (SE0002, …) instead of the string.
chown 305:909 <every file you added or replaced>
chmod 640 <files>   # 750 for directories

SELinux is not the wall here: files under /APPS get the hs_apps_file context, which the UI reads fine (it reads every other /APPS package). The failure mode is pure DAC β€” ownership + mode. Symptom check: if only one bundle's screens show raw ids while the rest of the UI looks normal, it is almost certainly ownership on the files you touched in that bundle.

Reversible: rm -r /APPS/pkgs/tv.vidaa.app.ui β†’ GET_PKG_DEST falls back to /opt (verified boot stays green; the shadow writes nothing to /opt).

5.3 Read-only bundles β€” bind-mount overlay (alternative)

The former primary method, kept as an alternative (e.g. when you want to override a single file without copying the whole package). Stage a patched copy in the lane's staging root and bind-mount it over the /opt original:

mkdir -p /var/local/alvidaa/ui-language/system-ui
cp <patched> /var/local/alvidaa/ui-language/system-ui/language_eng.json
mount --bind /var/local/alvidaa/ui-language/system-ui/language_eng.json \
            /opt/pkgs/tv.vidaa.app.ui/system-ui/language/language_eng.json
ls -i /opt/pkgs/tv.vidaa.app.ui/system-ui/language/language_eng.json   # inode changed = live

The staged file's own DAC is what SystemUI sees at the mount point β€” stage it world-readable (or 305:909 mode 640), never root:root 640 (Β§5.2 ownership trap). SELinux-compatible, partition-safe, reversible: umount <path> brings the original back. Writing to /opt is a gray area per never-touch.json; a bind mount writes nothing to the protected partition and verified boot stays green β€” flagged and accepted.

Verify liveness by inode, not by grepping /proc/mounts. /opt is a symlink to /mnt/tvroot/opt (erofs); the kernel resolves the bind target through it, so /proc/mounts shows the resolved path and the block device β€” never the source you mounted. ls -i <target> must equal ls -i <staged file> (same inode) to prove the mount is live; /proc/self/mountinfo shows the source path if you want to see it. The boot-persistent variant of this lane is in Β§7.2.

5.4 Variant subdirs

If the key is overridden in the active variant, patch it there too (it wins): grep -n '<key>' <language>/VDA/keys.json β†’ edit <language>/VDA/language_eng.json.

5.5 Making it take effect

The engine loads i18n at startup.

kill <SystemUI pid>          # then
/opt/hisenseUI/startgui.sh   # (busybox setsid, detached, if from a script)

Note: restarting SystemUI mid-session drops the current Live TV state β€” prefer a reboot when the TV is idle.

5.6 Alternative for menu-item titles β€” settingchange.json

Menu items can also be retitled via the per-item settingchange.json cloud override (keyed by item id; merges title/description). It is a separate, id-scoped layer from the i18n bundle. Use it to change a single item's title without touching the bundle (see the Quick Menu findings for the item registry).

6. Does changing a string affect saved menu layouts? (Quick Menu)

No. Menu layouts (e.g. the Quick Menu's two rows) are persisted as arrays of item ids β€” never as strings:

So a bundle string edit only changes the rendered label β€” it changes no id, no key, no stored byte. Storing, restoring, and editing the menu are all id-based and completely unaffected. The only things that would break the mapping are changing an item's id or its i18n key β€” both are code/registry changes, not bundle edits. (The "storage filename contains ==" and "edit only while SystemUI is stopped" caveats apply to editing the layout storage, not the bundle.)

7. Persistence across reboot

7.1 Shadow package (primary) β€” native persistence, no re-arm

Everything the shadow mechanism writes is on the writable ext4 (/APPS), so:

Verified 2026-11-18 (cold reboot): after reboot, the shadow was byte-identical (md5 of every language_*cze.json matched pre-reboot), no bind mounts existed, SystemUI came up from HI_UI_HOME=/APPS/pkgs/tv.vidaa.app.ui and the localized menu rendered correctly.

7.2 Bind-mount lane (alternative) β€” postinst re-arm, complete

The former primary method, documented in full β€” the step's complete code is inlined below. /opt bind mounts do not survive a power cycle, so the re.installer postinst carried a ui-language step that re-armed them at every boot. It was data-driven: the staging tree was the desired state.

The boot lane (measured 2026-11-21). The re-arm is driven by the dropbear lane's own boot lane: the re_sshd jsservice (/APPS/pkgs/tv.vidaa.jsservice.basic/CHA/services/re_sshd, serviceList.json autoStart: true, runs as uid 314) sends the superwatch opkg payloads over /var/run/superwatch_socket β€” 90:83:90;re.installer (uninstall) then 91:82:91;/APPS/installer.ipk;re.installer; (install) β€” and the install re-runs the postinst as uid 0 (the same root-elevation the dropbear lane uses). It retries every 5 s, up to 36 attempts, until dropbear is up. Timestamps from /APPS/.re_sshd/boot_marker.txt (ISO) + /proc/<pid>/stat, 2026-11-21 boot (boot β‰ˆ 13:51:00Z):

t since boot Event
~+4 s SystemUI starts (pid 1531, starttime 369 jiffies) and reads the unmounted bundles
+5.4 s re_sshd starts (uid 314); sends uninstall + install
+33…+38 s postinst re-arm: mounts the staged bundles, then kills and relaunches SystemUI

So on every cold boot the override is invisible for the first ~30 s, and the re-arm's SystemUI restart destroys the resumed Live TV session on every power cycle β€” the cost the shadow lane (Β§7.1) removes. (The postinst's own comments disagree on this ordering β€” one claims SystemUI is not up yet on a cold boot β€” but the timestamps settle it: SystemUI starts before the re-arm, so the restart fires on every boot, not only on manual re-arms.) install=[TIMEOUT] in the marker is the normal success pattern: the install response never returns within the 15 s socket timeout, but the install proceeds and dropbear is up by the next 5 s check.

The step, as shipped β€” complete code. The ui-language step of the re.installer postinst (runs as uid 0; de-indented from the postinst):

echo "--- step: ui-language ---"
# i18n override (findings 04): bind-mount staged language bundles over the
# read-only /opt copies. Data-driven: the staging tree IS the desired state.
# Layout: $LP/<bundle>/<relpath> -> /opt/pkgs/tv.vidaa.app.ui/<bundle>/language/<relpath>
# (relpath may include variant subdirs like VDA/). No-op when the staging
# root is absent; teardown = rm -r $LP (the stale sweep unmounts on the next
# re-arm). Filenames under $LP must not contain spaces (bundles don't).
LP=/var/local/alvidaa/ui-language
# /opt is a SYMLINK to /mnt/tvroot/opt (erofs). The kernel resolves a bind
# target through it, so /proc/mounts shows the RESOLVED path
# (/mnt/tvroot/opt/...), never the /opt/... we pass. Resolve once and use
# the canonical path for both mounting and the /proc/mounts checks, or the
# idempotency grep below never matches and every re-arm stacks a fresh bind
# mount on top of the old one (mount-table leak).
OPT_REAL=$(ls -ld /opt 2>/dev/null | awk '{print $NF}')
[ -n "$OPT_REAL" ] || OPT_REAL=/opt
UIROOT="$OPT_REAL/pkgs/tv.vidaa.app.ui"
if [ -d "$LP" ]; then
    # stale sweep: unmount our bind mounts whose staged source is gone.
    # Match on the RESOLVED target (field 2 of /proc/mounts); field 1 is the
    # block device, so it can never be matched against $LP.
    awk '{print $2}' /proc/mounts | while read -r dst; do
        case "$dst" in
            "$UIROOT"/*)
                sub=${dst#"$UIROOT"/}          # <bundle>/language/<rest>
                bundle=${sub%%/*}
                case "${sub#*/}" in
                    language/*)
                        rest=${sub#"$bundle"/language/}
                        [ -f "$LP/$bundle/$rest" ] || { echo "stale umount $dst"; umount "$dst" 2>&1; }
                        ;;
                esac
                ;;
        esac
    done
    mounted=0
    for f in $(find "$LP" -type f 2>/dev/null); do
        rel=${f#"$LP"/}
        case "$rel" in
            */*) ;;
            *) echo "skip (not in a bundle dir): $rel"; continue ;;
        esac
        bundle=${rel%%/*}
        rest=${rel#*/}
        t="$UIROOT/$bundle/language/$rest"
        if [ ! -e "$t" ]; then echo "no target: $t"; continue; fi
        if grep -q " $t " /proc/mounts; then
            echo "already mounted: $t"
        elif mount --bind "$f" "$t" 2>&1; then
            echo "mounted: $t <- $f"
            mounted=1
        else
            echo "MOUNT FAILED: $t"
        fi
    done
    # If anything was (re)mounted and SystemUI is already up, restart it so
    # it re-reads the bundles. On a cold boot SystemUI is not up yet, so
    # this only fires on a manual re-arm. Detached: postinst must not hang
    # on the UI launcher.
    if [ "$mounted" = 1 ]; then
        SU=0
        for p in /proc/[0-9]*/cmdline; do
            grep -q SystemUI "$p" 2>/dev/null && SU=1
        done
        if [ "$SU" = 1 ]; then
            echo "SystemUI running: restarting"
            # pkill does not exist on this TV (verified 2026-11-16); kill by
            # pid instead. startgui.sh bails if SystemUI is still up (its
            # `pidof SystemUI` guard), so wait for it to actually die first,
            # or the relaunch below is a silent no-op and the stale strings
            # persist. SystemUI starts at boot (tick ~47) BEFORE this step,
            # so it has already read the unmounted bundles and MUST be
            # restarted to pick up the freshly-mounted ones.
            kill $(pidof SystemUI) 2>/dev/null
            i=0
            while [ "$i" -lt 10 ] && pidof SystemUI >/dev/null 2>&1; do sleep 1; i=$((i+1)); done
            busybox setsid /bin/sh -c '/opt/hisenseUI/startgui.sh' >/dev/null 2>&1 < /dev/null &
        else
            echo "SystemUI not running: nothing to restart"
        fi
    fi
else
    echo "staging root absent: no-op"
fi

How it works:

Status: the ui-language step no longer ships in tools/ur9s/scripts/make_installer.py (the postinst no longer touches UI language), and the staging tree is deleted from the TV (/var/local/alvidaa is empty; verified 2026-11-21). The code above is the complete archive of the step β€” rebuild from it if the bind-mount lane is ever needed again.

Verified 2026-11-15 (cold reboot, historical): after a hard power cycle the postinst ran at boot and all four staged language files were bind-mounted and still live 17+ min later. Proof the mount is real (not just a path): ls -i of the target equals ls -i of the staged file (same inode) β€” e.g. system-ui language_eng.json inode 1354 on both sides.

8. Reversibility / teardown

9. Traps

10. Worked example (English)

Writable path β€” relabel the live-TV "Sleep Timer" (operationui, rw):

  1. Pull: scp root@TV:/APPS/pkgs/tv.vidaa.app.operationui/CHA/language/{keys.json,language_eng.json} /tmp/
  2. Find the value Sleep Timer β†’ index N β†’ keys.json[N] = ACF1357.
  3. Edit language_eng.json[N] β†’ Sleep Timer (auto-off).
  4. On the TV: cp $L/language_eng.json $L/language_eng.json.bak, then push the edited file to $L/language_eng.json.
  5. Restart SystemUI (or reboot). Verify on the TV.
  6. Persists across reboot (it is on /APPS) β€” no re-arm needed.

Read-only path β€” relabel OT0185 "Programme Guide Auto Update" (system-ui, ro):

  1. Ensure the shadow exists (Β§5.2): cp -a /opt/pkgs/tv.vidaa.app.ui /APPS/pkgs/ (skip if /APPS/pkgs/tv.vidaa.app.ui is already there).
  2. Pull keys.json + language_eng.json from the shadow's system-ui bundle.
  3. Find Programme Guide Auto Update β†’ index N β†’ OT0185.
  4. Edit the value, push the file back into the shadow, then chown 305:909 + chmod 640 it (Β§5.2 ownership trap).
  5. Restart SystemUI (or reboot β€” a reboot also preserves the TV's startup state). Verify.
  6. Boot-persistent natively β€” the shadow is on /APPS and is loaded at first launch every boot (Β§7.1). No re-arm, no boot-time restart.