# coding:utf8

__author__ = '极无双'

import os
import logging
import xml.dom.minidom
import re
import shutil
import glob
import gw_data_center
import gw_apk_tool


def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
    gw_data_center.pack_small = False
    gw_apk_tool.__apk_tool__ = 'apktool_2.3.4.jar'


def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
    # logging.info('------------SDK:'+SDK)
    # logging.info('------------decompileDir:'+decompileDir)
    # logging.info('------------channelSdkInfo:'+str(channelSdkInfo))
    # logging.info('------------new_game_channel_info:'+str(new_game_channel_info))
    # logging.info('------------gameInfo:'+str(gameInfo))
    # logging.info("------rm baidu smali------")
    # restdir = decompileDir+"/"+"smali_classes2/com/baidu/gamesdk"
    # if os.path.exists(restdir):
    # shutil.rmtree(restdir)

    # s3 = decompileDir + "/smali_classes3"

    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))

    if channelSdkInfo['id'] == '549':
        del_hjr(decompileDir)


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


if __name__ == '__main__':
    del_hjr("C:\\Users\\Administrator\\Desktop\\Shadow")
