Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Get Latest
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: 22.x
- uses: actions/checkout@v2
- name: Restore Dependency Cache
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
Expand All @@ -33,10 +33,10 @@ jobs:
with:
path: core/
- name: set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
distribution: 'temurin'
verify-android:
runs-on: ubuntu-latest
timeout-minutes: 30
Expand All @@ -49,9 +49,9 @@ jobs:
PORTALS_KEY: ${{ secrets.portals_key }}
run: echo portals_key=\"$PORTALS_KEY\" > ./local.properties
- name: set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
distribution: 'temurin'
- run: npm run verify
working-directory: ./
4 changes: 2 additions & 2 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
PORTALS_KEY: ${{ secrets.portals_key }}
run: echo portals_key=\"$PORTALS_KEY\" > ./local.properties
- name: set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Generate Docs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
PORTALS_KEY: ${{ secrets.portals_key }}
run: echo portals_key=\"$PORTALS_KEY\" > ./local.properties
- name: set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Generate Docs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-android-old.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
PORTALS_KEY: ${{ secrets.portals_key }}
run: echo portals_key=\"$PORTALS_KEY\" > ./local.properties
- name: set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Grant execute permission for publishing script
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Grant execute permission for publishing script
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
run: echo portals_key=\"$PORTALS_KEY\" > ./local.properties

- name: set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
distribution: 'temurin'

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
Expand Down
17 changes: 11 additions & 6 deletions IonicPortals/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.library")
id("maven-publish")
Expand All @@ -10,10 +12,10 @@ if (System.getenv("PORTALS_PUBLISH") == "true") {

android {
namespace = "io.ionic.portals"
compileSdk = 35
compileSdk = 36

defaultConfig {
minSdk = 23
minSdk = 24
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

Expand All @@ -33,18 +35,21 @@ android {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Comment thread
trevor-lambert marked this conversation as resolved.
}
kotlinOptions {
jvmTarget = "17"
}
publishing {
singleVariant("release")
}
}

kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
}
}

dependencies {
implementation(kotlin("reflect"))

api("com.capacitorjs:core:[7.0.0,7.1.0)")
api("com.capacitorjs:core:[8.0.0,9.0.0)")
compileOnly("io.ionic:liveupdates:0.5.5")

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ object PortalManager {
val rsaSignature = Signature.getInstance("SHA256withRSA")
rsaSignature.initVerify(pubKey)
rsaSignature.update(header)
rsaSignature.update(jwtDelimiter.toByte())
rsaSignature.update(jwtDelimiter.code.toByte())
rsaSignature.update(payload)

val result = rsaSignature.verify(tokenSignature)
Expand All @@ -215,7 +215,7 @@ object PortalManager {
registrationError()
false
}
} catch (e: Exception) {
} catch (_: Exception) {
registrationError()
}

Expand Down
3 changes: 1 addition & 2 deletions IonicPortals/src/main/kotlin/io/ionic/portals/PortalView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ class PortalView : FrameLayout {
portalFragment?.onInflate(context, attributeSet, null)
}

val handler = Handler()
val runnable = Runnable {
val thisView = findViewById<PortalView>(id)
if(thisView != null) {
Expand All @@ -206,7 +205,7 @@ class PortalView : FrameLayout {
}
}

handler.post(runnable)
post(runnable)
}
}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Ionic Portals is a solution that lets you add web-based experiences to your nati
The test projects within the repository will only work with a valid Portals key. Add the following new line to the `local.properties` file in the project root and enter your Portals key.

```
portals_key=""
portals_key=YOUR_PORTALS_KEY
```

Note: This file is in the `.gitignore` and is not committed to repos by default.
28 changes: 19 additions & 9 deletions TestApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.kotlin.konan.properties.Properties
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.io.FileInputStream
import com.android.build.api.variant.BuildConfigField

Expand All @@ -9,7 +10,7 @@ plugins {

android {
namespace = "io.ionic.portals.testapp"
compileSdk = 35
compileSdk = 36

buildFeatures {
buildConfig = true
Expand All @@ -18,7 +19,7 @@ android {
defaultConfig {
applicationId = "io.ionic.portals.testapp"
minSdk = 24
targetSdk = 35
targetSdk = 36
versionCode = 1
versionName = "1.0"

Expand All @@ -33,18 +34,20 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

kotlinOptions {
jvmTarget = "1.8"
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
}
}

androidComponents {
onVariants {
it.buildConfigFields.put("PORTALS_KEY", BuildConfigField("String", getPortalsKey(), "portals registration key"))
it.buildConfigFields?.put("PORTALS_KEY", BuildConfigField("String", getPortalsKey(), "portals registration key"))
}
}

Expand All @@ -67,5 +70,12 @@ fun getPortalsKey(): String {
val propFile = rootProject.file("local.properties")
val properties = Properties()
properties.load(FileInputStream(propFile))
return properties.getProperty("portals_key") ?: ""
}
val raw = properties.getProperty("portals_key") ?: ""
val normalized = if (raw.length >= 2 && raw.first() == '"' && raw.last() == '"') {
raw.substring(1, raw.length - 1)
} else {
raw
}
val escaped = normalized.replace("\\", "\\\\").replace("\"", "\\\"")
return "\"$escaped\""
}
35 changes: 22 additions & 13 deletions TestAppCompose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import org.jetbrains.kotlin.konan.properties.Properties
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.io.FileInputStream
import com.android.build.api.variant.BuildConfigField

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.kotlin.plugin.compose")
}

android {
namespace = "io.ionic.portals.composetestapp"
compileSdk = 35
compileSdk = 36

buildFeatures {
buildConfig = true
Expand All @@ -18,7 +20,7 @@ android {
defaultConfig {
applicationId = "io.ionic.portals.composetestapp"
minSdk = 24
targetSdk = 35
targetSdk = 36
versionCode = 1
versionName = "1.0"

Expand All @@ -35,28 +37,28 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.15"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
}
}

androidComponents {
onVariants {
it.buildConfigFields.put("PORTALS_KEY",
it.buildConfigFields?.put("PORTALS_KEY",
BuildConfigField("String", getPortalsKey(), "portals registration key")
)
}
Expand Down Expand Up @@ -87,5 +89,12 @@ fun getPortalsKey(): String {
val propFile = rootProject.file("local.properties")
val properties = Properties()
properties.load(FileInputStream(propFile))
return properties.getProperty("portals_key") ?: ""
}
val raw = properties.getProperty("portals_key") ?: ""
val normalized = if (raw.length >= 2 && raw.first() == '"' && raw.last() == '"') {
raw.substring(1, raw.length - 1)
} else {
raw
}
val escaped = normalized.replace("\\", "\\\\").replace("\"", "\\\"")
return "\"$escaped\""
}
21 changes: 5 additions & 16 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.base.DokkaBaseConfiguration

plugins {
id("org.jetbrains.dokka") version "1.7.20"
id("org.jetbrains.kotlin.plugin.serialization") version "1.9.25"
id("org.jetbrains.dokka") version "2.0.0"
id("org.jetbrains.kotlin.plugin.serialization") version "2.2.20"
}

buildscript {
val kotlinVersion = "1.9.25"
val kotlinVersion = "2.2.20"
extra.apply {
set("kotlinVersion", kotlinVersion)
}
Expand All @@ -26,8 +22,7 @@ buildscript {
classpath("io.github.gradle-nexus:publish-plugin:1.1.0")
}

classpath("org.jetbrains.dokka:dokka-base:1.7.20")
classpath("com.android.tools.build:gradle:8.7.3")
classpath("com.android.tools.build:gradle:8.13.0")
classpath("org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
}
Expand All @@ -45,15 +40,9 @@ allprojects {
}

apply(plugin = "org.jetbrains.dokka")

tasks.withType<DokkaTask>().configureEach {
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
footerMessage = "Created by Ionic"
}
}
}

// register Clean task
tasks.register("clean").configure {
delete("build")
}
}
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon May 08 10:58:01 CDT 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
Comment thread
trevor-lambert marked this conversation as resolved.
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading