#!/usr/bin/env python3
#-*-coding:utf-8-*-
import json
import string
import random
import base64
import glob, os


# def gen_rand_str():
#     rand_str = ''.join(random.choices(string.ascii_uppercase + string.ascii_lowercase, k=8))
#     return rand_str + str(random.randint(0, 1000000))

def print_path(path):
    with open(path, "r") as f:
        lines = f.readlines()
        for line in lines:
            if "package" in line and ";" in line:
                act_path = line.replace("package ","").replace(";",".SplashActivity")
                print("类名：" + act_path)
                return


for root, dirs, files in os.walk("../../../app/src/main"):
    directory = os.path.join(os.getcwd(), root)
    for file in files:
        if file.endswith("SplashActivity.java"):
            # get the path of the java file
            path = os.path.join(directory, file)
            print_path(path)
