-
Notifications
You must be signed in to change notification settings - Fork 0
/
root.py
32 lines (27 loc) · 1.01 KB
/
root.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from subprocess import run, PIPE
import command
def root():
print("Which option would you like?")
print("1. Root wtih MM Root\t\t\t\t", "2. Root with LP Root")
ins = int(input(": "))
def con(value, name):
if value.returncode == 0:
print(value.stdout)
print(f"Launch TWRP and flashh {name}. Which should be available on your sdcard")
else:
print(value.stderr)
if ins == 1:
print("Rooting with MM Root file....")
root = run((command.adb, "push", "mm-root.zip", "/sdcard/"), stdout=PIPE, stderr=PIPE, text=True)
mm = "MM-root.zip"
con(root, mm)
elif ins == 2:
print("Rooting with LP Root file....")
root = run((command.adb, "push", "lp-root.zip", "/sdcard/"), stdout=PIPE, stderr=PIPE, text=True)
lp = "lp-root.zip"
con(root, lp)
reboot = run((command.adb, "reboot-bootloader"), stdout=PIPE, stderr=PIPE, text=True)
r = None
con(reboot, r)
else:
exit()