# coding:utf8

__author__ = 'dong'

import os
import logging
import xml.dom.minidom
import re
import shutil
import glob
import distutils.dir_util
import os
import gw_apk_tool


def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
    if channelSdkInfo['id'] == '512':
        logging.info("remove_navigate")
        remove_navigate(decompileDir)
    if channelSdkInfo['id'] == '549':
        # del_qihoo(decompileDir)
        gw_apk_tool.yml_remove_uncompress(decompileDir)


def del_qihoo(decompileDir):
    qihoo = os.path.join(decompileDir, 'smali_classes2/com/qihoo')
    if os.path.exists(qihoo):
        shutil.rmtree(qihoo)


def remove_navigate(decompileDir):
    tmp_res = os.path.join(decompileDir, "res", "navigation")
    tmp_public_xml = os.path.join(decompileDir, "res", "values", "public.xml")
    if os.path.exists(tmp_res):
        distutils.dir_util.remove_tree(tmp_res)
    if os.path.exists(tmp_public_xml):
        os.remove(tmp_public_xml)


if __name__ == '__main__':
    # del_qihoo("C:\\Users\\Administrator\\Desktop\\zt")
    remove_navigate("G:\\autopack2.0_kuaifa\\tool\\workspace\\lrs360\\13651\\extract")
