Skip to content

Commit 60f324d

Browse files
authored
Support 16kb page size on android (#109)
## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> ## 📔 Objective Update JNA, Gradle and Android plugin to support 16KB page size Android devices. I've updated the rest of dependencies while I was at it. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes
1 parent 50f5a17 commit 60f324d

File tree

5 files changed

+35
-22
lines changed

5 files changed

+35
-22
lines changed

.cargo/config.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,14 @@ rustflags = ["--cfg", "aes_armv8"]
66

77
[target.wasm32-unknown-unknown]
88
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']
9+
10+
# Enable support for 16k pages on Android, JNA is using these same flags
11+
# https://android-developers.googleblog.com/2024/08/adding-16-kb-page-size-to-android.html
12+
# https://github.com/java-native-access/jna/issues/1647
13+
[target.'cfg(target_os = "android")']
14+
rustflags = [
15+
"-C",
16+
"link-arg=-Wl,-z,max-page-size=16384",
17+
"-C",
18+
"link-arg=-Wl,-z,common-page-size=16384",
19+
]

crates/bitwarden-uniffi/kotlin/app/build.gradle

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ plugins {
22
id 'com.android.application'
33
id 'org.jetbrains.kotlin.android'
44
id 'kotlinx-serialization'
5+
id 'org.jetbrains.kotlin.plugin.compose'
56
}
67

78
android {
89
namespace 'com.bitwarden.myapplication'
9-
compileSdk 34
10+
compileSdk 35
1011

1112
defaultConfig {
1213
applicationId "com.bitwarden.myapplication"
1314
minSdk 28
14-
targetSdk 34
15+
targetSdk 35
1516
versionCode 1
1617
versionName "1.0"
1718

@@ -51,11 +52,11 @@ dependencies {
5152
// implementation 'com.bitwarden.sdk-android'
5253
implementation project(':sdk')
5354

54-
implementation 'androidx.core:core-ktx:1.8.0'
55-
implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.0')
56-
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
57-
implementation 'androidx.activity:activity-compose:1.5.1'
58-
implementation platform('androidx.compose:compose-bom:2022.10.00')
55+
implementation 'androidx.core:core-ktx:1.15.0'
56+
implementation platform('org.jetbrains.kotlin:kotlin-bom:2.0.21')
57+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.7'
58+
implementation 'androidx.activity:activity-compose:1.10.1'
59+
implementation platform('androidx.compose:compose-bom:2025.02.00')
5960
implementation 'androidx.compose.ui:ui'
6061
implementation 'androidx.compose.ui:ui-graphics'
6162
implementation 'androidx.compose.ui:ui-tooling-preview'
@@ -66,9 +67,9 @@ dependencies {
6667
implementation "io.ktor:ktor-client-content-negotiation:2.3.3"
6768
implementation "io.ktor:ktor-serialization-kotlinx-json:2.3.3"
6869
testImplementation 'junit:junit:4.13.2'
69-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
70-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
71-
androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00')
70+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
71+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
72+
androidTestImplementation platform('androidx.compose:compose-bom:2025.02.00')
7273
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
7374
debugImplementation 'androidx.compose.ui:ui-tooling'
7475
debugImplementation 'androidx.compose.ui:ui-test-manifest'
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id 'com.android.application' version '8.4.0' apply false
4-
id 'com.android.library' version '8.4.0' apply false
5-
id 'org.jetbrains.kotlin.android' version '1.9.23' apply false
6-
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.23' apply false
3+
id 'com.android.application' version '8.9.0' apply false
4+
id 'com.android.library' version '8.9.0' apply false
5+
id 'org.jetbrains.kotlin.android' version '2.1.0' apply false
6+
id 'org.jetbrains.kotlin.plugin.serialization' version '2.1.0' apply false
7+
id 'org.jetbrains.kotlin.plugin.compose' version '2.1.0' apply false
78
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Mon Jul 24 14:16:42 CEST 2023
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

crates/bitwarden-uniffi/kotlin/sdk/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ plugins {
66

77
android {
88
namespace 'com.bitwarden.sdk'
9-
compileSdk 34
9+
compileSdk 35
1010

1111
defaultConfig {
1212
minSdk 28
13-
targetSdk 34
13+
targetSdk 35
1414

1515
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
1616
consumerProguardFiles 'consumer-rules.pro'
@@ -107,13 +107,13 @@ File findRustlsPlatformVerifierClassesJar() {
107107
}
108108

109109
dependencies {
110-
implementation 'net.java.dev.jna:jna:5.14.0@aar'
110+
implementation 'net.java.dev.jna:jna:5.17.0@aar'
111111
implementation files(findRustlsPlatformVerifierClassesJar())
112112

113-
implementation 'androidx.core:core-ktx:1.13.0'
114-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
113+
implementation 'androidx.core:core-ktx:1.15.0'
114+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.1'
115115

116116
testImplementation 'junit:junit:4.13.2'
117-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
118-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
117+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
118+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
119119
}

0 commit comments

Comments
 (0)