Compare commits

...

34 Commits

Author SHA1 Message Date
albexk 02ee7d113e chore: bump SDK to 35 2025-11-24 16:38:26 +03:00
albexk 61e67e7666 Merge branch 'master' into dev
# Conflicts:
#	gradle.properties
2025-11-24 16:33:34 +03:00
NickVs2015 704964c22a Merge pull request for Add support awg2 fields
Fix: Add support awg2 fields
2025-11-21 00:14:54 +03:00
NickVs2015 7aea733671 Fix awg2 fields 2025-11-18 11:43:41 +03:00
Yaroslav Gurov ade016a11c fix: remove unused parse_uint32 2025-09-03 16:20:14 +02:00
Yaroslav Gurov c1af1fb8d6 feat: awg 2.0 2025-09-03 14:53:37 +02:00
albexk 2e9f9d3650 Release AmneziaWG V1.5 (#41) 2025-08-13 22:42:11 +03:00
albexk 0a6ffdb50b chore: bump AmneziaWG version to 1.1.3 2025-08-13 22:33:09 +03:00
albexk e923447471 Merge branch 'master' into dev 2025-08-13 22:26:22 +03:00
Yaroslav Gurov f207d7bfd7 AmneziaWG V1.5 (#36) 2025-07-07 19:21:03 +02:00
pokamest e71423f46d Merge pull request #30 from amnezia-vpn/chore/update_go_1.24.2
Update go version to 1.24.2
2025-04-07 22:07:29 +01:00
pokamest 511397af2f Update go version to 1.24.2 2025-04-07 22:05:49 +01:00
albexk 7b4bf60271 Merge branch 'master' into dev
# Conflicts:
#	gradle.properties
2025-03-08 13:24:05 +03:00
albexk 6cab3754e1 Add import disclaimer 2025-03-07 19:22:37 +03:00
albexk 97a4fb5c43 Bump AmneziaWG version to 1.1.1 2024-06-17 17:15:28 +03:00
albexk 2eacd8f376 Update icons 2024-06-17 17:14:30 +03:00
albexk e7f0e9c75a Fix typo 2024-06-17 14:43:20 +03:00
albexk fc2daa27f4 Merge branch 'master' into dev
# Conflicts:
#	tunnel/tools/libwg-go/Makefile
#	tunnel/tools/libwg-go/go.mod
#	tunnel/tools/libwg-go/go.sum
2024-06-17 14:42:38 +03:00
albexk 305b3df553 Bump AmneziaWG version 2024-03-16 18:37:01 +04:00
albexk 564ca414f9 Add ability to specify android package name for amneziawg-go via environment variable 2024-03-16 18:36:38 +04:00
albexk 8f749140f4 Refactor GoBackend 2024-03-16 18:34:58 +04:00
albexk e94eaa845d Update amneziawg-go and amneziawg-tools 2024-03-16 18:32:27 +04:00
albexk 17f465f57c Change icons, edit tunnel editor layout 2024-03-15 14:29:15 +03:00
albexk 536e35b466 Remove REQUEST_INSTALL_PACKAGES permission 2024-03-12 17:39:42 +03:00
albexk b95a204b6d Prepare Release 2024-03-10 19:22:53 +03:00
albexk 80d3ad3d8e Fix UI 2024-03-04 23:51:24 +03:00
albexk 8f1c895b4f Fix GoBackend package 2024-03-04 22:59:10 +03:00
albexk 0235d82099 Rename packages 2024-03-04 22:51:52 +03:00
albexk 3800c798a3 Bump go, cleanup, set full awg parameter name 2024-03-04 22:13:49 +03:00
albexk 713183a92d Merge pull request #3 from dima424658/master
AmneziaWG protocol support
2024-03-04 16:43:46 +03:00
Dmitry Pankov 3f825d14a3 fix: revert .gitignore 2024-02-26 12:48:35 +03:00
Dmitry Pankov 9773380849 feat: update to wireguard to 1.0.20231018 2024-02-26 12:48:35 +03:00
Dmitry Pankov b3b1b16061 feat: AmneziaWG protocol support 2024-02-26 12:48:35 +03:00
Dmitry Pankov 9ddccd6fb0 fix: tunnel interface typo 2024-02-26 01:26:56 +03:00
14 changed files with 818 additions and 104 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
amneziawgVersionCode=5
amneziawgVersionName=1.1.2
amneziawgVersionCode=7
amneziawgVersionName=1.1.4
amneziawgPackageName=org.amnezia.awg
# When configured, Gradle will run in incubating parallel mode.
+2 -2
View File
@@ -27,8 +27,8 @@ include(":tunnel")
include(":ui")
configure<SettingsExtension> {
buildToolsVersion = "34.0.0"
compileSdk = 34
buildToolsVersion = "35.0.0"
compileSdk = 35
minSdk = 24
ndkVersion = "26.1.10909125"
}
@@ -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;
@@ -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;
}
}
+4 -4
View File
@@ -20,12 +20,12 @@ export GOARCH := $(NDK_GO_ARCH_MAP_$(ANDROID_ARCH_NAME))
export GOOS := android
export CGO_ENABLED := 1
GO_VERSION := 1.22.3
GO_VERSION := 1.24.2
GO_PLATFORM := $(shell uname -s | tr '[:upper:]' '[:lower:]')-$(NDK_GO_ARCH_MAP_$(shell uname -m))
GO_TARBALL := go$(GO_VERSION).$(GO_PLATFORM).tar.gz
GO_HASH_darwin-amd64 := 610e48c1df4d2f852de8bc2e7fd2dc1521aac216f0c0026625db12f67f192024
GO_HASH_darwin-arm64 := 02abeab3f4b8981232237ebd88f0a9bad933bc9621791cd7720a9ca29eacbe9d
GO_HASH_linux-amd64 := 8920ea521bad8f6b7bc377b4824982e011c19af27df88a815e3586ea895f1b36
GO_HASH_darwin-amd64 := 238d9c065d09ff6af229d2e3b8b5e85e688318d69f4006fb85a96e41c216ea83
GO_HASH_darwin-arm64 := b70f8b3c5b4ccb0ad4ffa5ee91cd38075df20fdbd953a1daedd47f50fbcff47a
GO_HASH_linux-amd64 := 68097bd680839cbc9d464a0edce4f7c333975e27a90246890e9f1078c7e702ad
default: $(DESTDIR)/libwg-go.so
+8 -6
View File
@@ -1,15 +1,17 @@
module github.com/amnezia-vpn/amneziawg-android
go 1.22.3
go 1.24.4
require (
github.com/amnezia-vpn/amneziawg-go v0.2.11
golang.org/x/sys v0.18.0
github.com/amnezia-vpn/amneziawg-go v0.2.15
golang.org/x/sys v0.33.0
)
require (
github.com/tevino/abool/v2 v2.1.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.21.0 // indirect
github.com/tevino/abool v1.2.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 // indirect
golang.org/x/net v0.41.0 // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
)
+28 -16
View File
@@ -1,18 +1,30 @@
github.com/amnezia-vpn/amneziawg-go v0.2.11 h1:JNGsxX4NIaYC/PpbUdwk23534HgS2SRMPgru6/K+364=
github.com/amnezia-vpn/amneziawg-go v0.2.11/go.mod h1:d7WpNfzCRLy7ufGElJBYpD58WRmNjyLyt3IDHPY8AmM=
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
github.com/tevino/abool/v2 v2.1.0 h1:7w+Vf9f/5gmKT4m4qkayb33/92M+Um45F2BkHOR+L/c=
github.com/tevino/abool/v2 v2.1.0/go.mod h1:+Lmlqk6bHDWHqN1cbxqhwEAwMPXgc8I1SDEamtseuXY=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44=
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
github.com/amnezia-vpn/amneziawg-go v0.2.15 h1:hQnFOJJHXrInorORe3JJwiAD55m1an81EGSW3AdbT74=
github.com/amnezia-vpn/amneziawg-go v0.2.15/go.mod h1:nRkPpIzjCxMW8pZKXTRkpqAQVlmFJdVOGkeQSC7wbms=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tevino/abool v1.2.0 h1:heAkClL8H6w+mK5md9dzsuohKeXHUpY7Vw0ZCKW+huA=
github.com/tevino/abool v1.2.0/go.mod h1:qc66Pna1RiIsPa7O4Egxxs9OqkuxDX55zznh9K07Tzg=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 h1:Di6/M8l0O2lCLc6VVRWhgCiApHV8MnQurBnFSHsQtNY=
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg=
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
gvisor.dev/gvisor v0.0.0-20230927004350-cbd86285d259 h1:TbRPT0HtzFP3Cno1zZo7yPzEEnfu8EjLfl6IU9VfqkQ=
gvisor.dev/gvisor v0.0.0-20230927004350-cbd86285d259/go.mod h1:AVgIgHMwK63XvmAzWG9vLQ41YnVHN0du0tEC46fI7yY=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489 h1:ze1vwAdliUAr68RQ5NtufWaXaOg8WUO2OACzEV+TNdE=
gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489/go.mod h1:10sU+Uh5KKNv1+2x2A0Gvzt8FjD3ASIhorV3YsauXhk=
+1 -1
View File
@@ -20,7 +20,7 @@ android {
namespace = pkg
defaultConfig {
applicationId = pkg
targetSdk = 34
targetSdk = 35
versionCode = providers.gradleProperty("amneziawgVersionCode").get().toInt()
versionName = providers.gradleProperty("amneziawgVersionName").get()
buildConfigField("int", "MIN_SDK_VERSION", minSdk.toString())
@@ -50,7 +50,7 @@ class AppListDialogFragment : DialogFragment() {
val packageName = it.packageName
val appInfo = it.applicationInfo
val appData =
ApplicationData(appInfo.loadIcon(pm), appInfo.loadLabel(pm).toString(), packageName, currentlySelectedApps.contains(packageName))
ApplicationData(appInfo?.loadIcon(pm) ?: pm.defaultActivityIcon, appInfo?.loadLabel(pm)?.toString() ?: packageName, packageName, currentlySelectedApps.contains(packageName))
applicationData.add(appData)
appData.addOnPropertyChangedCallback(object : Observable.OnPropertyChangedCallback() {
override fun onPropertyChanged(sender: Observable?, propertyId: Int) {
@@ -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)
}
@@ -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}"
+168 -14
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>
+7
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>