Skip to content

Commit

Permalink
fix/aldroid_pull_obbs_local_and_multiple_obbs
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianbuck committed Feb 7, 2025
1 parent 7b20088 commit d5bbab5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Formula/aldroid.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Aldroid < Formula
version "0.4.2"
version "0.4.3"

desc "This tool transforms Android APKs to make them debuggable and MITMable/Charlesable"
homepage "https://github.com/AppLovin/homebrew-Mobile-Tools"
Expand Down
19 changes: 12 additions & 7 deletions aldroid
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Example Usage: ./aldroid.sh d com.applovin.enterprise.apps.demoapp
#

VERSION=0.4.2
VERSION=0.4.3

usage() {
cat <<EOF
Expand Down Expand Up @@ -579,16 +579,16 @@ pull_obbs() {
fi

# Iterate over all OBBs we found and pull them from the device
for OBB in "$TEMP_OBBS"; do
while IFS= read -r OBB; do
# In case there are other files there make sure the obb files end in .obb
if [[ "${OBB: -4}" != ".obb" ]]; then
continue
fi

adb pull "/sdcard/Android/obb/$1/$OBB" "$OUTPUT_DIRECTORY/$OBB"
echo "Pulled $OBB into $OUTPUT_DIRECTORY/$OBB"
OBBS+=$OBB
done
OBBS+=($OBB)
done <<< "$TEMP_OBBS"

return 0
}
Expand All @@ -604,16 +604,17 @@ push_obbs() {
fi

echo "Pushing OBB(s)..."
echo "$OBBS"

# Safety for empty arrays as if it's empty we would push the entire folder
if [[ ${#OBBS[@]} -eq 0 ]]; then
echo "No OBBs to push"
return 0
fi

echo "${OBBS[@]}"

# Iterate all OBBs on $OBBS and push them back to the device
for OBB in "$OBBS"; do
for OBB in "${OBBS[@]}"; do
adb push "/tmp/$1/$OBB" "/sdcard/Android/obb/$1/$OBB"
done

Expand Down Expand Up @@ -884,7 +885,11 @@ case $SUBCOMMAND in

# If --obb was set, pull OBBs
if [[ $OBB_OPT_SET == true ]]; then
pull_obbs "$1" "$OUT_OPT_ARG"
if [[ -z "$OUT_OPT_ARG" ]]; then
pull_obbs "$1"
else
pull_obbs "$1" "$OUT_OPT_ARG"
fi
fi

exit 0
Expand Down

0 comments on commit d5bbab5

Please sign in to comment.