Skip to content

Commit

Permalink
v0.2.5
Browse files Browse the repository at this point in the history
- Finally setup a proper testing environment
- Major bug fixes
  • Loading branch information
Hifumi committed May 24, 2022
1 parent c136913 commit 1b9821f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 27 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Droid
Droid is an Android remote communications script created to communicate with an Android device on the local network over the Android debug bridge (adb).
Droid is a remote communications script created to communicate with an Android device on the local network over the Android debug bridge (adb) in a much easier way

NOTE: Script does require Android platform tools (adb) to be installed

## Usage
```bash
python3 droid.py
python3 droid.py -ip 127.0.0.1
```

## Options
Expand All @@ -15,7 +17,6 @@ python3 droid.py
-d, --disconnect | Disconnects from the Android device
-r, --reboot | Remotely reboots the Android device
-p, --package | The package name of the APK (ex: com.android.ui)
-i, --info | Learn more about the Android device
-dn, --download | Download a file from the Android device
```

Expand All @@ -30,9 +31,9 @@ This example connects to the Android device (127.0.0.1 is an example), removes t
python3 droid.py -ip 127.0.0.1 -c -rm -p com.android.ui -up ~/Downloads/test_apk_v1.apk
```

This example connects to the Android device (127.0.0.1 is an example), downloads an image, and then shows information about the Android device
This example connects to the Android device (127.0.0.1 is an example) and downloads an image
```bash
python3 droid.py -ip 127.0.0.1 --download /sdcard/cool_pic.png -i
python3 droid.py -ip 127.0.0.1 --download /sdcard/cool_pic.png
```

Once you're finished working within the Android environment, you can run this command to disconnect:
Expand Down
36 changes: 14 additions & 22 deletions droid.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
parser.add_argument('-d', '--disconnect', help="Disconnects from the Android device", action='store_true', default=False, required=False)
parser.add_argument('-r', '--reboot', help="Remotely reboots the Android device", action='store_true', default=False, required=False)
parser.add_argument('-p', '--package', help="The package name of the APK (ex: com.android.ui)", default=None, required=False)
parser.add_argument('-i', '--info', help="Learn more about the Android device", action='store_true', default=False, required=False)
parser.add_argument('-dn', '--download', help="Download a file from the Android device", action='store_true', default=False, required=False)
parser.add_argument('-dn', '--download', help="Download a file from the Android device", default=None, required=False)

args = parser.parse_args()

author = "Hifumi1337"
version = "0.1.4"
version = "0.2.5"

if platform.system() == 'Darwin':
adb = "$HOME/Library/Android/sdk/platform-tools/adb"
Expand All @@ -37,7 +36,7 @@ def banner(self):
██. ██ ▐█•█▌▐█▌.▐▌▐█▌██. ██
▀▀▀▀▀• .▀ ▀ ▀█▄▀▪▀▀▀▀▀▀▀▀•
{author} | v{version}
{author} | v{version}
""")

def connect_ip(self):
Expand Down Expand Up @@ -88,13 +87,6 @@ def reboot(self):
os.system(f"{adb} reboot {ip_address}")
except:
print("Device is unresponsive. Please check the connection")

def info(self):
try:
ip_address = args.ip_address
os.system(f"{adb} usb")
except:
print("Unable to access Android device information")

def download(self):
try:
Expand All @@ -110,17 +102,17 @@ def download(self):
if args.connect:
D.connect_ip()

if args.remove and args.package:
D.remove_apk()
if args.remove and args.package:
D.remove_apk()

if args.upload:
D.upload_apk()

if args.upload:
D.upload_apk()
if args.download:
D.download()

if args.reboot:
D.reboot()

if args.info:
D.info()
if args.reboot:
D.reboot()

if args.disconnect:
D.disconnect_ip()
if args.disconnect:
D.disconnect_ip()

0 comments on commit 1b9821f

Please sign in to comment.