mirror of
https://github.com/LSPosed/MagiskOnWSALocal.git
synced 2025-09-02 02:30:14 +00:00
parent
ec58edfd47
commit
87ec298263
4 changed files with 49 additions and 29 deletions
|
@ -1,5 +1,5 @@
|
||||||
# Automated Install script by Midonei
|
# Automated Install script by Midonei
|
||||||
$Host.UI.RawUI.WindowTitle = "Installing MagiskOnWSA..."
|
$Host.UI.RawUI.WindowTitle = "Installing MagiskOnWSA...."
|
||||||
function Test-Administrator {
|
function Test-Administrator {
|
||||||
[OutputType([bool])]
|
[OutputType([bool])]
|
||||||
param()
|
param()
|
||||||
|
@ -49,7 +49,11 @@ If (((Test-Path -Path $FileList) -Eq $false).Count) {
|
||||||
}
|
}
|
||||||
|
|
||||||
If ((Test-Path -Path "MakePri.ps1") -Eq $true) {
|
If ((Test-Path -Path "MakePri.ps1") -Eq $true) {
|
||||||
Start-Process powershell.exe -Wait -Args "-ExecutionPolicy Bypass -File MakePri.ps1" -WorkingDirectory $PSScriptRoot
|
$ProcMakePri = Start-Process powershell.exe -PassThru -Args "-ExecutionPolicy Bypass -File MakePri.ps1" -WorkingDirectory $PSScriptRoot
|
||||||
|
$ProcMakePri.WaitForExit()
|
||||||
|
If ($ProcMakePri.ExitCode -Ne 0) {
|
||||||
|
Write-Warning "Failed to merge resources, WSA Seetings will always be in English`r`n"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
|
||||||
|
@ -101,7 +105,7 @@ If (($null -Ne $Installed) -And (-Not ($Installed.IsDevelopmentMode))) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Clear-Host
|
Clear-Host
|
||||||
Write-Host "Installing MagiskOnWSA..."
|
Write-Host "Installing MagiskOnWSA...."
|
||||||
Stop-Process -Name "WsaClient" -ErrorAction SilentlyContinue
|
Stop-Process -Name "WsaClient" -ErrorAction SilentlyContinue
|
||||||
Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Register .\AppxManifest.xml
|
Add-AppxPackage -ForceApplicationShutdown -ForceUpdateFromAnyVersion -Register .\AppxManifest.xml
|
||||||
If ($?) {
|
If ($?) {
|
||||||
|
|
|
@ -16,34 +16,49 @@
|
||||||
# Copyright (C) 2023 LSPosed Contributors
|
# Copyright (C) 2023 LSPosed Contributors
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$Host.UI.RawUI.WindowTitle = "Merging resources...."
|
||||||
If ((Test-Path -Path "pri") -Eq $true -And (Test-Path -Path "xml") -Eq $true) {
|
If ((Test-Path -Path "pri") -Eq $true -And (Test-Path -Path "xml") -Eq $true) {
|
||||||
$AppxManifestFile = ".\AppxManifest.xml"
|
$AppxManifestFile = ".\AppxManifest.xml"
|
||||||
Copy-Item .\resources.pri -Destination ".\pri\resources.pri"
|
Copy-Item .\resources.pri -Destination ".\pri\resources.pri"
|
||||||
$proc = Start-Process -PassThru makepri.exe -Args "new /pr .\pri /cf .\xml\priconfig.xml /of .\resources.pri /mn $AppxManifestFile /o"
|
$ProcNew = Start-Process -PassThru makepri.exe -WindowStyle Hidden -Args "new /pr .\pri /cf .\xml\priconfig.xml /of .\resources.pri /mn $AppxManifestFile /o"
|
||||||
$proc.WaitForExit()
|
$ProcNew.WaitForExit()
|
||||||
If ($proc.ExitCode -Ne 0) {
|
If ($ProcNew.ExitCode -Ne 0) {
|
||||||
Write-Warning "Failed to merge resources`r`n"
|
Write-Warning "Failed to merge resources from pri`r`nTrying to dump...."
|
||||||
exit 1
|
New-Item -Path "." -Name "priinfo" -ItemType "directory"
|
||||||
}
|
$Processes = ForEach ($Item in Get-Item ".\pri\*" -Include "*.pri") {
|
||||||
else {
|
$Name = $Item.Name
|
||||||
$ProjectXml = [xml](Get-Content $AppxManifestFile)
|
Write-Host "Dumping $Name....`r`n"
|
||||||
$ProjectResources = $ProjectXml.Package.Resources;
|
Start-Process -PassThru -WindowStyle Hidden makepri.exe -Args "dump /if $Item /o /es .\resources.pri /of .\priinfo\$Name.xml /dt detailed"
|
||||||
$Item = Get-Item .\xml\* -Exclude "priconfig.xml" -Include "*.xml"
|
}
|
||||||
$Item | ForEach-Object {
|
Write-Host "Dumping resources....`r`n"
|
||||||
$Xml = [xml](Get-Content $_)
|
$Processes | Wait-Process
|
||||||
$Resource = $Xml.Package.Resources.Resource
|
Write-Host "Creating pri from dumps....`r`n"
|
||||||
$newNode = $ProjectXml.ImportNode($Resource, $true)
|
$ProcNewFromDump = Start-Process -PassThru -WindowStyle Hidden makepri.exe -Args "new /pr .\priinfo /cf .\xml\priconfig.xml /of .\resources.pri /mn $AppxManifestFile /o"
|
||||||
$ProjectResources.AppendChild($newNode)
|
$ProcNewFromDump.WaitForExit()
|
||||||
|
Remove-Item 'priinfo' -Recurse
|
||||||
|
If ($ProcNewFromDump.ExitCode -Ne 0) {
|
||||||
|
Write-Warning "Failed to merge resources from dump`r`n"
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
$ProjectXml.Save($AppxManifestFile)
|
|
||||||
Remove-Item 'pri' -Recurse
|
|
||||||
Set-Content -Path "filelist.txt" -Value (Get-Content -Path "filelist.txt" | Select-String -Pattern '^pri$' -NotMatch)
|
|
||||||
Remove-Item 'xml' -Recurse
|
|
||||||
Set-Content -Path "filelist.txt" -Value (Get-Content -Path "filelist.txt" | Select-String -Pattern '^xml$' -NotMatch)
|
|
||||||
Remove-Item 'makepri.exe'
|
|
||||||
Set-Content -Path "filelist.txt" -Value (Get-Content -Path "filelist.txt" | Select-String -Pattern 'makepri.exe' -NotMatch)
|
|
||||||
Remove-Item $PSCommandPath -Force
|
|
||||||
Set-Content -Path "filelist.txt" -Value (Get-Content -Path "filelist.txt" | Select-String -Pattern 'MakePri.ps1' -NotMatch)
|
|
||||||
exit 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$ProjectXml = [xml](Get-Content $AppxManifestFile)
|
||||||
|
$ProjectResources = $ProjectXml.Package.Resources;
|
||||||
|
$Item = Get-Item .\xml\* -Exclude "priconfig.xml" -Include "*.xml"
|
||||||
|
$Item | ForEach-Object {
|
||||||
|
$Xml = [xml](Get-Content $_)
|
||||||
|
$Resource = $Xml.Package.Resources.Resource
|
||||||
|
$newNode = $ProjectXml.ImportNode($Resource, $true)
|
||||||
|
$ProjectResources.AppendChild($newNode)
|
||||||
|
}
|
||||||
|
$ProjectXml.Save($AppxManifestFile)
|
||||||
|
Remove-Item 'pri' -Recurse
|
||||||
|
Set-Content -Path "filelist.txt" -Value (Get-Content -Path "filelist.txt" | Select-String -Pattern '^pri$' -NotMatch)
|
||||||
|
Remove-Item 'xml' -Recurse
|
||||||
|
Set-Content -Path "filelist.txt" -Value (Get-Content -Path "filelist.txt" | Select-String -Pattern '^xml$' -NotMatch)
|
||||||
|
Remove-Item 'makepri.exe'
|
||||||
|
Set-Content -Path "filelist.txt" -Value (Get-Content -Path "filelist.txt" | Select-String -Pattern 'makepri.exe' -NotMatch)
|
||||||
|
Remove-Item $PSCommandPath -Force
|
||||||
|
Set-Content -Path "filelist.txt" -Value (Get-Content -Path "filelist.txt" | Select-String -Pattern 'MakePri.ps1' -NotMatch)
|
||||||
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -898,7 +898,7 @@ if [ "$COMPRESS_OUTPUT" ] || [ -n "$COMPRESS_FORMAT" ]; then
|
||||||
elif [ "$COMPRESS_FORMAT" = "xz" ]; then
|
elif [ "$COMPRESS_FORMAT" = "xz" ]; then
|
||||||
echo "Compressing with tar xz"
|
echo "Compressing with tar xz"
|
||||||
if ! (tar -cP -I 'xz -9 -T0' -f "$OUTPUT_PATH" "$WORK_DIR/wsa/$artifact_name"); then
|
if ! (tar -cP -I 'xz -9 -T0' -f "$OUTPUT_PATH" "$WORK_DIR/wsa/$artifact_name"); then
|
||||||
echo "Out of memory? Trying again with single threads..."
|
echo "Out of memory? Trying again with single threads...."
|
||||||
tar -cPJvf "$OUTPUT_PATH" "$WORK_DIR/wsa/$artifact_name" || abort
|
tar -cPJvf "$OUTPUT_PATH" "$WORK_DIR/wsa/$artifact_name" || abort
|
||||||
fi
|
fi
|
||||||
elif [ "$COMPRESS_FORMAT" = "zip" ]; then
|
elif [ "$COMPRESS_FORMAT" = "zip" ]; then
|
||||||
|
|
|
@ -7,5 +7,6 @@
|
||||||
<indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true"
|
<indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true"
|
||||||
qualifierDelimiter="." />
|
qualifierDelimiter="." />
|
||||||
<indexer-config type="PRI" />
|
<indexer-config type="PRI" />
|
||||||
|
<indexer-config type="priinfo" />
|
||||||
</index>
|
</index>
|
||||||
</resources>
|
</resources>
|
Loading…
Add table
Reference in a new issue