Skip to content

Commit

Permalink
Merge pull request #768 from unoplatform/dev/eb/dual-obfuscation
Browse files Browse the repository at this point in the history
fix: Ensure filename obfuscation works with obfuscation
  • Loading branch information
jeromelaban authored Sep 7, 2023
2 parents a7a09c6 + 4aaf7eb commit 63afd8a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .vsts-ci-windows-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,23 @@ jobs:
env:
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
# Static linking test with dual obfuscation enabled
- pwsh: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Aot.Net6
dotnet clean -c Release /p:DISABLE_CLIHOST_NET6=true
dotnet publish -c Release /m:1 /p:DISABLE_CLIHOST_NET6=true /p:WasmShellEmccLinkOptimization=false /p:WasmShellObfuscateAssemblies=true /p:WasmShellAssembliesFileNameObfuscationMode=NoDots /bl:$(build.artifactstagingdirectory)/SampleNet6-dual-win.binlog
displayName: Build StaticLinking.Aot.Net6 Sample (dual obfuscation)
- pwsh: |
$(build.sourcesdirectory)\build\scripts\run-tests-windows.ps1 `
"$(build.sourcesdirectory)\src\Uno.Wasm.StaticLinking.Aot.Net6\bin\Release\net6.0\dist" `
"$(build.sourcesdirectory)\src\Uno.Wasm.StaticLinking.Aot.UITests" `
"http://localhost:8000/"
displayName: StaticLinking.Aot.Net6 Tests (net6 with dual obfuscation)
env:
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
# Static linking test (net5)
- pwsh: |
cd $(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Aot.Net6
Expand Down
6 changes: 5 additions & 1 deletion src/Uno.Wasm.Bootstrap/ts/Uno/WebAssembly/Bootstrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,11 @@ namespace Uno.WebAssembly.Bootstrap {
}

private async deobfuscateFile(asset: string, response: Promise<void | Response>): Promise<void | Response> {
if (this._unoConfig.assemblyObfuscationKey && asset.endsWith(this._unoConfig.assemblyFileExtension)) {
const assemblyFileSuffix = this._unoConfig.assemblyFileNameObfuscationMode !== "NoDots" ?
this._unoConfig.assemblyFileExtension :
this._unoConfig.assemblyFileExtension.replace(".", "_");

if (this._unoConfig.assemblyObfuscationKey && asset.endsWith(assemblyFileSuffix)) {
const responseValue = await response;

if (responseValue) {
Expand Down

0 comments on commit 63afd8a

Please sign in to comment.