# coding:utf8

__author__ = 'Snow'

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

ANDROID_NS = 'http://schemas.android.com/apk/res/android'
from xml.etree import ElementTree as ET


def script_init(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
    return


def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
    return


def script_pre(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
    return


def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
    logging.info('------------channelSdkInfo:' + str(channelSdkInfo))
    s1 = os.path.join(decompileDir, "smali_classes4/com")
    smali_classes2_dir = gw_apk_tool.create_mutil_smali(decompileDir)
    s3 = smali_classes2_dir
    list_package = ["heytap","huawei","iflytek","jg","kptech","leniu"]
    if not os.path.exists(s3):
        distutils.dir_util.mkpath(s3)
    gw_apk_tool.move_package(s1, s3, list_package)


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