-
Notifications
You must be signed in to change notification settings - Fork 49
Conversation
@@ -0,0 +1,49 @@ | |||
package zapsolutions.zap.connection.btcPay; | |||
|
|||
public class BTCPayConfiguration { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've only added the fields that we currently have in use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"certificateThumbprint" and "ssl" should maybe also included.
If I understood it correct, having ssl=false would mean falling back to certificateThumbprint, which actually is still ssl, as it uses LNDs generated sslCertificate instead of letsencryt one.
This case would have to be implemented in the other files as well though.
@rockstardev can you maybe comment on this? Did I understood that correct and is this case acutally important or does it not happen anyway?
app/src/main/java/zapsolutions/zap/setup/ConnectRemoteNodeActivity.java
Outdated
Show resolved
Hide resolved
app/src/main/java/zapsolutions/zap/setup/ConnectRemoteNodeActivity.java
Outdated
Show resolved
Hide resolved
# Conflicts: # app/src/main/java/zapsolutions/zap/connection/LndConnection.java # app/src/main/java/zapsolutions/zap/setup/ConnectRemoteNodeActivity.java # app/src/main/res/values-de/strings.xml # app/src/main/res/values/strings.xml
@@ -33,7 +33,7 @@ | |||
|
|||
|
|||
<!-- Theme for the QR-Code scanner activity. --> | |||
<style name="AppOverlayTheme" parent="@style/Theme.AppCompat.Light"> | |||
<style name="AppOverlayTheme" parent="@style/Theme.AppCompat"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelWuensch The light theme converted the text in the checkbox to black on my site.
@@ -239,6 +239,8 @@ | |||
<string name="error_connection_server_unreachable">Zeitüberschreitung.\nDer Server ist nicht erreichbar.\n\n- Bitte stelle sicher, dass du eine gute Internetverbindung hast.\n\n- Überprüfe ob der Server läuft und unter folgender IP-Adresse erreichbar ist:\n\n%1$s</string> | |||
<string name="error_connection_lnd_unavailable">Die Verbindung zum LND kann nicht hergestellt werden.\n\n- Stelle sicher, dass der LND deamon auf dem Server läuft.\n\n- Stelle sicher, dass Port forwarding aktiviert ist. (Port: %1$s)\n\n- Stelle sicher, dass das Zertifikat gültig ist.</string> | |||
<string name="error_connection_wallet_locked">Bitte entsperre die Wallet.</string> | |||
<string name="error_connection_btcpay_invalid_json">Die BTCPay Server Konfiguration hat eine ungültige JSON syntax.</string> | |||
<string name="error_connection_btcpay_invalid_config">Die BTCPay Server Konfiguration enthält keine Konfiguration für BTC GRPC.</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Server Konfiguration" should be "Serverkonfiguration"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those Germans and their concatenated nouns 😄
@@ -59,7 +60,7 @@ private void readSavedConnectionInfo() { | |||
mConnectionInfo = connectionInfo.split(";"); | |||
ZapLog.debug(LOG_TAG, connectionInfo); | |||
|
|||
if (mConnectionInfo[2].equals("null")) { | |||
if (mConnectionInfo[2].equals(BTCPayConfig.NO_CERT)) { | |||
// BTC PAY (no cert, hex encoded macaroon) | |||
mMacaroon = new MacaroonCallCredential(mConnectionInfo[3]); | |||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the else part the macaroon actually has to be created like this:
// LND Connect
String macaroonBase64UrlString = mConnectionInfo[3];
if (mConnectionInfo[2].equals("null")){
mMacaroon = new MacaroonCallCredential(mConnectionInfo[3]);
} else {
byte[] macaroonBytes = BaseEncoding.base64Url().decode(macaroonBase64UrlString);
String macaroon = BaseEncoding.base16().encode(macaroonBytes);
mMacaroon = new MacaroonCallCredential(macaroon);
}
This covers the case when we want to connect to a BtcPay with an lndconnect string.
In the future we will have to make sure that all our parsers already encode the macaroon in the same manner, so on the device the connection information is saved in the same format, no matter where it came from.
But this would require to reconnect the node after an update within the app.
One of the next things will probably Biometrics which will also require a reconnect. That's why I would wait with this refactor, so we need to do this only once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree, we should try to move the persisted config to a general format.
Biometrics are optional, so they would only require a reconnect for people that will use them, right?
What we could do is to support a legacy version for a few releases and with time stop supporting it, e.g. when the user base drops to a certain percentage of that version.
This PR enables support for BTCPay Server.
Description
Motivation and Context
Resolve issue: #32
How Has This Been Tested?
Set up a BTCPay Server instance to test the various connection strings/QR code.
If anyone has an instance running, would be happy for additional tests 👍
Screenshots (if appropriate):
Types of changes
Checklist: