Skip to content

Commit

Permalink
Fix Moshi Serialization Bug (#132)
Browse files Browse the repository at this point in the history
* updated android release workflow

* replace moshi file serialization

* updated changelog

* updated flutter version
  • Loading branch information
jumaallan authored Dec 16, 2024
1 parent 87c4e27 commit 07cda05
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
flutter-version: ['3.10.6', '3.22.2']
flutter-version: ['3.24.0']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Read version
id: read-file
run: |
sed -i "s/\(version findProperty(\"SDK_VERSION\") ?: \).*/\1\"$(echo "${{ github.event.inputs.android_release_version }}" | cut -c 2-)\"/" android/build.gradle
sed -i "s/\(def smileVersion = findProperty('smileVersion') ?: \).*/\1'$(echo "${{ github.event.inputs.android_release_version }}" | cut -c 2-)'/" android/build.gradle
- name: Commit and Push Changes
run: |
git config user.name "GitHub Actions"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 10.3.1

* Fixed Moshi configuration to only use FileAdapter which uses absolute path

## 10.3.0

* Introduce screens for the new Enhanced Selfie Capture Enrollment and Authentication Products (Android).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package com.smileidentity.flutter.enhanced
import android.content.Context
import androidx.compose.runtime.Composable
import com.smileidentity.SmileID
import com.smileidentity.SmileID.moshi
import com.smileidentity.compose.SmartSelfieAuthenticationEnhanced
import com.smileidentity.flutter.SmileComposablePlatformView
import com.smileidentity.networking.FileAdapter
import com.smileidentity.results.SmartSelfieResult
import com.smileidentity.results.SmileIDResult
import com.smileidentity.util.randomUserId
import com.squareup.moshi.Moshi
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.StandardMessageCodec
import io.flutter.plugin.platform.PlatformView
Expand All @@ -35,6 +36,10 @@ internal class SmileIDSmartSelfieAuthenticationEnhanced private constructor(
showInstructions = args["showInstructions"] as? Boolean ?: true,
extraPartnerParams = extraPartnerParams.toImmutableMap(),
) {
val moshi =
Moshi.Builder()
.add(FileAdapter)
.build()
when (it) {
is SmileIDResult.Success -> {
val result =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package com.smileidentity.flutter.enhanced
import android.content.Context
import androidx.compose.runtime.Composable
import com.smileidentity.SmileID
import com.smileidentity.SmileID.moshi
import com.smileidentity.compose.SmartSelfieEnrollmentEnhanced
import com.smileidentity.flutter.SmileComposablePlatformView
import com.smileidentity.networking.FileAdapter
import com.smileidentity.results.SmartSelfieResult
import com.smileidentity.results.SmileIDResult
import com.smileidentity.util.randomUserId
import com.squareup.moshi.Moshi
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.StandardMessageCodec
import io.flutter.plugin.platform.PlatformView
Expand All @@ -35,6 +36,10 @@ internal class SmileIDSmartSelfieEnrollmentEnhanced private constructor(
showInstructions = args["showInstructions"] as? Boolean ?: true,
extraPartnerParams = extraPartnerParams.toImmutableMap(),
) {
val moshi =
Moshi.Builder()
.add(FileAdapter)
.build()
when (it) {
is SmileIDResult.Success -> {
val result =
Expand Down

0 comments on commit 07cda05

Please sign in to comment.