Skip to content

Commit

Permalink
Improve abi including
Browse files Browse the repository at this point in the history
  • Loading branch information
furenster committed Oct 16, 2024
1 parent c485fff commit 82a5bd1
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 26 deletions.
61 changes: 35 additions & 26 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,34 @@ android {
val channelDimension by extra("channel")
flavorDimensions.add(channelDimension)

defaultConfig {
applicationId = "com.gemwallet.android"
minSdk = 28
targetSdk = 34
versionCode = Integer.valueOf(System.getenv("BUILD_NUMBER") ?: "1")
versionName = System.getenv("BUILD_VERSION") ?: "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}

splits {
abi {
isEnable = false
include("arm64-v8a", "armeabi-v7a")
isUniversalApk = false
}
}
}
productFlavors {
create("google") {
dimension = channelDimension
isDefault = true
ndk {
abiFilters.add("armeabi-v7a")
abiFilters.add("arm64-v8a")
}
buildConfigField("String", "UPDATE_URL", "\"https://play.google.com/store/apps/details?id=com.gemwallet.android\"")
}

Expand All @@ -36,41 +60,26 @@ android {
}
create("huawei") {
dimension = channelDimension
ndk {
abiFilters.add("armeabi-v7a")
abiFilters.add("arm64-v8a")
}
buildConfigField("String", "UPDATE_URL", "\"https://appgallery.huawei.com/app/C109713129\"")
}
create("solana") {
dimension = channelDimension
ndk {
abiFilters.add("x86_64")
}
buildConfigField("String", "UPDATE_URL", "\"solanadappstore://details?id=com.gemwallet.android\"")
}
create("universal") {
dimension = channelDimension
buildConfigField("String", "UPDATE_URL", "\"https://apk.gemwallet.com/gem_wallet_latest.apk\"")
}
}

defaultConfig {
applicationId = "com.gemwallet.android"
minSdk = 28
targetSdk = 34
versionCode = Integer.valueOf(System.getenv("BUILD_NUMBER") ?: "1")
versionName = System.getenv("BUILD_VERSION") ?: "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
ndk {
abiFilters.add("x86_64")
abiFilters.add("armeabi-v7a")
abiFilters.add("arm64-v8a")
}

splits {
abi {
isEnable = false
include("arm64-v8a", "armeabi-v7a")
isUniversalApk = false
ndk {
abiFilters.add("armeabi-v7a")
abiFilters.add("arm64-v8a")
}
buildConfigField("String", "UPDATE_URL", "\"https://apk.gemwallet.com/gem_wallet_latest.apk\"")
}
}
signingConfigs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
import androidx.hilt.navigation.compose.hiltViewModel
import com.gemwallet.android.BuildConfig
import com.gemwallet.android.R
import com.gemwallet.android.features.settings.develop.viewmodels.DevelopViewModel
import com.gemwallet.android.ui.components.CellEntity
Expand All @@ -29,6 +30,9 @@ fun DevelopScene(
},
CellEntity("Push token", viewModel.getPushToken()) {
clipboardManager.setText(AnnotatedString(viewModel.getPushToken()))
},
CellEntity("Store", BuildConfig.FLAVOR) {
clipboardManager.setText(AnnotatedString(viewModel.getPushToken()))
}
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.gemwallet.android.services.requestPushToken
import com.wallet.core.primitives.Currency
import com.wallet.core.primitives.Device
import com.wallet.core.primitives.Platform
import com.wallet.core.primitives.PlatformStore
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
Expand All @@ -28,6 +29,14 @@ class SyncDevice(
val device = Device(
id = deviceId,
platform = Platform.Android,
platformStore = when (BuildConfig.FLAVOR) {
"google" -> PlatformStore.GooglePlay
"universal" -> PlatformStore.ApkUniversal
"huawei" -> PlatformStore.Huawei
"solana" -> PlatformStore.SolanaStore
"fdroid" -> PlatformStore.Fdroid
else -> null
},
token = "",
locale = getLocale(Locale.getDefault()),
isPushEnabled = pushEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,14 @@ interface GemApiClient {
context: JsonDeserializationContext?
): Device {
val jObj = json?.asJsonObject ?: throw JsonSyntaxException(json?.toString())
val platformStore = jObj["platformStore"]?.asString
return Device(
id = jObj["id"]?.asString ?: "",
platform = when (jObj["platform"]?.asString) {
Platform.IOS.string -> Platform.IOS
else -> Platform.Android
},
platformStore = PlatformStore.entries.firstOrNull { it.string == platformStore },
token = jObj["token"]?.asString ?: "",
locale = jObj["locale"]?.asString ?: "",
version = jObj["version"]?.asString ?: "",
Expand All @@ -228,6 +230,7 @@ interface GemApiClient {
return JsonObject().apply {
addProperty("id", src.id)
addProperty("platform", src.platform.string)
addProperty("platformStore", src.platformStore?.string)
addProperty("token", src.token)
addProperty("locale", src.locale)
addProperty("version", src.version)
Expand Down

0 comments on commit 82a5bd1

Please sign in to comment.