Skip to content

Update dependencies #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
18 changes: 9 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

android {
namespace 'com.openwebgal.demo'
compileSdk 34
compileSdk 35

defaultConfig {
applicationId "com.openwebgal.demo"
Expand Down Expand Up @@ -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'
}
7 changes: 5 additions & 2 deletions app/src/main/java/com/openwebgal/demo/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -97,7 +100,7 @@ class MainActivity : AppCompatActivity() {

//移除默认播放海报
override fun getDefaultVideoPoster(): Bitmap? {
return Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888)
return createBitmap(10, 10)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Loading