mirror of
https://github.com/amnezia-vpn/amneziawg-tools.git
synced 2025-06-05 04:23:43 +02:00
wg-quick android support for new fields
This commit is contained in:
parent
adba8c59a0
commit
fb6f2b71f9
1 changed files with 24 additions and 2 deletions
|
@ -41,6 +41,7 @@
|
||||||
static bool is_exiting = false;
|
static bool is_exiting = false;
|
||||||
static bool binder_available = false;
|
static bool binder_available = false;
|
||||||
static unsigned int sdk_version;
|
static unsigned int sdk_version;
|
||||||
|
static bool is_asecurity_on = false;
|
||||||
|
|
||||||
static void *xmalloc(size_t size)
|
static void *xmalloc(size_t size)
|
||||||
{
|
{
|
||||||
|
@ -632,7 +633,10 @@ static void auto_su(int argc, char *argv[])
|
||||||
|
|
||||||
static void add_if(const char *iface)
|
static void add_if(const char *iface)
|
||||||
{
|
{
|
||||||
cmd("ip link add %s type wireguard", iface);
|
if (is_asecurity_on)
|
||||||
|
cmd("wireguard-go %s", iface);
|
||||||
|
else
|
||||||
|
cmd("ip link add %s type wireguard", iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void del_if(const char *iface)
|
static void del_if(const char *iface)
|
||||||
|
@ -1256,7 +1260,25 @@ static void parse_options(char **iface, char **config, unsigned int *mtu, char *
|
||||||
} else if (!strncasecmp(clean, "MTU=", 4) && j > 4) {
|
} else if (!strncasecmp(clean, "MTU=", 4) && j > 4) {
|
||||||
*mtu = atoi(clean + 4);
|
*mtu = atoi(clean + 4);
|
||||||
continue;
|
continue;
|
||||||
}
|
} else if (!strncasecmp(clean, "Jc=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "Jmin=", 5) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "Jmax=", 5) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "S1=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "S2=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "H1=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "H2=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "H3=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "H4=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*config = concat_and_free(*config, "", line);
|
*config = concat_and_free(*config, "", line);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue