#!/usr/bin/ruby # Author = Min Hu require 'cocoapods-bb-PodAssistant/helpers/pod_utils' # 是否儿童应用 def childrenApp isChildrenValue = BB::PodUtils.getValueFromInfoPlist("Children") return isChildrenValue === "true" end # 是否添加激励广告 def addRewardAd flag = BB::PodUtils.getValueFromInfoPlist("AddRewardAd") return flag === "true" end # 是否重置配置 def releaseConfig appEnvValue = BB::PodUtils.getValueFromInfoPlist("APP_Environment") adhocValue = BB::PodUtils.getValueFromInfoPlist("ADHOC") return appEnvValue === "1" && adhocValue != "true" end # 是否显示调试工具(小白点) def forceAddDebugTool forceAddDebugTool = BB::PodUtils.getValueFromInfoPlist("ForceAddDebugTool") return forceAddDebugTool === "true" end # 是否3d产品(968开始切新版unity2022引擎) def isUnity3DApp if isUnityApp # 1=>Cocos2D; 2=>Unity2D; 3=>普通 Unity3D; 4=>新版 Unity 3D; 5=>2D融合 打包机负责写入 value = BB::PodUtils.getValueFromInfoPlist("packer_engines_id") return value === "4" end return false end # 是否unity产品,包含2d/3d def isUnityApp value = BB::PodUtils.getValueFromInfoPlist("Unity3D") return value === "true" end # 是否需要第三方支付sdk def isThirdPaySdk value = BB::PodUtils.getValueFromInfoPlist("Third_Purcharse") return value === "true" end # 是否支持多引擎 def multiEngine val = BB::PodUtils.getValueFromInfoPlist("MultiEngine") return val === "true" end # 是否使用插件 def usePlugin(key) val = BB::PodUtils.getValueFromInfoPlist("Plugins") plugins = val.split("|") plugins.each do |plugin| if plugin.eql?(key) return true end end return false end # 产品备案号 def getCaseNumber val = BB::PodUtils.getValueFromInfoPlist("CaseNumber") return val end # 获取工程包名 def getProjectBundleIdentifier return BB::PodUtils.getProjectBundleIdentifier end # 获取工程根目录路径 def getProjectRootPath return BB::PodUtils.getProjectRootPath end # 获取工程路径 def getProjectPath return BB::PodUtils.getProjectPath end # 是否汉字产品 def isHanZiApp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.homeland" end # 是否奇妙屋产品 def isQMWApp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.talk2kiki" end # 是否拼音产品 def isPinyinAppp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.voicerecognition" || bundleId === "com.sinyee.babybus.read.ios" || bundleId === "com.sinyee.babybus.stroke" end # 是否科学产品 def isCourseApp bundleId = getProjectBundleIdentifier() return bundleId === "com.ailiyong.world.course" end # 是否思维产品 def isMathApp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.mathIII" end # 是否abc产品 def isABCApp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.abc" end # 是否城市产品 def isCityApp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.city" end # 是否矩阵产品 def isMatrixApp bundleId = getProjectBundleIdentifier() puts "###bundleId:#{bundleId}###".red if (isHanZiApp || isQMWApp || isPinyinAppp || isCourseApp || isMathApp || isABCApp || isCityApp) then return false end return true end