package drk_service

import (
    "android/soong/android"
    "android/soong/cc"
    "strconv"
    "os"
    "strings"
    "fmt"
    "path/filepath"
)

func findRootPath() (string) {
    interposer, err := os.Executable()
    if err != nil {
        fmt.Println("[DeviceRootKey][DRK] Unable to locate interposer executable:", err)
        return ""
    }
    if fi, err := os.Lstat(interposer); err == nil {
        if fi.Mode()&os.ModeSymlink != 0 {
            link, err := os.Readlink(interposer)
            if err != nil {
                fmt.Println("[DeviceRootKey][DRK] Unable to read link to interposer executable:", err)
                return ""
            }
            if filepath.IsAbs(link) {
                interposer = link
            } else {
                interposer = filepath.Join(filepath.Dir(interposer), link)
            }
        }
    } else {
        fmt.Println("[DeviceRootKey][DRK] Unable to stat interposer executable:", err)
        return "";
    }
    return strings.Split(interposer, "out/soong/")[0]
}

var ROOT_DIR string = findRootPath() + "vendor/samsung/system/security"
var QSEE_BUILD_PATH string = ROOT_DIR + "/trustedapps/build/qsee_ta_build.sh"

func isExistQseePath() bool {
    _, err := os.Stat(QSEE_BUILD_PATH)
    if os.IsNotExist(err) {
        fmt.Println("[DeviceRootKey][DRK] Qsee build path is not exist")
        return false
    }
    fmt.Println("[DeviceRootKey][DRK] Qsee build path is exist")
    return err == nil
}

var gTeeType string
var gTargetSoc string
var gTargetChipName string
var gVaultKeeperType string
var gIsEngBinary bool
var gIsTzEnabled bool
var gIsFactoryBinary bool
var gIsSecureBootEnabled bool
var gIsSecureProcessorEnabled bool
var gIsSecureNvmEnabled bool
var gIsBootLoaderRpEnabled bool
var gIsVerificationStrengthened bool
var gHwvaultVersion int
var gSssiBuildTarget string
var gTargetBoardPlatform string

var securehw_support_chipsets_lsi = []string {
    "exynos9830", "exynos990",
}

var support_strongbox string = "false"

func init() {
    android.RegisterModuleType("drk_service_config", drkServiceFactory)
    android.RegisterModuleType("drk_service_client_config", drkServiceClientFactory)
}

func drkServiceFactory() android.Module {
    module := cc.DefaultsFactory()
    android.AddLoadHook(module, createDrkService)
    return module
}

func drkServiceClientFactory() android.Module {
    module := cc.DefaultsFactory()
    android.AddLoadHook(module, createDrkServiceClient)
    return module
}

func createDrkServiceClient(ctx android.LoadHookContext) {
    type props struct {
        Include_dirs []string
        Shared_libs  []string
        Static_libs  []string
        Cflags       []string
        Srcs         []string
        Header_libs  []string
        Required     []string
    }

    gTeeType, gTargetSoc, gTargetChipName, gVaultKeeperType, gIsEngBinary, gIsTzEnabled, gIsFactoryBinary, gIsSecureBootEnabled, gIsSecureProcessorEnabled, gIsSecureNvmEnabled, gIsBootLoaderRpEnabled, gIsVerificationStrengthened, gHwvaultVersion, gSssiBuildTarget, gTargetBoardPlatform = getGlobalFeature(ctx, true)

    var include_dirs []string
    var shared_libs  []string
    var static_libs  []string
    var cflags       []string
    var srcs         []string
    var header_libs  []string
    var required     []string

    p := &props{}

    if  gIsTzEnabled && ((gIsSecureBootEnabled || gTeeType!= "qs") || gIsSecureProcessorEnabled || gIsSecureNvmEnabled) {
        include_dirs = []string {
            "vendor/samsung/interfaces/security/drk/2.0/default",
            "vendor/samsung/system/security/drk/include/dk_native_jni",
            "vendor/samsung/system/security/trustedapps/standalone/DeviceRootKey/drk/common/include",
            "vendor/samsung/system/security/trustedapps/standalone/DeviceRootKey/drk/common/include/util",
            "vendor/samsung/system/security/trustedapps/standalone/DeviceRootKey/drk/client/2.0/include",
        }

        srcs = []string {
            "client/2.0/src/drkServices.cpp",
            "client/2.0/src/msgHandler.cpp",
            ":SecDrkCommon_src",
        }

        cflags = []string {
            "-fPIC",
            "-Wall",
            "-Werror",
            "-Wunused-function",
            "-Wextra",
            "-Wno-unused-parameter",
            "-Wno-missing-field-initializers",
            "-DOS_NAME=\"android\"",
            "-fvisibility=hidden",
            "-DLOG_TAG_STR=\"DEVROOT#CIF\"",
            "-D_CLIENT_INTERFACE_",
            "-DDISABLE_LOG_SAVE",
            "-DUSE_ANDROID",
        }

        if gIsEngBinary {
            srcs = append(srcs, "client/2.0/src/eng/engSelftestCommand.cpp")
        } else {
            cflags = append(cflags, "-DUSE_RELEASE")
        }

        required = []string {
            "vendor.samsung.hardware.security.drk@2.0",
        }

        if gSssiBuildTarget == "" {  // Non-sssi
            required = append(required, "vendor.samsung.hardware.security.drk@2.0.vendor");
            required = append(required, "vendor.samsung.hardware.security.drk@2.0-service");
        }

        shared_libs = []string {
            "liblog",
            "libhidlbase",
            "libutils",
            "libcrypto",
            "vendor.samsung.hardware.security.drk@2.0",
        }
    }

    p.Include_dirs = include_dirs
    p.Shared_libs = shared_libs
    p.Static_libs = static_libs
    p.Cflags = cflags
    p.Srcs = srcs
    p.Header_libs = header_libs
    p.Required = required

    ctx.AppendProperties(p)
}

func createDrkService(ctx android.LoadHookContext) {
    type props struct {
        Include_dirs []string
        Shared_libs  []string
        Static_libs  []string
        Cflags       []string
        Srcs         []string
        Header_libs  []string
        Required     []string
    }

    gTeeType, gTargetSoc, gTargetChipName, gVaultKeeperType, gIsEngBinary, gIsTzEnabled, gIsFactoryBinary, gIsSecureBootEnabled, gIsSecureProcessorEnabled, gIsSecureNvmEnabled, gIsBootLoaderRpEnabled, gIsVerificationStrengthened, gHwvaultVersion, gSssiBuildTarget, gTargetBoardPlatform = getGlobalFeature(ctx, true)

    var include_dirs []string
    var shared_libs  []string
    var static_libs  []string
    var cflags       []string
    var srcs         []string
    var header_libs  []string
    var required     []string

    p := &props{}

    if (gSssiBuildTarget != "system") && gIsTzEnabled && ((gIsSecureBootEnabled || gTeeType!= "qs") || gIsSecureProcessorEnabled || gIsSecureNvmEnabled) {
        ///////////////////////
        // Add Includes
        ///////////////////////
        include_dirs = []string {
            "vendor/samsung/system/security/trustedapps/standalone/DeviceRootKey/drk/common/include",
            "vendor/samsung/system/security/trustedapps/standalone/DeviceRootKey/drk/common/include/util",
            "vendor/samsung/system/security/trustedapps/standalone/DeviceRootKey/drk/service/2.0/include",
            "vendor/samsung/system/security/trustedapps/standalone/DeviceRootKey/drk/service/2.0/include/hermes",
            "vendor/samsung/system/security/trustedapps/standalone/DeviceRootKey/drk/service/2.0/include/sys",
            "vendor/samsung/system/security/trustedapps/standalone/DeviceRootKey/drk/service/2.0/include/sys/ril",
            "vendor/samsung/system/security/trustedapps/standalone/DeviceRootKey/drk/service/2.0/include/tz",
            "vendor/samsung/system/security/trustedapps/standalone/DeviceRootKey/drk/service/2.0/include/tz/" + gTeeType,
            "vendor/samsung/system/security/trustedapps/standalone/DeviceRootKey/drk/service/2.0/include/util",
        }

        ///////////////////////
        // Add Srcs
        ///////////////////////
        srcs = []string {
            "service/2.0/src/vendor_main.cpp",
            "service/2.0/src/DrkCmdHandler.cpp",
            "service/2.0/src/EtcCmdHandler.cpp",
            "service/2.0/src/tz/DrkCommand.cpp",
            "service/2.0/src/tz/ProvCommand.cpp",
            "service/2.0/src/sys/DeviceInfo.cpp",
            "service/2.0/src/sys/ril/android/rilCommands.cpp",
            "service/2.0/src/tz/BaseTzCommand.cpp",
            "service/2.0/src/tz/" + gTeeType + "/TzCommunicator.cpp",
            "service/2.0/src/util/B64Coder.cpp",
            "service/2.0/src/util/File.cpp",
            "service/2.0/src/util/LockGuard.cpp",
            ":SecDrkCommon_src",
        }

        ///////////////////////
        // Add CFlags
        ///////////////////////
        cflags = []string {
            "-DLOG_TAG_STR=\"DEVROOT#VND\"",
            "-DTA_ROOT_DIR=\"/vendor\"",
            "-DUSE_ANDROID",
            "-Wno-unused-parameter",
            "-DSYSTEM_ROOT_IMAGE_ENABLED",
        }

        if !gIsEngBinary {
            cflags = append(cflags, "-DUSE_RELEASE")
        }

        if gIsVerificationStrengthened {
            cflags = append(cflags, "-DSTRENGTHEN_DRK_VERIFICAION")
        }

        ///////////////////////
        // Add Shared libraries
        ///////////////////////
        shared_libs = []string {
            "libcrypto",
            "libsecril-client",
            "libhidlbase",
            "liblog",
            "libutils",
            "libc",
            "libcutils",
        }

        if gTeeType == "tg" {
            shared_libs = append(shared_libs, "libteecl")
            shipping_api_level_, _ := ctx.AConfig().GetMkVar("PRODUCT_SHIPPING_API_LEVEL")
            shipping_api_level, err := strconv.Atoi(shipping_api_level_);
            if err != nil || shipping_api_level <= 30 { // ~ R os
                fmt.Println("[DeviceRootKey] TEEGRIS TA is appended to required list")
                required = append(required, "00000000-0000-0000-0000-000000534b4d")
                required = append(required, "00000000-0000-0000-0000-505256544545")
            }
        } else if gTeeType == "kn" {
            shared_libs = append(shared_libs, "libMcClient")
            required = append(required, "ffffffff00000000000000000000000c.tlbin")
            required = append(required, "ffffffff00000000000000000000000d.tlbin")
        } else {
            shared_libs = append(shared_libs, "libQSEEComAPI")
        }

        ///////////////////////
        // SecureHW & SecNVM
        ///////////////////////
        if gIsSecureProcessorEnabled {
            cflags = append(cflags, "-DSECURE_PROCESSOR_ENABLED")
            fmt.Println("[DeviceRootKey][HERMES] SECUREPROCESSOR_ENABLE    : true")
        } else {
            fmt.Println("[DeviceRootKey][HERMES] SECUREPROCESSOR_ENABLE    : false")
        }

        if gIsSecureNvmEnabled {
            cflags = append(cflags, "-DSECURE_NVM_ENABLED")
            fmt.Println("[DeviceRootKey][HERMES] SECURENVM_ENABLED         : true")
        } else {
            fmt.Println("[DeviceRootKey][HERMES] SECURENVM_ENABLED         : false")
        }

        if gIsBootLoaderRpEnabled {
            cflags = append(cflags, "-DBOOTLOADER_RP_ENABLED")
        }

        if gIsFactoryBinary {
            cflags = append(cflags, "-DFACTORY_BINARY")
        }

        if strings.Contains(gTargetSoc, "exynos") || strings.Contains(gTargetSoc, "MT") || strings.Contains(gTargetBoardPlatform, "universal") {
            srcs = append(srcs, "service/2.0/src/hermes/lsi/HermesCommand.cpp")
            // for SSP, SecNVM
            if gIsSecureProcessorEnabled || gIsSecureNvmEnabled {
                include_dirs = append(include_dirs, "vendor/samsung/system/security/hermes/include/hermes")
                shared_libs = append(shared_libs, "libhermes")
            }
        } else {
            srcs = append(srcs, "service/2.0/src/hermes/qc/HermesCommand.cpp")

            // for SPU
            if gIsSecureProcessorEnabled {
                // In SM8150 & SM8250, spcomlib.h is located on "securemsm/spcomlib/inc"
                if strings.Contains(gTargetChipName, "SM8150") || strings.Contains(gTargetChipName, "SM8250") {
                    include_dirs = append(include_dirs, "vendor/qcom/proprietary/securemsm/spcomlib/inc")
                } else {
                    include_dirs = append(include_dirs, "vendor/qcom/proprietary/spu/spcomlib/inc")
                    _, err := os.Stat(findRootPath() + "vendor/qcom/proprietary/spu/sputils/inc")
                    if err == nil {
                        fmt.Println("[DeviceRootKey][HERMES] support <spu_definitions.h>")
                        include_dirs = append(include_dirs, "vendor/qcom/proprietary/spu/sputils/inc")
                    } else {
                        fmt.Println("[DeviceRootKey][HERMES] not support <spu_definitions.h>")
                    }
                }

                // From SM8450, spcom.h is inlcuded on device_kernel_headers.
                if strings.Contains(gTargetChipName, "SM8150") || strings.Contains(gTargetChipName, "SM8250") || strings.Contains(gTargetChipName, "SM8350") {
                    header_libs = append(header_libs, "qti_kernel_headers")
                } else {
                    header_libs = append(header_libs, "device_kernel_headers")
                }

                shared_libs = append(shared_libs, "libspcom")

                // In SM8450, some health data is wrong. so skip it on selftest.
                if strings.Contains(gTargetChipName, "sm8450") {
                    cflags = append(cflags, "-DSPU_8450")
                }
                
                // In SM8350, some health data is wrong. so skip it on selftest.
                if strings.Contains(gTargetChipName, "SM8350") {
                    cflags = append(cflags, "-DSPU_8350")
                }

                // In SM8250, debugging logic of arc mismatch scenario is applied.
                if strings.Contains(gTargetChipName, "SM8250") {
                    cflags = append(cflags, "-DSPU_8250")
                    cflags = append(cflags, "-DCHECK_ARC_MISMATCH")
                }

                if strings.Contains(gTargetChipName, "SM8150") {
                    cflags = append(cflags, "-DSPU_8150")
                }

                if gIsSecureBootEnabled {
                    cflags = append(cflags, "-DQC_ARI_ENABLED")
                }
            }

            if gIsSecureNvmEnabled {
                // for SecNVM
                include_dirs = append(include_dirs, "vendor/samsung/system/security/hermes/include/hermes")
                shared_libs = append(shared_libs, "libhermes")
            }
        }

        ////////////////////////
        // vaultkeeper enable
        ////////////////////////
        if gVaultKeeperType == "vendor" {
            include_dirs = append(include_dirs, "vendor/samsung/external/vaultkeeper/common/include")
            cflags = append(cflags, "-DVAULTKEEPER_ENABLED")
            cflags = append(cflags, "-DSUPPORT_VENDOR_VAULTKEEPER")
            shared_libs = append(shared_libs, "libvkmanager_vendor")
            fmt.Println("[DeviceRootKey][HERMES] VAULTKEEPER_ENABLED         : true")
        } else {
            fmt.Println("[DeviceRootKey][HERMES] VAULTKEEPER_ENABLED         : false")
        }

        ////////////////////////
        // Add Static libraries
        ////////////////////////
        static_libs = []string {
            "libWbSrk",
        }

        if gHwvaultVersion > 0 {
            fmt.Println("[DeviceRootKey][DRK] use hwvault")
            cflags = append(cflags, "-DDRKFEATURE_HWVAULT_ENABLE")
            include_dirs = append(include_dirs, "vendor/samsung/system/security/hermes/include/hermes/hermes_cred.h")
            shared_libs = append(shared_libs, "libhermes_cred")
        }

        //platform version - temp
        platform_version := ctx.AConfig().Getenv("PLATFORM_VERSION")
        fmt.Println("[DeviceRootKey][DRK] PLATFORM_VERSION         : ", platform_version)
        if platform_version == "S" || platform_version == "12"{
            fmt.Println("[DeviceRootKey][DEBUG] set USE_KEYSTORE2 ")
            cflags = append(cflags, "-DUSE_KEYSTORE2")
        }
    }

    p.Include_dirs = include_dirs
    p.Shared_libs = shared_libs
    p.Static_libs = static_libs
    p.Cflags = cflags
    p.Srcs = srcs
    p.Header_libs = header_libs
    p.Required = required
    ctx.AppendProperties(p)
}

func getGlobalFeature(ctx android.BaseContext, printLog bool) (string, string, string, string, bool, bool, bool, bool, bool, bool, bool, bool, int, string, string) {
    cfg := ctx.AConfig()

    var teeType string
    var targetSoc string
    var targetChipName string
    var vaultKeeperType string = "none"
    var isEngBinary bool = false
    var isTzEnabled bool = false
    var isFactoryBinary bool = false
    var isSecureBootEnabled bool = false
    var isSecureProcessorEnabled = false
    var isSecureNvmEnabled = false
    var isBootLoaderRpEnabled = false
    var isVerificationStrengthened = false
    var hwvaultVersion int = 0
    var sssiBuildTarget string
    var targetBoardPlatform string


    build_sssi_target, _:= cfg.Getspf("SEC_PRODUCT_FEATURE_BUILD_SSSI_TARGET");
    sssiBuildTarget = build_sssi_target

    if sssiBuildTarget != "system" {
        // vendor or Non-sssi

        // set isTzEnabled
        tz_enabled, _ := cfg.GetMkVar("PRODUCT_TRUSTZONE_ENABLED")
        if tz_enabled == "true" {
            isTzEnabled=true
        }

        // set teeType
        use_blowfish, _ := cfg.GetMkVar("USE_BLOWFISH")
        use_mobicore, _ := cfg.GetMkVar("USE_MOBICORE")
        if use_blowfish == "true" {
            teeType = "tg"
        } else if use_mobicore == "true" {
            teeType = "kn"
        } else if isExistQseePath() {
            teeType = "qs"
        } else {
            teeType = "none"
            isTzEnabled=false
        }
    } else {
        //system
        teeType = "essi"
        isTzEnabled=true
    }

    // set targetSoc
    target_soc, _ := cfg.GetMkVar("TARGET_SOC")
    targetSoc = target_soc

    // set vaultKeeperType
    secondBrand, _ := cfg.Getspf("SEC_PRODUCT_FEATURE_COMMON_CONFIG_SEP_CATEGORY")
    if secondBrand == "sep_basic" {
        vkeeper, _ := cfg.Getspf("SEC_PRODUCT_FEATURE_COMMON_SUPPORT_MHS_DONGLE")
        if vkeeper != "TRUE" {
            support_vendor_vaultkeeper, _ := cfg.GetMkVar("SUPPORT_VENDOR_VAULTKEEPER")
            if support_vendor_vaultkeeper == "true" {
                vaultKeeperType = "vendor"
            }
        }
    }

    manufacturingType, _ := cfg.Getspf("SEC_PRODUCT_FEATURE_COMMON_CONFIG_DEVICE_MANUFACTURING_TYPE")

    // set isEngBinary
    build_type, _ := cfg.GetMkVar("TARGET_BUILD_VARIANT")
    if build_type == "eng" {
        isEngBinary=true
    }

    // set isFactoryBinary
    factory_binary, _ := cfg.GetMkVar("SEC_FACTORY_BUILD")
    if factory_binary == "true" {
        isFactoryBinary=true
    }

    // set isSecureBootEnabled
    secureBootEnabled, _ := cfg.GetMkVar("SEC_BUILD_OPTION_KNOX_CSB")
    if secureBootEnabled == "true"{
        isSecureBootEnabled=true
    }

    sechw_ver, _ := cfg.Getspf("SEC_PRODUCT_FEATURE_SECURITY_CONFIG_SECUREHW_VERSION")
    securehw_version, err := strconv.Atoi(sechw_ver);

    if err != nil {
        fmt.Println("[DeviceRootKey] securehw version conversion err")
        fmt.Println("[DeviceRootKey] secureprocessor & secnvm disabled")
    } else if (securehw_version == 1) {
        fmt.Println("[DeviceRootKey] secureprocessor enabled")
        fmt.Println("[DeviceRootKey] secnvm disabled")
        isSecureProcessorEnabled=true
    } else if (securehw_version > 1){
        fmt.Println("[DeviceRootKey] secureprocessor & secnvm enabled")
        isSecureProcessorEnabled=true
        isSecureNvmEnabled=true
    }

    device_category, _ := cfg.Getspf("SEC_PRODUCT_FEATURE_COMMON_CONFIG_DEVICE_CATEGORY")
    shipping_api_level_, _ := ctx.AConfig().GetMkVar("PRODUCT_SHIPPING_API_LEVEL")
    shipping_api_level, err := strconv.Atoi(shipping_api_level_);
    if err != nil {
        fmt.Println("[DeviceRootKey] api level conversion err")
        if device_category == "watch" {
            fmt.Println("[DeviceRootKey] watch --> DRK Verification feature added")
            isVerificationStrengthened = true;
        }
    } else if (shipping_api_level >= 30){
        fmt.Println("[DeviceRootKey] DRK Verification feature added")
        isVerificationStrengthened = true;
    }

    target_board_platform, _ := cfg.GetMkVar("TARGET_BOARD_PLATFORM")
    targetBoardPlatform = target_board_platform
    target_chip_name, _ := cfg.GetMkVar("TARGET_CHIP_NAME")
    if len(target_chip_name) == 0 {
        fmt.Println("[DeviceRootKey] try to get target_chip_name for PRODUCT_TRUSTZONE_TYPE")
        target_chip_name, _ = cfg.GetMkVar("PRODUCT_TRUSTZONE_TYPE")
    }
    targetChipName = target_chip_name

    hv_, _ := ctx.AConfig().Getspf("SEC_PRODUCT_FEATURE_SECURITY_CONFIG_HWVAULT_VERSION")
    hwvault_version, err := strconv.Atoi(hv_);
    if err == nil {
        hwvaultVersion = hwvault_version;
    } else {
        fmt.Println("[DeviceRootKey] hwvault version conversion err")
        hwvaultVersion = 0
    }

    bootloader_rp_enabled, _ := cfg.GetMkVar("SEC_BUILD_CONF_SECURE_BOOTLOADER_RP")
    if bootloader_rp_enabled == "true" {
        isBootLoaderRpEnabled=true
    }

    if printLog {
        fmt.Println("[DeviceRootKey][DRK] SHIPPING_API_LEVEL           : ", shipping_api_level_)
        fmt.Println("[DeviceRootKey][DRK] BUILD_SSSI_TARGET            : ", sssiBuildTarget)
        fmt.Println("[DeviceRootKey][DRK] TEE_TYPE                     : ", teeType)
        fmt.Println("[DeviceRootKey][DRK] ENG_BINARY                   : ", isEngBinary)
        fmt.Println("[DeviceRootKey][DRK] TZ_ENABLED                   : ", isTzEnabled)
        fmt.Println("[DeviceRootKey][DRK] SEC_FACTORY_BUILD            : ", isFactoryBinary)
        fmt.Println("[DeviceRootKey][DRK] TARGET_SOC                   : ", targetSoc)
        fmt.Println("[DeviceRootKey][DRK] TARGET_CHIP_NAME             : ", targetChipName)
        fmt.Println("[DeviceRootKey][DRK] TARGET_BOARD_PLATFORM        : ", targetBoardPlatform)
        fmt.Println("[DeviceRootKey][DRK] SEC_PLATFORM_CATEGORY        : ", secondBrand)
        fmt.Println("[DeviceRootKey][DRK] MANUFACTURING_TYPE           : ", manufacturingType)
        fmt.Println("[DeviceRootKey][DRK] SEC_BUILD_OPTION_KNOX_CSB    : ", isSecureBootEnabled)
        fmt.Println("[DeviceRootKey][DRK] VAULTKEEPER_TYPE             : ", vaultKeeperType)
        fmt.Println("[DeviceRootKey][DRK] SECUREPROCESSOR_ENABLED      : ", isSecureProcessorEnabled)
        fmt.Println("[DeviceRootKey][DRK] SECURNVM_ENABLED             : ", isSecureNvmEnabled)
        fmt.Println("[DeviceRootKey][DRK] BOOTLOADER_RP_ENABLED        : ", isBootLoaderRpEnabled)
        fmt.Println("[DeviceRootKey][DRK] hwvaultVersion               : ", hwvaultVersion)
        fmt.Println("=================================================================\n")
    }

    return teeType, targetSoc, targetChipName, vaultKeeperType, isEngBinary, isTzEnabled, isFactoryBinary, isSecureBootEnabled, isSecureProcessorEnabled, isSecureNvmEnabled, isBootLoaderRpEnabled, isVerificationStrengthened, hwvaultVersion, sssiBuildTarget, targetBoardPlatform
}
