-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathipadb.py
More file actions
23 lines (17 loc) · 981 Bytes
/
ipadb.py
File metadata and controls
23 lines (17 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import subprocess
device_ip = '192.168.88.102' # Replace with the IP address of the remote device
# Connect to the remote device using ADB
adb_connect_command = ['adb', 'connect', '{}:5555'.format(device_ip)]
subprocess.call(adb_connect_command)
# Get the message from user input
message = "Fuck you I can hack your phone , do you know that "
# Construct the ADB command to send the message
adb_command = ['adb', '-s', '{}:5555'.format(device_ip), 'shell', 'input', 'text', '"{}"'.format(message)]
# Execute the ADB command to send the message over wireless
process = subprocess.Popen(adb_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
output, error = process.communicate(input='1\n') # Send '1' as input followed by Enter ('\n')
# Check if the command was successful
if process.returncode == 0:
print("Message successfully sent using wireless ADB")
else:
print("An error occurred while sending the message:", error.decode('utf-8'))