diff --git a/README.md b/README.md index a88e8c1..2389f54 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ Open terminal and switch to directory where "main.py" is located then run: ``` sudo python3 main.py install nodataperm ``` -**WARNING**: Only tested on `lineage-18.1-20230121-VANILLA-waydroid_x86_64`. This script will replace `/system/framework/service.jar`, which may prevent WayDroid from booting. If so, run `sudo python3 main.py uninstall nodataperm` to remove it. +**WARNING**: Tested on `lineage-18.1-20230128-VANILLA-waydroid_x86_64.img`. This script will replace `/system/framework/service.jar`, which may prevent WayDroid from booting. If so, run `sudo python3 main.py uninstall nodataperm` to remove it. Or you can run the following commands directly in `sudo waydroid shell`. In this way, every time a new game is installed, you need to run it again, but it's much less risky. diff --git a/a b/a new file mode 100644 index 0000000..e69de29 diff --git a/stuffs/magisk.py b/stuffs/magisk.py index cee09c5..3996b40 100644 --- a/stuffs/magisk.py +++ b/stuffs/magisk.py @@ -141,7 +141,8 @@ on property:init.svc.zygote=stopped os.remove(file) bootanim_path = os.path.join(self.copy_dir, self.partition, "etc", "init", "bootanim.rc") if container.use_overlayfs(): - os.remove(bootanim_path) + if os.path.exists(bootanim_path): + os.remove(bootanim_path) else: with open(bootanim_path, "w") as initfile: initfile.write(self.oringinal_bootanim) diff --git a/stuffs/widevine.py b/stuffs/widevine.py index ce8665d..b2de90c 100644 --- a/stuffs/widevine.py +++ b/stuffs/widevine.py @@ -1,21 +1,29 @@ import os +import re import shutil from stuffs.general import General -from tools.helper import run +from tools.helper import host, run from tools.logger import Logger class Widevine(General): partition = "vendor" - dl_link = "https://codeload.github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/zip/94c9ee172e3d78fecc81863f50a59e3646f7a2bd" + dl_links = { + "x86": ["https://github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/archive/94c9ee172e3d78fecc81863f50a59e3646f7a2bd.zip", "a31f325453c5d239c21ecab8cfdbd878"], + "x86_64": ["https://github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/archive/94c9ee172e3d78fecc81863f50a59e3646f7a2bd.zip", "a31f325453c5d239c21ecab8cfdbd878"], + "armeabi-v7a": ["https://github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/archive/a1a19361d36311bee042da8cf4ced798d2c76d98.zip", "fed6898b5cfd2a908cb134df97802554"], + "arm64-v8a": ["https://github.com/supremegamers/vendor_google_proprietary_widevine-prebuilt/archive/a1a19361d36311bee042da8cf4ced798d2c76d98.zip", "fed6898b5cfd2a908cb134df97802554"] + } + machine = host() + dl_link = dl_links[machine[0]][0] + act_md5 = dl_links[machine[0]][1] dl_file_name = "widevine.zip" extract_to = "/tmp/widevineunpack" - act_md5 = "a31f325453c5d239c21ecab8cfdbd878" files = [ - "bin/hw/android.hardware.drm@1.3-service-lazy.widevine", + "bin/hw/*widevine", "bin/move_widevine_data.sh", - "etc/init/android.hardware.drm@1.3-service-lazy.widevine.rc", - "etc/vintf/manifest/manifest_android.hardware.drm@1.3-service.widevine.xml", + "etc/init/*widevine.rc", + "etc/vintf/manifest/*widevine.xml", "lib/libwvhidl.so", "lib/mediadrm", "lib64/mediadrm" @@ -23,6 +31,7 @@ class Widevine(General): def copy(self): run(["chmod", "+x", self.extract_to, "-R"]) + name = re.findall("([a-zA-Z0-9]+)\.zip", self.dl_link)[0] Logger.info("Copying widevine library files ...") - shutil.copytree(os.path.join(self.extract_to, "vendor_google_proprietary_widevine-prebuilt-94c9ee172e3d78fecc81863f50a59e3646f7a2bd", + shutil.copytree(os.path.join(self.extract_to, "vendor_google_proprietary_widevine-prebuilt-"+name, "prebuilts"), os.path.join(self.copy_dir, self.partition), dirs_exist_ok=True)