mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-04 00:00:14 -04:00
android: Add properties to VPN profiles for proxy server configuration
This commit is contained in:
parent
059c70e556
commit
a7cb2fcbf6
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Relution GmbH
|
||||
* Copyright (C) 2012-2024 Tobias Brunner
|
||||
* Copyright (C) 2012-2025 Tobias Brunner
|
||||
* Copyright (C) 2012 Giuliano Grassi
|
||||
* Copyright (C) 2012 Ralf Sager
|
||||
*
|
||||
@ -67,6 +67,9 @@ public class DatabaseHelper extends SQLiteOpenHelper
|
||||
new DbColumn(VpnProfileDataSource.KEY_IKE_PROPOSAL, "TEXT", 15),
|
||||
new DbColumn(VpnProfileDataSource.KEY_ESP_PROPOSAL, "TEXT", 15),
|
||||
new DbColumn(VpnProfileDataSource.KEY_DNS_SERVERS, "TEXT", 17),
|
||||
new DbColumn(VpnProfileDataSource.KEY_PROXY_HOST, "TEXT", 19),
|
||||
new DbColumn(VpnProfileDataSource.KEY_PROXY_PORT, "INTEGER", 19),
|
||||
new DbColumn(VpnProfileDataSource.KEY_PROXY_EXCLUSIONS, "TEXT", 19),
|
||||
});
|
||||
|
||||
public static final DbTable TABLE_TRUSTED_CERTIFICATE = new DbTable(TABLE_NAME_TRUSTED_CERTIFICATE, 18, new DbColumn[]{
|
||||
@ -84,7 +87,7 @@ public class DatabaseHelper extends SQLiteOpenHelper
|
||||
new DbColumn(ManagedUserCertificate.KEY_PASSWORD, "TEXT", 18),
|
||||
});
|
||||
|
||||
private static final int DATABASE_VERSION = 18;
|
||||
private static final int DATABASE_VERSION = 19;
|
||||
|
||||
private static final Set<DbTable> TABLES;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2019 Tobias Brunner
|
||||
* Copyright (C) 2012-2025 Tobias Brunner
|
||||
* Copyright (C) 2012 Giuliano Grassi
|
||||
* Copyright (C) 2012 Ralf Sager
|
||||
*
|
||||
@ -42,8 +42,8 @@ public class VpnProfile implements Cloneable
|
||||
|
||||
private String mName, mGateway, mUsername, mPassword, mCertificate, mUserCertificate;
|
||||
private String mRemoteId, mLocalId, mExcludedSubnets, mIncludedSubnets, mSelectedApps;
|
||||
private String mIkeProposal, mEspProposal, mDnsServers;
|
||||
private Integer mMTU, mPort, mSplitTunneling, mNATKeepAlive, mFlags;
|
||||
private String mIkeProposal, mEspProposal, mDnsServers, mProxyHost, mProxyExclusions;
|
||||
private Integer mMTU, mPort, mProxyPort, mSplitTunneling, mNATKeepAlive, mFlags;
|
||||
private SelectedAppsHandling mSelectedAppsHandling = SelectedAppsHandling.SELECTED_APPS_DISABLE;
|
||||
private VpnType mVpnType;
|
||||
private UUID mUUID;
|
||||
@ -313,6 +313,36 @@ public class VpnProfile implements Cloneable
|
||||
return mSelectedAppsHandling;
|
||||
}
|
||||
|
||||
public String getProxyHost()
|
||||
{
|
||||
return mProxyHost;
|
||||
}
|
||||
|
||||
public void setProxyHost(String proxy)
|
||||
{
|
||||
this.mProxyHost = proxy;
|
||||
}
|
||||
|
||||
public Integer getProxyPort()
|
||||
{
|
||||
return mProxyPort;
|
||||
}
|
||||
|
||||
public void setProxyPort(Integer port)
|
||||
{
|
||||
this.mProxyPort = port;
|
||||
}
|
||||
|
||||
public String getProxyExclusions()
|
||||
{
|
||||
return mProxyExclusions;
|
||||
}
|
||||
|
||||
public void setProxyExclusions(String exclusions)
|
||||
{
|
||||
this.mProxyExclusions = exclusions;
|
||||
}
|
||||
|
||||
public Integer getSplitTunneling()
|
||||
{
|
||||
return mSplitTunneling;
|
||||
|
@ -50,6 +50,9 @@ public interface VpnProfileDataSource
|
||||
String KEY_IKE_PROPOSAL = "ike_proposal";
|
||||
String KEY_ESP_PROPOSAL = "esp_proposal";
|
||||
String KEY_DNS_SERVERS = "dns_servers";
|
||||
String KEY_PROXY_HOST = "proxy_host";
|
||||
String KEY_PROXY_PORT = "proxy_port";
|
||||
String KEY_PROXY_EXCLUSIONS = "proxy_exclusions";
|
||||
String KEY_READ_ONLY = "read_only";
|
||||
|
||||
/**
|
||||
|
@ -151,6 +151,9 @@ public class VpnProfileSqlDataSource implements VpnProfileDataSource
|
||||
profile.setIkeProposal(cursor.getString(cursor.getColumnIndexOrThrow(KEY_IKE_PROPOSAL)));
|
||||
profile.setEspProposal(cursor.getString(cursor.getColumnIndexOrThrow(KEY_ESP_PROPOSAL)));
|
||||
profile.setDnsServers(cursor.getString(cursor.getColumnIndexOrThrow(KEY_DNS_SERVERS)));
|
||||
profile.setProxyHost(cursor.getString(cursor.getColumnIndexOrThrow(KEY_PROXY_HOST)));
|
||||
profile.setProxyPort(getInt(cursor, cursor.getColumnIndexOrThrow(KEY_PROXY_PORT)));
|
||||
profile.setProxyExclusions(cursor.getString(cursor.getColumnIndexOrThrow(KEY_PROXY_EXCLUSIONS)));
|
||||
return profile;
|
||||
}
|
||||
|
||||
@ -179,6 +182,9 @@ public class VpnProfileSqlDataSource implements VpnProfileDataSource
|
||||
values.put(KEY_IKE_PROPOSAL, profile.getIkeProposal());
|
||||
values.put(KEY_ESP_PROPOSAL, profile.getEspProposal());
|
||||
values.put(KEY_DNS_SERVERS, profile.getDnsServers());
|
||||
values.put(KEY_PROXY_HOST, profile.getProxyHost());
|
||||
values.put(KEY_PROXY_PORT, profile.getProxyPort());
|
||||
values.put(KEY_PROXY_EXCLUSIONS, profile.getProxyExclusions());
|
||||
return values;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user