def screen_brightness(status): if status == "get": term(adb + " shell settings get system screen_brightness") elif 255 >= status >= 0: term(adb + " shell settings put system screen_brightness " + str(status)) else: return error
def key_event(keycode,number): if keycode == "home": keycode = str(3) elif keycode == "back": keycode = str(4) elif keycode == "swich": keycode = str(187) elif keycode == "menu": keycode = str(82) elif keycode == "mute": keycode = str(164) elif keycode == "assistant": keycode = str(231) elif keycode == "power": keycode = str(26) elif keycode == "del": keycode = str(67) elif keycode == "volup": keycode = str(24) elif keycode == "voldown": keycode = str(25) if number == "": number = 1 while number <= 0: term(adb + " shell input " + str(keycode)) number -= 1
def virtual_plug_on(status): if status == True: term(adb + " shell dumpsys battery plug") elif status == False: term(adb + " shell dumpsys battery unplug") else: return error
def bt_on(status): if status == True: term(adb + " shell service call bluetooth_manager 6") elif status == False: term(adb + " shell service call bluetooth_manager 9") else: return error
def wifi_on(status): if status == True: term(adb + " shell svc wifi enable") elif status == False: term(adb + " shell svc wifi disable") else: return error
def install(path,method): if method == "": term(adb + " install " + str(path)) elif method == "r": term(adb + " install -r " + str(path)) elif method == "g": term(adb + " install -g " + str(path)) elif method == "rg" or method == "gr": term(adb + " install -r -g " + str(path)) else: term(adb + " install " +str(method) + " " + str(path))
def reboot(method): if method == "normal": term(adb + " shell reboot") elif method == "recovey": term(adb + " shell reboot recovey") elif method == "fastboot": term(adb + " shell reboot fastboot") elif method == "edl": term(adb + " shell reboot edl") else: term(adb + " shell reboot" + str(method))
def get_diretorio_atual(self): """ Pega o endereço de salvamento atual. :return: String. """ term("pwd > out.txt") file = open("out.txt", 'r') src = file.read().split('\n')[0] + '/' file.close() term("rm out.txt") return src
def screen_stay_on(status): if status == "ture": term(adb + " shell svc power stayon true") elif status == "false": term(adb + " shell svc power stayon false") elif status == "usb": term(adb + " shell svc power stayon usb") elif status == "ac": term(adb + " shell svc power stayon ac") elif status == "wireless": term(adb + " shell svc power stayon wireless") else: return error
def uninstall(packagename,method): if method == "": term(adb + " uninstall " + str(packagename)) elif method == "k": term(adb + " uninstall -k " + str(packagename)) else: term(adb + " uninstall -" +str(method) + " " + str(packagename))
def rec(top,keep,fname): if top == "": top = presetpath if fname == "": fname = "sc" term(adb + " shell screenrecord /sdcard/" + str(fname) + ".mp4") term(adb + " pull /sdcard/" + str(fname) + ".mp4" + str(top)) if keep == "n" or keep == "no" or keep == "": term(adb + " shell rm -rf /sdcard/" + str(fname) + ".mp4")
def cap(top,keep,fname): if top == "": top = presetpath if fname == "": fname = "sc" term(adb + " shell screencap -p /sdcard/" + str(fname) + ".png") term(adb + " pull /sdcard/" + str(fname) + ".png " + str(top)) if keep == "n" or keep == "no": term(adb + " shell rm -rf /sdcard/" + str(fname) + ".png")
def path(packagename): term(adb + " shell pm path " + str(packagename))
def shutdown(self): term(adb + " shell reboot -p")
def shell(cmd): term(adb + " shell " + str(cmd)) ##
def list(method): if method == "": term(adb + " shell pm list packages") elif method == "3" or method == "third": term(adb + " shell pm list packages -3") elif method == "s" or method == "system" or method == "builtin": term(adb + " shell pm list packages -s") elif method == "e" or method == "enabled": term(adb + " shell pm list packages -e") elif method == "d" or method == "disabled": term(adb + " shell pm list packages -d") else: term(adb + " shell pm list packages " + str(method))
def netadb(port): if port == "": port = 5555 term(adb + " tcpip " + str(port)) port = ""
def battery_level_set(level): term(adb + " shell dumpsys battery set level " + str(level))
#!/usr/bin/env python3 from checker import checker from colorama import Fore from os import system as term term('clear') phile = input('Type the filename of text file with proxies within: [] ') filer = open(phile) filer = list(filer) checker = checker() for item in filer: if checker.check(item): print(Fore.RED + 'Bad proxy', item) else: phile = open('good.txt', 'a') phile.write(item) print(Fore.GREEN + 'Good proxy', item)
def list(self): term(adb + " devices")
def restart(self): term(adb + " restart-server")
def kill(self): term(adb + " kill-server")
def sdcard(top): if top == "": top = presetpath term(adb + " pull /sdcard " + str(output))
def start(self): #有(self)的则在程序代码中输入("self"),如函数start(self),则输入start("self"),下同 term(adb + " start-server")
def power_key(self): term(adb + " shell input keyevent 26")
def clear(): if os.name == "nt": term("cls") else: term("clear")
def connect(ip,port): if port == "": #为无输入设置默认值,下同 port = 5555 term(adb + " connect " + str(ip) + ":" + str(port)) ip = "" #重置ip的状态,下同 port = ""
from os import system as term term('cp XRead.py /usr/bin/xread')
def disconnect(ip,port): if port == "": port = 5555 term(adb + " disconnect " + str(ip) + ":" + str(port)) ip = "" port = ""
def screen_off_timeout(status): if status == "get": term(adb + " shell settings get system screen_off_timeout") else: term(adb + " shell settings put system screen_off_timeout " + str(status))
def reset(self): term(adb + " shell dumpsys battery reset")