ufConf.conf - The Update Factory configuration file for Android¶
Overview¶
The ufConf.conf file determines how your devices communicate with the Update Factory platform.
Below, we define the various parameters and provide examples to ensure proper syntax.
Note
The essential parameters will be provided to you after your registration with Update Factory.
Parameters¶
tenant¶
The tenant is essentially your customer account. It is provided to you upon registration with Update Factory. You can define the tenant parameter like this:
tenant=tesla
url¶
The url defines which service on Update Factory that your devices will be connecting to.
url=https://personal.updatefactory.io/
controllerId¶
The controllerId is a unique identifier for each device. This Id will be how you differentiate between more than one device on Update Factory.
A best practice is to include an unique device identifier, like a MAC address or a serial number, as part of the controllerId. However the controller id string format has no particular requirement and including a substitutions is not mandatory.
The following example shows how to include the eth0 MAC address in the controller id:
controllerId=device-${file:///sys/class/net/eth0/address}
The following example shows how to include the Android ID in the controller id:
controllerId=device-${property:ANDROID_ID}
Substitutions¶
Substitutions are a handy way to use device information in the controller ID. Substitutions are supported only in the controllerId parameter.
The syntax is ${<scheme>:<scheme-specific-part>}.
Two <scheme> are supported:
file: the expression${file:<path-to-file>}is replaced with the first line of the file (<path-to-file>indicates the file to use);property: the expression${property:ANDROID_ID}is replaced with the device's Android ID.
Warning
SELinux Security Framework may block read access to some files to the UF Android Service.
For more information about SELinux on Android see the official documentation.
Note
The ANDROID_ID value is used as fallback value for invalid substitutions (invalid scheme, file not found, empty file, app doesn't have the permissions to read the file, etc).
gatewayToken¶
The gatewayToken is a shared Security Token string used to authenticate a device. The Gateway Token is shared across all of the devices in a tenant.
gatewayToken=ebeazfivzx74a2u4soltp134d4Wkkv33m
Danger
Due to its shared nature the Gateway Token should be used only for evaluation / development.
targetToken¶
The targetToken is the device Security Token string used to authenticate a device.
targetToken=aupsoltp6f4d4Wkkvf2me3eaxfivzx78a2
Info
Target Token is the recommended option for production.
apiMode¶
apiMode allows third party applications to provide dialog messages when the Update Factory update process requires feedback from the Android device. For example, this can be used when an update requires user confirmation on the device.
To let the UF Android Service handle the authorization dialog set apiMode=false; when using third party integration set apiMode=true.
Note
When using the UF Service API Reference Implementation it is recommended to set this to true.
apiMode=false
enable¶
The enable parameter defines whether the UF Android Service is active or inactive. Typically, this is set to true.
enable=true
updateFactoryServer¶
Setting this to true, enables the retrieval of the targetToken from the Update Factory server.
updateFactoryServer=true
ANDROID_ID¶
Android id is an unique id of the device generated by the Android system.
To see the Android ID of an Android device you can use the adb utility like this:
adb shell getprop net.hostname
Note
For more information about Android ID see the official documentation.
ufConf.conf examples¶
ufConf.conf with all parameters¶
tenant=tesla
url=https://personal.updatefactory.io/
controllerId=device-${file:///sys/class/net/eth0/address}
gatewayToken=ebeazfivzx74a2u4soltp134d4Wkkv33m
targetToken=9szDyU26EDarhjzSZZvl9szDyU26EDarh
apiMode=true
enable=true
updateFactoryServer=true
Note
If the file /sys/class/net/eth0/address exists (file that contains the mac
address of eth0) the controllerId used by the android service will be something
like device-21:8f:43:04:53:ab otherwise the
controllerId used by the android service will be
device-${property:ANDROID_ID} e.g. device-32c173321a2a2e31
For more information about the Substitutions feature see the Substitutions section.
ufConf.conf with minimal parameters¶
tenant=tesla
url=https://personal.updatefactory.io/
controllerId=device-${file:///sys/class/net/eth0/address}
gatewayToken=ebeazfivzx74a2u4soltp134d4Wkkv33m
Note
gatewayToken can be replaced with the targetToken
ufConf.conf file location¶
The ufConf.conf must be loaded in your Android device here: /sdcard/UpdateFactoryConfiguration/. You can use the adb utility like this:
adb push ufConf.conf /sdcard/UpdateFactoryConfiguration/ufConf.conf
Note
In UF Android Service ≥ v1.5.0 the ufConf.conf will be ignored after the first time a configuration is provided via the Third-Party Integration API. This behaviour is implemented to prevent possible configuration changes through the use of ufConf.conf.
Events and Machine States¶
Be sure to take a look at our documentation on the various machine states or events when your device(s) are in communication with Update Factory. This information can be helpful for debugging or troubleshooting.