diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 4a3fbc2..146c4f9 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -10,15 +10,15 @@ blocks: jobs: - name: Build commands: - - wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip -O ~/android-commandline-tools.zip + - wget https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -O ~/android-commandline-tools.zip - mkdir -p ~/android-sdk/ - unzip ~/android-commandline-tools.zip -d ~/android-sdk/cmdline-tools/ - mv ~/android-sdk/cmdline-tools/cmdline-tools/ ~/android-sdk/cmdline-tools/latest - export PATH=$PATH:~/android-sdk/cmdline-tools/latest/bin - - yes | sdkmanager "ndk;23.0.7599858" - - export PATH=$PATH:~/android-sdk/ndk/23.0.7599858/ + - yes | sdkmanager "ndk;25.2.9519653" + - export PATH=$PATH:~/android-sdk/ndk/25.2.9519653/ - export ANDROID_SDK_ROOT=~/android-sdk - checkout - - sem-version java 11 + - sem-version java 17 - ./gradlew build - artifact push job app/build/outputs/apk/release/app-release.apk diff --git a/app/build.gradle b/app/build.gradle index 564d85e..7ae1c19 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,7 +11,7 @@ buildscript { } android { - compileSdkVersion 33 + compileSdk 33 signingConfigs { debug { @@ -45,16 +45,15 @@ android { sourceCompatibility = '1.8' targetCompatibility = '1.8' } - - lintOptions { + namespace 'jp.co.cyberagent.stf' + lint { informational 'ExpiredTargetSdkVersion' } + } dependencies { - //TODO consider migrating to androidx - //noinspection GradleCompatible - implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'androidx.core:core:1.10.1' implementation 'com.google.protobuf:protobuf-lite:3.0.1' compileOnly fileTree(dir: '../shim/libs', include: ['*.jar']) } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0f49af5..7b500f3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ + xmlns:tools="http://schemas.android.com/tools"> diff --git a/app/src/main/java/jp/co/cyberagent/stf/IdentityActivity.java b/app/src/main/java/jp/co/cyberagent/stf/IdentityActivity.java index c9d2bb3..23634d5 100644 --- a/app/src/main/java/jp/co/cyberagent/stf/IdentityActivity.java +++ b/app/src/main/java/jp/co/cyberagent/stf/IdentityActivity.java @@ -8,8 +8,6 @@ import android.graphics.Color; import android.os.Build; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.telephony.TelephonyManager; import android.util.Log; import android.view.Gravity; @@ -19,6 +17,9 @@ import android.widget.LinearLayout; import android.widget.TextView; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -151,7 +152,8 @@ private void unlock() { } public static class IntentBuilder { - @Nullable private String serial; + @Nullable + private String serial; public IntentBuilder() { } diff --git a/app/src/main/java/jp/co/cyberagent/stf/MinitouchAgent.java b/app/src/main/java/jp/co/cyberagent/stf/MinitouchAgent.java index 2d644b8..f2c0bce 100644 --- a/app/src/main/java/jp/co/cyberagent/stf/MinitouchAgent.java +++ b/app/src/main/java/jp/co/cyberagent/stf/MinitouchAgent.java @@ -23,7 +23,6 @@ import android.os.Handler; import android.os.Looper; import android.os.SystemClock; -import android.support.annotation.RequiresApi; import android.util.Log; import android.view.Display; import android.view.InputDevice; @@ -45,7 +44,6 @@ import jp.co.cyberagent.stf.compat.WindowManagerWrapper; import jp.co.cyberagent.stf.util.InternalApi; -@RequiresApi(api = Build.VERSION_CODES.ICE_CREAM_SANDWICH) public class MinitouchAgent extends Thread { private static final String TAG = MinitouchAgent.class.getSimpleName(); private static final String SOCKET = "minitouchagent"; diff --git a/app/src/main/java/jp/co/cyberagent/stf/Service.java b/app/src/main/java/jp/co/cyberagent/stf/Service.java index da021d6..fe281fa 100644 --- a/app/src/main/java/jp/co/cyberagent/stf/Service.java +++ b/app/src/main/java/jp/co/cyberagent/stf/Service.java @@ -14,9 +14,10 @@ import android.os.Build; import android.os.IBinder; import android.os.Process; -import android.support.annotation.RequiresApi; -import android.support.v4.app.NotificationCompat; -import android.support.v4.content.ContextCompat; +import androidx.annotation.RequiresApi; +import androidx.core.app.NotificationCompat; +import androidx.core.content.ContextCompat; + import android.util.Log; import com.google.protobuf.InvalidProtocolBufferException; diff --git a/build.gradle b/build.gradle index 6a15ebd..5700237 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.0.2' } } @@ -14,7 +14,7 @@ allprojects { google() } - tasks.withType(JavaCompile) { + tasks.withType(JavaCompile).configureEach { sourceCompatibility = "1.8" targetCompatibility = "1.8" } diff --git a/gradle.properties b/gradle.properties index 5d08ba7..3ba3c47 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,9 @@ # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true \ No newline at end of file +# org.gradle.parallel=true +android.defaults.buildfeatures.buildconfig=true +android.nonFinalResIds=false +android.nonTransitiveRClass=false +android.useAndroidX=true +android.enableJetifier=false diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e583..033e24c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661..9f4197d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb..fcb6fca 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +130,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,6 +197,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/gradlew.bat b/gradlew.bat index 53a6b23..6689b85 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME%