SR-Lut3t1um / Webos-renew-dev

Renew dev mode
55 stars 1 forks source link

session time is not resting on TV #1

Open abdulazizalmass opened 1 year ago

abdulazizalmass commented 1 year ago

Thanks for the amazing tip.

After following the steps, this was received {"result":"success","errorCode":"200","errorMsg":"GNL"} .

The session was not extended as tested on the developer mod app from LG tv. By any chance, did this happen to you ?

reverse engineering might work through ssh with localhost:9922/status but will consider this after your response

licensed commented 1 year ago

Thanks for the amazing tip.

After following the steps, this was received {"result":"success","errorCode":"200","errorMsg":"GNL"} .

The session was not extended as tested on the developer mod app from LG tv. By any chance, did this happen to you ?

reverse engineering might work through ssh with localhost:9922/status but will consider this after your response

Same here.

xcorp commented 1 year ago

@SR-Lut3t1um @abdulazizalmass I also get the same issue, timer not updating on the Developer Mode app. This might only be a cosmetic thing?

abdulazizalmass commented 1 year ago

@SR-Lut3t1um @abdulazizalmass I also get the same issue, timer not updating on the Developer Mode app. This might only be a cosmetic thing?

After installing the latest code update from LG, LG developers added an amazing feature to extend the session to 999 hours. For now, this is a good alternative to try.

Best of luck 🤞

xcorp commented 1 year ago

@SR-Lut3t1um @abdulazizalmass I also get the same issue, timer not updating on the Developer Mode app. This might only be a cosmetic thing?

After installing the latest code update from LG, LG developers added an amazing feature to extend the session to 999 hours. For now, this is a good alternative to try.

Best of luck 🤞

Yeah, but I'm using this with https://github.com/SLG/tv-service so would be nice to not have to bother all together :)

SR-Lut3t1um commented 1 year ago

Sorry for the late respone. In theory it should still work, even if the timer is not correctly shown on the TV. You can verify the timer with https://developer.lge.com/secure/CheckDevModeSession.dev?sessionToken={your_token}. If that fails, you will need to redo the process. So using the actual script might be a more stable solution, keep in mind it will need to start the TV.

xcorp commented 1 year ago

Yeah, seems to reset fine, many thanks :)

posti85 commented 10 months ago

I seems the time counter doesn't update in the Developer Mode App until you turn off the TV and also unplug it. So, indeed, querying the CheckDevModeSession endpoint is the most fiable way.

By the way, you can also query the session token, after Connecting TV and PC, just executing:

ares-novacom --device tv --run "cat /var/luna/preferences/devmode_enabled"
gfrancesco commented 4 weeks ago

I just run into this, I can also confirm that I cannot see the timer reset on the TV even when the CheckDevModeSession endpoint confirms that it has been reset. I'll need to test unplugging the tv, but I'm a bit worried that the tv might just reset all the apps installed when its counter goes to zero, regardless of what the remote API endpoint says.

Anyway, I created a small Cloudflare Worker to reset the counter. You can run it for free (don't remember the free tier limit on Cloudflare but it's high), you just need to add a trigger to schedule the execution as often as you want (I set it once a week) and add an LG_API_KEY secret variable with your key under Variables and Secrets in the Cloudflare dashboard.

You can also reset the counter manually by calling the worker url.

async function fetchLGapi(api_key){
  let res = await fetch(`https://developer.lge.com/secure/ResetDevModeSession.dev?sessionToken=${api_key}`);
  return res;
}

export default {

  async fetch(request, env, ctx) {
    return await fetchLGapi(env.LG_API_KEY);
  },

  async scheduled(event, env, ctx) {
    return ctx.waitUntil(fetchLGapi(env.LG_API_KEY));
  }

};

EDIT: If of any interest, I performed a couple of tests and I was able to see the timer reset from the TV, but only after disabling QuickStart+ on the tv. My guess is that the cache is cleared more frequently, so the TV is updating the counter every time you turn it on or at least more often than before.

A note on the worker script above: if you use the standard URL for Cloudflare workers (e.g. your-worker.workers.dev) it will be hit by random bots several times during the day. It's not a big problem since I've never seen more than a hundred requests a day, which is way below the free tier, but if you want to avoid this you can delete the fetch block so the worker can be triggered only by the scheduler once a week or so.