LSPosed / MagiskOnWSALocal

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

[Bug] MakePri fails to generate resource files, resulting in installation failure #450

Closed MustardChef closed 1 year ago

MustardChef commented 1 year ago

Steps to reproduce/复现步骤

  1. Clone MagiskOnWSALocal repo and run the script using ./MagiskOnWSA/scripts/run.sh
  2. Select x64, WIF/Insider Fast, Yes to Root, Magisk, GApps Varient; Pico, MindTheGapps, Remove Amazon Appstore
  3. Copy the build from the WSL Network Drive/ WSL Distro storage to a location on the Windows drive
  4. Running "Run.bat" to install
  5. Error Shows

Expected behaviour/预期行为

WSA should install smoothly, without any issue like with the previously built builds

Actual behaviour/实际行为

Installing MagiskOnWSA.... WsaClient does not exist Deployment operation progress: C:\Users\MCDeltaT\Downloads\WSA_2302.40000.8.0_x64_Release-Nightly-with-magisk-981ccab Processing [o ] NamedResource Not Found. . Check that the string resource is defined and that there C:\Users\MCDeltaT\Downloads\WSA_2302.40000.8.0_x64_Release-Nightly-with-magisk-981ccabb(25210)-canary-MindTheGapps-13 .0-RemovedAmazon\AppxManifest.xml(79,27): error 0x80073B17: Cannot register the MicrosoftCorporationII.WindowsSubsystemForAndroid_2302.40000.8.0_x64__8wekyb3d8bbwe package because the following error was encountered while determining whether the ms-resource:WsaDisplayName string resource could be localized: NamedResource Not Found. . Check that the string resource is defined and that there is at least one instance defined in the resources.pri file contained in this package. NOTE: For additional information, look for [ActivityId] 903ba5dc-5ef4-0000-67f8-4e90f45ed901 in the Event Log or use the command line Get-AppPackageLog -ActivityID 903ba5dc-5ef4-0000-67f8-4e90f45ed901 At C:\Users\MCDeltaT\Downloads\WSA_2302.40000.8.0_x64_Release-Nightly-with-magisk-981ccabb(25210)-canary-MindTheGapps -13.0-RemovedAmazon\Install.ps1:139 char:1

All Done! Press any key to exit

MagiskOnWSALocal commit full SHA/MagiskOnWSALocal 提交的完整哈希

58e17da

Linux distribution info/Linux 发行版信息

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)" NAME="Debian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" KERNAL= 5.15.90.1-microsoft-standard-WSL2

Windows version/Windows 版本

10.0.22621.1413

Build Parameters/构建参数

COMMAND_LINE=--arch x64 --release-type WIF --magisk-ver canary --gapps-brand MindTheGapps --gapps-variant pico --remove-amazon --root-sol magisk --compress --compress-format zip INFO: Architecture: x64 INFO: Release Type: WIF INFO: Magisk Version: canary INFO: GApps Brand: MindTheGapps INFO: GApps Variant: pico INFO: Root Solution: magisk INFO: Compress Format: zip Build: RELEASE_TYPE=Insider Fast

Version requirement/版本要求

Logs/日志

[//]: <> (Don't modify above) ``` Time ID Message ---- -- ------- 25/03/2023 18:01:34 603 Started deployment Register operation on a package with main parameter AppxManifest.xml and Options ForceApplicationShutdownOption,DevelopmentModeOption,ForceUpdateFromAnyVersion and 0. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues. 25/03/2023 18:01:34 216 App manifest validation warning: Declared namespace http://schemas.microsoft.com/developer/appx/2015/build is inapplicable, it will be ignored during manifest processing. 25/03/2023 18:01:34 10002 Creating Resiliency File C:\ProgramData\Microsoft\Windows\AppRepository\7841aea9 -97fe-4de3-982a-5b92620321b0_S-1-5-21-3274399036-2637223480-2773644710-1001_3.rs lc for Register Operation on Package MicrosoftCorporationII.WindowsSubsystemForA ndroid_2302.40000.8.0_x64__8wekyb3d8bbwe. 25/03/2023 18:01:34 607 Deployment Register operation on package MicrosoftCorporationII.WindowsSubsystem ForAndroid_2302.40000.8.0_x64__8wekyb3d8bbwe has been de-queued and is running for user SID S-1-5-21-3274399036-2637223480-2773644710-1001. 25/03/2023 18:01:34 854 Successfully added the following uri(s) to be processed: C:\Users\MCDeltaT\Do wnloads\WSA_2302.40000.8.0_x64_Release-Nightly-with-magisk-981ccabb(25210)-canar y-MindTheGapps-13.0-RemovedAmazon\AppxManifest.xml. 25/03/2023 18:01:35 855 Finished resolving action lists. DeploymentRequest action lists: addPackageList: MicrosoftCorporationII.WindowsSubsystemForAndroid_2302.40000.8.0 _x64__8wekyb3d8bbwe. 25/03/2023 18:01:35 333 C:\Users\MCDeltaT\Downloads\WSA_2302.40000.8.0_x64_Release-Nightly-with-magisk -981ccabb(25210)-canary-MindTheGapps-13.0-RemovedAmazon\AppxManifest.xml(79,27): error 0x80073B17: Cannot register the MicrosoftCorporationII.WindowsSubsystemFo rAndroid_2302.40000.8.0_x64__8wekyb3d8bbwe package because the following error was encountered while determining whether the ms-resource:WsaDisplayName string resource could be localized: NamedResource Not Found. . Check that the string resource is defined and that there is at least one instance defined in the resources.pri file contained in this package. 25/03/2023 18:01:35 6902 AppxManifest.xml(78,6): error 0x80073B17: Cannot register the MicrosoftCorporati onII.WindowsSubsystemForAndroid_2302.40000.8.0_x64__8wekyb3d8bbwe package because the following error was encountered while parsing the App application: NamedResource Not Found. . Try again and contact the package publisher if the problem persists. 25/03/2023 18:01:35 6901 AppxManifest.xml(96,10): error 0x80073B17: Cannot register the MicrosoftCorporat ionII.WindowsSubsystemForAndroid_2302.40000.8.0_x64__8wekyb3d8bbwe package because the following error was encountered while parsing the windows.appExecutionAlias Extension element: NamedResource Not Found. . Try again and contact the package publisher if the problem persists. 25/03/2023 18:01:35 6800 AppxManifest.xml(98,14): error 0x80073B17: Cannot register the MicrosoftCorporationII.WindowsSubsystemForAndroid package because the following error was encountered while parsing the windows.appExecutionAlias extension: NamedResource Not Found. . Try again and contact the package publisher if the problem persists. 25/03/2023 18:01:35 303 error 0x80073B17: While preparing to process the request, the system failed to register the windows.appExecutionAlias extension due to the following error: NamedResource Not Found. . 25/03/2023 18:01:35 300 error 0x80073B17: Cannot register the MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe package due to the following error: NamedResource Not Found. . 25/03/2023 18:01:35 605 The last successful state reached was MutablePackageDirectoryAdd. Failure occurred before reaching the next state MachineRegisterAdd. hr: 0x80073CF6 25/03/2023 18:01:35 401 Deployment Register operation with target volume C: on Package MicrosoftCorporat ionII.WindowsSubsystemForAndroid_2302.40000.8.0_x64__8wekyb3d8bbwe from: (AppxManifest.xml) failed with error 0x80073CF6. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues. 25/03/2023 18:01:35 698 Deployment Register operation with target volume C: on Package MicrosoftCorporat ionII.WindowsSubsystemForAndroid_2302.40000.8.0_x64__8wekyb3d8bbwe from: (AppxManifest.xml) failed with error 0x80073CF6. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues. 25/03/2023 18:01:35 404 AppX Deployment operation failed for package MicrosoftCorporationII.WindowsSubsy stemForAndroid_2302.40000.8.0_x64__8wekyb3d8bbwe with error 0x80073CF6. The specific error text for this failure is: C:\Users\MCDeltaT\Downloads\WSA_2302. 40000.8.0_x64_Release-Nightly-with-magisk-981ccabb(25210)-canary-MindTheGapps-13 .0-RemovedAmazon\AppxManifest.xml(79,27): error 0x80073B17: Cannot register the MicrosoftCorporationII.WindowsSubsystemForAndroid_2302.40000.8.0_x64__8wekyb3d8b bwe package because the following error was encountered while determining whether the ms-resource:WsaDisplayName string resource could be localized: NamedResource Not Found. . Check that the string resource is defined and that there is at least one instance defined in the resources.pri file contained in this package. 25/03/2023 18:01:35 471 error 0x5: Deleting file \\?\C:\Program Files\WindowsApps\Deleted\MicrosoftCorpo rationII.WindowsSubsystemForAndroid_2302.40000.6.0_x64__8wekyb3d8bbwee4ef9bca-6d ea-49cc-b498-877a21bac2da\lxutil.dll failed. 25/03/2023 18:01:35 471 error 0x5: Deleting file \\?\C:\Program Files\WindowsApps\Deleted\MicrosoftCorpo rationII.WindowsSubsystemForAndroid_2302.40000.6.0_x64__8wekyb3d8bbwee4ef9bca-6d ea-49cc-b498-877a21bac2da\wslcoredeps.dll failed. 25/03/2023 18:01:35 471 error 0x5: Deleting file \\?\C:\Program Files\WindowsApps\Deleted\MicrosoftCorpo rationII.WindowsSubsystemForLinux_1.0.0.0_x64__8wekyb3d8bbwe1127e998-01db-4239-9 460-f5b07ed7ee66\lxutil.dll failed. 25/03/2023 18:01:35 493 There were 1 additional files that failed to be deleted under the folder \\?\C:\Program Files\WindowsApps\Deleted. ``` [//]: <> (Don't modify below)
Almighty188 commented 1 year ago

PS C:\Users\vince\Desktop\Windows Subsystem for Android\MagiskOnWSALocal\output\WSA_2302.40000.8.0_x64_Release-Nightly-with-magisk-25.2(25200)-stable-MindTheGapps-13.0> .\makepri.exe dump /if .\pri\resources.language-zh-hant.pri /o /es .\pri\resources.pri /of .\priinfo\resources.language-zh-hant.pri.xml /dt detailed ERROR: PRI175: 0x80004005 - Dump ERROR: PRI175: 0x80004005 - MakePri failed with error: Unspecified error

PS C:\Users\vince\Desktop\Windows Subsystem for Android\MagiskOnWSALocal\output\WSA_2302.40000.8.0_x64_Release-Nightly-with-magisk-25.2(25200)-stable-MindTheGapps-13.0>

Howard20181 commented 1 year ago

What the size of .\pri\resources.language-zh-hant.pri and .\pri\resources.pri? For me is 11KB and 87KB

Almighty188 commented 1 year ago

image

Howard20181 commented 1 year ago

.\pri\resources.pri image

Howard20181 commented 1 year ago

What is the size of resources.pri in the root of the WSA before running any scripts?

Howard20181 commented 1 year ago

In 2203.40000.8 It should be 87KB

MustardChef commented 1 year ago

In 2203.40000.8 It should be 87KB

It is indeed 87KB before any scripts are ran

Almighty188 commented 1 year ago

Yes, it is 87KB as seen in https://github.com/LSPosed/MagiskOnWSALocal/issues/450#issuecomment-1483916464 posted earlier.

Howard20181 commented 1 year ago

Try to dump one pri before any scripts be run. .\makepri.exe dump /if .\pri\resources.language-zh-hans.pri /o /es .\resources.pri /of .\resources.language-zh-hans.pri.xml /dt detailed

Howard20181 commented 1 year ago

Should be

Output File at .\resources.language-zh-hans.pri.xml
Successfully Completed
Almighty188 commented 1 year ago

image image

MustardChef commented 1 year ago

I also get the same message image

Howard20181 commented 1 year ago

Why did it fail to dump before? Try this MakePri.debug.ps1.txt Check if dumps success (check priinfo folder)

Howard20181 commented 1 year ago

If dumps success the exit code should be 0.

Howard20181 commented 1 year ago

If dumps success run makepri.exe new /pr .\priinfo /cf .\xml\priconfig.xml /of .\pri\resources.pri /mn .\AppxManifest.xml /o

MustardChef commented 1 year ago

If dumps success the exit code should be 0.

Exit code still shows as -2147024809 and still nothing inside the priinfo folder

Howard20181 commented 1 year ago

Does the size of .\pri\resources.pri same as .\resources.pri? It's 87KB.

Almighty188 commented 1 year ago

Output using MakePri.debug.ps1 from https://github.com/LSPosed/MagiskOnWSALocal/issues/450#issuecomment-1483932655 image

Howard20181 commented 1 year ago

Now MakePri.ps1 does the following:

  1. Copy .\resources.pri to .\pri\resources.pri to make a backup of the original file. This time the two pri should be 87KB.

  2. Try to create a new pri base on the files in pri folder, the new pri will overwrite the original one in the root folder, this way we need to do a backup.

  3. If failed to create from pri, try to dump all pri files in pri folder to priinfo. (In 2301 this will succeed, failed in 2302 so why do we need to dump)

    This time .\pri\resources.pri should be 87KB. Dumping pri for another language executes English needs based on the original one, this time we need to use the backup one in the pri folder. <- We failed on this step. So the backup one corrupted?

  4. Then create a new pri base on the files in priinfo folder

Almighty188 commented 1 year ago

Yes, because before I did the last execution of MakePri.debug.ps1 from https://github.com/LSPosed/MagiskOnWSALocal/issues/450#issuecomment-1483932655 - I backed up the resources.pri to resources.pri.orig just in case as seen here: image

My backup of .\resources.pri as .\resources.pri.orig is identical to the backup one in .\pri\resources.pri image

Howard20181 commented 1 year ago

One possible reason why the first copy step did not complete is that Copy-Item is non-blocking, so a | Out-Null was added to wait for it to complete, but I saw your feedback that .\pri\resources.pri is 87KB in size, the backup should be completed.

Howard20181 commented 1 year ago

This should success. .\makepri.exe dump /if .\pri\resources.language-zh-hans.pri /o /es .\pri\resources.pri /of .\resources.language-zh-hans.pri.xml /dt detailed

Means dump per-language pri (.\pri\resources.language-zh-hans.pri) based on the original backup pri (.\pri\resources.pri) to .\resources.language-zh-hans.pri.xml

Almighty188 commented 1 year ago

image

Howard20181 commented 1 year ago

Why it failed in the script and success manually?

Howard20181 commented 1 year ago

Try this MakePri.debug.ps1.txt image

Howard20181 commented 1 year ago

Try this MakePri.debug.ps1.txt It may be caused by a space in the path, which is now enclosed in quotes.

Almighty188 commented 1 year ago

Try this MakePri.debug.ps1.txt It may be caused by a space in the path, which is now enclosed in quotes.

Output using MakePri.debug.ps1 after deleting the priinfo folder and copying .\pri\resources.pri to .\resources.pri but did not regenerate WSA: image image image

Howard20181 commented 1 year ago

Seems like this stupid problem is finally fixed, my bad.

MustardChef commented 1 year ago

Seems to be working now.

Howard20181 commented 1 year ago

Check https://github.com/LSPosed/MagiskOnWSALocal/commit/e3e9c0adb810645c5e2494e1020935d6b089fd07

MustardChef commented 1 year ago

Check e3e9c0a

The error is no longer encountered and WSA installs normally. Thank you Almighty188 and Howard20181 for all the help

Howard20181 commented 1 year ago

Now I switch to relative path, can you confirm if it works properly? https://github.com/LSPosed/MagiskOnWSALocal/commit/2e02381b9addf70044e5464fab3c58dd308d584b

MustardChef commented 1 year ago

Now I switch to relative path, can you confirm if it works properly? 2e02381

Yes, I can confirm that I encounter no problems and it seems to work properly.

Almighty188 commented 1 year ago

WSA installs properly, but this time, both the Magisk and Google Play Store loads and then exits. Was able to start both Magisk and Google Play Store manually.