Skip to content

Commit

Permalink
SDKS-3098 Support Android 15
Browse files Browse the repository at this point in the history
  • Loading branch information
witrisna committed Sep 11, 2024
1 parent a0f6571 commit f86a74c
Show file tree
Hide file tree
Showing 22 changed files with 59 additions and 71 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Allow developers to customize SDK Storage [SDKS-3378]
- Support PingOne Protect Marketplace Node [SDKS-3279]
- Expose Realm, Success Url with SSOToken [SDKS-3351]
- Support Android 15 [SDKS-3098]

#### Fixed
- Potential CustomTabManager ServiceConnection leak. [SDKS-3346]
Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ val customTemplatesFolder = file("$projectDir/dokka/templates")
buildscript {

dependencies {
classpath("com.android.tools.build:gradle:8.2.2")
classpath("com.android.tools.build:gradle:8.6.0")
classpath("com.adarshr:gradle-test-logger-plugin:2.0.0")
classpath("com.google.gms:google-services:4.3.15")
}
Expand All @@ -27,8 +27,8 @@ plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("org.sonatype.gradle.plugins.scan") version "2.4.0"
id("org.jetbrains.dokka") version "1.9.10"
id("com.android.application") version "8.3.2" apply false
id("com.android.library") version "8.3.2" apply false
id("com.android.application") version "8.6.0" apply false
id("com.android.library") version "8.6.0" apply false
id("org.jetbrains.kotlin.android") version "1.9.22" apply false
}

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ repositories {
}

dependencies {
implementation("com.android.tools.build:gradle-api:8.3.2")
implementation("com.android.tools.build:gradle-api:8.6.0")
}
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/AndroidBuildGradlePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AndroidBuildGradlePlugin : Plugin<Project> {

override fun apply(project: Project) {
project.android().apply {
compileSdk = 34;
compileSdk = 35;
defaultConfig {
minSdk = 23
}
Expand All @@ -30,7 +30,7 @@ class AndroidBuildGradlePlugin : Plugin<Project> {
}
}
testOptions {
targetSdk = 34
targetSdk = 35
unitTests {
isIncludeAndroidResources = true
isReturnDefaultValues = true
Expand Down
4 changes: 2 additions & 2 deletions forgerock-auth-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ apply plugin: 'org.jetbrains.dokka'
android {
namespace 'org.forgerock.android.auth.ui'

compileSdk 34
compileSdk 35

defaultConfig {
minSdkVersion 23
targetSdkVersion 34
targetSdkVersion 35
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down
3 changes: 0 additions & 3 deletions forgerock-auth/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ dependencies {
compileOnly(libs.integrity)

androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(libs.mockwebserver)
androidTestImplementation(libs.commons.io)
androidTestImplementation(libs.rules)
Expand All @@ -108,15 +107,13 @@ dependencies {
testImplementation(libs.androidx.test.core)
testImplementation(libs.androidx.test.ext.junit)
testImplementation(libs.androidx.test.runner)
testImplementation(libs.androidx.fragment.testing)
testImplementation(libs.nimbus.jose.jwt)

testImplementation(libs.junit)
testImplementation(libs.org.robolectric.robolectric)
testImplementation(libs.mockwebserver)
testImplementation(libs.commons.io)
testImplementation(libs.assertj.core)
testImplementation(libs.androidx.espresso.intents)
testImplementation(libs.appauth)
testImplementation(libs.play.services.fido)
testImplementation(libs.play.services.auth)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,15 @@ open class WebAuthnRegistration() : WebAuthn() {
//Extension to support username-less
if (options.authenticatorSelection?.requireResidentKey == true &&
options.authenticatorSelection?.residentKeyRequirement == ResidentKeyRequirement.RESIDENT_KEY_DISCOURAGED) {
val source = PublicKeyCredentialSource.builder()
.id(publicKeyCredential.rawId)
.rpid(options.rp.id)
.userHandle(Base64.decode(options.user.id, Base64.URL_SAFE or Base64.NO_WRAP))
.otherUI(options.user.displayName).build()
persist(context, source)
}
publicKeyCredential.rawId?.let {
val source = PublicKeyCredentialSource.builder()
.id(it)
.rpid(options.rp.id)
.userHandle(Base64.decode(options.user.id, Base64.URL_SAFE or Base64.NO_WRAP))
.otherUI(options.user.displayName).build()
persist(context, source)
}
}
return (sb.toString())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class AppIntegrityCallbackTest {
override fun token(): String {
val token = JSONObject()
token.put("value", "test-standard-integrity-token")
token.put("requestHash", request.a())
token.put("requestHash", request.requestHash())
return token.toString()
}
}
Expand Down
1 change: 0 additions & 1 deletion forgerock-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ dependencies {
testImplementation(libs.androidx.test.runner)

androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(libs.mockwebserver)
androidTestImplementation(libs.commons.io)
androidTestImplementation(libs.rules)
Expand Down
3 changes: 1 addition & 2 deletions forgerock-integration-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ dependencies {
api(project(":forgerock-auth"))
api(project(":ping-protect"))

implementation(libs.appcompat)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.firebase.crashlytics.buildtools)
implementation(libs.kotlinx.serialization.json)
testImplementation(libs.junit)

androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(libs.mockwebserver)
androidTestImplementation(libs.commons.io)
androidTestImplementation(libs.rules)
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ GROUP=org.forgerock
VERSION=4.6.0-SNAPSHOT
VERSION_CODE=24
android.nonTransitiveRClass=false
android.nonFinalResIds=false
android.nonFinalResIds=false
android.suppressUnsupportedCompileSdk=35
52 changes: 21 additions & 31 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,48 +1,44 @@
[versions]
agp = "8.3.2"
annotation = "1.6.0"
agp = "8.6.0"
annotation = "1.8.2"
appauth = "0.11.1"
appcompat = "1.6.1"
assertj-core = "2.9.1"
appcompat = "1.7.0"
assertj-core = "3.19.0"
bcpkix-jdk15on = "1.58.0.0"
biometric-ktx = "1.2.0-alpha05"
commons-io = "2.16.1"
constraintlayout = "2.1.4"
easy-random-core = "4.0.0"
facebook-login = "16.0.0"
firebase-messaging = "23.1.2"
fragment-ktx = "1.6.1"
activity-ktx = "1.6.1"
integrity = "1.3.0"
integrity = "1.4.0"
kotlin = "1.9.22"
junit = "4.13.2"
androidx-test-core = "1.5.0"
androidx-test-ext-junit = "1.1.5"
androidx-test-runner = "1.5.2"
kotlinx-coroutines-play-services = "1.7.2"
androidx-test-core = "1.6.1"
androidx-test-ext-junit = "1.2.1"
androidx-test-runner = "1.6.2"
kotlinx-coroutines-play-services = "1.8.0"
lombok-version = "1.18.28"
mockito-core = "4.8.1"
mockito-core = "5.4.0"
mockito-kotlin = "4.0.0"
mockwebserver = "4.12.0"
nimbus-jose-jwt = "9.37.3"
okhttp = "4.11.0"
org-robolectric-robolectric = "4.9.2"
espresso-core = "3.5.1"
io-mockk = "1.13.9"
org-jetbrains-kotlinx = "1.7.2"
okhttp = "4.12.0"
org-robolectric-robolectric = "4.12.2"
io-mockk = "1.13.11"
org-jetbrains-kotlinx = "1.8.0"
com-pingidentity-signals = "5.1.2"
core-ktx = "1.12.0"
material = "1.11.0"
play-services-auth = "20.6.0"
play-services-fido = "20.0.1"
play-services-location = "21.0.1"
play-services-safetynet = "18.0.1"
material = "1.12.0"
play-services-auth = "21.2.0"
play-services-fido = "21.1.0"
play-services-location = "21.3.0"
play-services-safetynet = "18.1.0"
powermock-module-junit4 = "2.0.9"
powermock-api-mockito2 = "2.0.9"
recaptchaEnterprise = "18.6.0"
rules = "1.5.0"
rules = "1.6.1"
security-crypto = "1.1.0-alpha06"
firebase-crashlytics-buildtools = "2.9.9"
firebase-crashlytics-buildtools = "3.0.2"
pluginSserialization = "2.0.0"
serialization = "1.6.3"

Expand All @@ -51,10 +47,6 @@ androidx-annotation = { module = "androidx.annotation:annotation", version.ref =
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
androidx-biometric-ktx = { module = "androidx.biometric:biometric-ktx", version.ref = "biometric-ktx" }
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
androidx-espresso-intents = { module = "androidx.test.espresso:espresso-intents", version.ref = "espresso-core" }
androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "fragment-ktx" }
androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "activity-ktx" }
androidx-fragment-testing = { module = "androidx.fragment:fragment-testing", version.ref = "fragment-ktx" }
androidx-security-crypto = { module = "androidx.security:security-crypto", version.ref = "security-crypto" }
appauth = { module = "net.openid:appauth", version.ref = "appauth" }
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj-core" }
Expand All @@ -77,11 +69,9 @@ mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "
nimbus-jose-jwt = { module = "com.nimbusds:nimbus-jose-jwt", version.ref = "nimbus-jose-jwt" }
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
org-robolectric-robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "org-robolectric-robolectric" }
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" }
io-mockk = { group = "io.mockk", name = "mockk", version.ref = "io-mockk" }
org-jetbrains-kotlinx = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "org-jetbrains-kotlinx" }
com-pingidentity-signals = { group = "com.pingidentity.signals", name = "android-sdk", version.ref = "com-pingidentity-signals" }
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
play-services-auth = { module = "com.google.android.gms:play-services-auth", version.ref = "play-services-auth" }
play-services-fido = { module = "com.google.android.gms:play-services-fido", version.ref = "play-services-fido" }
Expand Down
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 @@
#Mon Jun 03 12:27:16 PDT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 0 additions & 2 deletions ping-protect/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,9 @@ dependencies {
testImplementation(libs.androidx.test.core)
testImplementation(libs.androidx.test.runner)
testImplementation(libs.androidx.test.ext.junit)
testImplementation(libs.espresso.core)

// Mockk
testImplementation(libs.io.mockk)

androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.espresso.core)
}
2 changes: 1 addition & 1 deletion samples/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {

android {
namespace = "com.example.app"
compileSdk = 34
compileSdk = 35
defaultConfig {
minSdk = 23
}
Expand Down
4 changes: 3 additions & 1 deletion samples/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

-dontwarn com.google.android.apps.common.proguard.SideEffectFree
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ fun DeviceSigningVerifierCallback(callback: DeviceSigningVerifierCallback,
val currentOnCompleted by rememberUpdatedState(onCompleted)
val coroutineScope = rememberCoroutineScope()
val context = LocalContext.current
val scroll = rememberScrollState(0)
var showProgress by remember {
mutableStateOf(true)
}
Expand Down Expand Up @@ -85,8 +84,7 @@ fun DeviceSigningVerifierCallback(callback: DeviceSigningVerifierCallback,
border = BorderStroke(2.dp, Color.Black),
shape = MaterialTheme.shapes.medium) {
Text(modifier = Modifier
.padding(4.dp)
.verticalScroll(scroll),
.padding(4.dp),
text = callback.challenge)
}
Spacer(modifier = Modifier.height(8.dp))
Expand Down Expand Up @@ -143,9 +141,11 @@ suspend fun sign(context: Context, callback: DeviceSigningVerifierCallback) {
//custom error example
//callback.setClientError("UnAuth")
}

is DeviceBindingErrorStatus.Abort -> {
return@loop
}

is DeviceBindingErrorStatus.ClientNotRegistered -> {
return@loop
}
Expand Down
4 changes: 2 additions & 2 deletions samples/auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ android {

namespace 'org.forgerock.auth'

compileSdk 34
compileSdk 35
defaultConfig {
applicationId "org.forgerock.auth"
minSdkVersion 23
targetSdkVersion 34
targetSdkVersion 35
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
4 changes: 2 additions & 2 deletions samples/authenticator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ apply plugin: 'com.android.application'
android {

namespace 'org.forgerock.authenticator.sample'
compileSdk 34
compileSdk 35

defaultConfig {
applicationId "org.forgerock.authenticator.sample"
minSdkVersion 23
targetSdkVersion 34
targetSdkVersion 35
versionCode 1
versionName "1.0"

Expand Down
4 changes: 2 additions & 2 deletions samples/kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ plugins {
android {

namespace 'com.forgerock.kotlinapp'
compileSdk 34
compileSdk 35

defaultConfig {
applicationId "com.forgerock.kotlinapp"
minSdk 23
targetSdk 34
targetSdk 35
versionCode 1
versionName "1.0"

Expand Down
4 changes: 2 additions & 2 deletions samples/quickstart/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ plugins {
android {

namespace 'org.forgerock.quickstart'
compileSdk 34
compileSdk 35

defaultConfig {
applicationId "org.forgerock.quickstart"
minSdkVersion 23
targetSdkVersion 34
targetSdkVersion 35
versionCode 1
versionName "1.0"

Expand Down
1 change: 0 additions & 1 deletion samples/quickstart/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
Set usesCleartextTraffic only for test purpose,
it is highly recommend to set this attribute to false in production
-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
Expand Down

0 comments on commit f86a74c

Please sign in to comment.