This commit is contained in:
parent
7c45b1e075
commit
f695dbf115
|
@ -27,17 +27,22 @@ class StatusOkHttpClientFactory implements OkHttpClientFactory {
|
||||||
X509Certificate cert = null;
|
X509Certificate cert = null;
|
||||||
HandshakeCertificates clientCertificates;
|
HandshakeCertificates clientCertificates;
|
||||||
String certPem = "";
|
String certPem = "";
|
||||||
|
|
||||||
// Get TLS PEM certificate from status-go
|
// Get TLS PEM certificate from status-go
|
||||||
try {
|
try {
|
||||||
// induce half second sleep because sometimes a cert is not immediately available
|
// induce half second sleep because sometimes a cert is not immediately available
|
||||||
// TODO : remove sleep if App no longer crashes on Android 10 devices with
|
// TODO : remove sleep if App no longer crashes on Android 10 devices with
|
||||||
// java.lang.RuntimeException: Could not invoke WebSocketModule.connect
|
// java.lang.RuntimeException: Could not invoke WebSocketModule.connect
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
certPem = StatusPackage.getImageTLSCert();
|
certPem = getCertificatePem();
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
Log.e(TAG, "Could not getImageTLSCert",e);
|
Log.e(TAG, "Could not getImageTLSCert",e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (certPem.isEmpty()) {
|
||||||
|
Log.e(TAG, "Certificate is empty, cannot create OkHttpClient without a valid certificate");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// Convert PEM certificate string to X509Certificate object
|
// Convert PEM certificate string to X509Certificate object
|
||||||
try {
|
try {
|
||||||
// induce half second sleep because sometimes a cert is not immediately available
|
// induce half second sleep because sometimes a cert is not immediately available
|
||||||
|
@ -74,4 +79,17 @@ class StatusOkHttpClientFactory implements OkHttpClientFactory {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private String getCertificatePem() {
|
||||||
|
try {
|
||||||
|
String certPem = StatusPackage.getImageTLSCert();
|
||||||
|
if (certPem == null || certPem.trim().isEmpty()) {
|
||||||
|
Log.e(TAG, "Certificate PEM string is null or empty");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return certPem;
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "Could not getImageTLSCert", e);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,10 +43,10 @@
|
||||||
{:keys [key-uid]} (first (sort-by :timestamp > (vals profiles)))]
|
{:keys [key-uid]} (first (sort-by :timestamp > (vals profiles)))]
|
||||||
(rf/merge cofx
|
(rf/merge cofx
|
||||||
(navigation/init-root :profiles)
|
(navigation/init-root :profiles)
|
||||||
(init-profiles-overview profiles key-uid)
|
(when key-uid (init-profiles-overview profiles key-uid))
|
||||||
;;we check if biometric is available, and try to login with it,
|
;;we check if biometric is available, and try to login with it,
|
||||||
;;if succeed "node.login" signal will be triggered
|
;;if succeed "node.login" signal will be triggered
|
||||||
(profile.login/login-with-biometric-if-available key-uid)))
|
(when key-uid (profile.login/login-with-biometric-if-available key-uid))))
|
||||||
(navigation/init-root cofx :intro)))
|
(navigation/init-root cofx :intro)))
|
||||||
|
|
||||||
(rf/defn update-setting-from-backup
|
(rf/defn update-setting-from-backup
|
||||||
|
|
|
@ -5,8 +5,10 @@
|
||||||
|
|
||||||
(defn rpc->profiles-overview
|
(defn rpc->profiles-overview
|
||||||
[{:keys [customizationColor keycard-pairing] :as profile}]
|
[{:keys [customizationColor keycard-pairing] :as profile}]
|
||||||
|
(if (map? profile)
|
||||||
(-> profile
|
(-> profile
|
||||||
(dissoc :customizationColor)
|
(dissoc :customizationColor)
|
||||||
(assoc :customization-color (keyword customizationColor))
|
(assoc :customization-color (keyword customizationColor))
|
||||||
(assoc :ens-name? (utils.ens/is-valid-eth-name? (:name profile)))
|
(assoc :ens-name? (utils.ens/is-valid-eth-name? (:name profile)))
|
||||||
(assoc :keycard-pairing (when-not (string/blank? keycard-pairing) keycard-pairing))))
|
(assoc :keycard-pairing (when-not (string/blank? keycard-pairing) keycard-pairing)))
|
||||||
|
profile))
|
||||||
|
|
Loading…
Reference in New Issue