Cathwyler / MagicRemoteService

Use your LG Magic Remote as a Windows mouse and control your PC with the LG Magic Remote from your LG WebOS TV
GNU General Public License v3.0
48 stars 2 forks source link

Solution for rooted (WebOSBrew Homebrew Channel) WebOS users? #20

Closed TehDomic closed 3 months ago

TehDomic commented 6 months ago

Hi, your app looks amazing, but it seems to be incompatible with already rooted WebOS TVs, since it replaces the Developer Mode (TV) app with it's own port 22 SSH server and everything.

I have WebOS Dev Manager installed on a Windows PC, which could install an IPK file either via that software, or if it was added to the official WebOSBrew Homebrew Channel github, but I have been unsuccessful in trying to manually add the SSH root user and password into your MagicRemoteService app as a new device.

Think you could possibly add some way for rooted users to utilize your app as well?

Cathwyler commented 6 months ago

Hi,

Unfortunatly i can not add the IPK file to the webOSbrew repo because the connexion settings are set before the build.

But you should be able to use MagicRemoteService with webOSBrew because they are using webOS OSE CLI instead of webOS TV CLI and they are similare. I don't know where npm install -g @webosose/ares-cli are installaling the CLI\bin folder but you need to set the WEBOS_CLI_TV environnement variable to this folder like in webOS TV CLI installation step 3. You need to verify if there is in CLI\bin folder the *.cmd files. If not you can pick it from the webOS TV CLI release and add them.

An other way is to build and install yourself the app. All the TV app source are there. But you need to set before build your network and input configuration there. https://github.com/Cathwyler/MagicRemoteService/blob/93847306a3196960a7ed4a57ea5710cb143d4f53/MagicRemoteService/Resources/TV/MagicRemoteService/main.js#L152-L160

Let me know if any of this solution works or not.

Regards

hatemfares commented 5 months ago

First thing I want to thank Cathwyler for your great effort. and you made LG TV more useful.

The following instruction , it works with windows 11 and rooted LG 65SM86000 "firmware 05.30.1 webOS version 4.9.7"

please start from scratch.

Download webOS TV CLI win 64bit version from https://webostv.developer.lge.com/develop/tools/cli-installation#cli-installation Unzip webOS_TV_CLI_win_1.12.4-j27.zip . then rename folder webOS_TV_CLI_win_1.12.4-j27 to webOS_TV_SDK move webOS_TV_SDK folder to c:\

Run cmd as administrator

cd C:\Windows\system32

setx /m LG_WEBOS_TV_SDK_HOME "C:\webOS_TV_SDK"

setx /m WEBOS_CLI_TV "%LG_WEBOS_TV_SDK_HOME%\CLI\bin"

setx /m PATH "%PATH%;%WEBOS_CLI_TV%"

setx /m PATH "$Env:PATH;$Env:WEBOS_CLI_TV”

restart the computer.

Run cmd as administrator

step 1 cd C:\webOS_TV_SDK\CLI\bin

step 2 type ares-setup-device

name deviceinfo connection profile


emulator developer@127.0.0.1:6622 ssh tv

** You can modify the device info in the above list, or add new device. ? Select: (Use arrow keys)

add modify remove

step 3 select add

? Enter Device Name: tv2
? Enter Device IP address: type IP address of LG TV ? Enter Device Port: 9922 for dev mode or 22 for rooted lg tv ? Enter ssh user: prisoner for dev mode or root for rooted lg tv ? Enter description: new device ? Select authentification: password
? Enter password: Passphrase for dev mode or alpine for rooted lg tv ? Save ? Yes

download MagicRemoteService???.zip and unzip it

run MagicRemoteService.exe

"when you first time run MagicRemoteService , you will get windows security alert please allow access and this is very important"

On setting TV name >> select TV2 TV HDMI >> select HDMI number that connected to PC HDMI click Install on TV "this will install app on lg tv" now enjoy your magic remote with your pc

Cathwyler commented 5 months ago

Thanks a lot for this information.

So, it seems i was a bit wrong. The webOS CLI TV should already work with rooted TV. If yes, you can try to add your TV like this (complete with your LG TV IP adress) image

If it's not working just do as hatemfares suggested.

Cathwyler commented 5 months ago

I changed the way commands lines are called. Commands should now works with webOS OSE CLI or webOS TV CLI without editing CLI\bin folder.

You can try this pre-release 1.2.3.0

Let me know if any of you encounter a new unwanted error.

pho084 commented 5 months ago

didn't work for me.

i had to manually add the TV via CMD CLI as per hatemfares instructions

TehDomic commented 4 months ago

Back from vacation, will test it in the following days and report back.

TehDomic commented 4 months ago

I followed @hatemfares instructions, however, I have trouble running the software. I figured out MagicRemoteService.exe needs to Run as Administrator, however, I get this message when trying to open it's Settings in the Tray Icon:

image

So, the program doesn't find (following @hatemfares's instructions) C:\webOS_TV_SDK\CLI\bin\. I've unzipped the MagicRemoteService folder to C:\Users\Username\Downloads\MagicRemoteService_1.2.4.3\

As a test, I made a shortcut for MagicRemoveService.exe, where I run it as Admin, and Target is set to C:\webOS_TV_SDK\CLI\bin\. image

This, kind of works, as the software can now read the WebOS SDK directory and fetch TV devices, Like so:

image

However, when trying any other commands (ares_*) like "Install to TV", you get more errors: image

So I currently can't get this to run properly.

pho084 commented 4 months ago

no expert here but i suggest you try and set up the ares environment first on cli basis

only when that works go to MagicRemoteService

Cathwyler commented 4 months ago

Thanks for testing it.

You don't need to start it in bin folder.

Can you verify if you have .CMD in your PATHEXT environnement variable ? Do ares command ares -V for example is working directly in your native Window command prompt in your starting user folder ?

image

TehDomic commented 4 months ago
setx /m PATH "%PATH%;%WEBOS_CLI_TV%"
setx /m PATH "$Env:PATH;$Env:WEBOS_CLI_TV”

It seems these two commands @hatemfares provided have messed up my default Windows 11 %PATH% environment variables. I have no backup of them...

image

$Env:PATH
$Env:WEBOS_CLI_TV
C:\Program Files\dotnet\
C:\Users\username\AppData\Local\Microsoft\WindowsApps
C:\Users\username\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.24.0-x86_64-pc-windows-msvc
C:\Users\username\AppData\Local\Microsoft\WinGet\Packages\GNU.Nano_Microsoft.Winget.Source_8wekyb3d8bbwe

These are my current PATH entries..

Any ideas how to fix this without reinstalling Windows?

Cathwyler commented 4 months ago

Hi,

Sry for that,

Window default path are C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem; You don't need to reinstall Window.

Most of app will automatically add their path at startup. If some are not working anymore just do a repair or reinstall from each app installer.

On my side i didn't use setx cmd. I added it with environment variables UI.

TehDomic commented 4 months ago

Do ares command ares -V for example is working directly in your native Window command prompt in your starting user folder ? @Cathwyler To answer this, no, it does not.

I've manually repaired my Path variables now (NirSoft tools and registry backup files from Volume Shadow Copy (Both user and System env vars).

I'm ready to continue trouble shooting.

Could you paste what your working PATH for the WebOS SDK stuff looks like so I can paste it in the Windows GUI this time? did you add it to System PATH, or Admin local account PATH by the way? Mine looks like this:

System Path: image

Cathwyler commented 4 months ago

I followed the webOS instruction:

But you can add bin folder directly to the path variable image

TehDomic commented 4 months ago

Thanks for testing it.

You don't need to start it in bin folder.

Can you verify if you have .CMD in your PATHEXT environnement variable ? Do ares command ares -V for example is working directly in your native Window command prompt in your starting user folder ?

image

After adding the full path to the bin folder, it now works, I couldn't figure out why %WEBOS_CLI_TV% didn't register as a valid path for $PATH in Windows 11.

PS C:\Users\username> ares -V
webOS TV CLI Version: 1.12.4-j27

I'm going to try out the software now.

TehDomic commented 4 months ago

Seems to work fine now, I run the MagicRemoteService.exe as Admin from a folder in my downloads directory as, and everything works great now.

However, I noticed I can't save when I remap keys on the Remote Tab. any ideas?

Error:

---------------------------
Error while saving remote configuration
---------------------------
Incorrect parameter.
Cathwyler commented 4 months ago

Good job

I fixed this bug today in 1.2.4.5

TehDomic commented 4 months ago

Yeah, I'm pleasantly surprised. I've been thinking about throwing together an automation script for setup (and uninstalling) for The WebOS sdk stuff plus your software, but would it be a legal issue to package/re-host untouched LG WebOS SDK installer files?

Is that why you have no automatic install process for this software?

10 mars 2024 22:04:11 Cathwyler @.***>:

Good job

I fixed this bug today in 1.2.4.5

— Reply to this email directly, view it on GitHubhttps://github.com/Cathwyler/MagicRemoteService/issues/20#issuecomment-1987361895, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALOD2UXBKFRX7BZT7UYVXMTYXTDEPAVCNFSM6AAAAABBTWTMGKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXGM3DCOBZGU. You are receiving this because you authored the thread.Message ID: @.***>

TehDomic commented 3 months ago

Updated to MRS 1.2.4.5 today, but some functions don't seem to be working anymore. Path and variables are still correct.

"Install on TV" gives this error:

Error while installing app on TV

ares-install ERR! Error: Unable to exec 

I don't know of a way to enable a debugging to help you troubleshoot problem.

Cathwyler commented 3 months ago

If you want to provide a bash script to install webOS CLI TV, feel free to post it there. Idk about the legal issue but i don't think there would be a problem cause i don't make commercial use.

Of course i could embeded the webOS CLI inside the app and provide an auto installation system. But i dont want to maintain this part when it's a LG issue. They should provide a friendly installer themselves.

Do C:\Users\username> ares -V still work? Are you sure you didn't add your environement variable in the user ones instead of system?

TehDomic commented 3 months ago

If you want to provide a bash script to install webOS CLI TV, feel free to post it there. Idk about the legal issue but i don't think there would be a problem cause i don't make commercial use.

Of course i could embeded the webOS CLI inside the app and provide an auto installation system. But i dont want to maintain this part when it's a LG issue. They should provide a friendly installer themselves.

Do C:\Users\username> ares -V still work? Are you sure you didn't add your environement variable in the user ones instead of system?

Not sure how I made it work again, but it works for now.

Cathwyler commented 2 months ago

For information, LG just updated CLI Installation. This is not what i call a friendly installation, but it's now way more convenient.

TehDomic commented 2 months ago

For information, LG just updated CLI Installation. This is not what i call a friendly installation, but it's now way more convenient.

Oh God, they want us to install npm too? Security risks galore. But then again, so is Windows "swiss cheese" anyway. 😂