diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index a326d2dd..59e00ed7 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -27,7 +27,9 @@ jobs: run: | BUILD_TOOLS_VERSION="$(grep -E "^io\.github\.x0b\.rcx\.buildToolsVersion=" gradle.properties | cut -d'=' -f2)" NDK_VERSION="$(grep -E "^io\.github\.x0b\.rcx\.ndkVersion=" gradle.properties | cut -d'=' -f2)" - yes | sudo "${ANDROID_HOME}/tools/bin/sdkmanager" "build-tools;${BUILD_TOOLS_VERSION}" "ndk;${NDK_VERSION}" + + yes | sudo "${ANDROID_HOME}/tools/bin/sdkmanager" --licenses + sudo "${ANDROID_HOME}/tools/bin/sdkmanager" "build-tools;${BUILD_TOOLS_VERSION}" "ndk;${NDK_VERSION}" - name: Build app run: ./gradlew assembleOssDebug - name: Upload APK diff --git a/.gitignore b/.gitignore index 12538b7c..5a635f59 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ *.apk *.ap_ +# Built libraries +*.so + # Files for the ART/Dalvik VM *.dex diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/DriveConfig.java b/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/DriveConfig.java index 1ab42c77..5a5dc8fd 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/DriveConfig.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/RemoteConfig/DriveConfig.java @@ -2,10 +2,8 @@ import android.annotation.SuppressLint; import android.content.Context; -import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; -import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.view.LayoutInflater; @@ -18,7 +16,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; -import androidx.browser.customtabs.CustomTabsIntent; import androidx.fragment.app.Fragment; import androidx.preference.PreferenceManager; import ca.pkay.rcloneexplorer.MainActivity; diff --git a/build.gradle b/build.gradle index 2ce2db62..8af4fed9 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.0.0' + classpath 'com.android.tools.build:gradle:4.0.1' for (String taskName : getGradle().getStartParameter().getTaskNames()) { if (taskName.endsWith('RcxDebug') || taskName.endsWith('RcxRelease')) { diff --git a/gradle.properties b/gradle.properties index f646f09b..ccb5d7ec 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,8 +14,8 @@ android.useAndroidX=true # android.enableR8=true org.gradle.jvmargs=-Xmx1536m -io.github.x0b.rcx.rCloneVersion=1.51.0 -io.github.x0b.rcx.buildToolsVersion=30.0.1 +io.github.x0b.rcx.rCloneVersion=1.52.3 +io.github.x0b.rcx.buildToolsVersion=29.0.3 io.github.x0b.rcx.ndkVersion=21.3.6528147 # When configured, Gradle will run in incubating parallel mode. diff --git a/rclone/.gitignore b/rclone/.gitignore index 71a8716d..14d86ad6 100644 --- a/rclone/.gitignore +++ b/rclone/.gitignore @@ -1 +1 @@ -/gopath +/cache diff --git a/rclone/build.gradle b/rclone/build.gradle index 454da17f..1349b105 100644 --- a/rclone/build.gradle +++ b/rclone/build.gradle @@ -3,8 +3,9 @@ import java.nio.file.Paths ext { NDK_VERSION = project.properties['io.github.x0b.rcx.ndkVersion'] RCLONE_VERSION = project.properties['io.github.x0b.rcx.rCloneVersion'] - RCLONE_REPOSITORY = 'github.com/rclone/rclone' - GO_PATH = Paths.get(projectDir.absolutePath, 'gopath').toAbsolutePath().toString() + RCLONE_MODULE = 'github.com/rclone/rclone' + CACHE_PATH = Paths.get(projectDir.absolutePath, 'cache').toAbsolutePath().toString() + GOPATH = Paths.get(CACHE_PATH, "gopath").toString() } def findSdkDir() { @@ -83,7 +84,7 @@ def buildRclone(compiler, arch, abi, env = [:]) { return { doLast { exec { - environment 'GOPATH', GO_PATH + environment 'GOPATH', GOPATH def crossCompiler = getCrossCompiler(compiler) environment 'CC', crossCompiler environment 'CC_FOR_TARGET', crossCompiler @@ -91,21 +92,27 @@ def buildRclone(compiler, arch, abi, env = [:]) { environment 'GOARCH', arch environment 'CGO_ENABLED', '1' env.each {entry -> environment "$entry.key", "$entry.value"} - commandLine 'go', 'build', '-tags', 'linux', '-o', getLibrclone(abi), RCLONE_REPOSITORY + workingDir CACHE_PATH + commandLine 'go', 'build', '-tags', 'linux', '-o', getLibrclone(abi), RCLONE_MODULE } } } } -task fetchRclone(type: Exec) { - mkdir GO_PATH - environment 'GOPATH', GO_PATH - commandLine 'go', 'get', '-d', RCLONE_REPOSITORY +task createRcloneModule(type: Exec) { + // We create a fake go module as it's the only way to checkout + // a specific tag. + onlyIf { !Paths.get(CACHE_PATH, 'go.mod').toFile().exists() } + mkdir CACHE_PATH + workingDir CACHE_PATH + environment 'GOPATH', GOPATH + commandLine 'go', 'mod', 'init', 'rclone' } -task checkoutRclone(type: Exec, dependsOn: fetchRclone) { - workingDir Paths.get(GO_PATH, 'src', *RCLONE_REPOSITORY.split('/')) - commandLine 'git', 'checkout', 'v' + RCLONE_VERSION +task checkoutRclone(type: Exec, dependsOn: createRcloneModule) { + workingDir CACHE_PATH + environment 'GOPATH', GOPATH + commandLine 'go', 'get', '-v', '-d', "${RCLONE_MODULE}@v${RCLONE_VERSION}" } task cleanNative {