From faa8d34e7945b3598d5ec1365f45d6b461becb90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Thu, 16 May 2024 18:55:02 +0200 Subject: [PATCH 1/3] Bump sdk to 2.6.7-SNAPSHOT --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 82317277..510d62e2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -191,7 +191,7 @@ ext { } dependencies { - implementation 'io.github.wulkanowy:sdk:2.6.6' + implementation 'io.github.wulkanowy:sdk:2.6.7-SNAPSHOT' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' From 729e0f547b301fcefc92f155a0e395f478e7b3d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Thu, 16 May 2024 23:12:55 +0200 Subject: [PATCH 2/3] Add sandbox isolate --- app/build.gradle | 2 ++ app/src/main/AndroidManifest.xml | 4 ++- .../wulkanowy/data/WulkanowySdkFactory.kt | 32 +++++++++++++++++-- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 510d62e2..a6974079 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -197,6 +197,7 @@ dependencies { implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$coroutines" implementation 'androidx.core:core-ktx:1.13.1' implementation 'androidx.core:core-splashscreen:1.0.1' @@ -204,6 +205,7 @@ dependencies { implementation "androidx.appcompat:appcompat:1.6.1" implementation "androidx.fragment:fragment-ktx:1.7.0" implementation "androidx.annotation:annotation:1.7.1" + implementation "androidx.javascriptengine:javascriptengine:1.0.0-beta01" implementation "androidx.preference:preference-ktx:1.2.1" implementation "androidx.recyclerview:recyclerview:1.3.2" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 79d75bc0..a4257893 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -3,6 +3,8 @@ xmlns:tools="http://schemas.android.com/tools" android:installLocation="internalOnly"> + + @@ -42,9 +44,9 @@ android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" + android:resizeableActivity="true" android:supportsRtl="false" android:theme="@style/WulkanowyTheme" - android:resizeableActivity="true" tools:ignore="DataExtractionRules,UnusedAttribute"> () + private val sandbox: ListenableFuture? = + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && JavaScriptSandbox.isSupported()) + JavaScriptSandbox.createConnectedInstanceAsync(context) + else null private val sdk = Sdk().apply { - androidVersion = android.os.Build.VERSION.RELEASE - buildTag = android.os.Build.MODEL + androidVersion = Build.VERSION.RELEASE + buildTag = Build.MODEL userAgentTemplate = remoteConfig.userAgentTemplate setSimpleHttpLogger { Timber.d(it) } setAdditionalCookieManager(webkitCookieManagerProxy) @@ -48,6 +60,22 @@ class WulkanowySdkFactory @Inject constructor( endpointsMapping = mapping.endpoints vTokenMapping = mapping.vTokens vTokenSchemeMapping = mapping.vTokenScheme + vParamsEvaluation = createIsolate() + } + } + } + + private suspend fun createIsolate(): suspend () -> EvaluateHandler { + return { + val isolate = sandbox?.await()?.createIsolate() + object : EvaluateHandler { + override suspend fun evaluate(code: String): String? { + return isolate?.evaluateJavaScriptAsync(code)?.await() + } + + override fun close() { + isolate?.close() + } } } } From 9a6b17c9d9c03e80f6b4341a500319a010efa85b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Fri, 17 May 2024 07:38:13 +0200 Subject: [PATCH 3/3] Version 2.6.8 --- .gitignore | 1 + app/build.gradle | 6 +++--- app/src/main/play/release-notes/pl-PL/default.txt | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ad83ced8..12c6f241 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,4 @@ google-services.json !app/google-services.json +.idea/appInsightsSettings.xml diff --git a/app/build.gradle b/app/build.gradle index a6974079..01f3b1cf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,8 +27,8 @@ android { testApplicationId "io.github.tests.wulkanowy" minSdkVersion 21 targetSdkVersion 34 - versionCode 167 - versionName "2.6.7" + versionCode 168 + versionName "2.6.8" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" resValue "string", "app_name", "Wulkanowy" @@ -191,7 +191,7 @@ ext { } dependencies { - implementation 'io.github.wulkanowy:sdk:2.6.7-SNAPSHOT' + implementation 'io.github.wulkanowy:sdk:2.6.7' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' diff --git a/app/src/main/play/release-notes/pl-PL/default.txt b/app/src/main/play/release-notes/pl-PL/default.txt index e4fa5476..889591fa 100644 --- a/app/src/main/play/release-notes/pl-PL/default.txt +++ b/app/src/main/play/release-notes/pl-PL/default.txt @@ -1,5 +1,6 @@ -Wersja 2.6.7 +Wersja 2.6.8 -— taka tam aktualizacja wiadomości w czwartek. Jeśli widzisz to w piątek, to może już nie działać +— i znowu aktualizacja, żeby wiadomości działały chociaż w piątek. Później już pewnie nie będą +— a i jeszcze naprawiliśmy dostęp mobilny, bo prosiliście Pełna lista zmian: https://github.com/wulkanowy/wulkanowy/releases