[App] libLockTV B/C/D/E/F/H - Parental Lock

Here are software that related with Samsung C series TVs, applications, programs that will run in your TV or computer...:!:This forum is NOT FOR USER QUESTIONS or Problems.

zoelechat
SamyGO Moderator
Posts: 8615
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

[App] libLockTV B/C/D/E/F/H - Parental Lock

Post by zoelechat »

Patch immediately locks TV with pincode on injection, and won't allow watching any channel/source until right pincode is entered. As soon as it's unlocked, pincode will never be prompted anymore. Can be useful to launch on startup for *full* parental lock.

Usage:
*For D series (arm), replace every instance of /mnt below by /mtd_rwcommon/widgets/user/SamyGO/SamyGO
*For C series (arm), replace every instance of /mnt below by /SamyGO on your rooting USB device
*For B series, latest samyGOso is there.
  • Get latest samyGOso from there and copy/overwrite samyGOso file (not folder) to /mnt/opt/privateer/usr/bin
  • Set permissions if needed (usually not if overwritten)

    Code: Select all

    chmod +x /mnt/opt/privateer/usr/bin/samyGOso
  • Extract attached archives and copy libLockTV.so to /mnt/opt/privateer/usr/libso (create folder if needed).
  • Execute

    Code: Select all

    samyGOso -d -A -B -r -l /mnt/opt/privateer/usr/libso/libLockTV.so [TRIES:n] [TIMEOUT:n]
    Commandline can take two args:
    • TRIES:n - Allow n pincode tries before auto-shutdown.
    • TIMEOUT:n - TV will shutdown if no valid pincode has been entered after n seconds.
    Logfile is written to /dtv/LockTV.log
  • Autostart (Script has an early number to lock TV as soon as possible on startup)
    • Copy 02_02_LockTV.init to /mnt/etc/init.d
    • Set permissions

      Code: Select all

      chmod +x /mnt/etc/init.d/02_02_LockTV.init
    • You can change OPTIONS value on top of script, default is

      Code: Select all

      OPTIONS="TIMEOUT:100 TRIES:3"
*Changelog:

Code: Select all

23/4/2015
v0.2.2 - Added C support
21/4/2015
v0.2.0 - Added TIMEOUT and TRIES args
14/4/2015
v0.1.0 - First public release
You do not have the required permissions to view the files attached to this post.
I do NOT receive any PM. Please use forum.
zoelechat
SamyGO Moderator
Posts: 8615
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libLockTV B/D/E/F/H - Parental Lock

Post by zoelechat »

New version, added user-defined max number of pincode tries, and timeout before automatic shutdown.
I do NOT receive any PM. Please use forum.
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: [App] libLockTV B/D/E/F/H - Parental Lock

Post by juusso »

Yah, works very well!!!
Here is my updated parent control script. I use my NAS to control when TV should start unlocked (TV_LOCK_ON flag file)

Code: Select all

#!/bin/sh
#
# ? Copyright 1996-2015, SamyGO
#
#
 . /dtv/SGO.env

LIBSO_DIR=$SYSROOT/opt/privateer/usr/libso
TV_ON="0"

#### CHANGE ME START! ####

SERVERIP="192.168.1.200"
SERVER="http://$SERVERIP"

FROM_TIME="00:05"
TO_TIME="07:30"
#FROM_TIME="12:00"
#TO_TIME="13:00"


#### CHANGE ME END! ####

  
check_TV_OK()
{
#check for TV_ON file on server
	CHECK=$( curl --max-time 6 --silent --head $SERVER/TV_LOCK_ON | grep -c 'HTTP/1.1 200 OK' )
	if [ $CHECK -eq "1" ]; then
      TV_LOCK_ON="1"
#   elif [ $CHECK -eq "7" ]; then               
	else
      TV_LOCK_ON="0"
	fi
}

request_pin()
{
   samyGOso -A -B -r -l $LIBSO_DIR/libLockTV.so TIMEOUT:120 TRIES:3
   sleep 3   
}

stop_bootloop()
{
   for USB in /dtv/usb/sd* ; do
      echo "checking $USB"
      [ -e $USB/STOP ] && echo "STOP found. ParientControl script exit..."  >> /mtd_down/SHUTDOWN.log && exit 1
   done
}

case $1 in
   start)
	stop_bootloop   

	check_TV_OK	

	FROM=$( echo $FROM_TIME | sed 's/://' )
	TO=$( echo $TO_TIME | sed 's/://' )
	CUR_TIME=$( getsetcurrenttimefromtv -n exeDSP -W )
	CUR_DATE_TIME=$( getsetcurrenttimefromtv -n exeDSP -D )
   
   if [ -z $CUR_TIME ]; then
      CUR_TIME=$(date +"%H%M")
      CUR_DATE_TIME=$(date)
   fi
   
   if [ $CUR_TIME -gt $FROM ] && [ $CUR_TIME -lt $TO ]; then
#Request PIN
      request_pin   
   else
#normal TV start
      echo "$CUR_DATE_TIME NORMAL TV start"
   fi

   if [ $TV_LOCK_ON -eq "0" ]; then
      echo "TV on, nothing else to say"
   else
      request_pin   
   fi

   ;;
   status)
   ;;
   *)
   echo "Usage: $0 {start|stop|status}" 1>&2
   exit 0
   ;;
esac

I did not remove old code, where you can request PIN at certain time interval(s) as well. I can log in to my home network and change the existence of that file remotely. Now i`m thinking about some android app or simple web page to get ability check which of TV is on and switch request for pin (after mandatory reboot). For this feature getsetcurrenttimefromtv patch is required (included). Read here: viewtopic.php?f=12&t=7415

Sounds a bit drastically, but i`m facing some LONG-TV-WATCHING-PROBLEM with my kids.

Edit: Used adroid app tasker + tasker ssh plugin + tasker app factory plugin and now i can enable/disable pin request by pressing red or green buttons on my smartphone desktop :)
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE
zoelechat
SamyGO Moderator
Posts: 8615
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libLockTV B/C/D/E/F/H - Parental Lock

Post by zoelechat »

New version, added C support. I'm proud to release the first ever unified B/C/D/E/F/H lib :P
Thanks sectroyer for making things easier on C ;)
I do NOT receive any PM. Please use forum.
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: [App] libLockTV B/C/D/E/F/H - Parental Lock

Post by juusso »

C series arm. Keep in mind, we have arm, mstar and trident c series... ;)
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE
sectroyer
Official SamyGO Developer
Posts: 6305
Joined: Wed May 04, 2011 5:10 pm

Re: [App] libLockTV B/C/D/E/F/H - Parental Lock

Post by sectroyer »

juuso wrote:C series arm. Keep in mind, we have arm, mstar and trident c series... ;)
Find me mstar or trident user with rooted TV and I will port it ;)
I do NOT support "latest fw" at ALL. If you have one you should block updates on router and wait for it to STOP being "latest":)
If you want me to help you please paste FULL log(s) to "spoiler"/"code" bbcodes or provide link(s) to pasted file(s) on https://pastebin.com Otherwise "NO HELP"!!!
If you want root DISABLE internet access to your device!!!!
DO NOT EVER INSTALL FIRMWARE UPGRADE !!!!
zoelechat
SamyGO Moderator
Posts: 8615
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libLockTV B/C/D/E/F/H - Parental Lock

Post by zoelechat »

juuso wrote:C series arm. Keep in mind, we have arm, mstar and trident c series... ;)
You broke my joy :D
I do NOT receive any PM. Please use forum.
tempinbox
Posts: 317
Joined: Wed May 11, 2011 7:00 pm

Re: [App] libLockTV B/C/D/E/F/H - Parental Lock

Post by tempinbox »

@zoelechat did you find the way to add C supports? anybody here that try this patch in C series and can confirm that work?
I try your test patch and i remember that didn't work.
zoelechat
SamyGO Moderator
Posts: 8615
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libLockTV B/C/D/E/F/H - Parental Lock

Post by zoelechat »

tempinbox wrote:@zoelechat did you find the way to add C supports? anybody here that try this patch in C series and can confirm that work?
I try your test patch and i remember that didn't work.
I was precisely expecting you to try and report. :)
Test version was meant to see which functions were missing. Patch has been tested and now works on C, only additional TRIES and TIMEOUT args haven't been tested yet.
I do NOT receive any PM. Please use forum.
tempinbox
Posts: 317
Joined: Wed May 11, 2011 7:00 pm

Re: [App] libLockTV B/C/D/E/F/H - Parental Lock

Post by tempinbox »

Ok i will try and post here the result.
Thanks and congrats for you united first b-h patch.
Please don't stop coding ;)
And if you need tester for C arm patch don't forget that i'm here.

Post Reply

Return to “[C] Software”