Example #1
0
 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
Example #2
0
 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
Example #3
0
 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
Example #4
0
 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
Example #5
0
 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
Example #6
0
 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))
Example #7
0
 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))
Example #8
0
    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
Example #9
0
 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
Example #10
0
 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))
Example #11
0
 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")
Example #12
0
 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")
Example #13
0
 def path(packagename):
     term(adb + " shell pm path " + str(packagename))
Example #14
0
 def shutdown(self):
     term(adb + " shell reboot -p")
Example #15
0
 def shell(cmd):
     term(adb + " shell " + str(cmd))    ##
Example #16
0
 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))
Example #17
0
 def netadb(port):
     if port == "":
         port = 5555
     term(adb + " tcpip " + str(port))
     port = ""
Example #18
0
 def battery_level_set(level):
     term(adb + " shell dumpsys battery set level " + str(level))
Example #19
0
#!/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)
Example #20
0
 def list(self):
     term(adb + " devices")
Example #21
0
 def restart(self):
     term(adb + " restart-server")
Example #22
0
 def kill(self):
     term(adb + " kill-server")
Example #23
0
 def sdcard(top):
     if top == "":
         top = presetpath
     term(adb + " pull /sdcard " + str(output))
Example #24
0
 def start(self):    #有(self)的则在程序代码中输入("self"),如函数start(self),则输入start("self"),下同
     term(adb + " start-server")
Example #25
0
 def power_key(self):
     term(adb + " shell input keyevent 26")
Example #26
0
def clear():
    if os.name == "nt":
        term("cls")
    else:
        term("clear")
Example #27
0
 def connect(ip,port):
     if port == "":    #为无输入设置默认值,下同
         port = 5555
     term(adb + " connect " + str(ip) + ":" + str(port))
     ip = ""    #重置ip的状态,下同
     port = ""
Example #28
0
from os import system as term

term('cp XRead.py /usr/bin/xread')
Example #29
0
 def disconnect(ip,port):
     if port == "":
         port = 5555
     term(adb + " disconnect " + str(ip) + ":" + str(port))
     ip = ""
     port = ""
Example #30
0
 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))
Example #31
0
 def reset(self):
     term(adb + " shell dumpsys battery reset")