Fix awg2 fields

This commit is contained in:
NickVs2015
2025-11-18 11:43:41 +03:00
parent ade016a11c
commit 7aea733671
6 changed files with 771 additions and 71 deletions

View File

@@ -84,10 +84,17 @@ public class BadConfigException extends Exception {
JUNK_PACKET_MAX_SIZE("JunkPacketMaxSize"),
INIT_PACKET_JUNK_SIZE("InitPacketJunkSize"),
RESPONSE_PACKET_JUNK_SIZE("ResponsePacketJunkSize"),
COOKIE_REPLY_PACKET_JUNK_SIZE("CookieReplyPacketJunkSize"),
TRANSPORT_PACKET_JUNK_SIZE("TransportPacketJunkSize"),
INIT_PACKET_MAGIC_HEADER("InitPacketMagicHeader"),
RESPONSE_PACKET_MAGIC_HEADER("ResponsePacketMagicHeader"),
UNDERLOAD_PACKET_MAGIC_HEADER("UnderloadPacketMagicHeader"),
TRANSPORT_PACKET_MAGIC_HEADER("TransportPacketMagicHeader");
TRANSPORT_PACKET_MAGIC_HEADER("TransportPacketMagicHeader"),
SPECIAL_JUNK_I1("SpecialJunkI1"),
SPECIAL_JUNK_I2("SpecialJunkI2"),
SPECIAL_JUNK_I3("SpecialJunkI3"),
SPECIAL_JUNK_I4("SpecialJunkI4"),
SPECIAL_JUNK_I5("SpecialJunkI5");
private final String name;

View File

@@ -51,10 +51,17 @@ public final class Interface {
private final Optional<Integer> junkPacketMaxSize;
private final Optional<Integer> initPacketJunkSize;
private final Optional<Integer> responsePacketJunkSize;
private final Optional<Long> initPacketMagicHeader;
private final Optional<Long> responsePacketMagicHeader;
private final Optional<Long> underloadPacketMagicHeader;
private final Optional<Long> transportPacketMagicHeader;
private final Optional<Integer> cookieReplyPacketJunkSize;
private final Optional<Integer> transportPacketJunkSize;
private final Optional<String> initPacketMagicHeader;
private final Optional<String> responsePacketMagicHeader;
private final Optional<String> underloadPacketMagicHeader;
private final Optional<String> transportPacketMagicHeader;
private final Optional<String> specialJunkI1;
private final Optional<String> specialJunkI2;
private final Optional<String> specialJunkI3;
private final Optional<String> specialJunkI4;
private final Optional<String> specialJunkI5;
private Interface(final Builder builder) {
// Defensively copy to ensure immutability even if the Builder is reused.
@@ -71,10 +78,17 @@ public final class Interface {
junkPacketMaxSize = builder.junkPacketMaxSize;
initPacketJunkSize = builder.initPacketJunkSize;
responsePacketJunkSize = builder.responsePacketJunkSize;
cookieReplyPacketJunkSize = builder.cookieReplyPacketJunkSize;
transportPacketJunkSize = builder.transportPacketJunkSize;
initPacketMagicHeader = builder.initPacketMagicHeader;
responsePacketMagicHeader = builder.responsePacketMagicHeader;
underloadPacketMagicHeader = builder.underloadPacketMagicHeader;
transportPacketMagicHeader = builder.transportPacketMagicHeader;
specialJunkI1 = builder.specialJunkI1;
specialJunkI2 = builder.specialJunkI2;
specialJunkI3 = builder.specialJunkI3;
specialJunkI4 = builder.specialJunkI4;
specialJunkI5 = builder.specialJunkI5;
}
/**
@@ -128,6 +142,12 @@ public final class Interface {
case "s2":
builder.parseResponsePacketJunkSize(attribute.getValue());
break;
case "s3":
builder.parseCookieReplyPacketJunkSize(attribute.getValue());
break;
case "s4":
builder.parseTransportPacketJunkSize(attribute.getValue());
break;
case "h1":
builder.parseInitPacketMagicHeader(attribute.getValue());
break;
@@ -140,6 +160,21 @@ public final class Interface {
case "h4":
builder.parseTransportPacketMagicHeader(attribute.getValue());
break;
case "i1":
builder.parseSpecialJunkI1(attribute.getValue());
break;
case "i2":
builder.parseSpecialJunkI2(attribute.getValue());
break;
case "i3":
builder.parseSpecialJunkI3(attribute.getValue());
break;
case "i4":
builder.parseSpecialJunkI4(attribute.getValue());
break;
case "i5":
builder.parseSpecialJunkI5(attribute.getValue());
break;
default:
throw new BadConfigException(Section.INTERFACE, Location.TOP_LEVEL,
Reason.UNKNOWN_ATTRIBUTE, attribute.getKey());
@@ -166,10 +201,17 @@ public final class Interface {
&& junkPacketMaxSize.equals(other.junkPacketMaxSize)
&& initPacketJunkSize.equals(other.initPacketJunkSize)
&& responsePacketJunkSize.equals(other.responsePacketJunkSize)
&& cookieReplyPacketJunkSize.equals(other.cookieReplyPacketJunkSize)
&& transportPacketJunkSize.equals(other.transportPacketJunkSize)
&& initPacketMagicHeader.equals(other.initPacketMagicHeader)
&& responsePacketMagicHeader.equals(other.responsePacketMagicHeader)
&& underloadPacketMagicHeader.equals(other.underloadPacketMagicHeader)
&& transportPacketMagicHeader.equals(other.transportPacketMagicHeader);
&& transportPacketMagicHeader.equals(other.transportPacketMagicHeader)
&& specialJunkI1.equals(other.specialJunkI1)
&& specialJunkI2.equals(other.specialJunkI2)
&& specialJunkI3.equals(other.specialJunkI3)
&& specialJunkI4.equals(other.specialJunkI4)
&& specialJunkI5.equals(other.specialJunkI5);
}
/**
@@ -294,12 +336,30 @@ public final class Interface {
return responsePacketJunkSize;
}
/**
* Returns the cookieReplyPacketJunkSize used for the AmneziaWG interface.
*
* @return the cookieReplyPacketJunkSize, or {@code Optional.empty()} if none is configured
*/
public Optional<Integer> getCookieReplyPacketJunkSize() {
return cookieReplyPacketJunkSize;
}
/**
* Returns the transportPacketJunkSize used for the AmneziaWG interface.
*
* @return the transportPacketJunkSize, or {@code Optional.empty()} if none is configured
*/
public Optional<Integer> getTransportPacketJunkSize() {
return transportPacketJunkSize;
}
/**
* Returns the initPacketMagicHeader used for the AmneziaWG interface.
*
* @return the initPacketMagicHeader, or {@code Optional.empty()} if none is configured
*/
public Optional<Long> getInitPacketMagicHeader() {
public Optional<String> getInitPacketMagicHeader() {
return initPacketMagicHeader;
}
@@ -308,7 +368,7 @@ public final class Interface {
*
* @return the responsePacketMagicHeader, or {@code Optional.empty()} if none is configured
*/
public Optional<Long> getResponsePacketMagicHeader() {
public Optional<String> getResponsePacketMagicHeader() {
return responsePacketMagicHeader;
}
@@ -317,7 +377,7 @@ public final class Interface {
*
* @return the underloadPacketMagicHeader, or {@code Optional.empty()} if none is configured
*/
public Optional<Long> getUnderloadPacketMagicHeader() {
public Optional<String> getUnderloadPacketMagicHeader() {
return underloadPacketMagicHeader;
}
@@ -326,10 +386,55 @@ public final class Interface {
*
* @return the transportPacketMagicHeader, or {@code Optional.empty()} if none is configured
*/
public Optional<Long> getTransportPacketMagicHeader() {
public Optional<String> getTransportPacketMagicHeader() {
return transportPacketMagicHeader;
}
/**
* Returns the specialJunkI1 used for the AmneziaWG interface.
*
* @return the specialJunkI1, or {@code Optional.empty()} if none is configured
*/
public Optional<String> getSpecialJunkI1() {
return specialJunkI1;
}
/**
* Returns the specialJunkI2 used for the AmneziaWG interface.
*
* @return the specialJunkI2, or {@code Optional.empty()} if none is configured
*/
public Optional<String> getSpecialJunkI2() {
return specialJunkI2;
}
/**
* Returns the specialJunkI3 used for the AmneziaWG interface.
*
* @return the specialJunkI3, or {@code Optional.empty()} if none is configured
*/
public Optional<String> getSpecialJunkI3() {
return specialJunkI3;
}
/**
* Returns the specialJunkI4 used for the AmneziaWG interface.
*
* @return the specialJunkI4, or {@code Optional.empty()} if none is configured
*/
public Optional<String> getSpecialJunkI4() {
return specialJunkI4;
}
/**
* Returns the specialJunkI5 used for the AmneziaWG interface.
*
* @return the specialJunkI5, or {@code Optional.empty()} if none is configured
*/
public Optional<String> getSpecialJunkI5() {
return specialJunkI5;
}
@Override
public int hashCode() {
@@ -346,10 +451,17 @@ public final class Interface {
hash = 31 * hash + junkPacketMaxSize.hashCode();
hash = 31 * hash + initPacketJunkSize.hashCode();
hash = 31 * hash + responsePacketJunkSize.hashCode();
hash = 31 * hash + cookieReplyPacketJunkSize.hashCode();
hash = 31 * hash + transportPacketJunkSize.hashCode();
hash = 31 * hash + initPacketMagicHeader.hashCode();
hash = 31 * hash + responsePacketMagicHeader.hashCode();
hash = 31 * hash + underloadPacketMagicHeader.hashCode();
hash = 31 * hash + transportPacketMagicHeader.hashCode();
hash = 31 * hash + specialJunkI1.hashCode();
hash = 31 * hash + specialJunkI2.hashCode();
hash = 31 * hash + specialJunkI3.hashCode();
hash = 31 * hash + specialJunkI4.hashCode();
hash = 31 * hash + specialJunkI5.hashCode();
return hash;
}
@@ -394,10 +506,17 @@ public final class Interface {
junkPacketMaxSize.ifPresent(jmax -> sb.append("Jmax = ").append(jmax).append('\n'));
initPacketJunkSize.ifPresent(s1 -> sb.append("S1 = ").append(s1).append('\n'));
responsePacketJunkSize.ifPresent(s2 -> sb.append("S2 = ").append(s2).append('\n'));
cookieReplyPacketJunkSize.ifPresent(s3 -> sb.append("S3 = ").append(s3).append('\n'));
transportPacketJunkSize.ifPresent(s4 -> sb.append("S4 = ").append(s4).append('\n'));
initPacketMagicHeader.ifPresent(h1 -> sb.append("H1 = ").append(h1).append('\n'));
responsePacketMagicHeader.ifPresent(h2 -> sb.append("H2 = ").append(h2).append('\n'));
underloadPacketMagicHeader.ifPresent(h3 -> sb.append("H3 = ").append(h3).append('\n'));
transportPacketMagicHeader.ifPresent(h4 -> sb.append("H4 = ").append(h4).append('\n'));
specialJunkI1.ifPresent(i1 -> sb.append("I1 = ").append(i1).append('\n'));
specialJunkI2.ifPresent(i2 -> sb.append("I2 = ").append(i2).append('\n'));
specialJunkI3.ifPresent(i3 -> sb.append("I3 = ").append(i3).append('\n'));
specialJunkI4.ifPresent(i4 -> sb.append("I4 = ").append(i4).append('\n'));
specialJunkI5.ifPresent(i5 -> sb.append("I5 = ").append(i5).append('\n'));
sb.append("PrivateKey = ").append(keyPair.getPrivateKey().toBase64()).append('\n');
return sb.toString();
}
@@ -417,10 +536,17 @@ public final class Interface {
junkPacketMaxSize.ifPresent(jmax -> sb.append("jmax=").append(jmax).append('\n'));
initPacketJunkSize.ifPresent(s1 -> sb.append("s1=").append(s1).append('\n'));
responsePacketJunkSize.ifPresent(s2 -> sb.append("s2=").append(s2).append('\n'));
cookieReplyPacketJunkSize.ifPresent(s3 -> sb.append("s3=").append(s3).append('\n'));
transportPacketJunkSize.ifPresent(s4 -> sb.append("s4=").append(s4).append('\n'));
initPacketMagicHeader.ifPresent(h1 -> sb.append("h1=").append(h1).append('\n'));
responsePacketMagicHeader.ifPresent(h2 -> sb.append("h2=").append(h2).append('\n'));
underloadPacketMagicHeader.ifPresent(h3 -> sb.append("h3=").append(h3).append('\n'));
transportPacketMagicHeader.ifPresent(h4 -> sb.append("h4=").append(h4).append('\n'));
specialJunkI1.ifPresent(i1 -> sb.append("i1=").append(i1).append('\n'));
specialJunkI2.ifPresent(i2 -> sb.append("i2=").append(i2).append('\n'));
specialJunkI3.ifPresent(i3 -> sb.append("i3=").append(i3).append('\n'));
specialJunkI4.ifPresent(i4 -> sb.append("i4=").append(i4).append('\n'));
specialJunkI5.ifPresent(i5 -> sb.append("i5=").append(i5).append('\n'));
return sb.toString();
}
@@ -453,13 +579,27 @@ public final class Interface {
// Defaults to not present.
private Optional<Integer> responsePacketJunkSize = Optional.empty();
// Defaults to not present.
private Optional<Long> initPacketMagicHeader = Optional.empty();
private Optional<Integer> cookieReplyPacketJunkSize = Optional.empty();
// Defaults to not present.
private Optional<Long> responsePacketMagicHeader = Optional.empty();
private Optional<Integer> transportPacketJunkSize = Optional.empty();
// Defaults to not present.
private Optional<Long> underloadPacketMagicHeader = Optional.empty();
private Optional<String> initPacketMagicHeader = Optional.empty();
// Defaults to not present.
private Optional<Long> transportPacketMagicHeader = Optional.empty();
private Optional<String> responsePacketMagicHeader = Optional.empty();
// Defaults to not present.
private Optional<String> underloadPacketMagicHeader = Optional.empty();
// Defaults to not present.
private Optional<String> transportPacketMagicHeader = Optional.empty();
// Defaults to not present.
private Optional<String> specialJunkI1 = Optional.empty();
// Defaults to not present.
private Optional<String> specialJunkI2 = Optional.empty();
// Defaults to not present.
private Optional<String> specialJunkI3 = Optional.empty();
// Defaults to not present.
private Optional<String> specialJunkI4 = Optional.empty();
// Defaults to not present.
private Optional<String> specialJunkI5 = Optional.empty();
public Builder addAddress(final InetNetwork address) {
@@ -613,37 +753,101 @@ public final class Interface {
}
}
public Builder parseInitPacketMagicHeader(final String initPacketMagicHeader) throws BadConfigException {
public Builder parseCookieReplyPacketJunkSize(final String cookieReplyPacketJunkSize) throws BadConfigException {
try {
return setInitPacketMagicHeader(Long.parseLong(initPacketMagicHeader));
return setCookieReplyPacketJunkSize(Integer.parseInt(cookieReplyPacketJunkSize));
} catch (final NumberFormatException e) {
throw new BadConfigException(Section.INTERFACE, Location.INIT_PACKET_MAGIC_HEADER, initPacketMagicHeader, e);
throw new BadConfigException(Section.INTERFACE, Location.COOKIE_REPLY_PACKET_JUNK_SIZE, cookieReplyPacketJunkSize, e);
}
}
public Builder parseTransportPacketJunkSize(final String transportPacketJunkSize) throws BadConfigException {
try {
return setTransportPacketJunkSize(Integer.parseInt(transportPacketJunkSize));
} catch (final NumberFormatException e) {
throw new BadConfigException(Section.INTERFACE, Location.TRANSPORT_PACKET_JUNK_SIZE, transportPacketJunkSize, e);
}
}
public Builder parseInitPacketMagicHeader(final String initPacketMagicHeader) throws BadConfigException {
if (initPacketMagicHeader == null || initPacketMagicHeader.trim().isEmpty()) {
this.initPacketMagicHeader = Optional.empty();
} else {
this.initPacketMagicHeader = Optional.of(initPacketMagicHeader.trim());
}
return this;
}
public Builder parseResponsePacketMagicHeader(final String responsePacketMagicHeader) throws BadConfigException {
try {
return setResponsePacketMagicHeader(Long.parseLong(responsePacketMagicHeader));
} catch (final NumberFormatException e) {
throw new BadConfigException(Section.INTERFACE, Location.RESPONSE_PACKET_MAGIC_HEADER, responsePacketMagicHeader, e);
if (responsePacketMagicHeader == null || responsePacketMagicHeader.trim().isEmpty()) {
this.responsePacketMagicHeader = Optional.empty();
} else {
this.responsePacketMagicHeader = Optional.of(responsePacketMagicHeader.trim());
}
return this;
}
public Builder parseUnderloadPacketMagicHeader(final String underloadPacketMagicHeader) throws BadConfigException {
try {
return setUnderloadPacketMagicHeader(Long.parseLong(underloadPacketMagicHeader));
} catch (final NumberFormatException e) {
throw new BadConfigException(Section.INTERFACE, Location.UNDERLOAD_PACKET_MAGIC_HEADER, underloadPacketMagicHeader, e);
if (underloadPacketMagicHeader == null || underloadPacketMagicHeader.trim().isEmpty()) {
this.underloadPacketMagicHeader = Optional.empty();
} else {
this.underloadPacketMagicHeader = Optional.of(underloadPacketMagicHeader.trim());
}
return this;
}
public Builder parseTransportPacketMagicHeader(final String transportPacketMagicHeader) throws BadConfigException {
try {
return setTransportPacketMagicHeader(Long.parseLong(transportPacketMagicHeader));
} catch (final NumberFormatException e) {
throw new BadConfigException(Section.INTERFACE, Location.TRANSPORT_PACKET_MAGIC_HEADER, transportPacketMagicHeader, e);
if (transportPacketMagicHeader == null || transportPacketMagicHeader.trim().isEmpty()) {
this.transportPacketMagicHeader = Optional.empty();
} else {
this.transportPacketMagicHeader = Optional.of(transportPacketMagicHeader.trim());
}
return this;
}
public Builder parseSpecialJunkI1(final String specialJunkI1) throws BadConfigException {
if (specialJunkI1 == null || specialJunkI1.trim().isEmpty()) {
this.specialJunkI1 = Optional.empty();
} else {
this.specialJunkI1 = Optional.of(specialJunkI1.trim());
}
return this;
}
public Builder parseSpecialJunkI2(final String specialJunkI2) throws BadConfigException {
if (specialJunkI2 == null || specialJunkI2.trim().isEmpty()) {
this.specialJunkI2 = Optional.empty();
} else {
this.specialJunkI2 = Optional.of(specialJunkI2.trim());
}
return this;
}
public Builder parseSpecialJunkI3(final String specialJunkI3) throws BadConfigException {
if (specialJunkI3 == null || specialJunkI3.trim().isEmpty()) {
this.specialJunkI3 = Optional.empty();
} else {
this.specialJunkI3 = Optional.of(specialJunkI3.trim());
}
return this;
}
public Builder parseSpecialJunkI4(final String specialJunkI4) throws BadConfigException {
if (specialJunkI4 == null || specialJunkI4.trim().isEmpty()) {
this.specialJunkI4 = Optional.empty();
} else {
this.specialJunkI4 = Optional.of(specialJunkI4.trim());
}
return this;
}
public Builder parseSpecialJunkI5(final String specialJunkI5) throws BadConfigException {
if (specialJunkI5 == null || specialJunkI5.trim().isEmpty()) {
this.specialJunkI5 = Optional.empty();
} else {
this.specialJunkI5 = Optional.of(specialJunkI5.trim());
}
return this;
}
public Builder parsePrivateKey(final String privateKey) throws BadConfigException {
@@ -715,35 +919,100 @@ public final class Interface {
return this;
}
public Builder setInitPacketMagicHeader(final long initPacketMagicHeader) throws BadConfigException {
if (initPacketMagicHeader < 0)
throw new BadConfigException(Section.INTERFACE, Location.INIT_PACKET_MAGIC_HEADER,
Reason.INVALID_VALUE, String.valueOf(initPacketMagicHeader));
this.initPacketMagicHeader = initPacketMagicHeader == 0 ? Optional.empty() : Optional.of(initPacketMagicHeader);
public Builder setCookieReplyPacketJunkSize(final int cookieReplyPacketJunkSize) throws BadConfigException {
if (cookieReplyPacketJunkSize < 0)
throw new BadConfigException(Section.INTERFACE, Location.COOKIE_REPLY_PACKET_JUNK_SIZE,
Reason.INVALID_VALUE, String.valueOf(cookieReplyPacketJunkSize));
this.cookieReplyPacketJunkSize = cookieReplyPacketJunkSize == 0 ? Optional.empty() : Optional.of(cookieReplyPacketJunkSize);
return this;
}
public Builder setResponsePacketMagicHeader(final long responsePacketMagicHeader) throws BadConfigException {
if (responsePacketMagicHeader < 0)
throw new BadConfigException(Section.INTERFACE, Location.RESPONSE_PACKET_MAGIC_HEADER,
Reason.INVALID_VALUE, String.valueOf(responsePacketMagicHeader));
this.responsePacketMagicHeader = responsePacketMagicHeader == 0 ? Optional.empty() : Optional.of(responsePacketMagicHeader);
public Builder setTransportPacketJunkSize(final int transportPacketJunkSize) throws BadConfigException {
if (transportPacketJunkSize < 0)
throw new BadConfigException(Section.INTERFACE, Location.TRANSPORT_PACKET_JUNK_SIZE,
Reason.INVALID_VALUE, String.valueOf(transportPacketJunkSize));
this.transportPacketJunkSize = transportPacketJunkSize == 0 ? Optional.empty() : Optional.of(transportPacketJunkSize);
return this;
}
public Builder setUnderloadPacketMagicHeader(final long underloadPacketMagicHeader) throws BadConfigException {
if (underloadPacketMagicHeader < 0)
throw new BadConfigException(Section.INTERFACE, Location.UNDERLOAD_PACKET_MAGIC_HEADER,
Reason.INVALID_VALUE, String.valueOf(underloadPacketMagicHeader));
this.underloadPacketMagicHeader = underloadPacketMagicHeader == 0 ? Optional.empty() : Optional.of(underloadPacketMagicHeader);
public Builder setInitPacketMagicHeader(final String initPacketMagicHeader) throws BadConfigException {
if (initPacketMagicHeader == null || initPacketMagicHeader.trim().isEmpty()) {
this.initPacketMagicHeader = Optional.empty();
} else {
this.initPacketMagicHeader = Optional.of(initPacketMagicHeader.trim());
}
return this;
}
public Builder setTransportPacketMagicHeader(final long transportPacketMagicHeader) throws BadConfigException {
if (transportPacketMagicHeader < 0)
throw new BadConfigException(Section.INTERFACE, Location.TRANSPORT_PACKET_MAGIC_HEADER,
Reason.INVALID_VALUE, String.valueOf(transportPacketMagicHeader));
this.transportPacketMagicHeader = transportPacketMagicHeader == 0 ? Optional.empty() : Optional.of(transportPacketMagicHeader);
public Builder setResponsePacketMagicHeader(final String responsePacketMagicHeader) throws BadConfigException {
if (responsePacketMagicHeader == null || responsePacketMagicHeader.trim().isEmpty()) {
this.responsePacketMagicHeader = Optional.empty();
} else {
this.responsePacketMagicHeader = Optional.of(responsePacketMagicHeader.trim());
}
return this;
}
public Builder setUnderloadPacketMagicHeader(final String underloadPacketMagicHeader) throws BadConfigException {
if (underloadPacketMagicHeader == null || underloadPacketMagicHeader.trim().isEmpty()) {
this.underloadPacketMagicHeader = Optional.empty();
} else {
this.underloadPacketMagicHeader = Optional.of(underloadPacketMagicHeader.trim());
}
return this;
}
public Builder setTransportPacketMagicHeader(final String transportPacketMagicHeader) throws BadConfigException {
if (transportPacketMagicHeader == null || transportPacketMagicHeader.trim().isEmpty()) {
this.transportPacketMagicHeader = Optional.empty();
} else {
this.transportPacketMagicHeader = Optional.of(transportPacketMagicHeader.trim());
}
return this;
}
public Builder setSpecialJunkI1(final String specialJunkI1) throws BadConfigException {
if (specialJunkI1 == null || specialJunkI1.trim().isEmpty()) {
this.specialJunkI1 = Optional.empty();
} else {
this.specialJunkI1 = Optional.of(specialJunkI1.trim());
}
return this;
}
public Builder setSpecialJunkI2(final String specialJunkI2) throws BadConfigException {
if (specialJunkI2 == null || specialJunkI2.trim().isEmpty()) {
this.specialJunkI2 = Optional.empty();
} else {
this.specialJunkI2 = Optional.of(specialJunkI2.trim());
}
return this;
}
public Builder setSpecialJunkI3(final String specialJunkI3) throws BadConfigException {
if (specialJunkI3 == null || specialJunkI3.trim().isEmpty()) {
this.specialJunkI3 = Optional.empty();
} else {
this.specialJunkI3 = Optional.of(specialJunkI3.trim());
}
return this;
}
public Builder setSpecialJunkI4(final String specialJunkI4) throws BadConfigException {
if (specialJunkI4 == null || specialJunkI4.trim().isEmpty()) {
this.specialJunkI4 = Optional.empty();
} else {
this.specialJunkI4 = Optional.of(specialJunkI4.trim());
}
return this;
}
public Builder setSpecialJunkI5(final String specialJunkI5) throws BadConfigException {
if (specialJunkI5 == null || specialJunkI5.trim().isEmpty()) {
this.specialJunkI5 = Optional.empty();
} else {
this.specialJunkI5 = Optional.of(specialJunkI5.trim());
}
return this;
}
}

View File

@@ -88,6 +88,20 @@ class InterfaceProxy : BaseObservable, Parcelable {
notifyPropertyChanged(BR.responsePacketJunkSize)
}
@get:Bindable
var cookieReplyPacketJunkSize: String = ""
set(value) {
field = value
notifyPropertyChanged(BR.cookieReplyPacketJunkSize)
}
@get:Bindable
var transportPacketJunkSize: String = ""
set(value) {
field = value
notifyPropertyChanged(BR.transportPacketJunkSize)
}
@get:Bindable
var initPacketMagicHeader: String = ""
set(value) {
@@ -116,6 +130,41 @@ class InterfaceProxy : BaseObservable, Parcelable {
notifyPropertyChanged(BR.transportPacketMagicHeader)
}
@get:Bindable
var specialJunkI1: String = ""
set(value) {
field = value
notifyPropertyChanged(BR.specialJunkI1)
}
@get:Bindable
var specialJunkI2: String = ""
set(value) {
field = value
notifyPropertyChanged(BR.specialJunkI2)
}
@get:Bindable
var specialJunkI3: String = ""
set(value) {
field = value
notifyPropertyChanged(BR.specialJunkI3)
}
@get:Bindable
var specialJunkI4: String = ""
set(value) {
field = value
notifyPropertyChanged(BR.specialJunkI4)
}
@get:Bindable
var specialJunkI5: String = ""
set(value) {
field = value
notifyPropertyChanged(BR.specialJunkI5)
}
@get:Bindable
var privateKey: String = ""
set(value) {
@@ -144,10 +193,17 @@ class InterfaceProxy : BaseObservable, Parcelable {
junkPacketMaxSize = parcel.readString() ?: ""
initPacketJunkSize = parcel.readString() ?: ""
responsePacketJunkSize = parcel.readString() ?: ""
cookieReplyPacketJunkSize = parcel.readString() ?: ""
transportPacketJunkSize = parcel.readString() ?: ""
initPacketMagicHeader = parcel.readString() ?: ""
responsePacketMagicHeader = parcel.readString() ?: ""
underloadPacketMagicHeader = parcel.readString() ?: ""
transportPacketMagicHeader = parcel.readString() ?: ""
specialJunkI1 = parcel.readString() ?: ""
specialJunkI2 = parcel.readString() ?: ""
specialJunkI3 = parcel.readString() ?: ""
specialJunkI4 = parcel.readString() ?: ""
specialJunkI5 = parcel.readString() ?: ""
privateKey = parcel.readString() ?: ""
}
@@ -164,10 +220,17 @@ class InterfaceProxy : BaseObservable, Parcelable {
junkPacketMaxSize = other.junkPacketMaxSize.map { it.toString() }.orElse("")
initPacketJunkSize = other.initPacketJunkSize.map { it.toString() }.orElse("")
responsePacketJunkSize = other.responsePacketJunkSize.map { it.toString() }.orElse("")
initPacketMagicHeader = other.initPacketMagicHeader.map { it.toString() }.orElse("")
responsePacketMagicHeader = other.responsePacketMagicHeader.map { it.toString() }.orElse("")
underloadPacketMagicHeader = other.underloadPacketMagicHeader.map { it.toString() }.orElse("")
transportPacketMagicHeader = other.transportPacketMagicHeader.map { it.toString() }.orElse("")
cookieReplyPacketJunkSize = other.cookieReplyPacketJunkSize.map { it.toString() }.orElse("")
transportPacketJunkSize = other.transportPacketJunkSize.map { it.toString() }.orElse("")
initPacketMagicHeader = other.initPacketMagicHeader.orElse("")
responsePacketMagicHeader = other.responsePacketMagicHeader.orElse("")
underloadPacketMagicHeader = other.underloadPacketMagicHeader.orElse("")
transportPacketMagicHeader = other.transportPacketMagicHeader.orElse("")
specialJunkI1 = other.specialJunkI1.orElse("")
specialJunkI2 = other.specialJunkI2.orElse("")
specialJunkI3 = other.specialJunkI3.orElse("")
specialJunkI4 = other.specialJunkI4.orElse("")
specialJunkI5 = other.specialJunkI5.orElse("")
val keyPair = other.keyPair
privateKey = keyPair.privateKey.toBase64()
}
@@ -197,10 +260,17 @@ class InterfaceProxy : BaseObservable, Parcelable {
if (junkPacketMaxSize.isNotEmpty()) builder.parseJunkPacketMaxSize(junkPacketMaxSize)
if (initPacketJunkSize.isNotEmpty()) builder.parseInitPacketJunkSize(initPacketJunkSize)
if (responsePacketJunkSize.isNotEmpty()) builder.parseResponsePacketJunkSize(responsePacketJunkSize)
if (cookieReplyPacketJunkSize.isNotEmpty()) builder.parseCookieReplyPacketJunkSize(cookieReplyPacketJunkSize)
if (transportPacketJunkSize.isNotEmpty()) builder.parseTransportPacketJunkSize(transportPacketJunkSize)
if (initPacketMagicHeader.isNotEmpty()) builder.parseInitPacketMagicHeader(initPacketMagicHeader)
if (responsePacketMagicHeader.isNotEmpty()) builder.parseResponsePacketMagicHeader(responsePacketMagicHeader)
if (underloadPacketMagicHeader.isNotEmpty()) builder.parseUnderloadPacketMagicHeader(underloadPacketMagicHeader)
if (transportPacketMagicHeader.isNotEmpty()) builder.parseTransportPacketMagicHeader(transportPacketMagicHeader)
if (specialJunkI1.isNotEmpty()) builder.parseSpecialJunkI1(specialJunkI1)
if (specialJunkI2.isNotEmpty()) builder.parseSpecialJunkI2(specialJunkI2)
if (specialJunkI3.isNotEmpty()) builder.parseSpecialJunkI3(specialJunkI3)
if (specialJunkI4.isNotEmpty()) builder.parseSpecialJunkI4(specialJunkI4)
if (specialJunkI5.isNotEmpty()) builder.parseSpecialJunkI5(specialJunkI5)
if (privateKey.isNotEmpty()) builder.parsePrivateKey(privateKey)
return builder.build()
}
@@ -217,10 +287,17 @@ class InterfaceProxy : BaseObservable, Parcelable {
dest.writeString(junkPacketMaxSize)
dest.writeString(initPacketJunkSize)
dest.writeString(responsePacketJunkSize)
dest.writeString(cookieReplyPacketJunkSize)
dest.writeString(transportPacketJunkSize)
dest.writeString(initPacketMagicHeader)
dest.writeString(responsePacketMagicHeader)
dest.writeString(underloadPacketMagicHeader)
dest.writeString(transportPacketMagicHeader)
dest.writeString(specialJunkI1)
dest.writeString(specialJunkI2)
dest.writeString(specialJunkI3)
dest.writeString(specialJunkI4)
dest.writeString(specialJunkI5)
dest.writeString(privateKey)
}

View File

@@ -390,6 +390,52 @@
app:layout_constraintTop_toBottomOf="@+id/response_packet_junk_size_label"
tools:text="18" />
<TextView
android:id="@+id/cookie_reply_packet_junk_size_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:labelFor="@+id/cookie_reply_packet_junk_size_text"
android:text="@string/cookie_reply_packet_junk_size"
android:visibility="@{!config.interface.cookieReplyPacketJunkSize.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/response_packet_junk_size_text" />
<TextView
android:id="@+id/cookie_reply_packet_junk_size_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@{config.interface.cookieReplyPacketJunkSize}"
android:textAppearance="?attr/textAppearanceBodyLarge"
android:visibility="@{!config.interface.cookieReplyPacketJunkSize.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cookie_reply_packet_junk_size_label"
tools:text="20" />
<TextView
android:id="@+id/transport_packet_junk_size_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:labelFor="@+id/transport_packet_junk_size_text"
android:text="@string/transport_packet_junk_size"
android:visibility="@{!config.interface.transportPacketJunkSize.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cookie_reply_packet_junk_size_text" />
<TextView
android:id="@+id/transport_packet_junk_size_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@{config.interface.transportPacketJunkSize}"
android:textAppearance="?attr/textAppearanceBodyLarge"
android:visibility="@{!config.interface.transportPacketJunkSize.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/transport_packet_junk_size_label"
tools:text="22" />
<TextView
android:id="@+id/init_packet_magic_header_label"
android:layout_width="0dp"
@@ -399,7 +445,7 @@
android:text="@string/init_packet_magic_header"
android:visibility="@{!config.interface.initPacketMagicHeader.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/response_packet_junk_size_text" />
app:layout_constraintTop_toBottomOf="@+id/transport_packet_junk_size_text" />
<TextView
android:id="@+id/init_packet_magic_header_text"
@@ -482,12 +528,152 @@
app:layout_constraintTop_toBottomOf="@+id/transport_packet_magic_header_label"
tools:text="1766607858" />
<TextView
android:id="@+id/special_junk_i1_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:labelFor="@+id/special_junk_i1_text"
android:text="@string/special_junk_i1"
android:visibility="@{!config.interface.specialJunkI1.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/transport_packet_magic_header_text" />
<TextView
android:id="@+id/special_junk_i1_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:contentDescription="@string/special_junk_i1"
android:nextFocusUp="@id/transport_packet_magic_header_text"
android:nextFocusDown="@id/special_junk_i2_text"
android:nextFocusForward="@id/special_junk_i2_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{config.interface.specialJunkI1}"
android:textAppearance="?attr/textAppearanceBodyLarge"
android:visibility="@{!config.interface.specialJunkI1.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/special_junk_i1_label"
tools:text="&lt;b 0x10001c00c00050001000000df00210473746c730561646f626506636f6d2d636e09656467657375697465036e657400c02b00050001000001e200350473746c730561646f626506636f6d2d636e09656467657375697465036e65740b676c6f62616c726564697206616b61646e73c047c0580005000100&gt;" />
<TextView
android:id="@+id/special_junk_i2_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:labelFor="@+id/special_junk_i2_text"
android:text="@string/special_junk_i2"
android:visibility="@{!config.interface.specialJunkI2.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/special_junk_i1_text" />
<TextView
android:id="@+id/special_junk_i2_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:contentDescription="@string/special_junk_i2"
android:nextFocusUp="@id/special_junk_i1_text"
android:nextFocusDown="@id/special_junk_i3_text"
android:nextFocusForward="@id/special_junk_i3_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{config.interface.specialJunkI2}"
android:textAppearance="?attr/textAppearanceBodyLarge"
android:visibility="@{!config.interface.specialJunkI2.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/special_junk_i2_label"
tools:text="&lt;b 0x1234&gt;" />
<TextView
android:id="@+id/special_junk_i3_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:labelFor="@+id/special_junk_i3_text"
android:text="@string/special_junk_i3"
android:visibility="@{!config.interface.specialJunkI3.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/special_junk_i2_text" />
<TextView
android:id="@+id/special_junk_i3_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:contentDescription="@string/special_junk_i3"
android:nextFocusUp="@id/special_junk_i2_text"
android:nextFocusDown="@id/special_junk_i4_text"
android:nextFocusForward="@id/special_junk_i4_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{config.interface.specialJunkI3}"
android:textAppearance="?attr/textAppearanceBodyLarge"
android:visibility="@{!config.interface.specialJunkI3.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/special_junk_i3_label"
tools:text="&lt;b 0x1234567890&gt;" />
<TextView
android:id="@+id/special_junk_i4_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:labelFor="@+id/special_junk_i4_text"
android:text="@string/special_junk_i4"
android:visibility="@{!config.interface.specialJunkI4.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/special_junk_i3_text" />
<TextView
android:id="@+id/special_junk_i4_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:contentDescription="@string/special_junk_i4"
android:nextFocusUp="@id/special_junk_i3_text"
android:nextFocusDown="@id/special_junk_i5_text"
android:nextFocusForward="@id/special_junk_i5_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{config.interface.specialJunkI4}"
android:textAppearance="?attr/textAppearanceBodyLarge"
android:visibility="@{!config.interface.specialJunkI4.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/special_junk_i4_label"
tools:text="&lt;b 0xdeadbeef&gt;" />
<TextView
android:id="@+id/special_junk_i5_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:labelFor="@+id/special_junk_i5_text"
android:text="@string/special_junk_i5"
android:visibility="@{!config.interface.specialJunkI5.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/special_junk_i4_text" />
<TextView
android:id="@+id/special_junk_i5_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:contentDescription="@string/special_junk_i5"
android:nextFocusUp="@id/special_junk_i4_text"
android:nextFocusDown="@id/applications_text"
android:nextFocusForward="@id/applications_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{config.interface.specialJunkI5}"
android:textAppearance="?attr/textAppearanceBodyLarge"
android:visibility="@{!config.interface.specialJunkI5.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/special_junk_i5_label"
tools:text="&lt;rc 12&gt;&lt;t&gt;&lt;rd 18&gt;" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/amnezia_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="transport_packet_magic_header_text" />
app:constraint_referenced_ids="transport_packet_magic_header_text,special_junk_i1_text,special_junk_i2_text,special_junk_i3_text,special_junk_i4_text,special_junk_i5_text" />
<TextView
android:id="@+id/applications_label"
@@ -504,7 +690,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/applications"
android:nextFocusUp="@id/mtu_text"
android:nextFocusUp="@id/special_junk_i5_text"
android:nextFocusDown="@id/peers_layout"
android:nextFocusForward="@id/peers_layout"
android:onClick="@{ClipboardUtils::copyTextView}"

View File

@@ -346,12 +346,56 @@
android:layout_height="wrap_content"
android:imeOptions="actionNext"
android:inputType="number"
android:nextFocusUp="@id/junk_packet_max_size_text"
android:nextFocusDown="@id/response_packet_magic_header_text"
android:nextFocusForward="@id/init_packet_magic_header_text"
android:nextFocusUp="@id/init_packet_junk_size_text"
android:nextFocusDown="@id/cookie_reply_packet_junk_size_text"
android:nextFocusForward="@id/cookie_reply_packet_junk_size_text"
android:text="@={config.interface.responsePacketJunkSize}" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/cookie_reply_packet_junk_size_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:hint="@string/cookie_reply_packet_junk_size"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/response_packet_junk_size_layout">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/cookie_reply_packet_junk_size_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext"
android:inputType="number"
android:nextFocusUp="@id/response_packet_junk_size_text"
android:nextFocusDown="@id/transport_packet_junk_size_text"
android:nextFocusForward="@id/transport_packet_junk_size_text"
android:text="@={config.interface.cookieReplyPacketJunkSize}" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/transport_packet_junk_size_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:hint="@string/transport_packet_junk_size"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cookie_reply_packet_junk_size_layout">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/transport_packet_junk_size_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext"
android:inputType="number"
android:nextFocusUp="@id/cookie_reply_packet_junk_size_text"
android:nextFocusDown="@id/init_packet_magic_header_text"
android:nextFocusForward="@id/init_packet_magic_header_text"
android:text="@={config.interface.transportPacketJunkSize}" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/init_packet_magic_header_layout"
android:layout_width="0dp"
@@ -359,7 +403,7 @@
android:hint="@string/init_packet_magic_header"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/response_packet_junk_size_layout"
app:layout_constraintTop_toBottomOf="@+id/transport_packet_junk_size_layout"
android:layout_margin="4dp">
<com.google.android.material.textfield.TextInputEditText
@@ -367,8 +411,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext"
android:inputType="number"
android:nextFocusUp="@id/init_packet_junk_size_text"
android:inputType="textNoSuggestions"
android:nextFocusUp="@id/transport_packet_junk_size_text"
android:nextFocusDown="@id/underload_packet_magic_header_text"
android:nextFocusForward="@id/response_packet_magic_header_text"
android:text="@={config.interface.initPacketMagicHeader}" />
@@ -389,7 +433,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext"
android:inputType="number"
android:inputType="textNoSuggestions"
android:nextFocusUp="@id/response_packet_junk_size_text"
android:nextFocusDown="@id/transport_packet_magic_header_text"
android:nextFocusForward="@id/underload_packet_magic_header_text"
@@ -411,9 +455,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext"
android:inputType="number"
android:inputType="textNoSuggestions"
android:nextFocusUp="@id/init_packet_magic_header_text"
android:nextFocusDown="@id/set_excluded_applications"
android:nextFocusDown="@id/special_junk_i1_text"
android:nextFocusForward="@id/transport_packet_magic_header_text"
android:text="@={config.interface.underloadPacketMagicHeader}" />
</com.google.android.material.textfield.TextInputLayout>
@@ -432,12 +476,122 @@
android:id="@+id/transport_packet_magic_header_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:inputType="number"
android:imeOptions="actionNext"
android:inputType="textNoSuggestions"
android:nextFocusUp="@id/response_packet_magic_header_text"
android:nextFocusDown="@id/special_junk_i1_text"
android:nextFocusForward="@id/special_junk_i1_text"
android:text="@={config.interface.transportPacketMagicHeader}" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/special_junk_i1_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:hint="@string/special_junk_i1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/transport_packet_magic_header_layout">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/special_junk_i1_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext"
android:inputType="textNoSuggestions"
android:nextFocusUp="@id/transport_packet_magic_header_text"
android:nextFocusDown="@id/special_junk_i2_text"
android:nextFocusForward="@id/special_junk_i2_text"
android:text="@={config.interface.specialJunkI1}" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/special_junk_i2_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:hint="@string/special_junk_i2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/special_junk_i1_layout">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/special_junk_i2_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext"
android:inputType="textNoSuggestions"
android:nextFocusUp="@id/special_junk_i1_text"
android:nextFocusDown="@id/special_junk_i3_text"
android:nextFocusForward="@id/special_junk_i3_text"
android:text="@={config.interface.specialJunkI2}" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/special_junk_i3_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:hint="@string/special_junk_i3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/special_junk_i2_layout">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/special_junk_i3_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext"
android:inputType="textNoSuggestions"
android:nextFocusUp="@id/special_junk_i2_text"
android:nextFocusDown="@id/special_junk_i4_text"
android:nextFocusForward="@id/special_junk_i4_text"
android:text="@={config.interface.specialJunkI3}" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/special_junk_i4_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:hint="@string/special_junk_i4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/special_junk_i3_layout">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/special_junk_i4_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext"
android:inputType="textNoSuggestions"
android:nextFocusUp="@id/special_junk_i3_text"
android:nextFocusDown="@id/special_junk_i5_text"
android:nextFocusForward="@id/special_junk_i5_text"
android:text="@={config.interface.specialJunkI4}" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/special_junk_i5_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:hint="@string/special_junk_i5"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/special_junk_i4_layout">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/special_junk_i5_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:inputType="textNoSuggestions"
android:nextFocusUp="@id/special_junk_i4_text"
android:nextFocusDown="@id/set_excluded_applications"
android:nextFocusForward="@id/set_excluded_applications"
android:text="@={config.interface.transportPacketMagicHeader}" />
android:text="@={config.interface.specialJunkI5}" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
@@ -446,7 +600,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:nextFocusUp="@id/dns_servers_text"
android:nextFocusUp="@id/special_junk_i5_text"
android:nextFocusDown="@id/peers_layout"
android:nextFocusForward="@id/peers_layout"
android:onClick="@{fragment::onRequestSetExcludedIncludedApplications}"
@@ -455,7 +609,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/transport_packet_magic_header_layout"
app:layout_constraintTop_toBottomOf="@id/special_junk_i5_layout"
app:rippleColor="?attr/colorSecondary"
tools:text="4 excluded applications" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -165,10 +165,17 @@
<string name="junk_packet_max_size">Junk packet maximum size</string>
<string name="init_packet_junk_size">Init packet junk size</string>
<string name="response_packet_junk_size">Response packet junk size</string>
<string name="cookie_reply_packet_junk_size">Cookie reply packet junk size</string>
<string name="transport_packet_junk_size">Transport packet junk size</string>
<string name="init_packet_magic_header">Init packet magic header</string>
<string name="response_packet_magic_header">Response packet magic header</string>
<string name="underload_packet_magic_header">Underload packet magic header</string>
<string name="transport_packet_magic_header">Transport packet magic header</string>
<string name="special_junk_i1">Special junk I1</string>
<string name="special_junk_i2">Special junk I2</string>
<string name="special_junk_i3">Special junk I3</string>
<string name="special_junk_i4">Special junk I4</string>
<string name="special_junk_i5">Special junk I5</string>
<string name="multiple_tunnels_summary_off">Turning on one tunnel will turn off others</string>
<string name="multiple_tunnels_summary_on">Multiple tunnels may be turned on simultaneously</string>
<string name="multiple_tunnels_title">Allow multiple simultaneous tunnels</string>