├── wc.mp3 ├── muxlock.gif ├── removelock ├── zshrc ├── motd ├── bash.bashrc ├── LICENSE ├── README.md └── setup.py /wc.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KasRoudra/muxlock/HEAD/wc.mp3 -------------------------------------------------------------------------------- /muxlock.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KasRoudra/muxlock/HEAD/muxlock.gif -------------------------------------------------------------------------------- /removelock: -------------------------------------------------------------------------------- 1 | rm -rf ~/../usr/etc/forgotten.sh 2 | cp -r ~/../usr/bash.bashrc ~/../usr/etc 3 | cp -r ~/../usr/zshrc ~/../usr/etc 4 | cp -r ~/../usr/motd ~/../usr/etc 5 | echo "Lock removed! Have a good time!" 6 | rm -rf ~/../usr/bin/removelock -------------------------------------------------------------------------------- /zshrc: -------------------------------------------------------------------------------- 1 | . /data/data/com.termux/files/usr/etc/profile 2 | command_not_found_handler() { 3 | /data/data/com.termux/files/usr/libexec/termux/command-not-found $1 4 | } 5 | #set nomatch so *.sh would not error if no file is available 6 | setopt +o nomatch 7 | . /data/data/com.termux/files/usr/etc/profile 8 | PS1='%# ' 9 | 10 | -------------------------------------------------------------------------------- /motd: -------------------------------------------------------------------------------- 1 | 2 | Welcome to Termux! 3 | 4 | Community forum: https://termux.com/community 5 | Gitter chat: https://gitter.im/termux/termux 6 | IRC channel: #termux on libera.chat 7 | 8 | Working with packages: 9 | 10 | * Search packages: pkg search 11 | * Install a package: pkg install 12 | * Upgrade packages: pkg upgrade 13 | 14 | Subscribing to additional repositories: 15 | 16 | * Root: pkg install root-repo 17 | * Unstable: pkg install unstable-repo 18 | * X11: pkg install x11-repo 19 | 20 | Report issues at https://termux.com/issues 21 | 22 | -------------------------------------------------------------------------------- /bash.bashrc: -------------------------------------------------------------------------------- 1 | # Command history tweaks: 2 | # - Append history instead of overwriting 3 | # when shell exits. 4 | # - When using history substitution, do not 5 | # exec command immediately. 6 | # - Do not save to history commands starting 7 | # with space. 8 | # - Do not save duplicated commands. 9 | shopt -s histappend 10 | shopt -s histverify 11 | export HISTCONTROL=ignoreboth 12 | 13 | # Default command line prompt. 14 | PROMPT_DIRTRIM=2 15 | PS1='\[\e[0;32m\]\w\[\e[0m\] \[\e[0;97m\]\$\[\e[0m\] ' 16 | 17 | # Handles nonexistent commands. 18 | # If user has entered command which invokes non-available 19 | # utility, command-not-found will give a package suggestions. 20 | if [ -x /data/data/com.termux/files/usr/libexec/termux/command-not-found ]; then 21 | command_not_found_handle() { 22 | /data/data/com.termux/files/usr/libexec/termux/command-not-found "$1" 23 | } 24 | fi 25 | 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 KasRoudra 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MuxLock 2 | 3 | ### [+] Created By KasRoudra 4 | 5 | ### [+] Disclaimer : 6 | ***MuxLock is a tool to lock your termux. If you follow every instructions carefully, you can enjoy this tool. But if you do something beyond instruction, I will not be responsible for it!*** 7 | 8 | ### [+] Installation 9 | 10 | ```apt install git python -y``` 11 | 12 | ```git clone https://github.com/KasRoudra/muxlock``` 13 | 14 | ```cd muxlock``` 15 | 16 | ```python setup.py``` 17 | 18 | ### Or, Use Single Command 19 | ``` 20 | apt install python git -y && git clone https://github.com/KasRoudra/muxlock && cd muxlock && python setup.py 21 | ``` 22 | 23 | ### Example 24 | 25 | 26 | 27 | ## If you forget password, Enter "forgotten" in both input! 28 | 29 | #### [+] Enter "removelock" command to remove lock 30 | 31 | ## [+] Find Me on : 32 | 37 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | import os, time 3 | black="\033[0;30m" 4 | red="\033[0;31m" 5 | green="\033[0;32m" 6 | yellow="\033[0;33m" 7 | blue="\033[0;34m" 8 | purple="\033[0;35m" 9 | cyan="\033[0;36m" 10 | white="\033[0;37m" 11 | ask = green + '[' + white + '?' + green + '] '+ yellow 12 | success = green + '[' + white + '√' + green + '] ' 13 | error = red + '[' + white + '!' + red + '] ' 14 | info= yellow + '[' + white + '+' + yellow + '] '+ cyan 15 | logo=''' 16 | '''+green+''' __ __ _ _ 17 | '''+red+''' | \/ | | | | | 18 | '''+cyan+''' | \ / |_ ___ __ | ___ ___| | __ 19 | '''+yellow+''' | |\/| | | | \ \/ / | / _ \ / __| |/ / 20 | '''+blue+''' | | | | |_| |> <| |____ (_) | (__| < 21 | '''+purple+''' |_| |_|\__,_/_/\_\______\___/ \___|_|\_\ 22 | '''+green+''' 23 | ''' 24 | def main(): 25 | print(yellow+'''Choose one of the following options below! 26 | 27 | >>>1. Lock and Welcome Name-Text 28 | 29 | >>>2. Only Lock, no Welcome Name-Text 30 | 31 | >>>3. Only Welcome Name-Text, no lock 32 | 33 | >>>0. Exit the setup 34 | ''') 35 | 36 | while True: 37 | num= input(ask+" > ",) 38 | if num== "1": 39 | setlock() 40 | setwc() 41 | exit() 42 | elif num== "2": 43 | setlock() 44 | exit() 45 | elif num== "3": 46 | setwc() 47 | exit() 48 | elif num=="0": 49 | exit() 50 | else: 51 | print(error+"Wrong input") 52 | time.sleep(2) 53 | main() 54 | def setlock(): 55 | if os.system("command -v figlet > /dev/null 2>&1")!=0: 56 | print(info+"Installing figlet....") 57 | os.system("apt update && apt upgrade -y && apt install figlet -y") 58 | os.system("clear") 59 | print(logo) 60 | x=input("\n"+ask+"Enter your username > "+green) 61 | if x=="": 62 | print(error+"No name") 63 | time.sleep(2) 64 | setlock() 65 | y=input("\n"+ask+"Enter your password > "+green) 66 | if y=="": 67 | print(error+"No Password") 68 | time.sleep(2) 69 | setlock() 70 | data=''' 71 | figlet MuxLock 72 | loop=true 73 | 74 | while $loop; do 75 | echo -e "\e[1;;34mEnter the username:\e[0m" 76 | read usr 77 | echo -e "\e[1;;37mEnter the password:\e[0m" 78 | read pwd 79 | if [[ ($usr == "'''+x+'''" && $pwd == "'''+y+'''") ]]; then 80 | echo -e "\e[1;;46mLogin successful!\e[0m" 81 | sleep 1 82 | loop=false 83 | elif [[ ($usr == "forgotten" && $pwd == "forgotten") ]]; then 84 | bash ~/../usr/etc/forgotten.sh 85 | loop=false 86 | else 87 | echo -e "\e[1;;45mWrong username or password!\e[0m" 88 | fi 89 | done 90 | clear 91 | figlet '''+x 92 | m=input("\n"+ask+"Your favourite food/person name in case you forgotten password > "+green) 93 | if m=="": 94 | print(error+"No information") 95 | time.sleep(2) 96 | setlock() 97 | forgotdata=''' 98 | loop=true 99 | while $loop; do 100 | echo -e "Enter your favourite person/food name:" 101 | read forg 102 | if [ "$forg"="'''+m+'''" ]; then 103 | echo -e "Removing lock!" 104 | removelock 105 | sleep 2 106 | loop=false 107 | else 108 | echo -e "You can't reset password.\nClear your termux data!" 109 | fi 110 | done 111 | ''' 112 | if os.path.isfile("/data/data/com.termux/files/usr/etc/zshrc"): 113 | os.system("cp -r zshrc ~/../usr/etc") 114 | with open("/data/data/com.termux/files/usr/etc/zshrc", "a") as file2: 115 | file2.write(data) 116 | if os.path.isfile("/data/data/com.termux/files/usr/etc/bash.bashrc"): 117 | os.system("cp -r bash.bashrc ~/../usr/etc") 118 | with open("/data/data/com.termux/files/usr/etc/bash.bashrc", "a") as file2: 119 | file2.write(data) 120 | if not os.path.isfile("/data/data/com.termux/files/usr/etc/forgotten.sh"): 121 | os.system("touch /data/data/com.termux/files/usr/etc/forgotten.sh") 122 | with open("/data/data/com.termux/files/usr/etc/forgotten.sh", "w") as forgotten: 123 | forgotten.write(forgotdata) 124 | os.system("cp -r ~/muxlock/removelock ~/../usr/bin") 125 | print("\n"+success+"Lock setup successful. Enter \"removelock\" to remove lock") 126 | time.sleep(2) 127 | def setwc(): 128 | if os.system("command -v mpv > /dev/null 2>&1")!=0: 129 | print(info+"Installing mpv....") 130 | os.system("apt update && apt upgrade -y && apt install mpv -y") 131 | os.system("clear") 132 | print(logo) 133 | b=input("\n"+ask+"Enter your name to be displayed on home > "+green) 134 | if b=="": 135 | print(error+"No name") 136 | time.sleep(2) 137 | setwc() 138 | c=input("\n"+ask+"Enter some welcome text > "+green) 139 | if c=="": 140 | print(error+"No welcome text") 141 | time.sleep(2) 142 | setwc() 143 | wcdata="\nmpv ~/../usr/etc/wc.mp3\nclear\nfiglet "+b+"\necho "+c 144 | if os.path.isfile("/data/data/com.termux/files/usr/etc/zshrc"): 145 | with open("/data/data/com.termux/files/usr/etc/zshrc", "r") as file: 146 | data= file.read() 147 | if not data.find("MuxLock")!=-1: 148 | os.remove("/data/data/com.termux/files/usr/etc/zshrc") 149 | os.system("cp -r zshrc ~/../usr/etc") 150 | with open("/data/data/com.termux/files/usr/etc/zshrc", "a") as file2: 151 | file2.write(wcdata) 152 | if os.path.isfile("/data/data/com.termux/files/usr/etc/bash.bashrc"): 153 | with open("/data/data/com.termux/files/usr/etc/bash.bashrc", "r") as file: 154 | data= file.read() 155 | if not data.find("MuxLock")!=-1: 156 | os.remove("/data/data/com.termux/files/usr/etc/bash.bashrc") 157 | os.system("cp -r bash.bashrc ~/../usr/etc") 158 | with open("/data/data/com.termux/files/usr/etc/bash.bashrc", "a") as file2: 159 | file2.write(wcdata) 160 | os.system("cp -r wc.mp3 ~/../usr/etc") 161 | print("\n"+success+"Welcome setup successful!") 162 | 163 | os.system("chmod 777 *") 164 | os.system("cp -r motd ~/../usr") 165 | os.system("cp -r bash.bashrc ~/../usr") 166 | os.system("cp -r zshrc ~/../usr") 167 | os.system("rm -rf ~/../usr/etc/motd") 168 | os.system("clear") 169 | print(logo) 170 | main() --------------------------------------------------------------------------------