Class AppOptions
- Namespace
- VpnHood.AppLib.App
- Assembly
- VpnHood.AppLib.App.dll
Provides the options a head builds the app with (Init(IDevice, AppOptions)): who the app is, what it offers, the providers it works through, and how it behaves.
public class AppOptions
- Inheritance
-
AppOptions
- Inherited Members
Remarks
The app's ID, name, version and storage come from context and cannot be set here: a desktop
platform has used the ID and the storage, for its single-instance lock and its files, before it builds the
options.
Constructors
AppOptions(AppOptionsContext, bool)
Provides the options a head builds the app with (Init(IDevice, AppOptions)): who the app is, what it offers, the providers it works through, and how it behaves.
public AppOptions(AppOptionsContext context, bool isDebugMode)
Parameters
contextAppOptionsContextWhat the platform has settled before the head builds the options: the app's ID, name and version, and its storage.
isDebugModebooltrue for a Debug build, which logs at the debug level and never anonymously, and reports to no tracker; by default, it also adds
_dbgto its adapter's name and takes port 9091 for its web host, so it runs beside an installed release.
Remarks
The app's ID, name, version and storage come from context and cannot be set here: a desktop
platform has used the ID and the storage, for its single-instance lock and its files, before it builds the
options.
Properties
AccessKeys
Gets or sets the access keys the app is built with. The default is none.
public string[] AccessKeys { get; set; }
Property Value
- string[]
Remarks
At its start the app adds each as a built-in VPN profile, which the person cannot overwrite by importing its key, and removes the built-in profiles of keys no longer listed. The first is selected when no profile is.
AccountProvider
Gets or sets the account backend, and its store through Billing, or null for an app with no accounts.
public IAccountProvider? AccountProvider { get; set; }
Property Value
AdOptions
Gets or sets how the app loads and shows its ads.
public AppAdOptions AdOptions { get; set; }
Property Value
AdProviderItems
Gets or sets the ad networks the app shows ads from, tried in this order. The default is none, and so is the value an engine without ads (Ads) leaves the app with.
public IReadOnlyList<AppAdProviderItem> AdProviderItems { get; set; }
Property Value
AdapterName
Gets or sets the VPN adapter's name where the system shows one, a Windows adapter or a Linux interface, or
null for PackageTitle, with _dbg in a Debug build.
public string? AdapterName { get; set; }
Property Value
AllowEndPointStrategy
Gets or sets a value indicating whether the person may choose how the client picks the server's endpoints, where the engine has it too (AllowEndPointStrategy). The default is true.
public bool AllowEndPointStrategy { get; set; }
Property Value
AllowEndPointTracker
Gets or sets a value indicating whether the trackers may get the availability of each server endpoint the client checks (AllowEndPointTracker), where the person allows usage data. The default is false.
public bool AllowEndPointTracker { get; set; }
Property Value
AllowRecommendUserReviewByServer
Gets or sets a value indicating whether the app asks for a review when the server recommends it during a session that ended well, where the app has a review provider. The default is false.
public bool AllowRecommendUserReviewByServer { get; set; }
Property Value
AlwaysOnOptions
Gets or sets how always on tries again after a failure.
public AppAlwaysOnOptions AlwaysOnOptions { get; set; }
Property Value
AppId
Gets the app's ID on the device (AppId).
public string AppId { get; }
Property Value
AppName
Gets the name people see (AppName).
public string AppName { get; }
Property Value
AppVersion
Gets the app's version (AppVersion).
public Version AppVersion { get; }
Property Value
AutoDiagnose
Gets or sets a value indicating whether a connect that fails checks the network on its own, so an error that comes from no internet says so. The default is true.
public bool AutoDiagnose { get; set; }
Property Value
Remarks
Not after a cancel, a server's refusal or a connect its caller tries again.
CompanyName
Gets the maker's name, which the app's words put in place of {companyName}, as they put
AppName in place of {appName}.
public required string CompanyName { get; init; }
Property Value
ConnectTimeout
Gets or sets how long a whole connect may take, three times as long when it diagnoses; not a single TCP connect's, which is Transport's. The default is four minutes.
public TimeSpan ConnectTimeout { get; set; }
Property Value
Remarks
While a debugger is attached, DebuggerTimeout takes its place where it is set.
CultureProvider
Gets or sets how the app reads and sets its language, or null for the app's own, which keeps it in the settings.
public IAppCultureProvider? CultureProvider { get; set; }
Property Value
CustomData
Gets or sets JSON the head hands a UI of its own, which the app does not read (CustomData), or null.
public JsonElement? CustomData { get; set; }
Property Value
DeviceId
Gets or sets the device's own ID, which the client ID is made from, or null for the install's own random ID.
public string? DeviceId { get; set; }
Property Value
DeviceUiProvider
Gets or sets what the app asks of the device's own UI, such as notifications, Quick Launch and the system bars, or null for a NullDeviceUiProvider, which supports none of it but takes a web browser as present.
public IDeviceUiProvider? DeviceUiProvider { get; set; }
Property Value
DisconnectOnDispose
Gets or sets a value indicating whether disposing the app with DisposeAsync() disconnects the VPN; Dispose() does not. The default is false, which leaves the VPN service connected.
public bool DisconnectOnDispose { get; set; }
Property Value
EventWatcherInterval
Gets or sets how often the app reads the VPN service's state in the background, for a head that does not read State often, or null for no reading beyond the first.
public TimeSpan? EventWatcherInterval { get; set; }
Property Value
IpLocationZipAsset
Gets or sets the IP-location database the head ships, a zip, or null for none, and then the app offers no split by country and looks up no location.
public IAsset? IpLocationZipAsset { get; set; }
Property Value
Remarks
The app opens it when it builds a split by country or looks a location up, as the reconfigure at its start may do.
IsAddAccessKeySupported
Gets or sets a value indicating whether a person may add an access key in the app (IsAddAccessKeySupported). The default is true.
public bool IsAddAccessKeySupported { get; set; }
Property Value
IsAnonymousTrackerOptInRequired
Gets or sets a value indicating whether usage data waits for the person's own yes in every region, as it does where the law wants one: the first-run page then asks with the box unticked everywhere. The default is false.
public bool IsAnonymousTrackerOptInRequired { get; set; }
Property Value
IsDebugMode
Gets a value indicating whether this is a Debug build.
public bool IsDebugMode { get; }
Property Value
IsLicenseAgreementRequired
Gets or sets a value indicating whether the person must accept the licence agreement before using the app, once. The default is true.
public bool IsLicenseAgreementRequired { get; set; }
Property Value
Remarks
A matter of distribution: a download from a website passed through nothing that showed the terms, while a store's install did. The Google Play heads turn it off; the App Store heads keep it, as App Review wants a VPN app to say what it collects before first use. The answer is IsLicenseAccepted.
KillSwitchOffScriptPath
Gets or sets the path of the installer's script that lifts the kill switch's block with neither the service nor the app running, which the Kill Switch page prints as a command; null outside an install. The Linux platform sets it.
public string? KillSwitchOffScriptPath { get; set; }
Property Value
Links
Gets or sets the pages this build links to: its legal documents and the menu's links.
public AppLinks Links { get; set; }
Property Value
Remarks
Our heads fill them in from their product's settings (Links), so a fork points at its own pages without changing code; the App Store heads set the terms of use to Apple's standard licence agreement.
LogAnonymous
Gets or sets a value the app does not read. The default is false in a Debug build and null otherwise.
public bool? LogAnonymous { get; set; }
Property Value
- bool?
Remarks
Whether the log hides addresses comes from LogServiceOptions's LogAnonymous and the person's LogAnonymous: anonymous where either is on, and never in a Debug build.
LogServiceOptions
Gets or sets the log's options. A Debug build logs at the debug level at least, and the person's debug commands may lower the level further.
public LogServiceOptions LogServiceOptions { get; set; }
Property Value
LogoAssetPath
Gets the path of the product's logo in the UI's store, such as images/logo-connect.png.
public required string LogoAssetPath { get; init; }
Property Value
NoBackupStorage
Gets the storage over NoBackupStorageFolderPath (NoBackupStorage).
public Storage NoBackupStorage { get; }
Property Value
NoBackupStorageFolderPath
Gets the folder for what must not travel with a backup: the sign-in session, the log and the caches (NoBackupStoragePath).
public string NoBackupStorageFolderPath { get; }
Property Value
PackageTitle
Gets the app's name without spaces, which its release files, a desktop executable and its service, and the VPN adapter are named by.
public required string PackageTitle { get; init; }
Property Value
Premium
Gets or sets this build's premium tier, or null for a product that has none, which then runs as the full app: every feature allowed, with no tier to sell.
public AppPremiumOptions? Premium { get; set; }
Property Value
PrivacyConsentAssetName
Gets the name of the product's consent summary in the UI's store, such as privacy-consent-connect, which
the UI reads as content/language/name.md, in English where a language has
none.
public required string PrivacyConsentAssetName { get; init; }
Property Value
RemoteSettingsUrl
Gets or sets the address of the settings the app reads from the web at each start, such as its promotion, or null for none.
public Uri? RemoteSettingsUrl { get; set; }
Property Value
ShowPoweredBy
Gets or sets a value indicating whether the menu shows the engine's credit, Powered by VpnHood! ENGINE. The default is true.
public bool ShowPoweredBy { get; set; }
Property Value
Storage
Gets the storage over StorageFolderPath (Storage).
public Storage Storage { get; }
Property Value
StorageFolderPath
Gets the folder that holds the settings and the VPN profiles (StoragePath).
public string StorageFolderPath { get; }
Property Value
TrackerFactories
Gets or sets the factories of the trackers the app and its VPN service report through, one tracker from each. The default is none.
public IReadOnlyList<ITrackerFactory> TrackerFactories { get; set; }
Property Value
Remarks
The app decides when they report, and a Debug build makes none.
Transport
Gets or sets the transport's tuning, which the app hands to the VPN client as it is. The default is this platform's preset (ForCurrentPlatform()), a limited one on iOS and tvOS.
public ClientTransportOptions Transport { get; set; }
Property Value
UiTheme
Gets or sets the look's name in the UI's store, such as blue or violet, which picks the palette
the UI draws with and the store's themes/ folder of the same name. The default is blue.
public string UiTheme { get; set; }
Property Value
UiZipAssets
Gets or sets the zips of the files the app's UI draws from, such as pictures, fonts and words; empty for a UI that brings none of its own. The default is empty.
public IReadOnlyList<IAsset> UiZipAssets { get; set; }
Property Value
Remarks
The app unpacks each into its device-only storage and reads them as one store (UiAssetProvider), which its web host serves to a paired phone too. A file is taken from the first zip that has it, so a zip of the head's own placed before the UI's replaces single files of it, such as a logo, without a UI build.
UpdaterOptions
Gets or sets how the app looks for its updates, or null for an app that does not.
public AppUpdaterOptions? UpdaterOptions { get; set; }
Property Value
UserReviewProvider
Gets or sets the store's in-app review, or null for none, and then the app never asks for a review.
public IAppUserReviewProvider? UserReviewProvider { get; set; }
Property Value
VpnEngineInfo
Gets or sets the VPN engine this head bundles, as it reports itself: the app writes the options in a version both speak, and offers only what the engine has. The default is this library's engine.
public VpnEngineInfo VpnEngineInfo { get; set; }
Property Value
WebHostFactory
Gets or sets how the app makes its web hosts, the one this device loads its UI from and the one a phone pairs with, or null for an app with neither, which then supports no remote access (IsRemoteAccessSupported).
public IAppWebHostFactory? WebHostFactory { get; set; }
Property Value
WebHostPort
Gets or sets the web host's port, which a paired phone's address names, or null for 9090, and 9091 in a Debug build, so it runs beside the installed app.
public int? WebHostPort { get; set; }
Property Value
- int?
WebRootZipAsset
Gets or sets the page the web host serves, the UI's browser build, as a zip, or null for none. A head that sets WebHostFactory must set it too.
public IAsset? WebRootZipAsset { get; set; }