import random
import sys
import uuid
import os

app_name = sys.argv[1].replace(" ", "").lower()
start_name = ["com", "cn", "id", "app", "host", "in"]
middle_name = ["android", "main", "home", "base", "play", "release", "full", "kredit", "cepat",
               "saku", "wallet", "coin", "loan", "flash", "pjnm", "indo", "lib"]

#start
pkg_name = start_name[random.randint(0, len(start_name) - 1)] + "." + app_name

#middle
length = random.randint(1, 3)
for i in range(0, length):
    pkg_name += "." + middle_name[random.randint(0, len(middle_name) - 1)]


#end
uuid_str = str(uuid.uuid1()).replace("-","")
random_str = ''.join(random.sample("abcdefghijklmnopqrstuvwxyz", random.randint(4, 8)))
pkg_name += "." + random_str

os.system('./rename_pkg.sh ' + pkg_name)
