diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 9195a68..0227a65 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -12,12 +12,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: set up JDK 17 - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - name: set up JDK 21 + uses: actions/setup-java@v4 with: - java-version: '17' distribution: 'temurin' + java-version: '21' cache: gradle - name: Replace the demo link run: sed -i 's/https:\/\/appassets.androidplatform.net\/assets\/webgal\/index.html/https:\/\/demo.openwebgal.com\//g' app/src/main/res/values/values.xml @@ -30,7 +30,7 @@ jobs: - name: Rename debug apk run: mv app/build/outputs/apk/debug/app-debug.apk webgal-$GITHUB_RUN_NUMBER-debug.apk - name: Upload debug apk - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: webgal-${{ github.run_number }}-debug.apk path: webgal-${{ github.run_number }}-debug.apk diff --git a/app/build.gradle b/app/build.gradle index 2d467c5..87d54ed 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,7 +5,7 @@ plugins { android { namespace 'com.openwebgal.demo' - compileSdk 34 + compileSdk 35 defaultConfig { applicationId "com.openwebgal.demo" @@ -42,13 +42,13 @@ android { dependencies { - implementation 'androidx.core:core-ktx:1.12.0' - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'com.google.android.material:material:1.10.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.webkit:webkit:1.8.0' - implementation 'androidx.browser:browser:1.6.0' + implementation 'androidx.core:core-ktx:1.15.0' + implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'com.google.android.material:material:1.12.0' + implementation 'androidx.constraintlayout:constraintlayout:2.2.1' + implementation 'androidx.webkit:webkit:1.13.0' + implementation 'androidx.browser:browser:1.8.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/app/src/main/java/com/openwebgal/demo/MainActivity.kt b/app/src/main/java/com/openwebgal/demo/MainActivity.kt index 5899957..ccc5589 100644 --- a/app/src/main/java/com/openwebgal/demo/MainActivity.kt +++ b/app/src/main/java/com/openwebgal/demo/MainActivity.kt @@ -20,6 +20,8 @@ import androidx.browser.customtabs.CustomTabsIntent import androidx.webkit.WebViewAssetLoader import androidx.webkit.WebViewAssetLoader.AssetsPathHandler import androidx.webkit.WebViewClientCompat +import androidx.core.graphics.createBitmap +import androidx.core.net.toUri class MainActivity : AppCompatActivity() { @@ -55,7 +57,8 @@ class MainActivity : AppCompatActivity() { webView: WebView, request: WebResourceRequest ): WebResourceResponse? { - val interceptedRequest = assetLoader.shouldInterceptRequest(Uri.parse(Uri.decode(request.url.toString()))) + val interceptedRequest = assetLoader.shouldInterceptRequest( + Uri.decode(request.url.toString()).toUri()) interceptedRequest?.let { if (request.url.toString().endsWith("js", true)) { it.mimeType = "text/javascript" @@ -97,7 +100,7 @@ class MainActivity : AppCompatActivity() { //移除默认播放海报 override fun getDefaultVideoPoster(): Bitmap? { - return Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888) + return createBitmap(10, 10) } } } diff --git a/build.gradle b/build.gradle index a7ea160..a749417 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '8.2.0' apply false - id 'com.android.library' version '8.2.0' apply false - id 'org.jetbrains.kotlin.android' version '1.8.0' apply false + id 'com.android.application' version '8.9.0' apply false + id 'com.android.library' version '8.9.0' apply false + id 'org.jetbrains.kotlin.android' version '2.1.10' apply false } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index a2e90d8..f19c7b9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,5 +21,4 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -android.defaults.buildfeatures.buildconfig=true android.nonFinalResIds=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 98ac5c9..d203b00 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Feb 03 09:54:54 CST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME