├── Monitor.py ├── app-release.apk ├── runadbcommands.py ├── screensleeps.py └── userlandinstallsetup.py /Monitor.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import time 3 | 4 | adb_path = r"C:\Users\Lukio-4090\OneDrive\Desktop\platform-tools\adb.exe" 5 | 6 | def get_adb_devices(): 7 | command = f"{adb_path} devices" 8 | result = subprocess.check_output(command, shell=True).decode("utf-8").strip() 9 | lines = result.split("\n")[1:] 10 | return [line.split()[0] for line in lines] 11 | 12 | def write_to_file(filename, device_ids): 13 | with open(filename, "w") as f: 14 | for device_id in device_ids: 15 | f.write(f"{device_id}\n") 16 | 17 | def read_from_file(filename): 18 | try: 19 | with open(filename, "r") as f: 20 | return [line.strip() for line in f.readlines()] 21 | except FileNotFoundError: 22 | open(filename, "w").close() # Create the file 23 | return [] 24 | 25 | def main(): 26 | while True: 27 | # Get connected devices 28 | connected_devices = get_adb_devices() 29 | 30 | # Read online, disconnected, and completed device lists from files 31 | online_devices = read_from_file("online_devices.txt") 32 | disconnected_devices = read_from_file("disconnected_devices.txt") 33 | completed_devices = read_from_file("completed_devices.txt") 34 | 35 | # Update online and disconnected device lists 36 | new_online_devices = [d for d in connected_devices if d not in online_devices] 37 | new_disconnected_devices = [d for d in online_devices if d not in connected_devices] 38 | 39 | online_devices = connected_devices 40 | disconnected_devices += new_disconnected_devices 41 | 42 | # Remove disconnected devices from the completed devices list 43 | for device_id in new_disconnected_devices: 44 | if device_id in completed_devices: 45 | completed_devices.remove(device_id) 46 | 47 | # Run adb commands on new online devices 48 | for device_id in new_online_devices: 49 | if device_id not in completed_devices: 50 | # Wait for 30 seconds if the device is still booting 51 | time.sleep(25) 52 | retries = 0 53 | while retries < 10: 54 | retries += 1 55 | try: 56 | subprocess.run(f"{adb_path} -s {device_id} shell dumpsys battery set temp 150", shell=True) 57 | subprocess.run(f"{adb_path} -s {device_id} shell dumpsys battery set level 100", shell=True) 58 | subprocess.run(f"{adb_path} -s {device_id} shell input swipe 500 1200 500 100", shell=True) 59 | time.sleep(3) 60 | subprocess.run(f"{adb_path} -s {device_id} shell input keyevent 3", shell=True) 61 | time.sleep(5) 62 | subprocess.run(f"{adb_path} -s {device_id} shell input keyevent 3", shell=True) 63 | subprocess.run(f"{adb_path} -s {device_id} shell input keyevent 3", shell=True) 64 | subprocess.run(f"{adb_path} -s {device_id} shell input keyevent 66", shell=True) 65 | time.sleep(1) 66 | subprocess.run(f"{adb_path} -s {device_id} shell input keyevent 66", shell=True) 67 | time.sleep(5) 68 | subprocess.run(f"{adb_path} -s {device_id} shell am start -n tech.ula/.MainActivity", shell=True) 69 | time.sleep(10) 70 | subprocess.run(f"{adb_path} -s {device_id} shell input keyevent 66", shell=True) 71 | time.sleep(3) 72 | subprocess.run(f"{adb_path} -s {device_id} shell input keyevent 66", shell=True) 73 | time.sleep(3) 74 | subprocess.run(f"{adb_path} -s {device_id} shell input text \"password\"", shell=True) 75 | time.sleep(3) 76 | subprocess.run(f"{adb_path} -s {device_id} shell input keyevent 66", shell=True) 77 | time.sleep(3) 78 | subprocess.run(f"{adb_path} -s {device_id} shell input text \"cd%sccminer\"", shell=True) 79 | subprocess.run(f"{adb_path} -s {device_id} shell input keyevent 66", shell=True) 80 | subprocess.run(f"{adb_path} -s {device_id} shell input text \"./start.sh\"", shell=True) 81 | subprocess.run(f"{adb_path} -s {device_id} shell input keyevent 66", shell=True) 82 | subprocess.run(f"{adb_path} -s {device_id} shell input keyevent 4", shell=True) 83 | subprocess.run(f"{adb_path} -s {device_id} shell svc power stayon true", shell=True) 84 | subprocess.run(f"{adb_path} -s {device_id} shell input keyevent 26", shell=True) 85 | completed_devices.append(device_id) 86 | break 87 | except subprocess.CalledProcessError: 88 | pass 89 | 90 | # Save device IDs to files 91 | write_to_file("online_devices.txt", online_devices) 92 | write_to_file("disconnected_devices.txt", disconnected_devices) 93 | write_to_file("completed_devices.txt", completed_devices) 94 | 95 | # Sleep for 2 seconds before running again 96 | time.sleep(2) 97 | 98 | if __name__ == "__main__": 99 | main() 100 | -------------------------------------------------------------------------------- /app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukewrightmain/PhoneScripts/9c99385a9388d8de815d7bad0f73aaf107248aed/app-release.apk -------------------------------------------------------------------------------- /runadbcommands.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import time 3 | 4 | adb_path = "C:\\Users\\Lukio-4090\\OneDrive\\Desktop\\platform-tools\\adb.exe" 5 | fastboot_path = "C:\\Users\\Lukio-4090\\OneDrive\\Desktop\\platform-tools\\fastboot.exe" 6 | 7 | def run_adb_command(device, command): 8 | subprocess.run([adb_path, "-s", device, "shell", command]) 9 | 10 | def run_fastboot_command(command): 11 | subprocess.run([fastboot_path, "-s", device, command]) 12 | 13 | def get_connected_devices(): 14 | output = subprocess.getoutput(f"{adb_path} devices") 15 | lines = output.strip().split("\n")[1:] 16 | devices = [line.split()[0] for line in lines] 17 | return devices 18 | 19 | if __name__ == "__main__": 20 | devices = get_connected_devices() 21 | for device in devices: 22 | print(f"Executing commands on device {device}") 23 | 24 | run_adb_command(device, "settings put global wifi_sleep_policy 2"), 25 | run_adb_command(device, "settings put global system_capabilities 100"), 26 | run_adb_command(device, "settings put global sem_enhanced_cpu_responsiveness 1") 27 | run_adb_command(device, "settings put global adaptive_battery_management_enable 0"), 28 | run_adb_command(device, "settings put global adaptive_power_saving_setting 0"), 29 | run_adb_command(device, "dumpsys deviceidle whitelist +tech.ula"), 30 | run_adb_command(device, "dumpsys battery set level 100"), # Removed extra "shell" 31 | run_adb_command(device, "settings put global window_animation_scale 0"), 32 | run_adb_command(device, "settings put global transition_animation_scale 0"), 33 | run_adb_command(device, "settings put global animator_duration_scale 0"), 34 | run_adb_command(device, "su -c echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"), 35 | run_adb_command(device, "settings put global background_limit 4") 36 | run_adb_command(device,"pm uninstall --user 0 com.verizon.dmclientupdate") 37 | run_adb_command(device,"pm uninstall --user 0 com.verizon.mips.services") 38 | run_adb_command(device,"pm uninstall --user 0 com.verizon.obdm_permissions") 39 | run_adb_command(device,"pm uninstall --user 0 com.verizon.obdm") 40 | run_adb_command(device,"pm uninstall --user 0 com.verizon.messaging.vzmsgs") 41 | run_adb_command(device,"pm uninstall --user 0 com.verizon.llkagent") 42 | run_adb_command(device,"pm uninstall --user 0 com.vcast.mediamanager") 43 | run_adb_command(device,"pm uninstall --user 0 com.vzw.hss.myverizon") 44 | run_adb_command(device,"pm uninstall --user 0 com.google.android.youtube") 45 | run_adb_command(device,"pm uninstall --user 0 com.google.android.apps.docs") 46 | run_adb_command(device,"pm uninstall --user 0 com.google.android.apps.maps") 47 | run_adb_command(device,"pm uninstall --user 0 com.google.android.calculator") 48 | run_adb_command(device,"pm uninstall --user 0 com.google.android.apps.photos") 49 | run_adb_command(device,"pm uninstall --user 0 com.google.android.calendar") 50 | run_adb_command(device,"pm uninstall --user 0 com.google.android.apps.chromecast.app") 51 | run_adb_command(device,"pm uninstall --user 0 com.google.android.apps.youtube.music") 52 | run_adb_command(device,"pm uninstall --user 0 com.google.android.gms.location.history") 53 | run_adb_command(device,"pm uninstall --user 0 com.google.android.videos") 54 | run_adb_command(device,"pm uninstall --user 0 com.google.android.setupwizard") 55 | run_adb_command(device,"pm uninstall --user 0 com.google.android.deskclock") 56 | run_adb_command(device,"pm uninstall --user 0 com.google.android.apps.tachyon") 57 | run_adb_command(device,"pm uninstall --user 0 com.google.android.apps.messaging") 58 | run_adb_command(device,"pm uninstall --user 0 com.google.android.googlequicksearchbox") 59 | run_adb_command(device,"pm uninstall --user 0 com.google.android.apps.googleassistant") 60 | run_adb_command(device,"pm uninstall --user 0 com.android.soundrecorder") 61 | run_adb_command(device,"pm uninstall --user 0 org.codeaurora.dialer") 62 | run_adb_command(device,"pm uninstall --user 0 com.android.contacts") 63 | run_adb_command(device,"pm uninstall --user 0 org.codeaurora.snapcam") 64 | run_adb_command(device,"pm uninstall --user 0 com.android.vending") 65 | run_adb_command(device,"pm uninstall --user 0 com.google.android.gm") 66 | run_adb_command(device,"pm uninstall --user 0 com.dreamgames.royalmatch") 67 | run_adb_command(device,"pm uninstall --user 0 net.supertreat.solitaire") 68 | run_adb_command(device,"pm uninstall --user 0 com.disney.disneyplus") 69 | run_adb_command(device,"pm uninstall --user 0 air.com.playtika.slotomania") 70 | run_adb_command(device,"pm uninstall --user 0 com.tripledot.solitaire") 71 | run_adb_command(device,"pm uninstall --user 0 com.facebook.appmanager") 72 | run_adb_command(device,"pm uninstall --user 0 tv.pluto.android") 73 | run_adb_command(device,"pm uninstall --user 0 com.einnovation.temu") 74 | run_adb_command(device,"pm uninstall --user 0 com.weather.Weather") 75 | run_adb_command(device,"pm uninstall --user 0 com.tripledot.woodoku") 76 | run_adb_command(device,"pm uninstall --user 0 com.king.candycrushsaga") 77 | run_adb_command(device,"pm uninstall --user 0 com.tubitv") 78 | run_adb_command(device,"pm uninstall --user 0 in.playsimple.wordtrip") 79 | run_adb_command(device,"pm uninstall --user 0 com.onedebit.chime") 80 | run_adb_command(device,"pm uninstall --user 0 me.lyft.android") 81 | run_adb_command(device,"pm uninstall --user 0 de.wetteronline.wetterapp") 82 | run_adb_command(device,"pm uninstall --user 0 com.dti.folderlauncher") 83 | run_adb_command(device,"pm uninstall --user 0 com.huub.viper") 84 | run_adb_command(device,"pm uninstall --user 0 com.odm.batterypreservation") 85 | run_adb_command(device,"pm uninstall --user 0 com.fiberlink.maas360.android.control") 86 | run_adb_command(device,"pm uninstall --user 0 com.facebook.katana") 87 | run_adb_command(device,"pm uninstall --user 0 com.moonactive.coinmaster") 88 | run_adb_command(device,"pm uninstall --user 0 air.com.buffalo_studios.newflashbingo") 89 | run_adb_command(device,"pm uninstall --user 0 in.playsimple.tripcross") 90 | run_adb_command(device,"pm uninstall --user 0 com.staplegames.dice") 91 | run_adb_command(device,"pm uninstall --user 0 com.gotv.nflgamecenter.us.lite") 92 | run_adb_command(device,"pm uninstall --user 0 com.apple.android.music") 93 | #run_adb_command(device,"pm uninstall --user 0 ") 94 | time.sleep(3) 95 | 96 | # Put the device into fastboot mode 97 | run_adb_command(device, "reboot bootloader") 98 | time.sleep(1) 99 | 100 | 101 | print("Done executing commands on all devices.") 102 | -------------------------------------------------------------------------------- /screensleeps.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import time 3 | 4 | adb_path = "C:\\Users\\Lukio-4090\\OneDrive\\Desktop\\platform-tools\\adb.exe" 5 | 6 | def run_adb_command(device, command): 7 | subprocess.run([adb_path, "-s", device, "shell", command]) 8 | 9 | def get_connected_devices(): 10 | output = subprocess.getoutput(f"{adb_path} devices") 11 | lines = output.strip().split("\n")[1:] 12 | devices = [line.split()[0] for line in lines] 13 | return devices 14 | 15 | if __name__ == "__main__": 16 | devices = get_connected_devices() 17 | for device in devices: 18 | print(f"Executing commands on device {device}") 19 | 20 | run_adb_command(device, "svc power stayon true") 21 | time.sleep(1) 22 | run_adb_command(device, "input keyevent 26") 23 | 24 | print("Done executing commands on all devices.") 25 | -------------------------------------------------------------------------------- /userlandinstallsetup.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import requests 3 | import threading 4 | import time 5 | import os 6 | 7 | # Define the path to the adb and fastboot executables 8 | adb_path = r"C:\Users\Lukio-4090\OneDrive\Desktop\platform-tools\adb.exe" 9 | fastboot_path = r"C:\Users\Lukio-4090\OneDrive\Desktop\platform-tools\fastboot.exe" 10 | 11 | # Function to get a list of connected devices 12 | def get_connected_devices(): 13 | result = subprocess.run([adb_path, 'devices'], capture_output=True, text=True) 14 | devices = result.stdout.splitlines() 15 | device_list = [device.split('\t')[0] for device in devices if '\tdevice' in device] 16 | return device_list 17 | 18 | # Function to simulate a tap on the screen 19 | def tap_screen(device_id, x, y): 20 | subprocess.run([adb_path, '-s', device_id, 'shell', 'input', 'tap', str(x), str(y)]) 21 | 22 | # Function to type text 23 | def type_text(device_id, text): 24 | subprocess.run([adb_path, '-s', device_id, 'shell', 'input', 'text', text]) 25 | 26 | def long_press(device_id, x, y, duration): 27 | subprocess.run([adb_path, '-s', device_id, 'shell', 'input', 'swipe', str(x), str(y), str(x), str(y), str(duration)]) 28 | 29 | def run_in_userland(device_id, command): 30 | # Replace spaces with '%s' and escape special characters 31 | formatted_command = command.replace(' ', '%s').replace('&', '\&').replace('|', '\|') 32 | # Enter the command in the terminal 33 | subprocess.run([adb_path, '-s', device_id, 'shell', 'input', 'text', formatted_command]) 34 | # Send the Enter key event 35 | subprocess.run([adb_path, '-s', device_id, 'shell', 'input', 'keyevent', '66']) 36 | time.sleep(10) 37 | 38 | def setup_userland(device_id): 39 | # Launch Userland 40 | subprocess.run([adb_path, '-s', device_id, 'shell', 'am start -n tech.ula/.MainActivity']) 41 | time.sleep(10) # Wait for Userland to launch 42 | 43 | # Interact with the UserLAnd App 44 | # Tap on "Ubuntu" option 45 | tap_screen(device_id, 328, 1036) # Replace with actual coordinates 46 | time.sleep(2) 47 | 48 | # Tap on "OK" and "ALLOW" 49 | tap_screen(device_id, 557, 919) # Replace with coordinates for "OK" 50 | time.sleep(1) 51 | tap_screen(device_id, 346, 863) # Replace with coordinates for "ALLOW" 52 | time.sleep(1) 53 | 54 | # Enter username, password, and VNC password 55 | tap_screen(device_id, 240, 667) 56 | time.sleep(2) 57 | type_text(device_id, 'x') # Enter username 58 | time.sleep(2) 59 | tap_screen(device_id, 171, 590) # Move to next field 60 | time.sleep(2) 61 | type_text(device_id, 'password') # Enter password 62 | time.sleep(2) 63 | tap_screen(device_id, 198.6, 737.5) # Move to VNC password field 64 | time.sleep(2) 65 | type_text(device_id, 'password') # Enter VNC password 66 | time.sleep(2) 67 | 68 | # Tap on "CONTINUE" 69 | tap_screen(device_id, 526, 828) # First "CONTINUE" 70 | time.sleep(2) 71 | tap_screen(device_id, 505, 991) # Second "CONTINUE" 72 | time.sleep(1800) # Wait for 5 minutes. 73 | 74 | # Close Userland (force stop) 75 | subprocess.run([adb_path, '-s', device_id, 'shell', 'am force-stop tech.ula']) 76 | time.sleep(5) 77 | 78 | # Re-launch Userland to open terminal 79 | subprocess.run([adb_path, '-s', device_id, 'shell', 'am start -n tech.ula/.MainActivity']) 80 | time.sleep(10) 81 | 82 | # Tap to setup AutoSTART TERMINAL 83 | tap_screen(device_id, 345.5, 128) # Tap Top incase of messages. 84 | time.sleep(1) 85 | long_press(device_id, 344.5, 1042.3, 2000) 86 | tap_screen(device_id, 433.3, 1104.3) #Tap App INFO 87 | time.sleep(1) 88 | tap_screen(device_id, 167.8, 316.7) 89 | time.sleep(1) 90 | tap_screen(device_id, 167.8, 316.7) 91 | time.sleep(1) 92 | tap_screen(device_id, 229.6, 1216.1) 93 | time.sleep(1) 94 | 95 | # Close Userland (force stop) 96 | subprocess.run([adb_path, '-s', device_id, 'shell', 'am force-stop tech.ula']) 97 | time.sleep(5) 98 | 99 | # Re-launch Userland to open terminal 100 | subprocess.run([adb_path, '-s', device_id, 'shell', 'am start -n tech.ula/.MainActivity']) 101 | time.sleep(10) 102 | 103 | # Run the setup commands in the terminal 104 | ul_setup_commands = [ 105 | 'password', 106 | ] 107 | 108 | # Run the setup commands in the terminal 109 | ul_setup_commands2 = [ 110 | 'curl -o- -k https://raw.githubusercontent.com/lukewrightmain/VerusCliMining/main/install.sh | bash', 111 | ] 112 | 113 | for command in ul_setup_commands: 114 | run_in_userland(device_id, command) 115 | time.sleep(10) # Adjust this based on your command execution time 116 | 117 | for command in ul_setup_commands2: 118 | run_in_userland2(device_id, command) 119 | time.sleep(10) # Adjust this based on your command execution time 120 | 121 | def run_in_userland(device_id, command): 122 | # No need to escape '&' and '|' 123 | formatted_command = command.replace(' ', '%s') 124 | # Enter the command in the terminal 125 | subprocess.run([adb_path, '-s', device_id, 'shell', 'input', 'text', formatted_command]) 126 | # Send the Enter key event 127 | subprocess.run([adb_path, '-s', device_id, 'shell', 'input', 'keyevent', '66']) 128 | time.sleep(10) 129 | 130 | def run_in_userland2(device_id, command): 131 | # Escape special characters 132 | escaped_command = command.replace(' ', '%s').replace('&', '\\&').replace('|', '\\|') 133 | 134 | # Enter the command in the terminal 135 | subprocess.run([adb_path, '-s', device_id, 'shell', 'input', 'text', escaped_command]) 136 | # Send the Enter key event 137 | subprocess.run([adb_path, '-s', device_id, 'shell', 'input', 'keyevent', '66']) 138 | time.sleep(1800) 139 | 140 | 141 | def reboot_into_fastboot(device_id): 142 | subprocess.run([adb_path, '-s', device_id, 'reboot', 'bootloader']) 143 | print(f"Rebooting {device_id} into fastboot mode...") 144 | time.sleep(10) 145 | 146 | def run_fastboot_command(device_id, command): 147 | subprocess.run([fastboot_path, '-s', device_id] + command.split()) 148 | print(f"Fastboot command executed on {device_id}.") 149 | 150 | def reboot_phone(device_id): 151 | subprocess.run([fastboot_path, '-s', device_id, 'reboot']) 152 | print(f"Rebooting {device_id}...") 153 | 154 | 155 | def device_setup(device_id, apk_file_path): 156 | print(f"Setting up device: {device_id}") 157 | 158 | # Install the APK on the current device 159 | subprocess.run([adb_path, '-s', device_id, 'install', apk_file_path]) 160 | print(f"APK installed on {device_id}.") 161 | 162 | setup_userland(device_id) 163 | 164 | reboot_into_fastboot(device_id) 165 | time.sleep(5) 166 | run_fastboot_command(device_id, r'oem off-mode-charge 0') 167 | time.sleep(3) 168 | reboot_phone(device_id) 169 | 170 | print(f'Device {device_id} setup complete.') 171 | 172 | def main(): 173 | devices = get_connected_devices() 174 | 175 | # Define the APK URL and download it 176 | apk_url = 'https://github.com/CypherpunkArmory/UserLAnd/releases/download/v2.8.3/app-release.apk' 177 | apk_file_name = apk_url.split('/')[-1] 178 | apk_file_path = os.path.join(os.getcwd(), apk_file_name) 179 | 180 | response = requests.get(apk_url) 181 | if response.status_code == 200: 182 | with open(apk_file_path, 'wb') as f: 183 | f.write(response.content) 184 | print("APK downloaded successfully.") 185 | else: 186 | print(f"Failed to download APK: {response.status_code}") 187 | return # Exit if download fails 188 | 189 | threads = [] 190 | for device_id in devices: 191 | thread = threading.Thread(target=device_setup, args=(device_id, apk_file_path)) 192 | threads.append(thread) 193 | thread.start() 194 | 195 | for thread in threads: 196 | thread.join() 197 | 198 | if __name__ == "__main__": 199 | main() 200 | 201 | print('Userland setup and ccminer installation complete on all connected devices.') --------------------------------------------------------------------------------