Skip to content

Commit

Permalink
Update android-tools-appimage.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Samueru-sama authored Apr 14, 2024
1 parent dab782a commit c7bf2e5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions android-tools-appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mkdir -p "./$APP/tmp" && cd "./$APP/tmp" || exit
# DOWNLOAD THE ARCHIVE
wget "$SITE/platform-tools-latest-linux.zip" && unzip -qq ./*.zip
cd ..
mkdir "./$APP.AppDir" && mv --backup=t ./tmp/*/* ./$APP.AppDir
mkdir -p "./$APP.AppDir/usr/bin" && mv --backup=t ./tmp/*/* "./$APP.AppDir/usr/bin"
cd ./$APP.AppDir || exit

# DESKTOP ENTRY
Expand All @@ -19,8 +19,7 @@ cat >> ./Android-$APP.desktop << 'EOF'
Name=Android-platform-tools
Type=Application
Icon=Android
TryExec=android-tools-appimage
Exec="sh -ic 'android-tools-appimage adb shell"";"" exec bash'"
Exec="sh -ic 'android-tools adb shell"";"" exec bash'"
Categories=Utility;
Terminal=true
EOF
Expand All @@ -32,7 +31,7 @@ ln -s ./Android.png ./.DirIcon
# AppRun
cat >> ./AppRun << 'EOF'
#!/bin/bash
CURRENTDIR="$(readlink -f "$(dirname "$0")")"
CURRENTDIR="$(readlink -f "$(dirname "$0")")"/usr/bin/
UDEVNOTICE=$(echo "If you get errors it might be because of missing android udev rules, use --getudev to install them")
if [ "$1" = "adb" ]; then
"$CURRENTDIR"/adb "${@:2}" || echo "$UDEVNOTICE"
Expand Down Expand Up @@ -65,12 +64,17 @@ else
echo "Error: No command specified, try \"./*tools.AppImage adb shell\" for example"
echo "You can also use aliases or wrapper scripts to not write ./*tools.AppImage every time"
echo "$UDEVNOTICE"
echo "Falling back to example adb shell:"
read -p "Do you wan to run adb shell? (y/n): " yn
if [[ "$yn" == [yY]* ]]; then
"$CURRENTDIR"/adb shell
fi
fi
EOF
chmod a+x ./AppRun

# MAKE APPIMAGE
APPVERSION=$(cat source.properties | grep vision | awk -F = '{print $NF; exit}')
APPVERSION=$(cat ./usr/bin/source.properties | grep vision | awk -F = '{print $NF; exit}')
cd ..
wget -q $(wget -q https://api.github.com/repos/probonopd/go-appimage/releases -O - | grep -v zsync | grep -i continuous | grep -i appimagetool | grep -i x86_64 | grep browser_download_url | cut -d '"' -f 4 | head -1) -O appimagetool
chmod a+x ./appimagetool
Expand Down

0 comments on commit c7bf2e5

Please sign in to comment.