refactor: set permission
This commit is contained in:
+6
-4
@@ -7,15 +7,16 @@ from tools.helper import run
|
||||
|
||||
class Smartdock(General):
|
||||
id = "smartdock"
|
||||
dl_link = "https://github.com/ayasa520/smartdock/releases/download/v1.9.6/smartdock.zip"
|
||||
dl_link = "https://github.com/ayasa520/smartdock/releases/download/v1.9.7/smartdock.zip"
|
||||
partition = "system"
|
||||
extract_to = "/tmp/smartdockunpack"
|
||||
dl_file_name = "smartdock.zip"
|
||||
act_md5 = "ad0cc5e023ac6ee97e7b013b9b0defee"
|
||||
act_md5 = "be965374522d95f28a486c95b1208f0"
|
||||
apply_props = { "qemu.hw.mainkeys" : "1" }
|
||||
files = [
|
||||
"etc/permissions/permissions_cu.axel.smartdock.xml",
|
||||
"priv-app/SmartDock"
|
||||
"priv-app/SmartDock",
|
||||
"etc/init/smartdock.rc"
|
||||
]
|
||||
rc_content = '''
|
||||
on property:sys.boot_completed=1
|
||||
@@ -33,12 +34,13 @@ service set_home_activity /system/bin/sh -c "cmd package set-home-activity cu.ax
|
||||
if not os.path.exists(os.path.join(self.copy_dir, self.partition, "etc", "permissions")):
|
||||
os.makedirs(os.path.join(self.copy_dir, self.partition, "etc", "permissions"))
|
||||
shutil.copyfile(os.path.join(self.extract_to, "app-release.apk"),
|
||||
os.path.join(self.copy_dir, self.partition, "priv-app", "SmartDock", "smartdock.apk"))
|
||||
os.path.join(self.copy_dir, self.partition, "priv-app/SmartDock/smartdock.apk"))
|
||||
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"))
|
||||
|
||||
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))
|
||||
self.extract_app_lib(os.path.join(self.copy_dir, self.partition, "priv-app/SmartDock/smartdock.apk"))
|
||||
with open(rc_dir, "w") as f:
|
||||
f.write(self.rc_content)
|
||||
|
||||
Reference in New Issue
Block a user