Skip to content

Commit c7bf2e5

Browse files
authored
Update android-tools-appimage.sh
1 parent dab782a commit c7bf2e5

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

android-tools-appimage.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mkdir -p "./$APP/tmp" && cd "./$APP/tmp" || exit
1010
# DOWNLOAD THE ARCHIVE
1111
wget "$SITE/platform-tools-latest-linux.zip" && unzip -qq ./*.zip
1212
cd ..
13-
mkdir "./$APP.AppDir" && mv --backup=t ./tmp/*/* ./$APP.AppDir
13+
mkdir -p "./$APP.AppDir/usr/bin" && mv --backup=t ./tmp/*/* "./$APP.AppDir/usr/bin"
1414
cd ./$APP.AppDir || exit
1515

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

7276
# MAKE APPIMAGE
73-
APPVERSION=$(cat source.properties | grep vision | awk -F = '{print $NF; exit}')
77+
APPVERSION=$(cat ./usr/bin/source.properties | grep vision | awk -F = '{print $NF; exit}')
7478
cd ..
7579
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
7680
chmod a+x ./appimagetool

0 commit comments

Comments
 (0)