class SetAdGooglePlay(): 

# 主函数的实现
if __name__ == "__main__":

      # 设置为utf8编码
    reload(sys)
    sys.setdefaultencoding("utf-8")

    # 入口参数:http://blog.csdn.net/intel80586/article/details/8545572
    cmdPath = common.cur_file_dir()
    count = len(sys.argv)
    for i in range(1, count):
        print ("参数", i, sys.argv[i])
        if i == 1:
            cmdPath = sys.argv[i]

    common.SetCmdPath(cmdPath)

    config_adsdk_android.SetAdSdk(source.ADVIEW, False)
    config_adsdk_android.SetAdSdk(source.GDT, False)
    config_adsdk_android.SetAdSdk(source.XIAOMI, False)
    config_adsdk_android.SetAdSdk(source.UNITY, True)
    config_adsdk_android.SetAdSdk(source.MOBVISTA, False)    
    
    print "set_ad_for_google_play sucess"
Beispiel #2
0
def updateChannel(channel,ishd): 
    print("updateChannel")
    # project_config = common.GetProjectConfigApp() + "/android" + "/gradle"
    targetDir = common.GetRootDirAndroidStudio()
    sourceDir = common.GetProjectConfigApp()
    project_android = "android/project"
    rootAndroidStudio = common.GetRootDirAndroidStudio()
    targetDir = rootAndroidStudio+"/src/main"

    if ishd==True: 
        project_android = "android/project_hd"

    if channel == source.GP:
        config_adsdk_android.SetAdSdk(source.ADMOB, True) 
        config_adsdk_android.SetAdSdk(source.ADVIEW, False)
        config_adsdk_android.SetAdSdk(source.GDT, False)
        config_adsdk_android.SetAdSdk(source.XIAOMI, False)
        config_adsdk_android.SetAdSdk(source.UNITY, True)
        config_adsdk_android.SetAdSdk(source.MOBVISTA, False)   
            # 
        project_config = sourceDir+"/"+project_android+"/config" 
        xml = sourceDir+"/"+project_android+"/xml_gp" 

    else:
        xml = sourceDir+"/"+project_android+"/xml"
        config_adsdk_android.SetAdSdk(source.ADMOB, True)
        config_adsdk_android.SetAdSdk(source.MOBVISTA, False)
        config_adsdk_android.SetAdSdk(source.UNITY, True)
            # 
        project_config = sourceDir+"/"+project_android+"/config"
        
    common.coverFiles(project_config,   targetDir)
    common.coverFiles(xml,   targetDir)

    build_gradle = common.GetProjectConfigApp() + "/android" + "/gradle/build"
    # or (channel == source.GP)
    if (channel == source.TAPTAP) :
        build_gradle = build_gradle+"_"+channel 

    build_gradle = build_gradle+".gradle"

    #配置build.grade
    #common.coverFiles(build_gradle,   targetDir)

    build_gradle_dst = rootAndroidStudio+"/build.gradle"
    flag = os.path.exists(build_gradle_dst)
    if flag:
        os.remove(build_gradle_dst)

    common.copyOneFile(build_gradle,build_gradle_dst)

    #  "channel_android": "xiaomi"
    file = getConfigJsonFile()
    print ("channel_android="+file)
    strStart = "channel_android\": \""
    strEnd = "\""
    strOut = replaceStringOfFile(file, strStart, strEnd, channel)
    saveString2File(strOut, file)
sys.path.append('./common')
import common
import source
import appname
import config_adsdk_android

# 主函数的实现
if __name__ == "__main__":

    # 设置为utf8编码
    reload(sys)
    sys.setdefaultencoding("utf-8")

    # 入口参数:http://blog.csdn.net/intel80586/article/details/8545572
    cmdPath = common.cur_file_dir()
    count = len(sys.argv)
    for i in range(1, count):
        print("参数", i, sys.argv[i])
        if i == 1:
            cmdPath = sys.argv[i]

    common.SetCmdPath(cmdPath)

    config_adsdk_android.SetAdSdk(source.ADVIEW, False)
    config_adsdk_android.SetAdSdk(source.GDT, False)
    config_adsdk_android.SetAdSdk(source.XIAOMI, False)
    config_adsdk_android.SetAdSdk(source.UNITY, True)
    config_adsdk_android.SetAdSdk(source.MOBVISTA, False)

    print "set_ad_for_google_play sucess"
import os.path
import time, datetime

#include common.py
sys.path.append('./common')
import common
import source
import appname
import config_adsdk_android

#主函数的实现
if __name__ == "__main__":

    # 设置为utf8编码
    reload(sys)
    sys.setdefaultencoding("utf-8")

    #入口参数:http://blog.csdn.net/intel80586/article/details/8545572
    cmdPath = common.cur_file_dir()
    count = len(sys.argv)
    for i in range(1, count):
        print("参数", i, sys.argv[i])
        if i == 1:
            cmdPath = sys.argv[i]

    common.SetCmdPath(cmdPath)

    config_adsdk_android.SetAdSdk(source.ADVIEW, False)

    print "set_no_adview sucess"
#     shutil.rmtree(dir2)

# shutil.copytree(dir1,dir2)

# CopyAndroidJavaFile_Weixin(rootAndroidStudio,isHD)

# if not common.isWindowsSystem():
    UpdateXcodeProjectFile(xcodeProject, isHD)

    # AD LIB JAVA CODE

    appid_xiaomi = adconfig.GetAppId(source.XIAOMI, source.ANDROID, isHD)
    if "0" == appid_xiaomi:
        print("no xiaomi ad appid")
        # VUNGLE 和 XIAOMI sdk gson库 冲突
        config_adsdk_android.SetAdSdk(source.XIAOMI, False)
        # True
        config_adsdk_android.SetAdSdk(source.VUNGLE, False)
    else:
        config_adsdk_android.SetAdSdk(source.XIAOMI, False)
        config_adsdk_android.SetAdSdk(source.VUNGLE, False)

    appid_gdt = adconfig.GetAppId(source.GDT, source.ANDROID, isHD)
    if "0" == appid_gdt:
        print("no gdt ad appid")
        config_adsdk_android.SetAdSdk(source.GDT, False)
    else:
        config_adsdk_android.SetAdSdk(source.GDT, True)

    config_adsdk_android.SetAdSdk(source.ADVIEW, False)