mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-22 04:39:28 +08:00
22 lines
785 B
Python
22 lines
785 B
Python
import os.path
|
|
from pathlib import Path
|
|
from module.handler.login import SWITCH_ACCOUNT_FILE
|
|
|
|
from module.base.base import ModuleBase
|
|
|
|
ACCOUNTS_DATA_ROOT_PATH = Path("./accounts_data")
|
|
|
|
|
|
class ExtractAccount(ModuleBase):
|
|
def run(self):
|
|
data_path = ACCOUNTS_DATA_ROOT_PATH / self.config.config_name
|
|
if not os.path.exists(str(data_path)):
|
|
os.makedirs(str(data_path))
|
|
for i in SWITCH_ACCOUNT_FILE:
|
|
self.device.u2.shell(f"su -c \'cp {i.destination} /storage/emulated/0\'")
|
|
self.device.sleep(1)
|
|
self.device.u2.pull(f"/storage/emulated/0/{i.source}", str(data_path / i.source))
|
|
self.device.sleep(1)
|
|
self.device.u2.shell(f"rm /storage/emulated/0/{i.source}")
|
|
self.device.sleep(1)
|