Skip to content

Instantly share code, notes, and snippets.

@AkdM
Last active February 18, 2024 13:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AkdM/c1571b2b0577f1bdb16011eb9b905803 to your computer and use it in GitHub Desktop.
Save AkdM/c1571b2b0577f1bdb16011eb9b905803 to your computer and use it in GitHub Desktop.
LG webOS cheatsheet

Context

I have a LG OLED 65C1, now rooted with RootMyTV v2. I have been hacking around exploring all the possibilities, and this gist is thus a personal cheatsheet.

Commands

🔄 "Stealth" reboot

If ever your TV goes into servicing at LG for whatever reason, it would be better to have every chances to your sides by not allowing them seeing you made some "not covered" stuff to the TV. A reboot command can be detected, so there's an alternative. But it has to be confirmed yet if it's really stealth or not.

Please however note the following from @Informatic. But we don't know if LG can do something about it:

LG Content Store is periodically queried for software updates of all installed applications (including homebrew/developer and system apps, app ids and versions are transmitted)

luna-send -a webosbrew -f -n 1 luna://com.webos.service.sleep/shutdown/machineReboot '{"reason":"remoteKey"}'

📸 Make a screenshot (from here)

luna-send -n 1 -f 'luna://com.webos.service.capture/executeOneShot' '{"path":"/tmp/capture.png", "method": "DISPLAY", "format": "PNG"}'
  • Supported formats: BMP, JPG, PNG, RGB, RGBA, YUV422
  • Supported methods: SCREEN/DISPLAY (alias?), SCREEN_WITH_SOURCE_VIDEO, VIDEO, GRAPHIC, SOURCE/SCALER (alias?)
  • Defaults to 960x540, but you can provide width and height parameters: "height": 2160, "width": 3840
  • Note: com.webos.service.capture can also be com.webos.service.tv.capture on some devices, call signature is the same.
  • Note 2: this is also available over SSAP as: ssap://tv/executeOneShot - returns imageUri attribute with HTTP link)

With current date:

luna-send -n 1 -f 'luna://com.webos.service.capture/executeOneShot' "{\"path\":\"/home/root/capture_`date "+%d-%m-%y_%H-%M-%S"`.png\",\"method\":\"DISPLAY\",\"format\":\"PNG\",\"height\":2160,\"width\":3840}"

📝 Get logs from an app (from @TBSniller on Discord)

Replace hyperion-webos by the app you want to read the logs

$ luna-send -n 1 -f luna://com.webos.service.config/setConfigs '{"configs": {"system.collectDevLogs": true}}'
$ PmLogCtl set hyperion-webos debug
$ tail -F /var/log/messages | grep hyperion-webos

## After that start capture using PicCap and let it run for a few secounds. After that copy content from terminal in somewhere, or redirect directly using
$ tail -F /var/log/messages | grep hyperion-webos > /tmp/hyperion-webos.log

➡️ Add/remove application as input

Add:

luna-send-pub -n 1 'luna://com.webos.service.eim/addDevice' '{"appId":"app-id", "pigImage":""}'

Remove:

luna-send-pub -n 1 'luna://com.webos.service.eim/deleteDevice' '{"appId":"app-id", "pigImage":""}'

The app needs to have "supportGIP":true to its appinfo.json. If added later, you need to reboot the TV.


👐 com.webos.app.home research (webOS 6.x)

  • Launch in half mode
luna-send -n 1 -f luna://com.webos.service.applicationmanager/launch '{"id": "com.webos.app.home", "params":{"activateType": "powerOn"}}'

ℹ️ instart mode (not tested yet)



Credits & references:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment