#!/bin/sh # clear-app-update-gate.sh # # Layer 5 (optional): block the app-update gate that LG uses to nag about app # updates, adapted from dr0dr1dr2dr3/lgappupdateblocker # (https://github.com/dr0dr1dr2dr3/lgappupdateblocker). # # WHY: lgappupdateblocker's core trick is to wipe the app store's cached update # state so the "update available" nag never appears: # /mnt/lg/cmn_data/var/palm/data/com.webos.appInstallService/updateInfo # We also wipe updateDependencyInfo (which the original misses) and — unlike the # original — we do NOT write /etc/hosts directly (that fails on the RO overlay); # the hosts part is covered by 10-block-lg-telemetry's bind-mount instead. # # NOTE: updateInfo can be re-created by the app store after a reboot (upstream # issue #2). Run this after each boot (add to init.d if you want it automatic), # or rely on the hosts/DNS layers to stop the store from reaching lgtvsdp.com in # the first place. # # Idempotent, safe to re-run. --dry-run prints what would change without writing. set -u BASE=/mnt/lg/cmn_data/var/palm/data/com.webos.appInstallService UPDATE_INFO="$BASE/updateInfo" UPDATE_DEP="$BASE/updateDependencyInfo" DRY_RUN=0 if [ "${1:-}" = "--dry-run" ]; then DRY_RUN=1 fi log() { echo "[clear-app-update-gate] $*" >&2; } for f in "$UPDATE_INFO" "$UPDATE_DEP"; do if [ -e "$f" ]; then if [ "$DRY_RUN" = 0 ]; then mv -f "$f" "$f.bak.$(date +%Y%m%d%H%M%S)" log "moved aside: $f" else log "would move aside: $f (dry-run)" fi else log "not present: $f" fi done # Optionally create empty replacement files so the service finds a valid (empty) # state instead of a missing one. Empty = no pending updates. if [ "$DRY_RUN" = 0 ] && [ -d "$BASE" ]; then for f in "$UPDATE_INFO" "$UPDATE_DEP"; do if [ ! -e "$f" ]; then : > "$f" log "created empty: $f" fi done fi log "done." exit 0