-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirestarter2.py
93 lines (77 loc) · 3.35 KB
/
firestarter2.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import os
from tkinter import *
from tkinter import filedialog
class FireStarter:
def __init__(self, master):
self.master = master
master.title("FireStarter")
# Create a label to display output
self.label = Label(master, text="Output:")
self.label.pack()
# Create a text box to display output
self.text = Text(master, height=10, width=40)
self.text.pack()
# Create a button to connect to ADB
self.button_connect = Button(master, text="Connect", command=self.connect)
self.button_connect.pack()
# Create a button to start ADB server
self.button_start_server = Button(master, text="Start Server", command=self.start_server)
self.button_start_server.pack()
# Create a button to kill ADB server
self.button_kill_server = Button(master, text="Kill Server", command=self.kill_server)
self.button_kill_server.pack()
# Create a button to install an APK
self.button_install_apk = Button(master, text="Install APK", command=self.install_apk)
self.button_install_apk.pack()
# Create a button to reboot the device
self.button_reboot = Button(master, text="Reboot", command=self.reboot)
self.button_reboot.pack()
# Method to run an ADB command and display its output
def run_command(self, command):
# Clear the output text box
self.text.delete('1.0', END)
# Open a new process to run the command
process = os.popen(command)
# Read the output of the process
output = process.read()
# Insert the output into the text box
self.text.insert(END, output)
# Method to connect to ADB
def connect(self):
# Construct the ADB command to connect to the device
command = 'adb connect ' + self.textbox.get()
# Run the ADB command and display its output
self.run_command(command)
# Method to start the ADB server
def start_server(self):
# Construct the ADB command to start the server
command = 'adb start-server'
# Run the ADB command and display its output
self.run_command(command)
# Method to kill the ADB server
def kill_server(self):
# Construct the ADB command to kill the server
command = 'adb kill-server'
# Run the ADB command and display its output
self.run_command(command)
# Method to install an APK
def install_apk(self):
# Open a file dialog to select the APK file
filename = filedialog.askopenfilename(initialdir='C:\\', title='Select your APK..', filetypes=(('APK files', '*.apk'),))
# If a file was selected
if filename:
# Construct the ADB command to install the APK
command = 'adb install "' + filename + '"'
# Run the ADB command and display its output
self.run_command(command)
# Display a message box to indicate that the APK was installed
messagebox.showinfo(title=None, message='.APK is Installed')
# Method to reboot the device
def reboot(self):
# Construct the ADB command to reboot the device
command = 'adb reboot'
# Run the ADB command and display its output
self.run_command(command)
# Create a new Tkinter window
root = Tk()
# Create a new instance of the FireStarter class