Skip to content

Commit c9c54fc

Browse files
author
adrianbartyczak
committed
Rename and adjust descriptions for all scripts in Mobile device management - Android
1 parent eb8eddd commit c9c54fc

File tree

9 files changed

+79
-92
lines changed

9 files changed

+79
-92
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Solutions for managing X11
6363

6464
Solutions for managing mobile devices
6565

66-
* [Watch for and print X and Y tap coordinates on an Android device screen.](scripts/mobile_device_management-android/hardware_management/getmobilescreentappos)
66+
* [Watch the X and Y screen tap positions of an Android device.](scripts/mobile_device_management-android/hardware_management/watchandroiddevscreentappos)
6767
* [Mount and unmount an MTP device.](scripts/mobile_device_management-generic/mounting/mntmtp)
6868

6969
## Text manipulation

scripts/mobile_device_management-android/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
## Application management
55

6-
* [sendsms](application_management/sendsms): Send an sms using an Android device.
6+
* [sendtextmesgviaandroiddev](application_management/sendtextmesgviaandroiddev): Send a text message via an Android device.
77

88
## Data retrieval
99

10-
* [getmobilecontactinfo](data_retrieval/getmobilecontactinfo): Get contact info from an Android device.
10+
* [getcontactinfofromandroiddev](data_retrieval/getcontactinfofromandroiddev): Get information of a contact from an Android device.
1111

1212
## Hardware management
1313

14-
* [getmobilescreentappos](hardware_management/getmobilescreentappos): Watch for and print X and Y tap coordinates on an Android device screen.
15-
* [turnmobilescreenoff](hardware_management/turnmobilescreenoff): Turn an Android device screen off if on.
16-
* [turnmobilescreenon](hardware_management/turnmobilescreenon): Turn an Android device screen on if off.
14+
* [watchandroiddevscreentappos](hardware_management/watchandroiddevscreentappos): Watch the X and Y screen tap positions of an Android device.
15+
* [turnandroiddevscreenoff](hardware_management/turnandroiddevscreenoff): Turn an Android device screen off.
16+
* [turnandroiddevscreenon](hardware_management/turnandroiddevscreenon): Turn an Android device screen on.
1717

scripts/mobile_device_management-android/application_management/sendsms

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env bash
2+
#
3+
# File:
4+
# sendtextmesgviaandroiddev
5+
#
6+
# Description:
7+
# Send a test message via an Android device.
8+
#
9+
# Usage:
10+
# sendtextmesgviaandroiddev <phone_number> <message>
11+
#
12+
# <message>: may contain "\n" for newlines
13+
#
14+
# Notes:
15+
# If the message fails to send and simply opens up the thread of the contact
16+
# of whom the message is being sent to, click the back button from the thread.
17+
#
18+
19+
if [ "$#" -lt 2 ]; then
20+
echo 'sendtextmesgviaandroiddev: invalid number of arguments' 1>&2
21+
exit 1
22+
fi
23+
24+
readonly PHONE_NUMBER="${1}"
25+
shift
26+
readonly MESSAGE="$(echo "${@}" | sed 's/\\n/${NL}/g')"
27+
28+
# Screen must be on for an sms to be sent using this method.
29+
isScreenOn="$(adb -d shell 'dumpsys power' | grep mScreenOn)"
30+
31+
# Exit if no device was found.
32+
if [ $? -eq 1 ]; then
33+
exit
34+
fi
35+
36+
if [[ "${isScreenOn##*=}" = *'false'* ]]; then
37+
adb -d shell 'input keyevent KEYCODE_POWER;'
38+
fi
39+
40+
adb -d shell "NL=$'\n' ; am start -a android.intent.action.SENDTO -d \
41+
sms:${PHONE_NUMBER} --es sms_body \"${MESSAGE}\" --ez exit_on_sent true; \
42+
input keyevent 66" >/dev/null
43+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
#
3+
# File:
4+
# getcontactinfofromandroiddev
5+
#
6+
# Description:
7+
# Get information of a contact from an Android device.
8+
#
9+
# Usage:
10+
# getcontactinfofromandroiddev <contact_phone_number_or_name>
11+
#
12+
13+
if [ "$#" -eq 0 ]; then
14+
echo 'getcontactinfofromandroiddev: contact phone number or name required' \
15+
1>&2
16+
exit 1
17+
fi
18+
19+
adb -d shell content query --uri \
20+
content://com.android.contacts/data/phones/filter/"${@}" | tr ',' '\n'
21+

scripts/mobile_device_management-android/data_retrieval/getmobilecontactinfo

Lines changed: 0 additions & 20 deletions
This file was deleted.

scripts/mobile_device_management-android/hardware_management/turnmobilescreenoff renamed to scripts/mobile_device_management-android/hardware_management/turnandroiddevscreenoff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22
#
33
# File:
4-
# turnmobilescreenoff
4+
# turnandroiddevscreenoff
55
#
66
# Description:
7-
# Turn an Android device screen off if on.
7+
# Turn an Android device screen off.
88
#
99

1010
readonly IS_SCREEN_ON="$(adb -d shell 'dumpsys power' | grep mScreenOn)"

scripts/mobile_device_management-android/hardware_management/turnmobilescreenon renamed to scripts/mobile_device_management-android/hardware_management/turnandroiddevscreenon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22
#
33
# File:
4-
# turnmobilescreenon
4+
# turnandroiddevscreenon
55
#
66
# Description:
7-
# Turn an Android device screen on if off.
7+
# Turn an Android device screen on,
88
#
99

1010
readonly IS_SCREEN_ON="$(adb -d shell 'dumpsys power' | grep mScreenOn)"

scripts/mobile_device_management-android/hardware_management/getmobilescreentappos renamed to scripts/mobile_device_management-android/hardware_management/watchandroiddevscreentappos

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#!/usr/bin/env bash
22
#
33
# File:
4-
# getmobilescreentappos
4+
# watchandroiddevscreentappos
55
#
66
# Description:
7-
# Watch for and print X and Y tap coordinates on an Android device screen.
7+
# Watch the X and Y screen tap positions of an Android device.
88
#
99
# Supplemental feature:
10-
# Output is converted from hexidecimal to decimal for easy readability.
10+
# Output is converted from hexidecimal to decimal.
1111
#
1212
# Usage:
13-
# getmobilescreentappos [seconds]
13+
# watchandroiddevscreentappos [seconds]
1414
#
15-
# [seconds]: (optional) number of seconds to watch for tap events
15+
# [seconds]: (optional) number of seconds to watch for tap events
1616
#
1717

1818
# ======= CONFIGURATIONS ==============

0 commit comments

Comments
 (0)