1
This commit is contained in:
2023-08-08 22:26:44 +08:00
parent 7b8652c02c
commit ab848035fc
12 changed files with 105 additions and 16 deletions

View File

@@ -11,12 +11,12 @@ def run_adb_command(command_list):
def get_now_time(device):
# adb shell date +%s
output, status_code, error = run_adb_command(['adb', '-s', device, 'shell', 'date', '+%s'])
output, status_code, error = run_adb_command(['adb', '-s', device, 'shell', 'date',"'+%Y-%m-%d %H:%M:%S'"])
if status_code == 0:
print(f"get_now_time output: {output}")
logging.info(f"get now time output: {output}")
now_timestamp = int(output)
return now_timestamp
now_time = output
return now_time
else:
print(error)
logging.error(f"get now time error: {error}")
@@ -100,4 +100,5 @@ def restart_ProxyMe(device):
return False
else:
print(f"stop autojs failed")
return False
return False

View File

@@ -16,3 +16,9 @@ def read_config_ini():
# return cache_file_path,database_config
return cache_file_path
def read_time_difference():
file_path = './config.ini'
config = configparser.ConfigParser()
config.read(file_path)
time_difference = config.get("General","time_difference")
return time_difference