Custom sdk dependencies
Customize the SDK internal logic
Create a Configuration File. Define a raw resource file named
sdk_deps.json
to specify custom dependencies. General structure of dependencies config may look like:
Set up metadata in
AndroidManifest.xml
. Add the following code to the<application>
section of yourAndroidManifest.xml
to link the configuration file:
Configure ProGuard. Make sure that your custom dependency classes are not renamed or removed by ProGuard or other code obfuscation tools.
Possible dependencies overrides
You can override various SDK dependencies by creating custom classes and specifying them in the sdk_deps.json
file. Below is an example of overriding the SDK's logging functionality.
Custom logger
Define a class that extends
unified.vpn.sdk.UnifiedLogDelegate
. This class will handle logging for the SDK:
Configure the SDK to Use the Custom Logger: Add the following entry in your sdk_deps.json
file to specify the custom logger class:
Additional configuration of OkHttpClient used in sdk
Define class that implements OkHttpNetworkLayer.HttpClientConfigurer
Setup SDK dependency override in sdk_deps
Custom backend URL rotator
Create a Custom URL Rotator: Define a class that implements the UrlRotator interface. This class controls the behavior for rotating backend.
Create a URL Rotator Factory: Define a class that implements the
UrlRotatorFactory
interface, which creates instances of your customUrlRotator
Configure the SDK to Use the Custom URL Rotator: Update the
sdk_deps.json
file to specify the custom URL rotator factory.
Custom notification builder
You can customize how notifications are displayed by defining your own notification builder. Follow these steps to set up a custom notification delegate:
Create a Custom Notification Delegate Class: Define a class that implements the
NotificationDelegate
interface. This class controls the appearance and behavior of notifications related to VPN activity.
Configure the SDK to Use the Custom Notification Delegate: Update the
sdk_deps.json
file to specify your custom notification delegate class.
Last updated
Was this helpful?