diff --git a/README.md b/README.md index 1c93ef2..54e0fd0 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ### sdkmanager The sdkmanager is a command line tool that allows you to view, install, update, and uninstall packages for the Android SDK. If you're using Android Studio, then you do not need to use this tool and you can instead manage your SDK packages from the IDE. - The sdkmanager tool is provided in the Android SDK Tools package (25.2.3 and higher) and is located in ~/snap/androidsdk/current/tools/bin/. + The sdkmanager tool is provided in the Android SDK Tools package (25.2.3 and higher) and is located in ~/AndroidSDK. ## Install diff --git a/scripts/start.sh b/scripts/start.sh index 685e8ba..73985a7 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -1,11 +1,31 @@ #!/bin/bash -SDK_ROOT=$HOME/AndroidSDK +EXTERNAL_HOME=/home/$USER +OLD_SDK_ROOT=$HOME/AndroidSDK +SDK_ROOT=$EXTERNAL_HOME/AndroidSDK export JAVA_HOME="$SNAP/usr/lib/jvm/java-8-openjdk-amd64" export ANDROID_SDK_HOME="$HOME/.Android" export _JAVA_OPTIONS=-Duser.home=$HOME +if [ "$(ls -A $OLD_SDK_ROOT)" ]; then + echo "The default sdk folder has been changed from $OLD_SDK_ROOT to $SDK_ROOT ." + echo "The Old location of sdk root have big problems with update the androidsdk package." + echo "For more information about this problem see the https://github.com/QuasarApp/sdkmanager-android/issues/2 issue." + echo "" + + if [ ! -d $SDK_ROOT ] + then + mkdir $SDK_ROOT + fi + + mv $OLD_SDK_ROOT $EXTERNAL_HOME + ln -s $SDK_ROOT $OLD_SDK_ROOT + echo "All your installed sdk files has been moved to new location." + echo "If you want change a sdk location please use the --sdk_root option." + +fi + for var in "$@" do if [[ $var == *"--sdk_root"* ]]; then diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 546ab7f..9dfa770 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: androidsdk -version: '1.0.6.1' +version: '1.1.0.0' summary: The package contains android sdkmanager. description: | This is snap version of console sdk manager for Android. For more information about sdkmanager see official google documentation git@github.com:EndrII/sdkmanager-android.git.