refactor
This commit is contained in:
+15
-11
@@ -6,6 +6,7 @@ from tools import container
|
||||
from tools.helper import run
|
||||
|
||||
class Smartdock(General):
|
||||
id = "smartdock"
|
||||
dl_link = "https://github.com/ayasa520/smartdock/releases/download/v1.9.6/smartdock.zip"
|
||||
partition = "system"
|
||||
extract_to = "/tmp/smartdockunpack"
|
||||
@@ -16,6 +17,15 @@ class Smartdock(General):
|
||||
"etc/permissions/permissions_cu.axel.smartdock.xml",
|
||||
"priv-app/SmartDock"
|
||||
]
|
||||
rc_content = '''
|
||||
on property:sys.boot_completed=1
|
||||
start set_home_activity
|
||||
|
||||
service set_home_activity /system/bin/sh -c "cmd package set-home-activity cu.axel.smartdock/.activities.LauncherActivity"
|
||||
user root
|
||||
group root
|
||||
oneshot
|
||||
'''
|
||||
|
||||
def copy(self):
|
||||
if not os.path.exists(os.path.join(self.copy_dir, self.partition, "priv-app", "SmartDock")):
|
||||
@@ -27,14 +37,8 @@ class Smartdock(General):
|
||||
shutil.copyfile(os.path.join(self.extract_to, "permissions_cu.axel.smartdock.xml"),
|
||||
os.path.join(self.copy_dir, self.partition, "etc", "permissions", "permissions_cu.axel.smartdock.xml"))
|
||||
|
||||
def extra2(self):
|
||||
index = 0
|
||||
while not container.is_running():
|
||||
list = ["\\", "|", "/", "—"]
|
||||
sleep(0.5)
|
||||
print("\r\tPlease start WayDroid for further setup {}".format(list[index%4]), end="")
|
||||
index += 1
|
||||
sleep(5)
|
||||
if index != 0:
|
||||
print()
|
||||
run(["waydroid", "shell", "cmd", "package", "set-home-activity", "cu.axel.smartdock/.activities.LauncherActivity"])
|
||||
rc_dir = os.path.join(self.copy_dir, self.partition, "etc/init/smartdock.rc")
|
||||
if not os.path.exists(os.path.dirname(rc_dir)):
|
||||
os.makedirs(os.path.dirname(rc_dir))
|
||||
with open(rc_dir, "w") as f:
|
||||
f.write(self.rc_content)
|
||||
|
||||
Reference in New Issue
Block a user