Update SmartTUBE Apps with PackageSync
PackageSync service was developed to install, update, delete individual user applications. This service is not associated with Google Play and can be used for one-time or forced app installations, update or downgrade already installed apps, as well as force removal of any apps.
STB automatically checks for updates 15 seconds after booting and every 10 minutes thereafter. You can also force a check through the API (for example, from an application) or manually from the ADB-console:
Bash (Unix Shell) |
adb shell am startservice -a tv.smartlabs.packagesync.CHECK_FOR_UPDATES tv.smartlabs.packagesync/.SyncService |
The link to the update server is embedded into the STB firmware and usually has the following URL: http://customer_firmware_update_server/android/check_version_ext
Process Description
STB requests URL of the following form:
http://update_url/check_version_ext?serial=60F01095567163400006&board=sml_amls905x&device=sml5041w&product=stb_sml5041&version=6.0.1_SMLMAIN601_eng.user.20180522.104924&mac=e4:87:71:4c:43:b6
and waits for the server response with the following content:
Code |
Package: tv.smartlabs.testplayer VersionCode: 1 Flags: ALLOW_DOWNGRADE ALWAYS_INSTALLED URL: http://customer_url/tv.smartlabs.testplayer.apk Package: tv.smartlabs.dummy1 VersionCode: -1 URL: Package: tv.smartlabs.dummy2 VersionCode: REMOVE Package: com.magicandroidapps.iperf VersionCode: 206 # VersionCode: REMOVE Flags: ALWAYS_INSTALLED URL: http://customer_url/com.magicandroidapps.iperf.apk |
Typical Configuration on Update Server (nginx)
Code |
recursive_error_pages on; location = /android-packages/check_version_ext { rewrite ^(.*)$ /android-packages/check_version_ext/$arg_board/$arg_product/$arg_version/packages.list break; error_page 404 = @android-packages-default-version; } location @android-packages-default-version { rewrite ^(.*)$ /android-packages/check_version_ext/$arg_board/$arg_product/default/packages.list break; } |