Skip to content

Commit

Permalink
Merge pull request #200 from IntergalacticPenguin/fix/1.0.0
Browse files Browse the repository at this point in the history
Fixes for 1.0.0
  • Loading branch information
IGPenguin authored Sep 11, 2020
2 parents 5254f6f + b77c857 commit dacb632
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions android/alaunch
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ android_choose_device
if [[ "$1" == "-s" ]]; then
PACKAGES=($(adb -s "$SELECTED_DEVICE" shell pm list packages -f | sed -e 's/.*=//' | sort))
elif [[ -n "$1" ]]; then
PACKAGE=$1
adb -s "$SELECTED_DEVICE" shell pm list packages -f | sed -e 's/.*=//' | grep -wx "$PACKAGE" &> /dev/null || { echo "🤷‍ Package \"$PACKAGE\" not installed"; exit; }
PACKAGE="$1"
android_is_package_installed "$PACKAGE"
else
PACKAGES=($(adb -s "$SELECTED_DEVICE" shell pm list packages -f -3 | sed -e 's/.*=//' | sort))
fi
Expand Down
6 changes: 3 additions & 3 deletions android/arecord
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ ctrlc(){
FILENAME=$1
fi
echo "📁 Copying the video from the device..."
adb -s "$SELECTED_DEVICE" pull "$DEVICE_FILE_PATH" ~/Desktop/"$FILENAME".mp4 &> /dev/null
adb -s "$SELECTED_DEVICE" shell rm "$DEVICE_FILE_PATH" &> /dev/null
adb -s "$SELECTED_DEVICE" pull "$DEVICE_FILE_PATH"/output.mp4 ~/Desktop/"$FILENAME".mp4 &> /dev/null
adb -s "$SELECTED_DEVICE" shell rm "$DEVICE_FILE_PATH"/output.mp4 &> /dev/null
echo "✅ Saved into ~/Desktop/$FILENAME.mp4"
fi
exit
Expand All @@ -30,4 +30,4 @@ android_get_storage_location_per_SDK "$SDK"
RECORDING=true
echo "📹 Recording screen on $SELECTED_DEVICE, stop it with ctrl^c"
adb -s "$SELECTED_DEVICE" shell settings put system show_touches 1
adb -s "$SELECTED_DEVICE" shell screenrecord "$DEVICE_FILE_PATH"
adb -s "$SELECTED_DEVICE" shell screenrecord "$DEVICE_FILE_PATH"/output.mp4
6 changes: 3 additions & 3 deletions android/ascreenshot
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ screenshot(){
android_get_storage_location_per_SDK "$SDK"

echo "📸 Saving screenshot into $FILENAME..."
adb -s "$1" shell screencap -p "$DEVICE_FILE_PATH"
adb -s "$1" pull "$DEVICE_FILE_PATH" ~/Desktop/"$FILENAME" &>/dev/null
adb -s "$1" shell rm "$DEVICE_FILE_PATH"
adb -s "$1" shell screencap -p "$DEVICE_FILE_PATH"/output.png
adb -s "$1" pull "$DEVICE_FILE_PATH"/output.png ~/Desktop/"$FILENAME" &>/dev/null
adb -s "$1" shell rm "$DEVICE_FILE_PATH"/output.png
}

screenshot_all(){
Expand Down
5 changes: 4 additions & 1 deletion android/awipe
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ prompt(){
}

wipe_data(){
android_device_info "$SELECTED_DEVICE"
android_get_storage_location_per_SDK "$SDK"

echo "🔥 Deleting everything in mnt/sdcard..."
adb -s "$SELECTED_DEVICE" shell rm -rf mnt/sdcard/*
adb -s "$SELECTED_DEVICE" shell rm -rf "$DEVICE_FILE_PATH/*" &>/dev/null
}

wipe_apps(){
Expand Down
3 changes: 2 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
🩹 fix Android 11 - arecord, ascreenshot, akill, aerase
🩹 fix alaunch installed package detection
🩹 fix awipe on Android 11
6 changes: 3 additions & 3 deletions common_tools
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ android_get_foreground_package_sdk_low(){

android_get_storage_location_per_SDK(){
if (( "$1" < 30 )); then
DEVICE_FILE_PATH="/mnt/sdcard/output.png"
DEVICE_FILE_PATH="/mnt/sdcard"
else
DEVICE_FILE_PATH="/storage/self/primary/output.png"
DEVICE_FILE_PATH="/storage/self/primary"
fi
}

Expand All @@ -161,7 +161,7 @@ android_is_package_installed() {
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo "🤷‍ Package \"$1\" is not installed."
exit
exit 1
fi
}

Expand Down

0 comments on commit dacb632

Please sign in to comment.