Skip to content
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<p align="center">
<a href="https://github.com/ForgeRock">
<img src="https://www.forgerock.com/themes/custom/forgerock/images/fr-logo-horz-color.svg" alt="Logo">
<img src="https://www.pingidentity.com/content/dam/picr/nav/Ping-Logo-2.svg" alt="Logo">
</a>
<center>
<h2>ForgeRock Flutter Plugins</h2>
Expand Down Expand Up @@ -33,7 +33,7 @@ These are the available plugins in this repository.
* Access Management (AM) 6.5.2
* Android API level 23+
* iOS 12 and above
* Flutter SDK 2.10.x and above
* Flutter SDK 3.9.x and above

## Documentation

Expand Down Expand Up @@ -66,4 +66,4 @@ If you would like to contribute to this project you can fork the repository, clo

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
6 changes: 3 additions & 3 deletions forgerock-authenticator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<p align="center">
<a href="https://github.com/ForgeRock">
<img src="https://www.forgerock.com/themes/custom/forgerock/images/fr-logo-horz-color.svg" alt="Logo">
<img src="https://www.pingidentity.com/content/dam/picr/nav/Ping-Logo-2.svg" alt="Logo">
</a>
<center>
<h2>ForgeRock Authenticator Plugin</h2>
Expand Down Expand Up @@ -35,7 +35,7 @@ This project is provided as a Flutter plugin, a specialized package that include
* Access Management (AM) 6.5.2
* Android API level 23+
* iOS 12 and above
* Flutter SDK 2.10.x and above
* Flutter SDK 3.9.x and above

## Installation

Expand Down Expand Up @@ -89,4 +89,4 @@ If you would like to contribute to this project you can fork the repository, clo

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
30 changes: 22 additions & 8 deletions forgerock-authenticator/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
group 'com.forgerock.authenticator'
version '1.0'
group 'org.forgerock.forgerock_authenticator'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '2.1.0'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.google.gms:google-services:4.3.15'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0"
classpath 'com.android.tools.build:gradle:8.9.1'
classpath 'com.google.gms:google-services:4.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

Expand All @@ -25,19 +26,33 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 33
namespace 'org.forgerock.forgerock_authenticator'
compileSdk 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

defaultConfig {
minSdkVersion 23
consumerProguardFiles 'proguard-rules.pro'
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.annotation:annotation:1.6.0'
implementation 'androidx.activity:activity-ktx:1.7.2'
implementation 'com.google.firebase:firebase-messaging:23.1.2'
Expand All @@ -54,5 +69,4 @@ dependencies {
// implementation 'com.squareup.okhttp3:logging-interceptor:4.3.1'
// implementation 'androidx.biometric:biometric-ktx:1.2.0-alpha05'

}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Mon Oct 27 17:16:18 PDT 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
145 changes: 145 additions & 0 deletions forgerock-authenticator/android/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# ===================================
# Keep attributes for debugging and proper functionality
# ===================================
-keepattributes Signature
-keepattributes *Annotation*
-keepattributes SourceFile
-keepattributes LineNumberTable
-keepattributes EnclosingMethod
-keepattributes InnerClasses

# ===================================
# Gson - JSON Serialization (CRITICAL)
# ===================================
# Keep Gson TypeToken classes (fixes the TypeToken crash)
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken

# Keep generic signature of TypeToken (solves the TypeToken issue)
-keep class com.google.gson.internal.$Gson$Types { *; }
-keep class com.google.gson.internal.** { *; }

# Gson specific classes
-dontwarn sun.misc.**
-keep class sun.misc.Unsafe { *; }

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}

# Retain generic signatures of TypeToken and its subclasses with members
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken

# Keep generic type parameters for Gson
-keep class * implements com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Keep all classes that might be used with Gson reflection
-keepclassmembers class * {
@com.google.gson.annotations.SerializedName <fields>;
@com.google.gson.annotations.Expose <fields>;
}

# ===================================
# ForgeRock SDK (CRITICAL)
# ===================================
# Keep all ForgeRock classes and their generic signatures
-keep class org.forgerock.** { *; }
-keep interface org.forgerock.** { *; }

# Keep all model classes that might be serialized/deserialized
-keepclassmembers class org.forgerock.** {
<fields>;
<methods>;
}

# ===================================
# OkHttp3 - HTTP Client
# ===================================
# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**

# A resource is loaded with a relative path so the package of this class must be preserved.
-adaptresourcefilenames okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz

# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*

# OkHttp platform used only on JVM and when Conscrypt and other security providers are available.
-dontwarn okhttp3.internal.platform.**
-dontwarn org.conscrypt.**
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**

# Keep OkHttp classes
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**

# Keep Okio classes (OkHttp dependency)
-keep class okio.** { *; }
-dontwarn okio.**

# ===================================
# Nimbus JOSE+JWT - JWT/JWE Processing
# ===================================
# Keep Nimbus classes for JWT handling
-keep class com.nimbusds.** { *; }
-keep interface com.nimbusds.** { *; }
-dontwarn com.nimbusds.**

# Keep JWT and JWE classes
-keepclassmembers class com.nimbusds.jose.** { *; }
-keepclassmembers class com.nimbusds.jwt.** { *; }

# Keep cryptography providers
-keep class org.bouncycastle.** { *; }
-dontwarn org.bouncycastle.**
-keep class javax.crypto.** { *; }

# ===================================
# Kotlin and Coroutines
# ===================================
# Keep Kotlin metadata
-keep class kotlin.** { *; }
-keep class kotlin.Metadata { *; }
-dontwarn kotlin.**
-keepclassmembers class **$WhenMappings {
<fields>;
}
-keepclassmembers class kotlin.Metadata {
public <methods>;
}

# Kotlinx Coroutines
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
-keepclassmembers class kotlinx.coroutines.** {
volatile <fields>;
}
-keepclassmembers class kotlin.coroutines.SafeContinuation {
volatile <fields>;
}
-dontwarn kotlinx.coroutines.**

# ===================================
# AndroidX and Support Libraries
# ===================================
-keep class androidx.** { *; }
-keep interface androidx.** { *; }
-dontwarn androidx.**

# Keep AndroidX Biometric classes (if used)
-keep class androidx.biometric.** { *; }

# ===================================
# Firebase and Google Play Services
# ===================================
-keep class com.google.firebase.** { *; }
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.firebase.**
-dontwarn com.google.android.gms.**
3 changes: 1 addition & 2 deletions forgerock-authenticator/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.forgerock.forgerock_authenticator">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Expand Down
63 changes: 37 additions & 26 deletions forgerock-authenticator/example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'dev.flutter.flutter-gradle-plugin'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localPropertiesFile.withReader("UTF-8") { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = '1'
flutterVersionCode = "1"
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) {
flutterVersionName = '1.0'
flutterVersionName = "1.0"
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

// The keystore.properties holds configuration for the release keystore
def keystorePropertiesFile = rootProject.file("key.properties")
def keystorePropertiesFileExists = keystorePropertiesFile.exists()
Expand All @@ -34,12 +34,13 @@ if (keystorePropertiesFileExists) {
}

android {
compileSdkVersion 33
namespace "com.example.authenticator"
compileSdk flutter.compileSdkVersion

defaultConfig {
applicationId "com.example.authenticator"
minSdkVersion 23
targetSdkVersion 33
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName

Expand All @@ -60,16 +61,29 @@ android {
buildTypes {
debug {
signingConfig signingConfigs.debug
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
release {
if (keystorePropertiesFileExists) {
signingConfig signingConfigs.release
}
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
lint {
abortOnError = false
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}

Expand All @@ -78,12 +92,9 @@ flutter {
}

dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

implementation 'com.google.firebase:firebase-messaging:23.1.1'
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
}
Loading
Loading