All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.com.wisetrack.sdk.VersionConfig.kt Maven / Gradle / Ivy

There is a newer version: 1.5.8-alpha
Show newest version
package com.wisetrack.sdk

/**
@author hamed (@hamed-hsb)
 * @since 22th October 2024
 */
internal class VersionConfig(private val type: PlatformType,private val env: EnvirmentType) {

    var sdk_version: String? = null
    var sdk_version_code: String? = null
    var sdk_hash_Build: String? = null
    var sdk_platform: String? = null
    var sdk_envirment: String? = null

    init {
        BuildConfig.ENVIRMENT_PRODOCUTION
        when(type){
            PlatformType.ANDROID_NATIVE -> {
                sdk_version = BuildConfig.SDK_VERSION
                sdk_version_code = BuildConfig.SDK_VERSION_CODE
                sdk_hash_Build = "82b12fd10673cf9684e73484f02bef065e857f2691f94112e2fafafe3895c2da"
                sdk_platform = "android_native"
                sdk_envirment = env.displayName
                Constants.ENVIRONMENT = env.displayName

            }
            PlatformType.ANDROID_FLUTTER -> {
                sdk_version = BuildConfig.ANDROID_FLUTTER_SDK_VERSION
                sdk_version_code = BuildConfig.ANDROID_FLUTTER_SDK_VERSION_CODE
                sdk_hash_Build = "1d11f3cdc395d83b057edd3d5445f31d9b18e6e0a212d4c033460d40f68da4ec"
                sdk_platform = "android_flutter"
                sdk_envirment = env.displayName
                Constants.ENVIRONMENT = env.displayName

            }
            PlatformType.ANDROID_REACT_NATIVE -> {
                sdk_version = BuildConfig.ANDROID_REACT_NATIVE_SDK_VERSION
                sdk_version_code = BuildConfig.ANDROID_REACT_NATIVE_SDK_VERSION_CODE
                sdk_hash_Build = ""
                sdk_platform = "android_react_native"
                sdk_envirment = env.displayName
                Constants.ENVIRONMENT = env.displayName

            }
            PlatformType.ANDROID_UNITY -> {
                sdk_version = BuildConfig.ANDROID_UNITY_SDK_VERSION
                sdk_version_code = BuildConfig.ANDROID_UNITY_VERSION_CODE
                sdk_hash_Build = "f309ca179da437af3b6266050eee87539cd231ab52962581bd178aabfe7f14a1"
                sdk_platform = "android_unity"
                sdk_envirment = env.displayName
                Constants.ENVIRONMENT = env.displayName
            }
        }
    }
}

internal enum class EnvirmentType(val displayName: String){
    PRODUCTION("production"),
    STAGE("stage"),
    DEBUG("debug");

    override fun toString(): String {
        return displayName
    }
}




internal enum class  PlatformType{
    ANDROID_NATIVE,
    ANDROID_FLUTTER,
    ANDROID_REACT_NATIVE,
    ANDROID_UNITY
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy