mirror of
https://github.com/ayasa520/redroid-script.git
synced 2026-11-25 14:24:33 +08:00
Fix variable naming and hardcoded path
Remove Dockerfile init
This commit is contained in:
1 parent
4ccbc05426
commit
dcb48bb2a4
11 files changed
+45
-25
No files matched your search
+3
-3
@@ -15,7 +15,7 @@ class Gapps(General):
|
||||
dl_link = dl_links[arch[0]][0]
|
||||
dl_file_name = os.path.join(download_loc, "open_gapps.zip")
|
||||
act_md5 = dl_links[arch[0]][1]
|
||||
sys_image_mount = "./gapps"
|
||||
copy_dir = "./gapps"
|
||||
extract_to = "/tmp/ogapps/extract"
|
||||
non_apks = [
|
||||
"defaultetc-common.tar.lz",
|
||||
@@ -49,11 +49,11 @@ class Gapps(General):
|
||||
app_priv = os.listdir(os.path.join(self.extract_to, "appunpack", app_name, "nodpi"))[0]
|
||||
app_src_dir = os.path.join(self.extract_to, "appunpack", app_name, xx_dpi, app_priv)
|
||||
for app in os.listdir(app_src_dir):
|
||||
shutil.copytree(os.path.join(app_src_dir, app), os.path.join(self.sys_image_mount, "system", "priv-app", app), dirs_exist_ok=True)
|
||||
shutil.copytree(os.path.join(app_src_dir, app), os.path.join(self.copy_dir, "system", "priv-app", app), dirs_exist_ok=True)
|
||||
else:
|
||||
print(" Processing extra package : "+os.path.join(self.extract_to, "Core", lz_file))
|
||||
run(["tar", "--lzip", "-xvf", os.path.join(self.extract_to, "Core", lz_file), "-C", os.path.join(self.extract_to, "appunpack")])
|
||||
app_name = os.listdir(os.path.join(self.extract_to, "appunpack"))[0]
|
||||
common_content_dirs = os.listdir(os.path.join(self.extract_to, "appunpack", app_name, "common"))
|
||||
for ccdir in common_content_dirs:
|
||||
shutil.copytree(os.path.join(self.extract_to, "appunpack", app_name, "common", ccdir), os.path.join(self.sys_image_mount, "system", ccdir), dirs_exist_ok=True)
|
||||
shutil.copytree(os.path.join(self.extract_to, "appunpack", app_name, "common", ccdir), os.path.join(self.copy_dir, "system", ccdir), dirs_exist_ok=True)
|
||||
+3
-3
@@ -7,7 +7,7 @@ from tools.helper import bcolors, get_download_dir, print_color, run
|
||||
|
||||
class Houdini(General):
|
||||
download_loc = get_download_dir()
|
||||
sys_image_mount = "./houdini"
|
||||
copy_dir = "./houdini"
|
||||
dl_links = {
|
||||
"11.0.0": [
|
||||
"https://github.com/supremegamers/vendor_intel_proprietary_houdini/archive/81f2a51ef539a35aead396ab7fce2adf89f46e88.zip",
|
||||
@@ -44,9 +44,9 @@ class Houdini(General):
|
||||
print_color("Copying libhoudini library files ...", bcolors.GREEN)
|
||||
name = re.findall("([a-zA-Z0-9]+)\.zip", self.dl_link)[0]
|
||||
shutil.copytree(os.path.join(self.extract_to, "vendor_intel_proprietary_houdini-" + name,
|
||||
"prebuilts"), os.path.join(self.sys_image_mount, "vendor"), dirs_exist_ok=True)
|
||||
"prebuilts"), os.path.join(self.copy_dir, "vendor"), dirs_exist_ok=True)
|
||||
|
||||
init_path = os.path.join(self.sys_image_mount, "system", "etc", "init", "houdini.rc")
|
||||
init_path = os.path.join(self.copy_dir, "system", "etc", "init", "houdini.rc")
|
||||
if not os.path.isfile(init_path):
|
||||
os.makedirs(os.path.dirname(init_path), exist_ok=True)
|
||||
with open(init_path, "w") as initfile:
|
||||
|
||||
+5
-5
@@ -10,8 +10,8 @@ class Magisk(General):
|
||||
dl_link = "https://huskydg.github.io/magisk-files/app-release.apk"
|
||||
dl_file_name = os.path.join(download_loc, "magisk.apk")
|
||||
extract_to = "/tmp/magisk_unpack"
|
||||
sys_overlay_dir = "./magisk"
|
||||
magisk_dir = os.path.join(sys_overlay_dir, "system", "etc", "init", "magisk")
|
||||
copy_dir = "./magisk"
|
||||
magisk_dir = os.path.join(copy_dir, "system", "etc", "init", "magisk")
|
||||
machine = host()
|
||||
oringinal_bootanim = """
|
||||
service bootanim /system/bin/bootanimation
|
||||
@@ -71,8 +71,8 @@ on property:init.svc.zygote=stopped
|
||||
if not os.path.exists(self.magisk_dir):
|
||||
os.makedirs(self.magisk_dir, exist_ok=True)
|
||||
|
||||
if not os.path.exists(os.path.join(self.sys_overlay_dir, "sbin")):
|
||||
os.makedirs(os.path.join(self.sys_overlay_dir, "sbin"), exist_ok=True)
|
||||
if not os.path.exists(os.path.join(self.copy_dir, "sbin")):
|
||||
os.makedirs(os.path.join(self.copy_dir, "sbin"), exist_ok=True)
|
||||
|
||||
print_color("Copying magisk libs now ...", bcolors.GREEN)
|
||||
|
||||
@@ -88,7 +88,7 @@ on property:init.svc.zygote=stopped
|
||||
|
||||
# Updating Magisk from Magisk manager will modify bootanim.rc,
|
||||
# So it is necessary to backup the original bootanim.rc.
|
||||
bootanim_path = os.path.join(self.sys_overlay_dir, "system", "etc", "init", "bootanim.rc")
|
||||
bootanim_path = os.path.join(self.copy_dir, "system", "etc", "init", "bootanim.rc")
|
||||
gz_filename = os.path.join(bootanim_path)+".gz"
|
||||
with gzip.open(gz_filename,'wb') as f_gz:
|
||||
f_gz.write(self.oringinal_bootanim.encode('utf-8'))
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@ from tools.helper import bcolors, get_download_dir, print_color, run
|
||||
|
||||
class Ndk(General):
|
||||
download_loc = get_download_dir()
|
||||
sys_image_mount = "./ndk"
|
||||
copy_dir = "./ndk"
|
||||
dl_link = "https://www.dropbox.com/s/eaf4dj3novwiccp/libndk_translation_Module-c6077f3398172c64f55aad7aab0e55fad9110cf3.zip?dl=1"
|
||||
dl_file_name = os.path.join(download_loc, "libndktranslation.zip")
|
||||
extract_to = "/tmp/libndkunpack"
|
||||
@@ -30,9 +30,9 @@ on property:ro.enable.native.bridge.exec=1
|
||||
run(["chmod", "+x", self.extract_to, "-R"])
|
||||
|
||||
print_color("Copying libndk library files ...", bcolors.GREEN)
|
||||
shutil.copytree(os.path.join(self.extract_to, "libndk_translation_Module-c6077f3398172c64f55aad7aab0e55fad9110cf3", "system"), os.path.join(self.sys_image_mount, "system"), dirs_exist_ok=True)
|
||||
shutil.copytree(os.path.join(self.extract_to, "libndk_translation_Module-c6077f3398172c64f55aad7aab0e55fad9110cf3", "system"), os.path.join(self.copy_dir, "system"), dirs_exist_ok=True)
|
||||
|
||||
init_path = os.path.join(self.sys_image_mount, "system", "etc", "init", "libndk.rc")
|
||||
init_path = os.path.join(self.copy_dir, "system", "etc", "init", "libndk.rc")
|
||||
if not os.path.isfile(init_path):
|
||||
os.makedirs(os.path.dirname(init_path), exist_ok=True)
|
||||
with open(init_path, "w") as initfile:
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ from tools.helper import bcolors, get_download_dir, print_color, run
|
||||
|
||||
class Widevine(General):
|
||||
download_loc = get_download_dir()
|
||||
vendor_image_mount = "./widevine"
|
||||
copy_dir = "./widevine"
|
||||
dl_link = "https://codeload.github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/zip/94c9ee172e3d78fecc81863f50a59e3646f7a2bd"
|
||||
dl_file_name = os.path.join(download_loc, "widevine.zip")
|
||||
extract_to = "/tmp/widevineunpack"
|
||||
@@ -20,4 +20,4 @@ class Widevine(General):
|
||||
run(["chmod", "+x", self.extract_to, "-R"])
|
||||
print_color("Copying widevine library files ...", bcolors.GREEN)
|
||||
shutil.copytree(os.path.join(self.extract_to, "vendor_google_proprietary_widevine-prebuilt-94c9ee172e3d78fecc81863f50a59e3646f7a2bd",
|
||||
"prebuilts"), os.path.join(self.vendor_image_mount, "vendor"), dirs_exist_ok=True)
|
||||
"prebuilts"), os.path.join(self.copy_dir, "vendor"), dirs_exist_ok=True)
|
||||
Reference in new issue
Block a user