Alternative key exchange by providing the public key in the URI (bugfixes)
This commit is contained in:
parent
911dfa7a27
commit
a8dada6c89
@ -64,18 +64,20 @@ public class CreateAddressActivity extends AppCompatActivity {
|
|||||||
String[] parameters = getParameters(uri);
|
String[] parameters = getParameters(uri);
|
||||||
for (String parameter : parameters) {
|
for (String parameter : parameters) {
|
||||||
Matcher matcher = KEY_VALUE_PATTERN.matcher(parameter);
|
Matcher matcher = KEY_VALUE_PATTERN.matcher(parameter);
|
||||||
String key = matcher.group(1).toLowerCase();
|
if (matcher.find()) {
|
||||||
String value = matcher.group(2);
|
String key = matcher.group(1).toLowerCase();
|
||||||
switch (key) {
|
String value = matcher.group(2);
|
||||||
case "label":
|
switch (key) {
|
||||||
label.setText(value.trim());
|
case "label":
|
||||||
break;
|
label.setText(value.trim());
|
||||||
case "action":
|
break;
|
||||||
subscribe.setChecked(value.trim().equalsIgnoreCase("subscribe"));
|
case "action":
|
||||||
break;
|
subscribe.setChecked(value.trim().equalsIgnoreCase("subscribe"));
|
||||||
case "pubkey":
|
break;
|
||||||
pubkeyBytes = Base64.decode(value, URL_SAFE);
|
case "pubkey":
|
||||||
break;
|
pubkeyBytes = Base64.decode(value, URL_SAFE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ import ch.dissem.bitmessage.exception.ApplicationException;
|
|||||||
|
|
||||||
import static android.graphics.Color.BLACK;
|
import static android.graphics.Color.BLACK;
|
||||||
import static android.graphics.Color.WHITE;
|
import static android.graphics.Color.WHITE;
|
||||||
|
import static android.util.Base64.NO_WRAP;
|
||||||
import static android.util.Base64.URL_SAFE;
|
import static android.util.Base64.URL_SAFE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -85,7 +86,7 @@ public class Drawables {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ApplicationException(e);
|
throw new ApplicationException(e);
|
||||||
}
|
}
|
||||||
link.append("pubkey=").append(Base64.encodeToString(pubkey.toByteArray(), URL_SAFE));
|
link.append("pubkey=").append(Base64.encodeToString(pubkey.toByteArray(), URL_SAFE | NO_WRAP));
|
||||||
}
|
}
|
||||||
BitMatrix result;
|
BitMatrix result;
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user