LSPosed / MagiskOnWSALocal

Integrate Magisk root and Google Apps into WSA (Windows Subsystem for Android)
GNU Affero General Public License v3.0
9.6k stars 23.13k forks source link

Some Errors #2

Closed D4rkov closed 2 years ago

D4rkov commented 2 years ago

Should I rerun the run.sh, what's wrong?

[sudo] password for darkov:
Remove Amazon AppStore
Integrate Magisk
#!/system/bin/sh
mkdir -p /data/adb/magisk
cp /sbin/* /data/adb/magisk/
chmod -R 755 /data/adb/magisk
restorecon -R /data/adb/magisk
for module in $(ls /data/adb/modules); do
    if ! [ -f "/data/adb/modules/$module/disable" ] && [ -f "/data/adb/modules/$module/sepolicy.rule" ]; then
        /sbin/magiskpolicy --live --apply "/data/adb/modules/$module/sepolicy.rule"
    fi
done
sudo: patchelf: command not found
sudo: patchelf: command not found
sudo: patchelf: command not found
sudo: patchelf: command not found
/dev/wsa-magisk(/.*)?    u:object_r:magisk_file:s0
/data/adb/magisk(/.*)?   u:object_r:magisk_file:s0
sudo: unable to execute ../workdir/magisk/magiskpolicy: No such file or directory
on post-fs-data
    start logd
    start adbd
    mkdir /dev/wsa-magisk
    mount tmpfs tmpfs /dev/wsa-magisk mode=0755
    copy /sbin/magisk64 /dev/wsa-magisk/magisk64
    chmod 0755 /dev/wsa-magisk/magisk64
    symlink ./magisk64 /dev/wsa-magisk/magisk
    symlink ./magisk64 /dev/wsa-magisk/su
    symlink ./magisk64 /dev/wsa-magisk/resetprop
    copy /sbin/magisk32 /dev/wsa-magisk/magisk32
    chmod 0755 /dev/wsa-magisk/magisk32
    copy /sbin/magiskinit /dev/wsa-magisk/magiskinit
    chmod 0755 /dev/wsa-magisk/magiskinit
    copy /sbin/magiskpolicy /dev/wsa-magisk/magiskpolicy
    chmod 0755 /dev/wsa-magisk/magiskpolicy
    mkdir /dev/wsa-magisk/.magisk 700
    mkdir /dev/wsa-magisk/.magisk/mirror 700
    mkdir /dev/wsa-magisk/.magisk/block 700
    copy /sbin/magisk.apk /dev/wsa-magisk/stub.apk
    rm /dev/.magisk_unblock
    start IhhslLhHYfse
    start FAhW7H9G5sf
    wait /dev/.magisk_unblock 40
    rm /dev/.magisk_unblock

service IhhslLhHYfse /system/bin/sh /sbin/loadpolicy.sh
    user root
    seclabel u:r:magisk:s0
    oneshot

service FAhW7H9G5sf /dev/wsa-magisk/magisk --post-fs-data
    user root
    seclabel u:r:magisk:s0
    oneshot

service HLiFsR1HtIXVN6 /dev/wsa-magisk/magisk --service
    class late_start
    user root
    seclabel u:r:magisk:s0
    oneshot

on property:sys.boot_completed=1
    mkdir /data/adb/magisk 755
    copy /sbin/magisk.apk /data/adb/magisk/magisk.apk
    start YqCTLTppv3ML

service YqCTLTppv3ML /dev/wsa-magisk/magisk --boot-complete
    user root
    seclabel u:r:magisk:s0
    oneshot
Merge Language Resources
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources targetOsVersion="10.0.0" majorVersion="1">
<index root="\" startIndexAt="\">
    <indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true" qualifierDelimiter="."/>
    <indexer-config type="PRI"/>
</index>
</resources>
run.sh: line 280: wine64: command not found
Add extra packages
chcon: failed to change context of '../workdir/system/system/priv-app/BuiltInPrintService/lib/x86_64/libwfds.so' to ‘u:object_r:system_file:s0’: No such file or directory
chcon: failed to change context of '../workdir/system/system/priv-app/BuiltInPrintService/lib/x86_64/libcups.so' to ‘u:object_r:system_file:s0’: No such file or directory
Integrate GApps
'../workdir/gapps/product/overlay/GoogleWebViewOverlay.apk' -> '../workdir/system/product/overlay/GoogleWebViewOverlay.apk'
rm: cannot remove '../workdir/gapps/product/overlay/GoogleWebViewOverlay.apk': Permission denied
'../workdir/gapps/priv-app/SetupWizard' -> '../workdir/system/system/priv-app/SetupWizard'
'../workdir/gapps/priv-app/SetupWizard/SetupWizard.apk' -> '../workdir/system/system/priv-app/SetupWizard/SetupWizard.apk'
cp: cannot overwrite non-directory '../workdir/system/system/product' with directory '../workdir/gapps/product'
chown: cannot dereference '../workdir/system/system/app/PrintSpooler/lib/x86_64/libprintspooler_jni.so': No such file or directory
chown: cannot dereference '../workdir/system/system/app/Bluetooth/lib/x86_64/libbluetooth_jni.so': No such file or directory
chown: cannot dereference '../workdir/system/system/priv-app/BuiltInPrintService/lib/x86_64/libwfds.so': No such file or directory
chown: cannot dereference '../workdir/system/system/priv-app/BuiltInPrintService/lib/x86_64/libcups.so': No such file or directory
chown: cannot dereference '../workdir/system/product/app/Camera2/lib/x86_64/libjni_jpegutil.so': No such file or directory
chown: cannot dereference '../workdir/system/product/app/Camera2/lib/x86_64/libjni_tinyplanet.so': No such file or directory
chown: cannot dereference '../workdir/system/product/app/Gallery2/lib/x86_64/libjni_jpegstream.so': No such file or directory
chown: cannot dereference '../workdir/system/product/app/Gallery2/lib/x86_64/libjni_filtershow_filters.so': No such file or directory
chown: cannot dereference '../workdir/system/product/app/Gallery2/lib/x86_64/libjni_eglfence.so': No such file or directory
find: ‘../workdir/system/product/lib’: No such file or directory
find: ‘../workdir/system/product/lib’: No such file or directory
find: ‘../workdir/system/product/lib’: No such file or directory
find: ‘../workdir/system/product/lib’: No such file or directory
find: ‘../workdir/system/product/lib’: No such file or directory
ls: cannot access '../workdir/gapps/etc/': No such file or directory
ls: cannot access '../workdir/gapps/etc/': No such file or directory
ls: cannot access '../workdir/gapps/etc/': No such file or directory
sudo: patchelf: command not found
sudo: patchelf: command not found
sudo: patchelf: command not found
sudo: patchelf: command not found
sudo: unable to execute ../workdir/magisk/magiskpolicy: No such file or directory
Fix GApps prop
fixing ../workdir/system/system/build.prop
fixing ../workdir/system/vendor/build.prop
fixing ../workdir/system/vendor/odm/etc/build.prop
Umount images
Shrink images
e2fsck 1.45.5 (07-Jan-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/: 2697/3072 files (0.5% non-contiguous), 216870/237259 blocks
resize2fs 1.45.5 (07-Jan-2020)
Resizing the filesystem on ../workdir/wsa/x64/system.img to 229469 (4k) blocks.
The filesystem on ../workdir/wsa/x64/system.img is now 229469 (4k) blocks long.

e2fsck 1.45.5 (07-Jan-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
vendor: 1349/1392 files (0.9% non-contiguous), 89241/93637 blocks
resize2fs 1.45.5 (07-Jan-2020)
Resizing the filesystem on ../workdir/wsa/x64/vendor.img to 89249 (4k) blocks.
The filesystem on ../workdir/wsa/x64/vendor.img is now 89249 (4k) blocks long.

e2fsck 1.45.5 (07-Jan-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
product: 144/192 files (0.0% non-contiguous), 73014/84421 blocks
resize2fs 1.45.5 (07-Jan-2020)
Resizing the filesystem on ../workdir/wsa/x64/product.img to 73036 (4k) blocks.
The filesystem on ../workdir/wsa/x64/product.img is now 73036 (4k) blocks long.

e2fsck 1.45.5 (07-Jan-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
system_ext: 83/96 files (1.2% non-contiguous), 33709/37316 blocks
resize2fs 1.45.5 (07-Jan-2020)
Resizing the filesystem on ../workdir/wsa/x64/system_ext.img to 33716 (4k) blocks.
The filesystem on ../workdir/wsa/x64/system_ext.img is now 33716 (4k) blocks long.

Remove signature and add scripts
# Automated Install script by Mioki
# http://github.com/okibcn
function Test-Administrator {
    [OutputType([bool])]
    param()
    process {
        [Security.Principal.WindowsPrincipal]$user = [Security.Principal.WindowsIdentity]::GetCurrent();
        return $user.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator);
    }
}

function Finish {
    Clear-Host
    Start-Process "wsa://com.topjohnwu.magisk"
    Start-Process "wsa://com.android.vending"
}

if (-not (Test-Administrator)) {
    Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force
    $proc = Start-Process -PassThru -WindowStyle Hidden -Verb RunAs powershell.exe -Args "-executionpolicy bypass -command Set-Location '$PSScriptRoot'; &'$PSCommandPath' EVAL"
    $proc.WaitForExit()
    if ($proc.ExitCode -ne 0) {
        Clear-Host
        Write-Warning "Failed to launch start as Administrator`r`nPress any key to exit"
        $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
    }
    exit
}
elseif (($args.Count -eq 1) -and ($args[0] -eq "EVAL")) {
    Start-Process powershell.exe -Args "-executionpolicy bypass -command Set-Location '$PSScriptRoot'; &'$PSCommandPath'"
    exit
}

if (((Test-Path -Path "AppxManifest.xml","Assets","CustomInstall","Fonts","GSKServer","Images","Licenses","Microsoft.UI.Xaml.winmd","Registry.dat","Styles","Tools","WSACodecs.dll","WSACrashUploader","WsaClient","WsaProxy","WsaService","WsaSettings.exe","WsaSettings.winmd","WsaSettingsBroker","appcompatdb.json","classicAppInstaller_WSA.sccd","gfxstream_backend.dll","libEGL.dll","libGLESv2.dll","lxutil.dll","metadata.vhdx","product.img","resources.pri","system.img","system_ext.img","userdata.vhdx","vclibs.appx","vendor.img","wslcore.dll","wsldeps.dll","wsldevicehost.dll","wslhost.exe","xaml.appx") -eq $false).Count) {
    Write-Error "Some files are missing in the zip. Please try to download it again from the browser downloader, or try to run the workflow again. Press any key to exist"
    $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
    exit 1
}

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"

$VMP = Get-WindowsOptionalFeature -Online -FeatureName 'VirtualMachinePlatform'
if ($VMP.State -ne "Enabled") {
    Enable-WindowsOptionalFeature -Online -NoRestart -FeatureName 'VirtualMachinePlatform'
    Clear-Host
    Write-Warning "Need restart to enable virtual machine platform`r`nPress y to restart or press any key to exit"
    $key = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
    If ("y" -eq $key.Character) {
        Restart-Computer -Confirm
    }
    Else {
        exit 1
    }
}

Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Path vclibs.appx
Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Path xaml.appx

$Installed = $null
$Installed = Get-AppxPackage -Name 'MicrosoftCorporationII.WindowsSubsystemForAndroid'

If (($null -ne $Installed) -and (-not ($Installed.IsDevelopmentMode))) {
    Clear-Host
    Write-Warning "There is already one installed WSA. Please uninstall it first.`r`nPress y to uninstall existing WSA or press any key to exit"
    $key = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
    If ("y" -eq $key.Character) {
        Remove-AppxPackage -Package $Installed.PackageFullName
    }
    Else {
        exit 1
    }
}
Clear-Host
Write-Host "Installing MagiskOnWSA..."
Stop-Process -Name "wsaclient" -ErrorAction "silentlycontinue"
Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Register .\AppxManifest.xml
if ($?) {
    Finish
}
Elseif ($null -ne $Installed) {
    Clear-Host
    Write-Host "Failed to update, try to uninstall existing installation while preserving userdata..."
    Remove-AppxPackage -PreserveApplicationData -Package $Installed.PackageFullName
    Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Register .\AppxManifest.xml
    if ($?) {
        Finish
    }
}
Write-Host "All Done`r`nPress any key to exit"
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
Generate info
WSA-with-magisk-GApps-pico_x64
WSA_VER=2205.40000.21.0
WSA_MAIN_VER=2205
WSA_REL=Release-Nightly
rm: cannot remove '../workdir/gapps/product/overlay/GoogleWebViewOverlay.apk': Permission denied
rm: cannot remove '../workdir/gapps/priv-app/SetupWizard/SetupWizard.apk': Permission denied
Howard20181 commented 2 years ago

What's your environment?

D4rkov commented 2 years ago

What's your environment?

I ran git clone and bash run.sh on WSL2 Ubuntu, The GUI worked fine, was able to choose arch, gapps and stuff. Downloads fine. After it got done downloading Magisk, that came.

Howard20181 commented 2 years ago

sudo: patchelf: command not found

apt install failed?

try sudo apt update && sudo apt -y install setools lzip wine winetricks patchelf whiptail e2fsprogs

What it say?

D4rkov commented 2 years ago

That worked!