From 05f84916e71f6706f45d5ce3053b7075f5192327 Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Sun, 26 Jun 2022 11:37:00 +0200 Subject: [PATCH 01/20] Update waydroid_extras.py --- waydroid_extras.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index fea3dd0..50dd6f3 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -202,10 +202,10 @@ def get_android_id(): def install_ndk(): sys_image_mount = "/tmp/waydroidimage" - ndk_zip_url = "https://github.com/newbit1/libndk_translation_Module/archive/c6077f3398172c64f55aad7aab0e55fad9110cf3.zip" + ndk_zip_url = "https://github.com/newbit1/libndk_translation_Module/releases/download/v1.0/libndk_translation_Module.zip" dl_file_name = os.path.join(download_loc, "libndktranslation.zip") extract_to = "/tmp/libndkunpack" #All catalog files will be marked as executable! - act_md5 = "5e8e0cbde0e672fdc2b47f20a87472fd" + act_md5 = "5D2F9E3D94906BAEBD3CEFA7860BD7EC" loc_md5 = "" apply_props = { "ro.product.cpu.abilist": "x86_64,x86,armeabi-v7a,armeabi", #arm64-v8a, @@ -266,7 +266,7 @@ on property:ro.enable.native.bridge.exec=1 # Copy library file print("==> Copying library files ...") - shutil.copytree(os.path.join(extract_to, "libndk_translation_Module-c6077f3398172c64f55aad7aab0e55fad9110cf3", "system"), os.path.join(sys_image_mount, "system"), dirs_exist_ok=True) + shutil.copytree(os.path.join(extract_to, "libndk_translation_Module", "system"), os.path.join(sys_image_mount, "system"), dirs_exist_ok=True) # Add entries to build.prop print("==> Adding arch in build.prop") From 9e6c8fd67f81906cb9f3f44b2b9a23881e8c7fe0 Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Sun, 26 Jun 2022 12:14:48 +0200 Subject: [PATCH 02/20] Update waydroid_extras.py --- waydroid_extras.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index 50dd6f3..fe478e2 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -202,15 +202,21 @@ def get_android_id(): def install_ndk(): sys_image_mount = "/tmp/waydroidimage" - ndk_zip_url = "https://github.com/newbit1/libndk_translation_Module/releases/download/v1.0/libndk_translation_Module.zip" + ndk_zip_url = "https://github.com/LegacyGamerHD/libndk_translation_Module/releases/download/v1.0/libndk_translation_Module.zip" dl_file_name = os.path.join(download_loc, "libndktranslation.zip") extract_to = "/tmp/libndkunpack" #All catalog files will be marked as executable! - act_md5 = "5D2F9E3D94906BAEBD3CEFA7860BD7EC" + act_md5 = "CC9D109BDC550CDA41BA4990798905D3" loc_md5 = "" apply_props = { - "ro.product.cpu.abilist": "x86_64,x86,armeabi-v7a,armeabi", #arm64-v8a, + "ro.product.cpu.abilist": "x86_64,x86,armeabi-v7a,armeabi", "ro.product.cpu.abilist32": "x86,armeabi-v7a,armeabi", - "ro.product.cpu.abilist64": "x86_64", #,arm64-v8a", + "ro.product.cpu.abilist64": "x86_64", + "ro.odm.product.cpu.abilist": "x86_64,x86,armeabi-v7a,armeabi", + "ro.odm.product.cpu.abilist32": "x86,armeabi-v7a,armeabi", + "ro.odm.product.cpu.abilist6": "x86_64", + "ro.vendor.product.cpu.abilist": "x86_64,x86,armeabi-v7a,armeabi", + "ro.vendor.product.cpu.abilist32": "x86,armeabi-v7a,armeabi", + "ro.vendor.product.cpu.abilist64": "x86_64", "ro.dalvik.vm.native.bridge": "libndk_translation.so", "ro.enable.native.bridge.exec": "1", "ro.ndk_translation.version": "0.2.2", From 8ad6bb8283f153d0cc37aa6197317fc799afd9bc Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Sun, 26 Jun 2022 12:16:14 +0200 Subject: [PATCH 03/20] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 28ca681..dfd536b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Script to add gapps and other stuff to waydroid ! sudo zypper install lzip sqlite Then run: - git clone https://github.com/casualsnek/waydroid_script + git clone https://github.com/LegacyGamerHD/waydroid_script cd waydroid_script sudo python3 -m pip install -r requirements.txt sudo python3 waydroid_extras.py [-i/-g/-n/-h] From b9390a7ebc10cb0b086eff87df3cd9e495a27dc8 Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Sun, 26 Jun 2022 17:08:47 +0200 Subject: [PATCH 04/20] fix --- waydroid_extras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index fe478e2..be45271 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -205,7 +205,7 @@ def install_ndk(): ndk_zip_url = "https://github.com/LegacyGamerHD/libndk_translation_Module/releases/download/v1.0/libndk_translation_Module.zip" dl_file_name = os.path.join(download_loc, "libndktranslation.zip") extract_to = "/tmp/libndkunpack" #All catalog files will be marked as executable! - act_md5 = "CC9D109BDC550CDA41BA4990798905D3" + act_md5 = "cc9d109bdc550cda41ba4990798905d3" loc_md5 = "" apply_props = { "ro.product.cpu.abilist": "x86_64,x86,armeabi-v7a,armeabi", From 8f28a3723db77a404d4bb5cfaacbe3187b61b76b Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Sun, 26 Jun 2022 17:33:43 +0200 Subject: [PATCH 05/20] Update waydroid_extras.py --- waydroid_extras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index be45271..289853b 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -272,7 +272,7 @@ on property:ro.enable.native.bridge.exec=1 # Copy library file print("==> Copying library files ...") - shutil.copytree(os.path.join(extract_to, "libndk_translation_Module", "system"), os.path.join(sys_image_mount, "system"), dirs_exist_ok=True) + shutil.copytree(os.path.join(extract_to, "libndk_translation_Module-c6077f3398172c64f55aad7aab0e55fad9110cf3", "system"), os.path.join(sys_image_mount, "system"), dirs_exist_ok=True) # Add entries to build.prop print("==> Adding arch in build.prop") From c91ab576e234bc60e51b4219ff88ae948ac35692 Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Sun, 26 Jun 2022 17:36:01 +0200 Subject: [PATCH 06/20] Update waydroid_extras.py --- waydroid_extras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index 289853b..7410434 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -272,7 +272,7 @@ on property:ro.enable.native.bridge.exec=1 # Copy library file print("==> Copying library files ...") - shutil.copytree(os.path.join(extract_to, "libndk_translation_Module-c6077f3398172c64f55aad7aab0e55fad9110cf3", "system"), os.path.join(sys_image_mount, "system"), dirs_exist_ok=True) + shutil.copytree(os.path.join(extract_to, "/*", "system"), os.path.join(sys_image_mount, "system"), dirs_exist_ok=True) # Add entries to build.prop print("==> Adding arch in build.prop") From 44ffa7152b0aa5fad1e984aad60de721ef1ab70d Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Sun, 26 Jun 2022 17:39:24 +0200 Subject: [PATCH 07/20] Update waydroid_extras.py --- waydroid_extras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index 7410434..d7c7627 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -272,7 +272,7 @@ on property:ro.enable.native.bridge.exec=1 # Copy library file print("==> Copying library files ...") - shutil.copytree(os.path.join(extract_to, "/*", "system"), os.path.join(sys_image_mount, "system"), dirs_exist_ok=True) + shutil.copytree(os.path.join(extract_to, "system"), os.path.join(sys_image_mount, "system"), dirs_exist_ok=True) # Add entries to build.prop print("==> Adding arch in build.prop") From aab34beacae2cb94c5883d7451bbbe9f88d8b2b8 Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Thu, 3 Nov 2022 06:39:27 +0100 Subject: [PATCH 08/20] new houdini and new magisk --- waydroid_extras.py | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index d7c7627..44ae241 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -58,7 +58,7 @@ def get_image_dir(): cfg.read(cfg_file) if "waydroid" not in cfg: - print("==> Required entry in config was not found, Cannot continue !s") + print("==> Required entry in config was not found, Cannot continue !s") #magisk sys.exit(1) return cfg["waydroid"]["images_path"] @@ -202,21 +202,15 @@ def get_android_id(): def install_ndk(): sys_image_mount = "/tmp/waydroidimage" - ndk_zip_url = "https://github.com/LegacyGamerHD/libndk_translation_Module/releases/download/v1.0/libndk_translation_Module.zip" + ndk_zip_url = "https://github.com/newbit1/libndk_translation_Module/archive/c6077f3398172c64f55aad7aab0e55fad9110cf3.zip" dl_file_name = os.path.join(download_loc, "libndktranslation.zip") extract_to = "/tmp/libndkunpack" #All catalog files will be marked as executable! - act_md5 = "cc9d109bdc550cda41ba4990798905d3" + act_md5 = "5e8e0cbde0e672fdc2b47f20a87472fd" loc_md5 = "" apply_props = { - "ro.product.cpu.abilist": "x86_64,x86,armeabi-v7a,armeabi", + "ro.product.cpu.abilist": "x86_64,x86,armeabi-v7a,armeabi", #arm64-v8a, "ro.product.cpu.abilist32": "x86,armeabi-v7a,armeabi", - "ro.product.cpu.abilist64": "x86_64", - "ro.odm.product.cpu.abilist": "x86_64,x86,armeabi-v7a,armeabi", - "ro.odm.product.cpu.abilist32": "x86,armeabi-v7a,armeabi", - "ro.odm.product.cpu.abilist6": "x86_64", - "ro.vendor.product.cpu.abilist": "x86_64,x86,armeabi-v7a,armeabi", - "ro.vendor.product.cpu.abilist32": "x86,armeabi-v7a,armeabi", - "ro.vendor.product.cpu.abilist64": "x86_64", + "ro.product.cpu.abilist64": "x86_64", #,arm64-v8a", "ro.dalvik.vm.native.bridge": "libndk_translation.so", "ro.enable.native.bridge.exec": "1", "ro.ndk_translation.version": "0.2.2", @@ -272,7 +266,7 @@ on property:ro.enable.native.bridge.exec=1 # Copy library file print("==> Copying library files ...") - shutil.copytree(os.path.join(extract_to, "system"), os.path.join(sys_image_mount, "system"), dirs_exist_ok=True) + shutil.copytree(os.path.join(extract_to, "libndk_translation_Module-c6077f3398172c64f55aad7aab0e55fad9110cf3", "system"), os.path.join(sys_image_mount, "system"), dirs_exist_ok=True) # Add entries to build.prop print("==> Adding arch in build.prop") @@ -314,10 +308,10 @@ on property:ro.enable.native.bridge.exec=1 def install_houdini(): sys_image_mount = "/tmp/waydroidimage" - houdini_zip_url = "https://raw.githubusercontent.com/casualsnek/miscpackages/main/libhoudini_a11.zip" + houdini_zip_url = "https://github.com/natsumerinchan/libhoudini-package/archive/refs/tags/v2.1.zip" dl_file_name = os.path.join(download_loc, "libhoudini.zip") - extract_to = "/tmp/houdiniunpack" #All catalog files will be marked as executable! - act_md5 = "c9a80831641de8fd44ccf93a0ad8b585" + extract_to = "/tmp/houdiniunpack/libhoudini-package-2.1" #All catalog files will be marked as executable! + act_md5 = "25c7532cc4256ee64c12695fc0bc60d0" loc_md5 = "" apply_props = { @@ -419,12 +413,12 @@ on property:ro.enable.native.bridge.exec=1 def install_magisk(): - dl_link = "https://github.com/topjohnwu/Magisk/releases/download/v20.4/Magisk-v20.4.zip" + dl_link = "https://www.dropbox.com/s/eawfmhlot8q61i9/Magisk-v25.2.zip?dl=1" busybox_dl_link = "https://github.com/Gnurou/busybox-android/raw/master/busybox-android" busybox_dl_file_name = os.path.join(download_loc, "busybox-android") dl_file_name = os.path.join(download_loc, "magisk.zip") extract_to = "/tmp/magisk_unpack" - act_md5 = "9503fc692e03d60cb8897ff2753c193f" + act_md5 = "278576ca7483716bcbc16af7cff268bd" busybox_act_md5 = "2e43cc2e8f44b83f9029a6561ce5d8b9" sys_image_mount = "/tmp/waydroidimage" loc_md5 = "" From de2b5597e1de64df3b98f9f0f59576e041872932 Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Thu, 3 Nov 2022 08:18:33 +0100 Subject: [PATCH 09/20] Update waydroid_extras.py --- waydroid_extras.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index 44ae241..b511865 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -308,10 +308,10 @@ on property:ro.enable.native.bridge.exec=1 def install_houdini(): sys_image_mount = "/tmp/waydroidimage" - houdini_zip_url = "https://github.com/natsumerinchan/libhoudini-package/archive/refs/tags/v2.1.zip" + houdini_zip_url = "https://www.dropbox.com/s/v7g0fluc7e8tod8/libhoudini.zip?dl=1" dl_file_name = os.path.join(download_loc, "libhoudini.zip") - extract_to = "/tmp/houdiniunpack/libhoudini-package-2.1" #All catalog files will be marked as executable! - act_md5 = "25c7532cc4256ee64c12695fc0bc60d0" + extract_to = "/tmp/houdiniunpack" #All catalog files will be marked as executable! + act_md5 = "838097117cec7762e958d7cbc209415e" loc_md5 = "" apply_props = { From be97f33bcdd55623ca263b802df2b04563bb54c9 Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Thu, 3 Nov 2022 08:21:24 +0100 Subject: [PATCH 10/20] Test --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index dfd536b..85e1db1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Waydroid Extras Script -## Since waydroid images with libndk/gapps/magisk and libhoudini are already available. This script has little to no use. So, i am archiving this repository. If you have any questions or queries, my Inbox is available at casualsnek(at)pm(d0t)me. Free free to send emails :) - [![Visits Badge](https://badges.pufler.dev/visits/casualsnek/waydroid_script)](https://github.com/casualsnek) Script to add gapps and other stuff to waydroid ! From fd732b5b0330626d159de3913d3e4ef05e63e871 Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Sun, 6 Nov 2022 18:15:26 +0100 Subject: [PATCH 11/20] lower the magisk version and some other tweaks --- waydroid_extras.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index b511865..8ea17c6 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -215,7 +215,9 @@ def install_ndk(): "ro.enable.native.bridge.exec": "1", "ro.ndk_translation.version": "0.2.2", "ro.dalvik.vm.isa.arm": "x86", - "ro.dalvik.vm.isa.arm64": "x86_64" + "ro.dalvik.vm.isa.arm64": "x86_64", + "ro.sys.sdcardfs": "false", + "persist.sys.sdcardfs": "force_off" } init_rc_component = """ on early-init @@ -321,7 +323,9 @@ def install_houdini(): "ro.dalvik.vm.native.bridge": "libhoudini.so", "ro.enable.native.bridge.exec": "1", "ro.dalvik.vm.isa.arm": "x86", - "ro.dalvik.vm.isa.arm64": "x86_64" + "ro.dalvik.vm.isa.arm64": "x86_64", + "ro.sys.sdcardfs": "false", + "persist.sys.sdcardfs": "force_off" } init_rc_component = """ on early-init @@ -413,7 +417,7 @@ on property:ro.enable.native.bridge.exec=1 def install_magisk(): - dl_link = "https://www.dropbox.com/s/eawfmhlot8q61i9/Magisk-v25.2.zip?dl=1" + dl_link = "https://github.com/topjohnwu/Magisk/releases/download/v21.4/Magisk-v21.4.zip" busybox_dl_link = "https://github.com/Gnurou/busybox-android/raw/master/busybox-android" busybox_dl_file_name = os.path.join(download_loc, "busybox-android") dl_file_name = os.path.join(download_loc, "magisk.zip") From c207028677de6911b47666bf62196f229ad21b6b Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Sun, 6 Nov 2022 18:19:10 +0100 Subject: [PATCH 12/20] Update README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 85e1db1..216329c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # Waydroid Extras Script - -[![Visits Badge](https://badges.pufler.dev/visits/casualsnek/waydroid_script)](https://github.com/casualsnek) - Script to add gapps and other stuff to waydroid ! # Installation/Usage From 4849abf9ccffb7264fadf40baf76eb21447c3aa0 Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Tue, 8 Nov 2022 17:01:22 +0100 Subject: [PATCH 13/20] fix my mestake --- waydroid_extras.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index 8ea17c6..b5565dd 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -215,9 +215,7 @@ def install_ndk(): "ro.enable.native.bridge.exec": "1", "ro.ndk_translation.version": "0.2.2", "ro.dalvik.vm.isa.arm": "x86", - "ro.dalvik.vm.isa.arm64": "x86_64", - "ro.sys.sdcardfs": "false", - "persist.sys.sdcardfs": "force_off" + "ro.dalvik.vm.isa.arm64": "x86_64" } init_rc_component = """ on early-init @@ -323,9 +321,7 @@ def install_houdini(): "ro.dalvik.vm.native.bridge": "libhoudini.so", "ro.enable.native.bridge.exec": "1", "ro.dalvik.vm.isa.arm": "x86", - "ro.dalvik.vm.isa.arm64": "x86_64", - "ro.sys.sdcardfs": "false", - "persist.sys.sdcardfs": "force_off" + "ro.dalvik.vm.isa.arm64": "x86_64" } init_rc_component = """ on early-init From 2ffd72c7d34ea8858abee73f855560bed6d2bd33 Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Wed, 9 Nov 2022 21:01:22 +0100 Subject: [PATCH 14/20] Update waydroid_extras.py --- waydroid_extras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index b5565dd..00395c1 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -418,7 +418,7 @@ def install_magisk(): busybox_dl_file_name = os.path.join(download_loc, "busybox-android") dl_file_name = os.path.join(download_loc, "magisk.zip") extract_to = "/tmp/magisk_unpack" - act_md5 = "278576ca7483716bcbc16af7cff268bd" + act_md5 = "ee6dd05579776e7de3a6077087846e53" busybox_act_md5 = "2e43cc2e8f44b83f9029a6561ce5d8b9" sys_image_mount = "/tmp/waydroidimage" loc_md5 = "" From a6dda23325acb0b234195d19672cca4e3c4c34be Mon Sep 17 00:00:00 2001 From: Quackdoc <74831516+Quackdoc@users.noreply.github.com> Date: Mon, 14 Nov 2022 16:08:54 -0500 Subject: [PATCH 15/20] update houdini for overlayFS --- waydroid_extras.py | 86 ++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 53 deletions(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index 00395c1..6f0ee3a 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -62,32 +62,32 @@ def get_image_dir(): sys.exit(1) return cfg["waydroid"]["images_path"] -def mount_image(image, mount_point): - print("==> Unmounting .. ") - try: - subprocess.check_output(["losetup", "-D"], stderr=subprocess.STDOUT) - subprocess.check_output(["umount", mount_point], stderr=subprocess.STDOUT) - except subprocess.CalledProcessError as e: - print("==> Warning: umount failed.. {} ".format(str(e.output.decode()))) - if not os.path.exists(mount_point): - os.makedirs(mount_point) - try: - subprocess.check_output(["mount", "-o", "rw", image, mount_point], stderr=subprocess.STDOUT) - except subprocess.CalledProcessError as e: - print("==> Failed to mount system image... ! {}".format(str(e.output.decode()))) - sys.exit(1) +#def mount_image(image, mount_point): +# print("==> Unmounting .. ") +# try: +# subprocess.check_output(["losetup", "-D"], stderr=subprocess.STDOUT) +# subprocess.check_output(["umount", mount_point], stderr=subprocess.STDOUT) +# except subprocess.CalledProcessError as e: +# print("==> Warning: umount failed.. {} ".format(str(e.output.decode()))) +# if not os.path.exists(mount_point): +# os.makedirs(mount_point) +# try: +# subprocess.check_output(["mount", "-o", "rw", image, mount_point], stderr=subprocess.STDOUT) +# except subprocess.CalledProcessError as e: +# print("==> Failed to mount system image... ! {}".format(str(e.output.decode()))) +# sys.exit(1) -def resize_img(img_file, size): - # Resize the system image - print("==> Resizing system image....") - try: - subprocess.check_output(["e2fsck -y -f "+img_file], stderr=subprocess.STDOUT, shell=True) - subprocess.check_output(["resize2fs '{}' {}".format(img_file, size)], stderr=subprocess.STDOUT, shell=True) - except subprocess.CalledProcessError as e: - print("==> Failed to resize image '{}' .. ! {}".format(img_file, str(e.output.decode()))) - p = input("==> You can exit and retry with sudo or force continue (May fail installation !), Continue ? [y/N]: ") - if not p.lower() == "y": - sys.exit(1) +#def resize_img(img_file, size): +# # Resize the system image +# print("==> Resizing system image....") +# try: +# subprocess.check_output(["e2fsck -y -f "+img_file], stderr=subprocess.STDOUT, shell=True) +# subprocess.check_output(["resize2fs '{}' {}".format(img_file, size)], stderr=subprocess.STDOUT, shell=True) +# except subprocess.CalledProcessError as e: +# print("==> Failed to resize image '{}' .. ! {}".format(img_file, str(e.output.decode()))) +# p = input("==> You can exit and retry with sudo or force continue (May fail installation !), Continue ? [y/N]: ") +# if not p.lower() == "y": +# sys.exit(1) def install_gapps(): @@ -307,7 +307,8 @@ on property:ro.enable.native.bridge.exec=1 def install_houdini(): - sys_image_mount = "/tmp/waydroidimage" + sys_image_mount = "/var/lib/waydroid/overlay" + prop_file = "/var/lib/waydroid/waydroid_base.prop" houdini_zip_url = "https://www.dropbox.com/s/v7g0fluc7e8tod8/libhoudini.zip?dl=1" dl_file_name = os.path.join(download_loc, "libhoudini.zip") extract_to = "/tmp/houdiniunpack" #All catalog files will be marked as executable! @@ -339,21 +340,6 @@ on property:ro.enable.native.bridge.exec=1 bytes = f.read() loc_md5 = hashlib.md5(bytes).hexdigest() - system_img = os.path.join(get_image_dir(), "system.img") - if not os.path.isfile(system_img): - print("The system image path '{}' from waydroid config is not valid !".format(system_img)) - sys.exit(1) - print("==> Found system image: "+system_img) - - img_size = int(os.path.getsize(system_img)/(1024*1024)) - - # Resize image to get some free space - resize_img(system_img, "{}M".format(img_size+300)) - - - # Mount the system image - mount_image(system_img, sys_image_mount) - # Download the file if hash mismatches or if file does not exist while not os.path.isfile(dl_file_name) or loc_md5 != act_md5: if os.path.isfile(dl_file_name): @@ -376,8 +362,8 @@ on property:ro.enable.native.bridge.exec=1 shutil.copytree(os.path.join(extract_to, "system"), os.path.join(sys_image_mount, "system"), dirs_exist_ok=True) # Add entries to build.prop - print("==> Adding arch in build.prop") - with open(os.path.join(sys_image_mount, "system", "build.prop"), "r") as propfile: + print("==> Adding arch in", prop_file) + with open(os.path.join(prop_file), "r") as propfile: prop_content = propfile.read() for key in apply_props: if key not in prop_content: @@ -385,16 +371,16 @@ on property:ro.enable.native.bridge.exec=1 else: p = re.compile(r"^{key}=.*$".format(key=key), re.M) prop_content = re.sub(p, "{key}={value}".format(key=key, value=apply_props[key]), prop_content) - with open(os.path.join(sys_image_mount, "system", "build.prop"), "w") as propfile: + with open(os.path.join(prop_file), "w") as propfile: propfile.write(prop_content) # Add entry to init.rc print("==> Adding entry to init.rc") # Check if init.rc is located in Android 11's path - init_path = os.path.join(sys_image_mount, "system", "etc", "init", "hw", "init.rc") + init_path = os.path.join(sys_image_mount, "system", "etc", "init", "houdini.rc") if not os.path.isfile(init_path): - # init.rc not found, assuming it's located in the root folder (Android 10 and older) - init_path = os.path.join(sys_image_mount, "init.rc") + os.makedirs(os.path.dirname(init_path), exist_ok=True) + f = open(init_path, "x") with open(init_path, "r") as initfile: initcontent = initfile.read() if init_rc_component not in initcontent: @@ -402,12 +388,6 @@ on property:ro.enable.native.bridge.exec=1 with open(init_path, "w") as initfile: initfile.write(initcontent) - # Unmount and exit - print("==> Unmounting .. ") - try: - subprocess.check_output(["umount", sys_image_mount], stderr=subprocess.STDOUT) - except subprocess.CalledProcessError as e: - print("==> Warning: umount failed.. {} ".format(str(e.output.decode()))) print("==> libhoudini translation installed ! Restart waydroid service to apply changes !") From 45d5dbd12d6fadf6d65290b1761d3aa265331f4b Mon Sep 17 00:00:00 2001 From: Quackdoc <74831516+Quackdoc@users.noreply.github.com> Date: Mon, 14 Nov 2022 21:08:22 -0500 Subject: [PATCH 16/20] update gaaps --- waydroid_extras.py | 51 ++-------------------------------------------- 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index 6f0ee3a..d7c1bef 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -62,34 +62,6 @@ def get_image_dir(): sys.exit(1) return cfg["waydroid"]["images_path"] -#def mount_image(image, mount_point): -# print("==> Unmounting .. ") -# try: -# subprocess.check_output(["losetup", "-D"], stderr=subprocess.STDOUT) -# subprocess.check_output(["umount", mount_point], stderr=subprocess.STDOUT) -# except subprocess.CalledProcessError as e: -# print("==> Warning: umount failed.. {} ".format(str(e.output.decode()))) -# if not os.path.exists(mount_point): -# os.makedirs(mount_point) -# try: -# subprocess.check_output(["mount", "-o", "rw", image, mount_point], stderr=subprocess.STDOUT) -# except subprocess.CalledProcessError as e: -# print("==> Failed to mount system image... ! {}".format(str(e.output.decode()))) -# sys.exit(1) - -#def resize_img(img_file, size): -# # Resize the system image -# print("==> Resizing system image....") -# try: -# subprocess.check_output(["e2fsck -y -f "+img_file], stderr=subprocess.STDOUT, shell=True) -# subprocess.check_output(["resize2fs '{}' {}".format(img_file, size)], stderr=subprocess.STDOUT, shell=True) -# except subprocess.CalledProcessError as e: -# print("==> Failed to resize image '{}' .. ! {}".format(img_file, str(e.output.decode()))) -# p = input("==> You can exit and retry with sudo or force continue (May fail installation !), Continue ? [y/N]: ") -# if not p.lower() == "y": -# sys.exit(1) - - def install_gapps(): dl_links = { @@ -105,7 +77,8 @@ def install_gapps(): dl_file_name = os.path.join(download_loc, "open_gapps.zip") act_md5 = dl_links[platform.machine()][1] loc_md5 = "" - sys_image_mount = "/tmp/waydroidimage" + sys_image_mount = "/var/lib/waydroid/overlay" + prop_file = "/var/lib/waydroid/waydroid_base.prop" extract_to = "/tmp/ogapps/extract" non_apks = [ "defaultetc-common.tar.lz", @@ -128,21 +101,6 @@ def install_gapps(): loc_md5 = hashlib.md5(bytes).hexdigest() print("==> Excepted hash: {} | File hash: {}".format(act_md5, loc_md5)) - - system_img = os.path.join(get_image_dir(), "system.img") - if not os.path.isfile(system_img): - print("The system image path '{}' from waydroid config is not valid !".format(system_img)) - sys.exit(1) - print("==> Found system image: "+system_img) - - img_size = int(os.path.getsize(system_img)/(1024*1024)) - - # Resize image to get some free space - resize_img(system_img, "{}M".format(img_size+500)) - - # Mount the system image - mount_image(system_img, sys_image_mount) - # Download the file if hash mismatches or if file does not exist while not os.path.isfile(dl_file_name) or loc_md5 != act_md5: if os.path.isfile(dl_file_name): @@ -176,11 +134,6 @@ def install_gapps(): common_content_dirs = os.listdir(os.path.join(extract_to, "appunpack", app_name, "common")) for ccdir in common_content_dirs: shutil.copytree(os.path.join(extract_to, "appunpack", app_name, "common", ccdir), os.path.join(sys_image_mount, "system", ccdir), dirs_exist_ok=True) - print("==> Unmounting .. ") - try: - subprocess.check_output(["umount", sys_image_mount], stderr=subprocess.STDOUT) - except subprocess.CalledProcessError as e: - print("==> Warning: umount failed.. {} ".format(str(e.output.decode()))) print("==> OpenGapps installation complete try re init /restarting waydroid") print("==> Please note, google apps wont be usable without device registration !, Use --get-android-id for registration instructions") From 1995d57e2112f8f132f61a3a4551ec077bebb3bf Mon Sep 17 00:00:00 2001 From: Quackdoc <74831516+Quackdoc@users.noreply.github.com> Date: Mon, 14 Nov 2022 21:54:50 -0500 Subject: [PATCH 17/20] Houdini, doesn't work in the first place? --- waydroid_extras.py | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index d7c1bef..a992800 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -78,7 +78,6 @@ def install_gapps(): act_md5 = dl_links[platform.machine()][1] loc_md5 = "" sys_image_mount = "/var/lib/waydroid/overlay" - prop_file = "/var/lib/waydroid/waydroid_base.prop" extract_to = "/tmp/ogapps/extract" non_apks = [ "defaultetc-common.tar.lz", @@ -353,7 +352,7 @@ def install_magisk(): extract_to = "/tmp/magisk_unpack" act_md5 = "ee6dd05579776e7de3a6077087846e53" busybox_act_md5 = "2e43cc2e8f44b83f9029a6561ce5d8b9" - sys_image_mount = "/tmp/waydroidimage" + sys_image_mount = "/var/lib/waydroid/overlay_rw" loc_md5 = "" busybox_loc_md5 = "" magisk_init = """#!/system/bin/sh @@ -395,21 +394,6 @@ service magisk /system/bin/init-magisk.sh bytes = f.read() busybox_loc_md5 = hashlib.md5(bytes).hexdigest() - - system_img = os.path.join(get_image_dir(), "system.img") - if not os.path.isfile(system_img): - print("The system image path '{}' from waydroid config is not valid !".format(system_img)) - sys.exit(1) - print("==> Found system image: " + system_img) - - img_size = int(os.path.getsize(system_img)/(1024*1024)) - - # Resize image to get some free space - resize_img(system_img, "{}M".format(img_size+50)) - - # Mount the system image - mount_image(system_img, sys_image_mount) - # Download magisk while not os.path.isfile(dl_file_name) or loc_md5 != act_md5: if os.path.isfile(dl_file_name): @@ -431,11 +415,16 @@ service magisk /system/bin/init-magisk.sh # Now setup and install magisk binary and app print("==> Installing magisk now ...") + if not os.path.isdir(os.path.join(sys_image_mount, "system", "bin")): + os.makedirs(os.path.join(sys_image_mount, "system", "bin"), exist_ok=True) with open(os.path.join(sys_image_mount, "system", "bin", "init-magisk.sh"), "w") as imf: imf.write(magisk_init) os.system("chmod 755 {}".format(os.path.join(sys_image_mount, "system", "bin", "init-magisk.sh"))) arch_dir = "x86" if "x86" in platform.machine() else "arm" arch = "64" if "64" in platform.machine() else "" + #prep folders + if not os.path.isdir(os.path.join(sys_image_mount, "sbin")): + os.makedirs(os.path.join(sys_image_mount, "sbin"), exist_ok=True) shutil.copyfile(os.path.join(extract_to, arch_dir, "magiskinit{arch}".format(arch=arch)), os.path.join(sys_image_mount, "sbin", "magiskinit")) shutil.copyfile(os.path.join(extract_to, arch_dir, "magiskinit{arch}".format(arch=arch)), @@ -462,12 +451,16 @@ service magisk /system/bin/init-magisk.sh print("==> magiskinit -> magiskpolicy") # Add entry to init.rc - print("==> Adding entry to init.rc") - with open(os.path.join(sys_image_mount, "init.rc"), "r") as initfile: + print("==> Adding entry to magsik.rc") + init_path = os.path.join(sys_image_mount, "system", "etc", "init", "magisk.rc") + if not os.path.isfile(init_path): + os.makedirs(os.path.dirname(init_path), exist_ok=True) + f = open(init_path, "x") + with open(init_path, "r") as initfile: initcontent = initfile.read() if init_rc_component not in initcontent: initcontent=initcontent+init_rc_component - with open(os.path.join(sys_image_mount, "init.rc"), "w") as initfile: + with open(init_path, "w") as initfile: initfile.write(initcontent) # Install Magisk apk @@ -476,12 +469,6 @@ service magisk /system/bin/init-magisk.sh shutil.copyfile(os.path.join(extract_to, "common", "magisk.apk"), os.path.join(sys_image_mount, "system", "priv-app", "Magisk", "magisk.apk")) - # Unmount and exit - print("==> Unmounting .. ") - try: - subprocess.check_output(["umount", sys_image_mount], stderr=subprocess.STDOUT) - except subprocess.CalledProcessError as e: - print("==> Warning: umount failed.. {} ".format(str(e.output.decode()))) print("==> Magisk was installed ! Restart waydroid service to apply changes !") def main(): From b90c148229e021e89e9d2e6c2f28cf63984a0eb7 Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Fri, 25 Nov 2022 09:01:35 +0100 Subject: [PATCH 18/20] update libndk for amd --- waydroid_extras.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index 00395c1..acc47b3 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -202,18 +202,18 @@ def get_android_id(): def install_ndk(): sys_image_mount = "/tmp/waydroidimage" - ndk_zip_url = "https://github.com/newbit1/libndk_translation_Module/archive/c6077f3398172c64f55aad7aab0e55fad9110cf3.zip" + ndk_zip_url = "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" #All catalog files will be marked as executable! - act_md5 = "5e8e0cbde0e672fdc2b47f20a87472fd" + act_md5 = "4456fc1002dc78e544e8d9721bb24398" loc_md5 = "" apply_props = { - "ro.product.cpu.abilist": "x86_64,x86,armeabi-v7a,armeabi", #arm64-v8a, + "ro.product.cpu.abilist": "x86_64,x86,armeabi-v7a,armeabi,arm64-v8a", "ro.product.cpu.abilist32": "x86,armeabi-v7a,armeabi", - "ro.product.cpu.abilist64": "x86_64", #,arm64-v8a", + "ro.product.cpu.abilist64": "x86_64,arm64-v8a", "ro.dalvik.vm.native.bridge": "libndk_translation.so", "ro.enable.native.bridge.exec": "1", - "ro.ndk_translation.version": "0.2.2", + # "ro.ndk_translation.version": "0.2.2", "ro.dalvik.vm.isa.arm": "x86", "ro.dalvik.vm.isa.arm64": "x86_64" } From 472de72e50c21cd032d6ea25efab88ff0c6436da Mon Sep 17 00:00:00 2001 From: LegacyGamerHD Date: Fri, 25 Nov 2022 09:03:58 +0100 Subject: [PATCH 19/20] Update waydroid_extras.py --- waydroid_extras.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index acc47b3..d4180eb 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -15,8 +15,8 @@ download_loc = "" if os.environ.get("XDG_CACHE_HOME", None) is None: download_loc = os.path.join('/', "home", os.environ.get("SUDO_USER", os.environ["USER"]), ".cache", "waydroid_script", "downloads") else: - os.path.join(os.environ["XDG_CACHE_HOME"], "waydroid_script", "downloads") - + download_loc = os.path.join(os.environ["XDG_CACHE_HOME"], "waydroid_script", "downloads") + print(download_loc) if not os.path.exists(download_loc): From e69aadaa94350b695252952f0075b0b1a7df6815 Mon Sep 17 00:00:00 2001 From: Quackdoc <74831516+Quackdoc@users.noreply.github.com> Date: Fri, 25 Nov 2022 05:08:45 -0500 Subject: [PATCH 20/20] ndk overlay --- waydroid_extras.py | 70 +++++++++++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 20 deletions(-) diff --git a/waydroid_extras.py b/waydroid_extras.py index e531799..d15ca07 100644 --- a/waydroid_extras.py +++ b/waydroid_extras.py @@ -153,7 +153,9 @@ def get_android_id(): print("==> Error getting id... '{}' ".format(str(e.output.decode()))) def install_ndk(): - sys_image_mount = "/tmp/waydroidimage" + # sys_image_mount = "/tmp/waydroidimage" + sys_image_mount = "/var/lib/waydroid/overlay" + prop_file = "/var/lib/waydroid/waydroid_base.prop" ndk_zip_url = "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" #All catalog files will be marked as executable! @@ -184,20 +186,20 @@ on property:ro.enable.native.bridge.exec=1 bytes = f.read() loc_md5 = hashlib.md5(bytes).hexdigest() - system_img = os.path.join(get_image_dir(), "system.img") - if not os.path.isfile(system_img): - print("The system image path '{}' from waydroid config is not valid !".format(system_img)) - sys.exit(1) - print("==> Found system image: "+system_img) + #system_img = os.path.join(get_image_dir(), "system.img") + #if not os.path.isfile(system_img): + # print("The system image path '{}' from waydroid config is not valid !".format(system_img)) + # sys.exit(1) + #print("==> Found system image: "+system_img) # Resize rootfs - img_size = int(os.path.getsize(system_img)/(1024*1024)) + #img_size = int(os.path.getsize(system_img)/(1024*1024)) # Resize image to get some free space - resize_img(system_img, "{}M".format(img_size+50)) + #resize_img(system_img, "{}M".format(img_size+50)) # Mount the system image - mount_image(system_img, sys_image_mount) + #mount_image(system_img, sys_image_mount) # Download the file if hash mismatches or if file does not exist while not os.path.isfile(dl_file_name) or loc_md5 != act_md5: @@ -220,9 +222,23 @@ on property:ro.enable.native.bridge.exec=1 print("==> Copying library files ...") shutil.copytree(os.path.join(extract_to, "libndk_translation_Module-c6077f3398172c64f55aad7aab0e55fad9110cf3", "system"), os.path.join(sys_image_mount, "system"), dirs_exist_ok=True) + ##add this # Add entries to build.prop - print("==> Adding arch in build.prop") - with open(os.path.join(sys_image_mount, "system", "build.prop"), "r") as propfile: + #print("==> Adding arch in build.prop") + #with open(os.path.join(sys_image_mount, "system", "build.prop"), "r") as propfile: + # prop_content = propfile.read() + # for key in apply_props: + # if key not in prop_content: + # prop_content = prop_content+"\n{key}={value}".format(key=key, value=apply_props[key]) + # else: + # p = re.compile(r"^{key}=.*$".format(key=key), re.M) + # prop_content = re.sub(p, "{key}={value}".format(key=key, value=apply_props[key]), prop_content) + #with open(os.path.join(sys_image_mount, "system", "build.prop"), "w") as propfile: + # propfile.write(prop_content) + + # Add entries to build.prop + print("==> Adding arch in", prop_file) + with open(os.path.join(prop_file), "r") as propfile: prop_content = propfile.read() for key in apply_props: if key not in prop_content: @@ -230,17 +246,31 @@ on property:ro.enable.native.bridge.exec=1 else: p = re.compile(r"^{key}=.*$".format(key=key), re.M) prop_content = re.sub(p, "{key}={value}".format(key=key, value=apply_props[key]), prop_content) - with open(os.path.join(sys_image_mount, "system", "build.prop"), "w") as propfile: + with open(os.path.join(prop_file), "w") as propfile: propfile.write(prop_content) + ###add This + ## Add entry to init.rc + #print("==> Adding entry to init.rc") + ## Check if init.rc is located in Android 11's path + #init_path = os.path.join(sys_image_mount, "system", "etc", "init", "hw", "init.rc") + #if not os.path.isfile(init_path): + # # init.rc not found, assuming it's located in the root folder (Android 10 and older) + # init_path = os.path.join(sys_image_mount, "init.rc") + #with open(init_path, "r") as initfile: + # initcontent = initfile.read() + # if init_rc_component not in initcontent: + # initcontent=initcontent+init_rc_component + #with open(init_path, "w") as initfile: + # initfile.write(initcontent) # Add entry to init.rc print("==> Adding entry to init.rc") # Check if init.rc is located in Android 11's path - init_path = os.path.join(sys_image_mount, "system", "etc", "init", "hw", "init.rc") + init_path = os.path.join(sys_image_mount, "system", "etc", "init", "houdini.rc") if not os.path.isfile(init_path): - # init.rc not found, assuming it's located in the root folder (Android 10 and older) - init_path = os.path.join(sys_image_mount, "init.rc") + os.makedirs(os.path.dirname(init_path), exist_ok=True) + f = open(init_path, "x") with open(init_path, "r") as initfile: initcontent = initfile.read() if init_rc_component not in initcontent: @@ -249,11 +279,11 @@ on property:ro.enable.native.bridge.exec=1 initfile.write(initcontent) # Unmount and exit - print("==> Unmounting .. ") - try: - subprocess.check_output(["umount", sys_image_mount], stderr=subprocess.STDOUT) - except subprocess.CalledProcessError as e: - print("==> Warning: umount failed.. {} ".format(str(e.output.decode()))) + ##print("==> Unmounting .. ") + ##try: + ## subprocess.check_output(["umount", sys_image_mount], stderr=subprocess.STDOUT) + ##except subprocess.CalledProcessError as e: + ## print("==> Warning: umount failed.. {} ".format(str(e.output.decode()))) print("==> libndk translation installed ! Restart waydroid service to apply changes !")