##Copyright 2023 ByteDance Ltd. and/or its affiliates ##SPDX-License-Identifier: MIT module PM # 配置项key # class BuildConfig def self.get_load_key :gm_auto_load end def self.get_update_key :gm_auto_update end def self.get_load_detect_key :gm_load_detect end def self.get_load_whitelist_key :auto_load_whitelist end def self.get_is_release_key :is_release end def self.get_use_service_local_key :use_service_local end def self.update_value_last_version return "last" ## 最新版本 end def self.update_value_last_stable_version return "last_stable" ## 最新稳定版本 end def self.update_value_non return "not_update" ## 不自动更新 end def self.mediation_name return "Ads-Global-Beta" end def self.rely_name return "BURelyFoundation_Global" end def self.get_all_config [BuildConfig.get_update_key,BuildConfig.get_load_key,BuildConfig.get_load_detect_key] end end # admob: # IS:IronSourcePangleAdapter # max: # tradplus: # pod 'TradPlusAdSDK/PangleAdapter', '9.9.0' # topon: # pod '','6.2.66' # adn mediation adapter 三者之间的映射关系, mediation后续会用到 class MapRelations ADNADAPTER = Hash[ ## sdk 不需要 # 'Ads-CN' => 'ABUAdCsjAdapter', 'UnityAds' => 'ABUAdUnityAdapter', 'Google-Mobile-Ads-SDK'=> 'ABUAdAdmobAdapter', 'BaiduMobAdSDK'=> 'ABUAdBaiduAdapter', 'GDTMobSDK'=> 'ABUAdGdtAdapter', 'SigmobAd-iOS'=> 'ABUAdSigmobAdapter', 'KSAdSDK'=> 'ABUAdKsAdapter', 'KlevinAdSDK'=> 'ABUAdKlevinAdapter', 'MintegralAdSDK'=> 'ABUAdMintegralAdapter', ].freeze ## sdk 被接入adapter的映射关系 SERVERMAPADAPTER = Hash[ 'GoogleMobileAdsMediationPangle'=> 'admob', 'IronSourcePangleAdapter'=> 'ironsource', 'AppLovinMediationByteDanceAdapter'=> 'max', 'TradPlusAdSDK/PangleAdapter'=> 'tradplus', 'AnyThinkiOS/AnyThinkPangleAdapter'=> 'topon', ].freeze SERVERMAPADN = Hash[ 'UnityAds' => 'unity', 'Google-Mobile-Ads-SDK'=> 'admob', 'BaiduMobAdSDK'=> 'baidu', 'GDTMobSDK'=> 'gdt', 'SigmobAd-iOS'=> 'sigmob', 'KSAdSDK'=> 'ks', 'KlevinAdSDK'=> 'klevin', 'MintegralAdSDK'=> 'mtg', ].freeze SDKNAME = "Ads-Global-Beta".freeze SDKRELY = "BURelyFoundation_Global".freeze SHOULD_REMOVE = [SDKNAME,SDKRELY] def self.is_adn?(name) name == SDKNAME end def self.get_adn_abbreviation(name) SERVERMAPADN[name] end def self.get_adapter_from_adn_abbreviation(name) SERVERMAPADAPTER[name] end def self.is_adn?(name) ADNADAPTER.has_key?(name) end def self.is_sdk?(name) SDKNAME==name end def self.is_adapter?(name) SERVERMAPADAPTER.has_key?(name) end def self.should_remove_requirements?(name) SHOULD_REMOVE.include?(name) end def self.get_adapter(name) adapter = '' if is_adn?(name) adapter = ADNADAPTER[name] end adapter end def self.get_adn(name) adn_name = '' if is_adapter?(name) ## .index 在调试时候会报错 ADNADAPTER.select{ |key, value| if value == name adn_name = key break end true } end adn_name end def self.get_all_adapter ADNADAPTER.values end def self.get_all_adn ADNADAPTER.keys end def self.get_sdk SDKNAME end end end