@24i/smartapps-bigscreen-rnv-build-engine 0.17.2-alpha.2164 → 0.17.2-alpha.2166

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -248,10 +248,10 @@ android {
248
248
  bigscreenAppstage {
249
249
  // X.Y.Z XXYYZZUU -> version 1.2.3 will be 01020300, 5th update of 1.2.3 will be 01020305
250
250
  dimension "bridge"
251
- versionCode 1000100
252
- versionName "1.0.1"
253
- applicationId "com.twentyfouri.app.appstagebigscreen"
254
- resValue "string", "app_name", "Appstage BIGscreen"
251
+ versionCode {{APP_VERSION_CODE}}
252
+ versionName "{{APP_VERSION_NAME}}"
253
+ applicationId "{{APP_ID}}"
254
+ resValue "string", "app_name", "{{configProps.appName}}"
255
255
  }
256
256
  kan {
257
257
  // X.Y.Z XXYYZZUU -> version 1.2.3 will be 01020300, 5th update of 1.2.3 will be 01020305
@@ -1,5 +1,5 @@
1
1
  {
2
- "baseUrl": "http://appstage-bigscreen.kan.24imedia.com.s3.amazonaws.com/builds/androidtv/animated_1080/dist/v0.0.9/public/index.html",
2
+ "baseUrl": "{{APP_URL}}",
3
3
  "customizableUrl": false,
4
4
  "mediaEventPrefix": "player:",
5
5
  "startWithHighVideoQuality": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@24i/smartapps-bigscreen-rnv-build-engine",
3
- "version": "0.17.2-alpha.2164",
3
+ "version": "0.17.2-alpha.2166",
4
4
  "description": "Package with build engine for SmartApps BIGscreen projects...",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {
@@ -1,184 +0,0 @@
1
- package com.twentyfouri.tvbridge.global.utils
2
-
3
- import android.net.Uri
4
- import android.text.TextUtils
5
- import android.util.Base64
6
- import android.util.Log
7
- import com.google.android.exoplayer2.C
8
- import com.google.android.exoplayer2.drm.ExoMediaDrm
9
- import com.google.android.exoplayer2.upstream.DataSourceInputStream
10
- import com.google.android.exoplayer2.upstream.DataSpec
11
- import com.google.android.exoplayer2.upstream.HttpDataSource
12
- import com.google.android.exoplayer2.util.Assertions
13
- import com.google.android.exoplayer2.util.Util
14
- import com.twentyfouri.smartexoplayer.drm.SmartMediaDrmCallback
15
- import com.twentyfouri.smartexoplayer.model.DrmConfiguration
16
- import com.twentyfouri.tvbridge.BuildConfig
17
- import org.json.JSONException
18
- import org.json.JSONObject
19
- import java.io.BufferedReader
20
- import java.io.IOException
21
- import java.io.InputStreamReader
22
- import java.net.MalformedURLException
23
- import java.net.URL
24
- import java.net.URLEncoder
25
- import java.util.HashMap
26
- import java.util.UUID
27
-
28
- class HttpMediaDrmCallback(
29
- private val defaultLicenseUrl: String?,
30
- private val forceDefaultLicenseUrl: Boolean,
31
- private val dataSourceFactory: HttpDataSource.Factory
32
- ) : SmartMediaDrmCallback {
33
-
34
- private val keyRequestProperties = HashMap<String, String>()
35
-
36
- /**
37
- * @param defaultLicenseUrl The default license URL. Used for key requests that do not specify
38
- * their own license URL.
39
- * @param dataSourceFactory A factory from which to obtain [HttpDataSource] instances.
40
- */
41
- constructor(defaultLicenseUrl: String, dataSourceFactory: HttpDataSource.Factory) : this(defaultLicenseUrl, false, dataSourceFactory) {}
42
-
43
- /**
44
- * Sets a header for key requests made by the callback.
45
- *
46
- * @param name The name of the header field.
47
- * @param value The value of the field.
48
- */
49
- override fun setKeyRequestProperty(name: String, value: String) {
50
- Log.d(TAG, "setKeyRequestProperty")
51
- Assertions.checkNotNull(name)
52
- Assertions.checkNotNull(value)
53
- synchronized(keyRequestProperties) { keyRequestProperties.put(name, value) }
54
- }
55
-
56
- /**
57
- * Clears a header for key requests made by the callback.
58
- *
59
- * @param name The name of the header field.
60
- */
61
- override fun clearKeyRequestProperty(name: String) {
62
- Log.d(TAG, "clearKeyRequestProperty")
63
- Assertions.checkNotNull(name)
64
- synchronized(keyRequestProperties) { keyRequestProperties.remove(name) }
65
- }
66
-
67
- /**
68
- * Clears all headers for key requests made by the callback.
69
- */
70
- override fun clearAllKeyRequestProperties() {
71
- Log.d(TAG, "clearAllKeyRequestProperties")
72
- synchronized(keyRequestProperties) { keyRequestProperties.clear() }
73
- }
74
-
75
- @Throws(IOException::class)
76
- override fun executeProvisionRequest(uuid: UUID, request: ExoMediaDrm.ProvisionRequest): ByteArray {
77
- Log.d(TAG, "executeProvisionRequest")
78
- val url = request.defaultUrl + "&signedRequest=" + String(request.data)
79
- return executePost(dataSourceFactory, url, ByteArray(0), null)
80
- }
81
-
82
- @Throws(Exception::class)
83
- override fun executeKeyRequest(uuid: UUID, request: ExoMediaDrm.KeyRequest): ByteArray {
84
- Log.d(TAG, "executeKeyRequest")
85
- var url: String? = request.licenseServerUrl
86
- if (forceDefaultLicenseUrl || url.isNullOrEmpty()) {
87
- url = defaultLicenseUrl
88
- }
89
- val requestProperties: MutableMap<String, String> = HashMap()
90
- // Add standard request properties for supported schemes.
91
- val contentType = "text/plain"
92
- requestProperties["Content-Type"] = contentType
93
- if (C.PLAYREADY_UUID == uuid) {
94
- requestProperties["SOAPAction"] = "http://schemas.microsoft.com/DRM/2007/03/protocols/AcquireLicense"
95
- }
96
- // Add additional request properties.
97
- synchronized(keyRequestProperties) { requestProperties.putAll(keyRequestProperties) }
98
-
99
- //adding data to url
100
- val challenge = request.data
101
- val encoded = URLEncoder.encode(Base64.encodeToString(challenge, Base64.NO_WRAP), "UTF-8")
102
- url = appendQuery(url, "_widevineChallenge=$encoded")
103
- if (BuildConfig.DEBUG) {
104
- Log.d(TAG, "Executing post on url $url with content type $contentType")
105
- }
106
- return executeGet(url)
107
- }
108
-
109
- class Factory(
110
- private val licenseUrl: String?,
111
- private val forceDefaultUrl: Boolean
112
- ) : SmartMediaDrmCallback.Factory {
113
- override fun build(drm: DrmConfiguration, dataSourceFactory: HttpDataSource.Factory): SmartMediaDrmCallback =
114
- HttpMediaDrmCallback(licenseUrl, forceDefaultUrl, dataSourceFactory)
115
- }
116
-
117
- companion object {
118
- private const val TAG = "DrmCallback"
119
-
120
- private fun executeGet(urlString: String): ByteArray {
121
- var licenserRequest: URL? = null
122
- try {
123
- licenserRequest = URL(urlString)
124
- val yc = licenserRequest.openConnection()
125
- val input = BufferedReader(InputStreamReader(yc.getInputStream()))
126
- val builder = StringBuilder()
127
- var inputLine: String?
128
- while (input.readLine().also { inputLine = it } != null) {
129
- builder.append(inputLine)
130
- }
131
- input.close()
132
- val jsonObject = JSONObject(builder.toString())
133
- val container = jsonObject.getJSONObject("getWidevineLicenseResponse")
134
- val license = container.getString("license")
135
- if (BuildConfig.DEBUG) {
136
- Log.d(TAG, "Finished post: $license")
137
- }
138
- return Base64.decode(license, Base64.NO_WRAP)
139
- } catch (e: MalformedURLException) {
140
- e.printStackTrace()
141
- } catch (e: IOException) {
142
- e.printStackTrace()
143
- } catch (e: JSONException) {
144
- e.printStackTrace()
145
- }
146
- return byteArrayOf()
147
- }
148
-
149
- @Throws(IOException::class)
150
- private fun executePost(
151
- dataSourceFactory: HttpDataSource.Factory,
152
- url: String,
153
- data: ByteArray,
154
- requestProperties: Map<String, String>?
155
- ): ByteArray {
156
- Log.d(TAG, "executePost")
157
- val dataSource = dataSourceFactory.createDataSource()
158
- if (requestProperties != null) {
159
- for ((key, value) in requestProperties) {
160
- dataSource.setRequestProperty(key, value)
161
- }
162
- }
163
- val dataSpec = DataSpec(Uri.parse(url), data, 0, 0, C.LENGTH_UNSET.toLong(), null,
164
- DataSpec.FLAG_ALLOW_GZIP)
165
- val inputStream = DataSourceInputStream(dataSource, dataSpec)
166
- return try {
167
- Util.toByteArray(inputStream)
168
- } finally {
169
- Util.closeQuietly(inputStream)
170
- }
171
- }
172
-
173
- fun appendQuery(url: String?, appendQuery: String): String {
174
- val oldUri = Uri.parse(url)
175
- var newQuery = oldUri.query
176
- if (newQuery == null) {
177
- newQuery = appendQuery
178
- } else {
179
- newQuery += "&$appendQuery"
180
- }
181
- return oldUri.scheme + "://" + oldUri.authority + oldUri.path + "?" + newQuery
182
- }
183
- }
184
- }
@@ -1,8 +0,0 @@
1
- ## This file must *NOT* be checked into Version Control Systems,
2
- # as it contains information specific to your local configuration.
3
- #
4
- # Location of the SDK. This is only used by Gradle.
5
- # For customization when using a Version Control System, please read the
6
- # header note.
7
- #Mon Nov 14 13:06:27 CET 2022
8
- sdk.dir=/Users/radimbuchtela/Library/Android/sdk