# -*-coding:utf-8-*-
from func import Function
from shell import Shell
from tools.garble import Garble
from tools.activity_garble import ActivityGarble
import os
import shutil

# properties 配置
config = Function().load_properties("../../gradle.properties")
config['root'] = "../.."
config['jks_path'] = "../../jks"
config['properties'] = "../../gradle.properties"


print(" ")
print("------------- 使用帮助 -----------------")
print("1、编译apk")
print("2、修改包名，版本号+1")
print("3、创建新的签名文件")
print("4、commit & push project")
print("5、pull lib_base & cash_plugin_toolbox")
print("6、commit & push lib_base")
print("7、获取签名秘钥散列")
print("8、提交一个渠道包Tag")
print("9、还原某一次提交的包名、logo、gw、name、但保持最新代码")
print("10、更新Gateway")
print("11、copy apk")
print("12、马甲包切换")
print("13、打印checklist")
print("14、生成隐协议文件")
print("15、刷新本地协议")
print("16、api混淆")
print("17、字符串混淆")
print("18、四大组件混淆")
print("21、reset project")

command = int(input("请输入指令编号："))

# 命令
if command == 1:
    Shell().build_release()
    
elif command == 2:
    Function().new_appid(config)
    
elif command == 3:
    Function().new_keystore(config)

elif command == 4:
    Shell().push_project(config)

elif command == 5:
    Shell().pull_base(config)

elif command == 6:
    Shell().push_base(config)

elif command == 7:
    Function().getFbSign(config)

elif command == 8:
    Shell().push_with_tag(config)

elif command == 9:
    Shell().reset_by_pkgname(config)
    Function().move_resources(config)

elif command == 10:
    Function().update_gateway(config)

elif command == 11:
    Function().move_apk(config)

elif command == 12:
    Function().cutover(config)

elif command == 13 or command == 133:
    Function().print_checklist(config, command == 133)

elif command == 14:
    Function().new_privacy(config)

elif command == 15:
    Function().update_local_privacy(config)

elif command == 16:
    Garble().api_garble(config)

elif command == 17:
    Garble().str_grable(config)

elif command == 18:
    ActivityGarble().activity_garble(config)

elif command == 21:
    Shell().reset_project(config)
