diff --git a/README.md b/README.md index 1f7cf67..fef690e 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,36 @@ Open terminal and switch to directory where "main.py" is located then run: sudo python3 main.py install smartdock +## Granting full permission for apps data (HACK) + + +This is a temporary hack to combat against the apps permission issue on Android 11. Whenever an app is open it will always enable a property (persist.sys.nodataperm) to make it execute a script to grant the data full permissions (777). The **correct** way is to use `sdcardfs` or `esdfs`, both need to recompile the kernel or WayDroid image. + +Arknights, PUNISHING: GRAY RAVEN and other games won't freeze on the black screen. + +![](assets/6.png) + +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. + + +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. + +``` +chmod 777 -R /sdcard/Android +chmod 777 -R /data/media/0/Android +chmod 777 -R /sdcard/Android/data +chmod 777 -R /data/media/0/Android/obb +chmod 777 -R /mnt/*/*/*/*/Android/data +chmod 777 -R /mnt/*/*/*/*/Android/obb +``` + +- https://github.com/supremegamers/device_generic_common/commit/2d47891376c96011b2ee3c1ccef61cb48e15aed6 +- https://github.com/supremegamers/android_frameworks_base/commit/24a08bf800b2e461356a9d67d04572bb10b0e819 ## Get Android ID for device registration diff --git a/assets/6.png b/assets/6.png new file mode 100644 index 0000000..c32dc92 Binary files /dev/null and b/assets/6.png differ diff --git a/main.py b/main.py index 0b01148..4fef3d7 100755 --- a/main.py +++ b/main.py @@ -7,6 +7,7 @@ from stuffs.gapps import Gapps from stuffs.houdini import Houdini from stuffs.magisk import Magisk from stuffs.ndk import Ndk +from stuffs.nodataperm import Nodataperm from stuffs.smartdock import Smartdock from stuffs.widevine import Widevine import tools.helper as helper @@ -29,8 +30,10 @@ def install(*args): Magisk().install() if "widevine" in args: Widevine().install() - if "smartdock" in args : + if "smartdock" in args: Smartdock().install() + if "nodataperm" in args: + Nodataperm().install() def uninstall(*args): pass @@ -57,7 +60,7 @@ def main(): "dest": "app", "type": str, "nargs": '+', - "choices": ["gapps", "libndk","libhoudini","magisk", "smartdock","widevine"], + "choices": ["gapps", "libndk","libhoudini","magisk", "smartdock","widevine", "nodataperm"], } install_parser = subparsers.add_parser("install", help='install something') diff --git a/stuffs/general.py b/stuffs/general.py index 5de2895..244b5c5 100644 --- a/stuffs/general.py +++ b/stuffs/general.py @@ -103,12 +103,6 @@ class General: def extra2(self): pass - # def install(self): - # if DBusContainerService().GetSession(): - # print("running") - # else: - # print("stopped") - # run("waydroid session start".split()) def install(self): if container.use_overlayfs(): self.download() diff --git a/stuffs/magisk.py b/stuffs/magisk.py index 3750342..78735ae 100644 --- a/stuffs/magisk.py +++ b/stuffs/magisk.py @@ -5,6 +5,7 @@ import re from stuffs.general import General from tools.helper import download_file, host, run from tools.logger import Logger +from tools import container class Magisk(General): partition = "system" diff --git a/stuffs/nodataperm.py b/stuffs/nodataperm.py new file mode 100644 index 0000000..87ed01b --- /dev/null +++ b/stuffs/nodataperm.py @@ -0,0 +1,20 @@ +import os +import shutil +from stuffs.general import General +from tools.helper import run +from tools.logger import Logger + +class Nodataperm(General): + dl_link = "https://github.com/ayasa520/hack_full_data_permission/archive/refs/heads/main.zip" + dl_file_name = "nodataperm.zip" + extract_to = "/tmp/nodataperm" + act_md5 = "eafd7b0986f3edaebaf1dd89f19d49bf" + partition = "system" + + def copy(self): + extract_path = os.path.join(self.extract_to, "hack_full_data_permission-main") + os.chmod(os.path.join(extract_path, "framework", "services.jar"), 0o644) + os.chmod(os.path.join(extract_path, "etc", "nodataperm.sh"), 0o755) + os.chmod(os.path.join(extract_path, "etc", "init", "nodataperm.rc"), 0o755) + Logger.info("Copying widevine library files ...") + shutil.copytree(extract_path, os.path.join(self.copy_dir, self.partition), dirs_exist_ok=True)