From 212135d3c8838c1d0498e13257354b58428be6d6 Mon Sep 17 00:00:00 2001 From: axolotlek Date: Tue, 25 Jul 2023 13:59:51 +0300 Subject: [PATCH 01/11] fixed mistakes in readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c65f064..e7f539d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Waydroid Extras Script -Script to add gapps and other stuff to waydroid ! +Script to add gapps and other stuff to waydroid! # Installation/Usage @@ -8,8 +8,8 @@ Script to add gapps and other stuff to waydroid ! ``` git clone https://github.com/casualsnek/waydroid_script cd waydroid_script -sudo python3 -m pip install -r -sudo python main.py +sudo python3 -m pip install -r requirements.txt +sudo python3 main.py ``` ![image-20230430013103883](assets/img/README/image-20230430013103883.png) @@ -30,9 +30,9 @@ sudo python main.py # uninstall something sudo python3 main.py uninstall {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg} # get Android device ID - sudo python main.py certified + sudo python3 main.py certified # some hacks - sudo python3 hack {nodataperm, hidestatusbar} + sudo python3 main.py hack {nodataperm, hidestatusbar} ## Dependencies From 098036cca95f6740d47e1f96a2b47e54766226ed Mon Sep 17 00:00:00 2001 From: axolotlek Date: Tue, 25 Jul 2023 14:46:43 +0300 Subject: [PATCH 02/11] fixed mistakes in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7f539d..83351b4 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ sudo python3 main.py hack hidestatusbar You need to register you device with its it before being able to use gapps, this will print out your Android ID which you can use for device registration required for google apps: Open terminal and switch to directory where "main.py" is located then run: - sudo python3 main.py google + sudo python3 main.py certified Star this repository if you find this useful, if you encounter problem create a issue on github ! From 9c2d8fcd837f3599d4139e85186350b05ef50c02 Mon Sep 17 00:00:00 2001 From: SUFandom <70519093+SUFandom@users.noreply.github.com> Date: Tue, 25 Jul 2023 20:09:05 +0800 Subject: [PATCH 03/11] [URGENT] Update nodataperm.py Change the MD5Sum Because trying it spams error because its invalid Suggestion: Just add the main.zip to the Releases tag and let The script grab the 'stable' version there an just change it alongside with the python script library for update to not add issues --- stuff/nodataperm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stuff/nodataperm.py b/stuff/nodataperm.py index f0e4e99..964271b 100644 --- a/stuff/nodataperm.py +++ b/stuff/nodataperm.py @@ -10,7 +10,7 @@ class Nodataperm(General): id = "nodataperm" dl_links = { "11": ["https://github.com/ayasa520/hack_full_data_permission/archive/refs/heads/main.zip", - "eafd7b0986f3edaebaf1dd89f19d49bf"], + "8f067ef796c3f6849f9767a85496156f"], "13": ["", ""] } dl_file_name = "nodataperm.zip" From 337d066eeb3e04428d30d6e4fc17de7f2c6488fe Mon Sep 17 00:00:00 2001 From: ayasa520 <55699692+ayasa520@users.noreply.github.com> Date: Thu, 1 Jun 2023 15:39:14 +0800 Subject: [PATCH 04/11] fix(microg): typos --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 67c26ae..26689e7 100755 --- a/main.py +++ b/main.py @@ -235,7 +235,7 @@ def interact(): ).execute() microg_variants = ["Standard", "NoGoolag", "UNLP", "Minimal", "MinimalIAP"] - if "MicroG" in apps: + if "microg" in apps: microg_variant = inquirer.select( message="Select MicroG variant", choices=microg_variants, From e1ee7f0b0c7307683e77bb463426c499c7cf7c4f Mon Sep 17 00:00:00 2001 From: Rikka Date: Sat, 24 Jun 2023 21:01:55 +0800 Subject: [PATCH 05/11] Fix capitalization of MicroG and update nodataperm --- main.py | 2 +- stuff/nodataperm.py | 52 ++++++++++++++++++++++++++++++--------------- tools/helper.py | 13 ++++++++++++ 3 files changed, 49 insertions(+), 18 deletions(-) diff --git a/main.py b/main.py index 26689e7..79889fe 100755 --- a/main.py +++ b/main.py @@ -82,7 +82,7 @@ def install_app(args): if "smartdock" in app: install_list.append(Smartdock()) if "microg" in app: - install_list.append(MicroG(args.android_version)) + install_list.append(MicroG(args.android_version, args.microg_variant)) if not container.use_overlayfs(): copy_dir = "/tmp/waydroid" diff --git a/stuff/nodataperm.py b/stuff/nodataperm.py index 964271b..4f140db 100644 --- a/stuff/nodataperm.py +++ b/stuff/nodataperm.py @@ -1,7 +1,8 @@ -import gzip import os +import re import shutil from stuff.general import General +from tools.helper import backup, restore from tools.logger import Logger from tools import container @@ -9,9 +10,14 @@ from tools import container class Nodataperm(General): id = "nodataperm" dl_links = { - "11": ["https://github.com/ayasa520/hack_full_data_permission/archive/refs/heads/main.zip", - "8f067ef796c3f6849f9767a85496156f"], - "13": ["", ""] + "11": + { + "x86_64": [ + "https://github.com/ayasa520/hack_full_data_permission/archive/d4beab7780eb792059d33e77d865579c9ee41546.zip", + "b0e3908ffcf5df8ea62f4929aa680f1a" + ], + }, + "13": {} } dl_file_name = "nodataperm.zip" extract_to = "/tmp/nodataperm" @@ -21,25 +27,34 @@ class Nodataperm(General): files = [ "etc/nodataperm.sh", "etc/init/nodataperm.rc", - "framework/services.jar" + "framework/services.jar", + "framework/services.jar.prof", + "framework/services.jar.bprof", ] def __init__(self, android_version="11") -> None: super().__init__() - self.dl_link = self.dl_links[android_version][0] - self.act_md5 = self.dl_links[android_version][1] + print("ok") + arch = self.arch[0] + self.dl_link = self.dl_links[android_version][arch][0] + self.act_md5 = self.dl_links[android_version][arch][1] def copy(self): + name = re.findall("([a-zA-Z0-9]+)\.zip", self.dl_link)[0] extract_path = os.path.join( - self.extract_to, "hack_full_data_permission-main") + self.extract_to, f"hack_full_data_permission-{name}") if not container.use_overlayfs(): services_jar = os.path.join( self.copy_dir, self.partition, "framework", "services.jar") - gz_filename = services_jar+".gz" - with gzip.open(gz_filename, 'wb') as f_gz: - with open(services_jar, "rb") as f: - f_gz.write(f.read()) - Logger.info("Copying widevine library files ...") + services_jar_prof = os.path.join( + self.copy_dir, self.partition, "framework", "services.jar.prof") + services_jar_bprof = os.path.join( + self.copy_dir, self.partition, "framework", "services.jar.bprof") + backup(services_jar) + backup(services_jar_prof) + backup(services_jar_bprof) + + Logger.info(f"Copying {self.id} library files ...") shutil.copytree(extract_path, os.path.join( self.copy_dir, self.partition), dirs_exist_ok=True) @@ -47,7 +62,10 @@ class Nodataperm(General): if not container.use_overlayfs(): services_jar = os.path.join( self.copy_dir, self.partition, "framework", "services.jar") - gz_filename = services_jar+".gz" - with gzip.GzipFile(gz_filename) as f_gz: - with open(services_jar, "wb") as f: - f.writelines(f_gz) + services_jar_prof = os.path.join( + self.copy_dir, self.partition, "framework", "services.jar.prof") + services_jar_bprof = os.path.join( + self.copy_dir, self.partition, "framework", "services.jar.bprof") + restore(services_jar) + restore(services_jar_prof) + restore(services_jar_bprof) diff --git a/tools/helper.py b/tools/helper.py index 6ef84cd..a4dd78b 100644 --- a/tools/helper.py +++ b/tools/helper.py @@ -1,3 +1,4 @@ +import gzip import os import re import platform @@ -131,3 +132,15 @@ def check_root(): if os.geteuid() != 0: Logger.error("This script must be run as root. Aborting.") sys.exit(1) + +def backup(path): + gz_filename = path+".gz" + with gzip.open(gz_filename, 'wb') as f_gz: + with open(path, "rb") as f: + f_gz.write(f.read()) + +def restore(path): + gz_filename = path+".gz" + with gzip.GzipFile(gz_filename) as f_gz: + with open(path, "wb") as f: + f.writelines(f_gz) From 3e51f7f56ee486196314d240722322a2f12f136c Mon Sep 17 00:00:00 2001 From: Rikka Date: Wed, 28 Jun 2023 02:28:47 +0800 Subject: [PATCH 06/11] update smartdock link --- stuff/smartdock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stuff/smartdock.py b/stuff/smartdock.py index 2741e07..5b2e8ae 100644 --- a/stuff/smartdock.py +++ b/stuff/smartdock.py @@ -4,10 +4,10 @@ from stuff.general import General class Smartdock(General): id = "smartdock" - dl_link = "https://f-droid.org/repo/cu.axel.smartdock_198.apk" + dl_link = "https://f-droid.org/repo/cu.axel.smartdock_1100.apk" partition = "system" dl_file_name = "smartdock.apk" - act_md5 = "a8ce0bca5e1772796404602e0fa250a4" + act_md5 = "f4087d34218eac902a5cca98ee03d215" apply_props = { "qemu.hw.mainkeys" : "1" } skip_extract = True permissions = """ From a80ff8e855dc63a16fe0f8ca2757333b60d83afd Mon Sep 17 00:00:00 2001 From: Rikka Date: Sun, 2 Jul 2023 01:50:19 +0800 Subject: [PATCH 07/11] update hidestatusbar link --- stuff/hidestatusbar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stuff/hidestatusbar.py b/stuff/hidestatusbar.py index 41a4483..1953cd3 100644 --- a/stuff/hidestatusbar.py +++ b/stuff/hidestatusbar.py @@ -5,8 +5,8 @@ from stuff.general import General class HideStatusBar(General): id = "hide status bar" - dl_links = {"11": ["https://github.com/ayasa520/hide-status-bar/releases/download/v0.0.1/app-release.apk", - "ae6c4cc567d6f3de77068e54e43818e2"]} + dl_links = {"11": ["https://github.com/ayasa520/hide-status-bar/releases/download/v0.0.2/app-release.apk", + "ff2fe63ddfb4b035e6720a1b195b2355"]} partition = "system" dl_file_name = "hidestatusbar.apk" dl_link = ... From 6d5af57ebceb70479697e994ac1da0737474bf74 Mon Sep 17 00:00:00 2001 From: Rikka Date: Sun, 2 Jul 2023 11:41:04 +0800 Subject: [PATCH 08/11] fix: Fix simlink path issue https://github.com/casualsnek/waydroid_script/issues/101 Relative path fails when using symlink. Replace it with absolute path. --- stuff/general.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stuff/general.py b/stuff/general.py index f377e0b..3dc0962 100644 --- a/stuff/general.py +++ b/stuff/general.py @@ -73,8 +73,8 @@ class General: if not os.path.isfile(os.path.join(bin_dir, "resetprop")): if not os.path.exists(bin_dir): os.makedirs(bin_dir) - shutil.copy(os.path.join( - "./bin", self.arch[0], "resetprop"), bin_dir) + shutil.copy(os.path.join(os.path.join(os.path.dirname(__file__), "..", "bin", + self.arch[0], "resetprop")), bin_dir) os.chmod(os.path.join(bin_dir, "resetprop"), 0o755) if not os.path.isfile(os.path.join(bin_dir, "resetprop.sh")): with open(os.path.join(bin_dir, "resetprop.sh"), "w") as f: From 854b4b0a6cb68a42939146caa426592507974bf1 Mon Sep 17 00:00:00 2001 From: Rikka Date: Thu, 24 Aug 2023 21:15:56 +0800 Subject: [PATCH 09/11] Use venv to avoid breaking Python installation or OS --- README.md | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 83351b4..d07a7ad 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,9 @@ Script to add gapps and other stuff to waydroid! ``` git clone https://github.com/casualsnek/waydroid_script cd waydroid_script -sudo python3 -m pip install -r requirements.txt -sudo python3 main.py +python3 -m venv venv +venv/bin/pip install -r requirements.txt +sudo venv/bin/python3 main.py ``` ![image-20230430013103883](assets/img/README/image-20230430013103883.png) @@ -24,15 +25,16 @@ sudo python3 main.py git clone https://github.com/casualsnek/waydroid_script cd waydroid_script - sudo python3 -m pip install -r requirements.txt + python3 -m venv venv + venv/bin/pip install -r requirements.txt # install something - sudo python3 main.py install {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg} + sudo venv/bin/python3 main.py install {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg} # uninstall something - sudo python3 main.py uninstall {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg} + sudo venv/bin/python3 main.py uninstall {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg} # get Android device ID - sudo python3 main.py certified + sudo venv/bin/python3 main.py certified # some hacks - sudo python3 main.py hack {nodataperm, hidestatusbar} + sudo venv/bin/python3 main.py hack {nodataperm, hidestatusbar} ## Dependencies @@ -52,7 +54,7 @@ sudo python3 main.py Open terminal and switch to directory where "main.py" is located then run: - sudo python3 main.py install gapps + sudo venv/bin/python3 main.py install gapps Then launch waydroid with: @@ -60,7 +62,7 @@ Then launch waydroid with: After waydroid has finished booting open terminal and switch to directory where "main.py" is located then run: - sudo python3 main.py google + sudo venv/bin/python3 main.py certified Copy the returned numeric ID open ["https://google.com/android/uncertified/?pli=1"](https://google.com/android/uncertified/?pli=1) enter the id and register it, you may need to wait upto 10-20 minutes for device to get registered, then clear Google Play Service's cache and try logging in ! ## Install Magisk @@ -69,7 +71,7 @@ Copy the returned numeric ID open ["https://google.com/android/uncertified/?pli= Open terminal and switch to directory where "main.py" is located then run: - sudo python3 main.py install magisk + sudo venv/bin/python3 main.py install magisk Magisk will be installed on next boot ! @@ -87,7 +89,7 @@ libndk seems to have better performance than libhoudini on AMD. Open terminal and switch to directory where "main.py" is located then run: - sudo python3 main.py install libndk + sudo venv/bin/python3 main.py install libndk ## Install libhoudini arm translation @@ -99,7 +101,7 @@ houdini64 version: 11.0.1b_z.38765.m Open terminal and switch to directory where "main.py" is located then run: - sudo python3 main.py install libhoudini + sudo venv/bin/python3 main.py install libhoudini ## Integrate Widevine DRM (L3) @@ -107,7 +109,7 @@ Open terminal and switch to directory where "main.py" is located then run: Open terminal and switch to directory where "main.py" is located then run: - sudo python3 main.py install widevine + sudo venv/bin/python3 main.py install widevine ## Install Smart Dock @@ -116,7 +118,7 @@ Open terminal and switch to directory where "main.py" is located then run: Open terminal and switch to directory where "main.py" is located then run: - sudo python3 main.py install smartdock + sudo venv/bin/python3 main.py install smartdock ## Granting full permission for apps data (HACK) @@ -130,9 +132,9 @@ Arknights, PUNISHING: GRAY RAVEN and other games won't freeze on the black scree Open terminal and switch to directory where "main.py" is located then run: ``` -sudo python3 main.py hack nodataperm +sudo venv/bin/python3 main.py hack nodataperm ``` -**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. +**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 venv/bin/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. @@ -165,7 +167,7 @@ After ![After](assets/9.png) ``` -sudo python3 main.py hack hidestatusbar +sudo venv/bin/python3 main.py hack hidestatusbar ``` @@ -174,7 +176,7 @@ sudo python3 main.py hack hidestatusbar You need to register you device with its it before being able to use gapps, this will print out your Android ID which you can use for device registration required for google apps: Open terminal and switch to directory where "main.py" is located then run: - sudo python3 main.py certified + sudo venv/bin/python3 main.py certified Star this repository if you find this useful, if you encounter problem create a issue on github ! From 821c7c0bc25424e8bdec3416d9eef126f3cc1738 Mon Sep 17 00:00:00 2001 From: Rikka Date: Thu, 24 Aug 2023 21:19:00 +0800 Subject: [PATCH 10/11] Update prompt --- stuff/android_id.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stuff/android_id.py b/stuff/android_id.py index 75acbb1..db3c1d8 100644 --- a/stuff/android_id.py +++ b/stuff/android_id.py @@ -14,7 +14,7 @@ class AndroidId: except: return else: - Logger.error("WayDroid isn't running !") + Logger.error("Please make sure Waydroid is running and Gapps has been installed!") return print(queryout.replace("android_id|", "").strip()) print(" ^----- Open https://google.com/android/uncertified/?pli=1") From 367697d59e39b266120948d1d0e634401e11d1bd Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Sun, 17 Sep 2023 02:26:48 +0200 Subject: [PATCH 11/11] Add `bash` syntax highlighting to `README.md` --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d07a7ad..9d586de 100644 --- a/README.md +++ b/README.md @@ -23,18 +23,20 @@ sudo venv/bin/python3 main.py ## Command Line - git clone https://github.com/casualsnek/waydroid_script - cd waydroid_script - python3 -m venv venv - venv/bin/pip install -r requirements.txt - # install something - sudo venv/bin/python3 main.py install {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg} - # uninstall something - sudo venv/bin/python3 main.py uninstall {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg} - # get Android device ID - sudo venv/bin/python3 main.py certified - # some hacks - sudo venv/bin/python3 main.py hack {nodataperm, hidestatusbar} +```bash +git clone https://github.com/casualsnek/waydroid_script +cd waydroid_script +python3 -m venv venv +venv/bin/pip install -r requirements.txt +# install something +sudo venv/bin/python3 main.py install {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg} +# uninstall something +sudo venv/bin/python3 main.py uninstall {gapps, magisk, libndk, libhoudini, nodataperm, smartdock, microg} +# get Android device ID +sudo venv/bin/python3 main.py certified +# some hacks +sudo venv/bin/python3 main.py hack {nodataperm, hidestatusbar} +``` ## Dependencies