Blockstream / green_android

Blockstream Green Wallet for Android
GNU General Public License v3.0
184 stars 74 forks source link

2fa resolver: use 'required_data' only to determine actions neeeding HWW resolution #123

Closed jgriffiths closed 3 years ago

jgriffiths commented 3 years ago

Device information will be moving to required_data in due course, this change is compatible with the currently used gdk version.

lvaccaro commented 3 years ago

utack caf65771626d4ab83ccbfcf8e362b7d410aec223

For the same reason, some small updates in the app will follow the MR.

I think device could be also removed from TwoFactorStatusData https://github.com/Blockstream/green_android/blob/ed95135ddda33dcaaa77d4ca2e2d5c4286423e1b/crypto/src/main/java/com/greenaddress/greenapi/data/TwoFactorStatusData.java#L21

Moreover there is a still working progress refactoring in kotlin inside the crypto package which requires a similar updates https://github.com/Blockstream/green_android/blob/ed95135ddda33dcaaa77d4ca2e2d5c4286423e1b/crypto/src/main/java/com/blockstream/gdk/AuthHandler.kt#L81

lvaccaro commented 3 years ago

sorry to be a be late on testing, it requires to add the @JsonIgnoreProperties annotation to ignore the unused device field, as the follow:

iff --git a/crypto/src/main/java/com/greenaddress/greenapi/data/TwoFactorStatusData.java b/crypto/src/main/java/com/greenaddress/greenapi/data/TwoFactorStatusData.java
index b441b21b..59a68e44 100644
--- a/crypto/src/main/java/com/greenaddress/greenapi/data/TwoFactorStatusData.java
+++ b/crypto/src/main/java/com/greenaddress/greenapi/data/TwoFactorStatusData.java
@@ -1,5 +1,6 @@
 package com.greenaddress.greenapi.data;

+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.databind.PropertyNamingStrategy;
 import com.fasterxml.jackson.databind.annotation.JsonNaming;
@@ -9,6 +10,7 @@ import java.util.List;

 @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
 @JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
 public class TwoFactorStatusData extends JSONData {
     private String status;
     private String action;
lvaccaro commented 3 years ago

ack 3067d1957452db8a98ff9c54b8a5aebb379bd255