@24i/smartapps-bigscreen-rnv-build-engine 5.0.0-alpha.16 → 5.0.0
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.
- package/build-freshness.js +158 -0
- package/dist/.build-freshness.json +1010 -0
- package/dist/templates/platforms/firetv/project/README.md +196 -0
- package/dist/templates/platforms/firetv/project/amazoniap/build.gradle +41 -0
- package/dist/templates/platforms/firetv/project/amazoniap/consumer-rules.pro +0 -0
- package/dist/templates/platforms/firetv/project/amazoniap/proguard-rules.pro +21 -0
- package/dist/templates/platforms/firetv/project/amazoniap/src/main/kotlin/com/twentyfouri/bridgetv/amazoniap/AmazonIapService.kt +91 -0
- package/dist/templates/platforms/firetv/project/amazoniap/src/main/kotlin/com/twentyfouri/bridgetv/amazoniap/AmazonIapServiceFactory.kt +13 -0
- package/dist/templates/platforms/firetv/project/app/build.gradle +138 -0
- package/dist/templates/platforms/firetv/project/app/proguard-rules.pro +47 -0
- package/dist/templates/platforms/firetv/project/app/src/bigscreenAppstage/kotlin/com/twentyfouri/tvbridge/Flavor.kt +9 -0
- package/dist/templates/platforms/firetv/project/app/src/bigscreenAppstage/res/raw/configuration.json +8 -0
- package/dist/templates/platforms/firetv/project/app/src/main/AndroidManifest.xml +52 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/FlavorBase.kt +9 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/bridge/BridgeFromJavaScript.kt +421 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/bridge/BridgeToJavaScript.kt +121 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/configuration/BridgeConfig.kt +19 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/configuration/ConfigCallback.kt +6 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/configuration/ConfigProvider.kt +27 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/configuration/Drm.kt +10 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/configuration/UserAgent.kt +6 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/BaseApplication.kt +73 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/di/ActivityComponent.kt +13 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/di/ActivityModule.kt +14 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/di/ApplicationComponent.kt +23 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/di/ApplicationModule.kt +51 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/di/PerActivity.kt +26 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/utils/LocalStorage.kt +30 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/utils/LoggingDrmCallback.kt +38 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/utils/OverriddenHttpMediaDrmCallback.kt +134 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/utils/PlayerFactoryBitmovinCustomized.kt +19 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/utils/PlayerFactoryConfigured.kt +37 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/utils/PlayerFactoryExoPlayerCustomized.kt +106 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/utils/PlayerFactoryExoPlayerNpaw.kt +581 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/utils/PlayerFactoryVersion.kt +27 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/utils/SimpleActivityLifecycleCallback.kt +32 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/utils/SourceDrmOverridden.kt +91 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/sound/TouchPlayer.kt +86 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/client/BridgeWebView.kt +82 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/client/BridgeWebViewClient.kt +114 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/model/AnalyticsPlaybackInfo.kt +10 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/model/ContentModel.kt +14 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/model/DrmModel.kt +20 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/model/MediaEventType.kt +31 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/parser/PlaybackInfoParser.kt +10 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/parser/SourceParser.kt +89 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/parser/TrackJsonModelParser.kt +58 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/view/Mainview.kt +18 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/view/PlayerCache.kt +15 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/view/WebViewActivity.kt +252 -0
- package/dist/templates/platforms/firetv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/viewmodel/WebViewModel.kt +748 -0
- package/dist/templates/platforms/firetv/project/app/src/main/res/drawable/button_background_focus.xml +10 -0
- package/dist/templates/platforms/firetv/project/app/src/main/res/drawable/button_background_normal.xml +7 -0
- package/dist/templates/platforms/firetv/project/app/src/main/res/drawable/button_background_pressed.xml +7 -0
- package/dist/templates/platforms/firetv/project/app/src/main/res/drawable/button_focus.xml +8 -0
- package/dist/templates/platforms/firetv/project/app/src/main/res/layout/activity_web_view.xml +28 -0
- package/dist/templates/platforms/firetv/project/app/src/main/res/raw/click.ogg +0 -0
- package/dist/templates/platforms/firetv/project/app/src/main/res/values/styles.xml +12 -0
- package/dist/templates/platforms/firetv/project/app/src/main/res/xml/network_security_config.xml +4 -0
- package/dist/templates/platforms/firetv/project/build.gradle +45 -0
- package/dist/templates/platforms/firetv/project/common/build.gradle +41 -0
- package/dist/templates/platforms/firetv/project/common/consumer-rules.pro +0 -0
- package/dist/templates/platforms/firetv/project/common/proguard-rules.pro +21 -0
- package/dist/templates/platforms/firetv/project/common/src/main/kotlin/com/twentyfouri/tvbridge/common/Util.kt +11 -0
- package/dist/templates/platforms/firetv/project/common/src/main/kotlin/com/twentyfouri/tvbridge/common/iap/IapCallback.kt +11 -0
- package/dist/templates/platforms/firetv/project/common/src/main/kotlin/com/twentyfouri/tvbridge/common/iap/IapException.kt +14 -0
- package/dist/templates/platforms/firetv/project/common/src/main/kotlin/com/twentyfouri/tvbridge/common/iap/IapProduct.kt +16 -0
- package/dist/templates/platforms/firetv/project/common/src/main/kotlin/com/twentyfouri/tvbridge/common/iap/IapPurchase.kt +9 -0
- package/dist/templates/platforms/firetv/project/common/src/main/kotlin/com/twentyfouri/tvbridge/common/iap/IapService.kt +14 -0
- package/dist/templates/platforms/firetv/project/common/src/main/kotlin/com/twentyfouri/tvbridge/common/iap/IapServiceFactory.kt +8 -0
- package/dist/templates/platforms/firetv/project/common/src/main/kotlin/com/twentyfouri/tvbridge/common/iap/NullIapService.kt +32 -0
- package/dist/templates/platforms/firetv/project/googleiap/build.gradle +41 -0
- package/dist/templates/platforms/firetv/project/googleiap/consumer-rules.pro +0 -0
- package/dist/templates/platforms/firetv/project/googleiap/proguard-rules.pro +21 -0
- package/dist/templates/platforms/firetv/project/googleiap/src/main/kotlin/com/twentyfouri/tvbridge/googleiap/GoogleIapService.kt +6 -0
- package/dist/templates/platforms/firetv/project/googleiap/src/main/kotlin/com/twentyfouri/tvbridge/googleiap/GoogleIapServiceFactory.kt +13 -0
- package/dist/templates/platforms/firetv/project/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/dist/templates/platforms/firetv/project/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/dist/templates/platforms/firetv/project/gradle.properties +4 -0
- package/dist/templates/platforms/firetv/project/gradlew +251 -0
- package/dist/templates/platforms/firetv/project/gradlew.bat +94 -0
- package/dist/templates/platforms/firetv/project/proguard-rules.pro +42 -0
- package/dist/templates/platforms/firetv/project/settings.gradle +4 -0
- package/index.js +2 -31
- package/package.json +7 -3
- package/project.json +96 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
|
+
<item android:drawable="@drawable/button_background_pressed"
|
|
4
|
+
android:state_pressed="true" />
|
|
5
|
+
<item android:drawable="@drawable/button_background_focus"
|
|
6
|
+
android:state_focused="true" />
|
|
7
|
+
<item android:drawable="@drawable/button_background_normal"/>
|
|
8
|
+
</selector>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
android:layout_width="match_parent"
|
|
3
|
+
android:layout_height="match_parent"
|
|
4
|
+
android:background="@android:color/black">
|
|
5
|
+
|
|
6
|
+
<com.twentyfouri.player.base.PlayerView
|
|
7
|
+
android:id="@+id/player_view"
|
|
8
|
+
android:layout_width="match_parent"
|
|
9
|
+
android:layout_height="match_parent" />
|
|
10
|
+
|
|
11
|
+
<View
|
|
12
|
+
android:id="@+id/black_curtain"
|
|
13
|
+
android:layout_width="match_parent"
|
|
14
|
+
android:layout_height="match_parent"
|
|
15
|
+
android:background="@android:color/black" />
|
|
16
|
+
|
|
17
|
+
<com.twentyfouri.tvbridge.webview.client.BridgeWebView
|
|
18
|
+
android:id="@+id/webview"
|
|
19
|
+
android:layout_width="match_parent"
|
|
20
|
+
android:layout_height="match_parent"
|
|
21
|
+
android:layout_alignParentStart="true"
|
|
22
|
+
android:layout_alignParentTop="true"
|
|
23
|
+
android:layout_alignParentEnd="true"
|
|
24
|
+
android:layout_alignParentBottom="true"
|
|
25
|
+
android:background="@android:color/transparent"
|
|
26
|
+
android:visibility="gone" />
|
|
27
|
+
|
|
28
|
+
</RelativeLayout>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<resources>
|
|
3
|
+
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar.FullScreen"/>
|
|
4
|
+
|
|
5
|
+
<style name="Theme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light">
|
|
6
|
+
<item name="windowNoTitle">true</item>
|
|
7
|
+
<item name="windowActionBar">false</item>
|
|
8
|
+
<item name="android:windowFullscreen">true</item>
|
|
9
|
+
<item name="android:windowContentOverlay">@null</item>
|
|
10
|
+
<item name="android:windowBackground">#000000</item>
|
|
11
|
+
</style>
|
|
12
|
+
</resources>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
ext.kotlin_version = '2.2.10'
|
|
3
|
+
|
|
4
|
+
repositories {
|
|
5
|
+
google()
|
|
6
|
+
mavenCentral()
|
|
7
|
+
}
|
|
8
|
+
dependencies {
|
|
9
|
+
classpath 'com.android.tools.build:gradle:8.12.1'
|
|
10
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
11
|
+
classpath 'com.google.gms:google-services:4.4.3'
|
|
12
|
+
classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.6'
|
|
13
|
+
|
|
14
|
+
// NOTE: Do not place your application dependencies here; they belong
|
|
15
|
+
// in the individual module build.gradle files
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
ext {
|
|
20
|
+
mavenRepositoryUrl = 'https://maven.pkg.github.com/24i/*'
|
|
21
|
+
mavenRepositoryUsername = findProperty('github_username') ?: "24i"
|
|
22
|
+
mavenRepositoryPassword = findProperty('github_token') ?: System.getenv("GH_TOKEN") ?: System.getenv("GITHUB_TOKEN")
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
allprojects {
|
|
26
|
+
repositories {
|
|
27
|
+
mavenLocal()
|
|
28
|
+
google()
|
|
29
|
+
mavenCentral()
|
|
30
|
+
maven {
|
|
31
|
+
url "$mavenRepositoryUrl"
|
|
32
|
+
credentials {
|
|
33
|
+
username = "$mavenRepositoryUsername"
|
|
34
|
+
password = "$mavenRepositoryPassword"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
maven { url "https://jitpack.io" }
|
|
38
|
+
maven { url "https://artifact.plugin.npaw.com/artifactory/plugins/android" }
|
|
39
|
+
maven { url "https://artifacts.bitmovin.com/artifactory/public-releases" }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
tasks.register('clean', Delete) {
|
|
44
|
+
delete rootProject.layout.buildDirectory
|
|
45
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
2
|
+
|
|
3
|
+
plugins {
|
|
4
|
+
id 'com.android.library'
|
|
5
|
+
id 'kotlin-android'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
android {
|
|
9
|
+
namespace = "com.twentyfouri.tvbridge.common"
|
|
10
|
+
compileSdk = {{COMPILE_SDK_VERSION}}
|
|
11
|
+
|
|
12
|
+
compileOptions {
|
|
13
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
14
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
defaultConfig {
|
|
18
|
+
minSdk = {{MIN_SDK_VERSION}}
|
|
19
|
+
targetSdk = {{TARGET_SDK_VERSION}}
|
|
20
|
+
|
|
21
|
+
versionCode {{APP_VERSION_CODE}}
|
|
22
|
+
versionName "{{APP_VERSION_NAME}}"
|
|
23
|
+
|
|
24
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
25
|
+
consumerProguardFiles "consumer-rules.pro"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
buildTypes {
|
|
29
|
+
release {
|
|
30
|
+
minifyEnabled false
|
|
31
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
kotlin.compilerOptions.jvmTarget = JvmTarget.JVM_17
|
|
37
|
+
|
|
38
|
+
dependencies {
|
|
39
|
+
api 'androidx.core:core-ktx:1.17.0'
|
|
40
|
+
api 'androidx.appcompat:appcompat:1.7.1'
|
|
41
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Add project specific ProGuard rules here.
|
|
2
|
+
# You can control the set of applied configuration files using the
|
|
3
|
+
# proguardFiles setting in build.gradle.
|
|
4
|
+
#
|
|
5
|
+
# For more details, see
|
|
6
|
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
7
|
+
|
|
8
|
+
# If your project uses WebView with JS, uncomment the following
|
|
9
|
+
# and specify the fully qualified class name to the JavaScript interface
|
|
10
|
+
# class:
|
|
11
|
+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
12
|
+
# public *;
|
|
13
|
+
#}
|
|
14
|
+
|
|
15
|
+
# Uncomment this to preserve the line number information for
|
|
16
|
+
# debugging stack traces.
|
|
17
|
+
#-keepattributes SourceFile,LineNumberTable
|
|
18
|
+
|
|
19
|
+
# If you keep the line number information, uncomment this to
|
|
20
|
+
# hide the original source file name.
|
|
21
|
+
#-renamesourcefileattribute SourceFile
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
package com.twentyfouri.tvbridge.common
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
|
|
5
|
+
@Suppress("DEPRECATION", "unused")
|
|
6
|
+
val Context.installerPackageName get() =
|
|
7
|
+
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) {
|
|
8
|
+
packageManager.getInstallSourceInfo(packageName).installingPackageName
|
|
9
|
+
} else {
|
|
10
|
+
packageManager.getInstallerPackageName(packageName)
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
package com.twentyfouri.tvbridge.common.iap
|
|
2
|
+
|
|
3
|
+
interface IapCallback {
|
|
4
|
+
fun checkNewPurchasesFinished(result: List<IapPurchase>)
|
|
5
|
+
fun checkNewPurchasesFinished(exception: Exception)
|
|
6
|
+
fun getProductsFinished(result: List<IapProduct>, missing: List<String>)
|
|
7
|
+
fun getProductsFinished(exception: Exception)
|
|
8
|
+
fun purchaseFinished(result: IapPurchase)
|
|
9
|
+
fun purchaseFinished(exception: Exception)
|
|
10
|
+
fun acknowledgeReceiptFinished(exception: Exception?)
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
package com.twentyfouri.tvbridge.common.iap
|
|
2
|
+
|
|
3
|
+
class IapException(
|
|
4
|
+
val status: String,
|
|
5
|
+
message: String = "In-app payment failed: $status",
|
|
6
|
+
cause: Exception? = null
|
|
7
|
+
) : Exception(message, cause) {
|
|
8
|
+
companion object {
|
|
9
|
+
const val STATUS_FAILED = "FAILED"
|
|
10
|
+
const val STATUS_NOT_SUPPORTED = "NOT_SUPPORTED"
|
|
11
|
+
const val STATUS_INVALID_SKU = "INVALID_SKU"
|
|
12
|
+
const val STATUS_ALREADY_PURCHASED = "ALREADY_PURCHASED"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
package com.twentyfouri.tvbridge.common.iap
|
|
2
|
+
|
|
3
|
+
data class IapProduct(
|
|
4
|
+
val title: String,
|
|
5
|
+
val description: String,
|
|
6
|
+
val price: String,
|
|
7
|
+
val icon: String,
|
|
8
|
+
val type: String,
|
|
9
|
+
val sku: String,
|
|
10
|
+
) {
|
|
11
|
+
companion object {
|
|
12
|
+
const val TYPE_CONSUMABLE = "CONSUMABLE"
|
|
13
|
+
const val TYPE_SUBSCRIPTION = "SUBSCRIPTION"
|
|
14
|
+
const val TYPE_ENTITLED = "ENTITLED"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
package com.twentyfouri.tvbridge.common.iap
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import org.json.JSONObject
|
|
5
|
+
|
|
6
|
+
interface IapService {
|
|
7
|
+
fun initialize()
|
|
8
|
+
fun destroy()
|
|
9
|
+
fun checkNewPurchases()
|
|
10
|
+
fun getProducts(skus: Iterable<String>)
|
|
11
|
+
fun purchase(activity: Activity, sku: String)
|
|
12
|
+
fun acknowledgeReceipt(receipt: JSONObject)
|
|
13
|
+
fun setCallback(callback: IapCallback?)
|
|
14
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
package com.twentyfouri.tvbridge.common.iap
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import org.json.JSONObject
|
|
5
|
+
|
|
6
|
+
open class NullIapService : IapService {
|
|
7
|
+
private var callback: IapCallback? = null
|
|
8
|
+
|
|
9
|
+
override fun initialize() = Unit
|
|
10
|
+
|
|
11
|
+
override fun destroy() = Unit
|
|
12
|
+
|
|
13
|
+
override fun checkNewPurchases() {
|
|
14
|
+
callback?.checkNewPurchasesFinished(UnsupportedOperationException())
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override fun getProducts(skus: Iterable<String>) {
|
|
18
|
+
callback?.getProductsFinished(UnsupportedOperationException())
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
override fun purchase(activity: Activity, sku: String) {
|
|
22
|
+
callback?.purchaseFinished(UnsupportedOperationException())
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override fun acknowledgeReceipt(receipt: JSONObject) {
|
|
26
|
+
callback?.acknowledgeReceiptFinished(UnsupportedOperationException())
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
override fun setCallback(callback: IapCallback?) {
|
|
30
|
+
this.callback = callback
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
2
|
+
|
|
3
|
+
plugins {
|
|
4
|
+
id 'com.android.library'
|
|
5
|
+
id 'kotlin-android'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
android {
|
|
9
|
+
namespace = "com.twentyfouri.tvbridge.googleiap"
|
|
10
|
+
compileSdk = {{COMPILE_SDK_VERSION}}
|
|
11
|
+
|
|
12
|
+
compileOptions {
|
|
13
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
14
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
defaultConfig {
|
|
18
|
+
minSdk = {{MIN_SDK_VERSION}}
|
|
19
|
+
targetSdk = {{TARGET_SDK_VERSION}}
|
|
20
|
+
|
|
21
|
+
versionCode {{APP_VERSION_CODE}}
|
|
22
|
+
versionName "{{APP_VERSION_NAME}}"
|
|
23
|
+
|
|
24
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
25
|
+
consumerProguardFiles "consumer-rules.pro"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
buildTypes {
|
|
29
|
+
release {
|
|
30
|
+
minifyEnabled false
|
|
31
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
kotlin.compilerOptions.jvmTarget = JvmTarget.JVM_17
|
|
37
|
+
|
|
38
|
+
dependencies {
|
|
39
|
+
implementation project(':common')
|
|
40
|
+
implementation 'com.android.billingclient:billing-ktx:8.0.0'
|
|
41
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Add project specific ProGuard rules here.
|
|
2
|
+
# You can control the set of applied configuration files using the
|
|
3
|
+
# proguardFiles setting in build.gradle.
|
|
4
|
+
#
|
|
5
|
+
# For more details, see
|
|
6
|
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
7
|
+
|
|
8
|
+
# If your project uses WebView with JS, uncomment the following
|
|
9
|
+
# and specify the fully qualified class name to the JavaScript interface
|
|
10
|
+
# class:
|
|
11
|
+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
12
|
+
# public *;
|
|
13
|
+
#}
|
|
14
|
+
|
|
15
|
+
# Uncomment this to preserve the line number information for
|
|
16
|
+
# debugging stack traces.
|
|
17
|
+
#-keepattributes SourceFile,LineNumberTable
|
|
18
|
+
|
|
19
|
+
# If you keep the line number information, uncomment this to
|
|
20
|
+
# hide the original source file name.
|
|
21
|
+
#-renamesourcefileattribute SourceFile
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
package com.twentyfouri.tvbridge.googleiap
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.os.Build
|
|
5
|
+
import com.twentyfouri.tvbridge.common.iap.IapServiceFactory
|
|
6
|
+
import com.twentyfouri.tvbridge.common.installerPackageName
|
|
7
|
+
|
|
8
|
+
object GoogleIapServiceFactory : IapServiceFactory {
|
|
9
|
+
override fun detectSupport(context: Context) =
|
|
10
|
+
Build.MANUFACTURER != "Amazon" && context.installerPackageName != "com.amazon.venezia"
|
|
11
|
+
|
|
12
|
+
override fun build(context: Context) = GoogleIapService
|
|
13
|
+
}
|