mirror of
https://github.com/readest/readest.git
synced 2026-04-29 20:10:55 +00:00
feat(android): add foss flavor build without gms services (#3666)
This commit is contained in:
parent
966f5e2acd
commit
bbfc82e50d
6 changed files with 48 additions and 9 deletions
|
|
@ -30,10 +30,21 @@ android {
|
|||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
|
||||
flavorDimensions += "store"
|
||||
productFlavors {
|
||||
create("foss") {
|
||||
dimension = "store"
|
||||
}
|
||||
create("googleplay") {
|
||||
dimension = "store"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.android.billingclient:billing-ktx:7.1.1")
|
||||
"googleplayImplementation"("com.android.billingclient:billing-ktx:7.1.1")
|
||||
"googleplayImplementation"("com.google.android.gms:play-services-base:18.5.0")
|
||||
implementation("androidx.core:core-ktx:1.12.0")
|
||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||
implementation("androidx.browser:browser:1.8.0")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
package com.readest.native_bridge
|
||||
|
||||
import android.app.Activity
|
||||
import android.util.Log
|
||||
|
||||
class BillingManager(private val activity: Activity) {
|
||||
companion object {
|
||||
private const val TAG = "BillingManager"
|
||||
}
|
||||
|
||||
fun isBillingAvailable(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
fun initialize(callback: (Boolean) -> Unit) {
|
||||
Log.d(TAG, "Google Play billing not available in this build")
|
||||
callback(false)
|
||||
}
|
||||
|
||||
fun fetchProducts(productIds: List<String>, callback: (List<ProductData>) -> Unit) {
|
||||
callback(emptyList())
|
||||
}
|
||||
|
||||
fun purchaseProduct(productId: String, callback: (PurchaseData?) -> Unit) {
|
||||
callback(null)
|
||||
}
|
||||
|
||||
fun restorePurchases(callback: (List<PurchaseData>) -> Unit) {
|
||||
callback(emptyList())
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue