├── .gitignore ├── LICENCE ├── riru-wsa.patch ├── README.md └── magisk-wsa.patch /.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | src 3 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. -------------------------------------------------------------------------------- /riru-wsa.patch: -------------------------------------------------------------------------------- 1 | diff --git a/rirud/src/main/java/riru/Daemon.java b/rirud/src/main/java/riru/Daemon.java 2 | index 02f7584..2c4bf72 100644 3 | --- a/rirud/src/main/java/riru/Daemon.java 4 | +++ b/rirud/src/main/java/riru/Daemon.java 5 | @@ -68,12 +68,12 @@ public class Daemon implements IBinder.DeathRecipient { 6 | allowRestart = false; 7 | handler.post(() -> { 8 | Log.w(TAG, "Restarting zygote..."); 9 | - if (DaemonUtils.has64Bit() && DaemonUtils.has32Bit()) { 10 | +/* if (DaemonUtils.has64Bit() && DaemonUtils.has32Bit()) { 11 | // Only devices with both 32-bit and 64-bit support have zygote_secondary 12 | SystemProperties.set("ctl.restart", "zygote_secondary"); 13 | } else { 14 | SystemProperties.set("ctl.restart", "zygote"); 15 | - } 16 | + } */ 17 | }); 18 | return; 19 | } else { 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Magisk On WSA 2 | 3 | __DEPRECATED__: Use LSPosed's version instead: https://github.com/LSPosed/MagiskOnWSALocal 4 | 5 | ## What is this? 6 | 7 | A script to compile Magisk and Riru module for using LSPosed on WSA 8 | 9 | ## How to Use? 10 | 11 | Install requirements listed in script, prepare a good network connection and enough space, then run `bash build.sh` and follow the script output to deploy it to Windows. 12 | 13 | ## What will have in the final artifacts? 14 | 15 | - A modified WSA Develop Package 16 | - Deploy PowerShell Script 17 | - Modified Riru Magisk module for WSA 18 | 19 | ## Why create this script? 20 | 21 | The original plan to use Magisk on WSA is from [LSPosed](https://github.com/LSPosed/MagiskOnWSA), I just do all the thing in a shell script. 22 | 23 | ## About localized WSA Setting App 24 | 25 | ~~At [here](https://github.com/LSPosed/MagiskOnWSA/issues/61) you can find a way to merge localization content into side-load folder, but this requires Windows environment so it is hard to operate on Linux.~~ 26 | Now we are doing the same as LSPosed, we are using wine/wine64 to merge localized contents if we detected that you have installed wine/wine64. Only wine64 is needed but we think you may need to install whole wine on most Distributions. Thanks LSPosed again for what they have done for using Magisk on WSA. 27 | -------------------------------------------------------------------------------- /magisk-wsa.patch: -------------------------------------------------------------------------------- 1 | diff --git a/build.py b/build.py 2 | index 4cf96de..ad38037 100755 3 | --- a/build.py 4 | +++ b/build.py 5 | @@ -408,9 +408,10 @@ def setup_ndk(args): 6 | url = f'https://dl.google.com/android/repository/android-ndk-r{ndk_ver}-{os_name}.zip' 7 | ndk_zip = url.split('/')[-1] 8 | 9 | - header(f'* Downloading {ndk_zip}') 10 | - with urllib.request.urlopen(url) as response, open(ndk_zip, 'wb') as out_file: 11 | - shutil.copyfileobj(response, out_file) 12 | + if not os.path.exists(ndk_zip): 13 | + header(f'* Downloading {ndk_zip} with URL {url}') 14 | + with urllib.request.urlopen(url) as response, open(ndk_zip, 'wb') as out_file: 15 | + shutil.copyfileobj(response, out_file) 16 | 17 | header('* Extracting NDK zip') 18 | rm_rf(ndk_path) 19 | @@ -449,17 +450,17 @@ def setup_avd(args): 20 | build_binary(args) 21 | build_app(args) 22 | 23 | - header('* Setting up emulator') 24 | + # header('* Setting up emulator') 25 | 26 | - abi = cmd_out([adb_path, 'shell', 'getprop', 'ro.product.cpu.abi']) 27 | - proc = execv([adb_path, 'push', f'native/out/{abi}/busybox', 'out/app-debug.apk', 28 | - 'scripts/avd_magisk.sh', '/data/local/tmp']) 29 | - if proc.returncode != 0: 30 | - error('adb push failed!') 31 | + # abi = cmd_out([adb_path, 'shell', 'getprop', 'ro.product.cpu.abi']) 32 | + # proc = execv([adb_path, 'push', f'native/out/{abi}/busybox', 'out/app-debug.apk', 33 | + # 'scripts/avd_magisk.sh', '/data/local/tmp']) 34 | + # if proc.returncode != 0: 35 | + # error('adb push failed!') 36 | 37 | - proc = execv([adb_path, 'shell', 'sh', '/data/local/tmp/avd_magisk.sh']) 38 | - if proc.returncode != 0: 39 | - error('avd_magisk.sh failed!') 40 | + # proc = execv([adb_path, 'shell', 'sh', '/data/local/tmp/avd_magisk.sh']) 41 | + # if proc.returncode != 0: 42 | + # error('avd_magisk.sh failed!') 43 | 44 | 45 | def patch_avd_ramdisk(args): 46 | --------------------------------------------------------------------------------