mirror of
https://github.com/bitcookies/winrar-keygen.git
synced 2026-03-11 17:45:31 +00:00
🚀 UTF8NoBOM Support
This commit is contained in:
parent
5c77901c1c
commit
44e0ef1c74
2 changed files with 69 additions and 37 deletions
30
.github/workflows/keygen.yml
vendored
30
.github/workflows/keygen.yml
vendored
|
|
@ -33,7 +33,7 @@ jobs:
|
|||
- uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Generating License (ASCII)
|
||||
# Do Not Use pwsh
|
||||
# Use PowerShell 5
|
||||
shell: powershell
|
||||
run: |
|
||||
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
||||
|
|
@ -41,7 +41,7 @@ jobs:
|
|||
bin/x64-Release/winrar-keygen.exe "${{ env.KEY_USERNAME }}" "${{ env.KEY_LICENSE_NAME }}" | Out-File -Encoding ${{ env.KEY_ENCODING }} rarreg.key
|
||||
|
||||
- name: Uploading License
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: rarreg_file_${{ env.KEY_ENCODING }}
|
||||
path: rarreg.key
|
||||
|
|
@ -70,7 +70,7 @@ jobs:
|
|||
bin/x64-Release/winrar-keygen.exe "${{ env.KEY_USERNAME }}" "${{ env.KEY_LICENSE_NAME }}" | Out-File -Encoding ${{ env.KEY_ENCODING }} rarreg.key
|
||||
|
||||
- name: Uploading License
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: rarreg_file_${{ env.KEY_ENCODING }}
|
||||
path: rarreg.key
|
||||
|
|
@ -91,15 +91,31 @@ jobs:
|
|||
- uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Generating License (UTF-8)
|
||||
# Do Not Use pwsh
|
||||
shell: powershell
|
||||
# Use PowerShell 7
|
||||
shell: pwsh
|
||||
run: |
|
||||
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
||||
$PSVersionTable.PSVersion
|
||||
bin/x64-Release/winrar-keygen.exe "utf8:${{env.KEY_USERNAME}}" "${{env.KEY_LICENSE_NAME}}" | Out-File -Encoding ${{env.KEY_ENCODING}} rarreg.key
|
||||
$user = "utf8:${{ env.KEY_USERNAME }}"
|
||||
$license = "${{ env.KEY_LICENSE_NAME }}"
|
||||
|
||||
$allAscii = $true
|
||||
foreach ($c in $license.ToCharArray()) {
|
||||
if ([int][char]$c -gt 127) {
|
||||
$allAscii = $false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $allAscii) {
|
||||
$license = "utf8:" + $license
|
||||
}
|
||||
|
||||
Write-Host "License string: $license"
|
||||
bin/x64-Release/winrar-keygen.exe "$user" "$license" | Out-File -Encoding utf8NoBOM rarreg.key
|
||||
|
||||
- name: Uploading License
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: rarreg_file_${{ env.KEY_ENCODING }}
|
||||
path: rarreg.key
|
||||
|
|
|
|||
30
.github/workflows/keygen_secrets.yml
vendored
30
.github/workflows/keygen_secrets.yml
vendored
|
|
@ -23,7 +23,7 @@ jobs:
|
|||
- uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Generating License (ASCII)
|
||||
# Do Not Use pwsh
|
||||
# Use PowerShell 5
|
||||
shell: powershell
|
||||
run: |
|
||||
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
||||
|
|
@ -32,7 +32,7 @@ jobs:
|
|||
7z a rarreg.7z rarreg.key -p"${{ env.ZIP_PWD }}"
|
||||
|
||||
- name: Uploading License
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: rarreg_file_${{ env.KEY_ENCODING }}
|
||||
path: rarreg.7z
|
||||
|
|
@ -63,7 +63,7 @@ jobs:
|
|||
7z a rarreg.7z rarreg.key -p"${{ env.ZIP_PWD }}"
|
||||
|
||||
- name: Uploading License
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: rarreg_file_${{ env.KEY_ENCODING }}
|
||||
path: rarreg.7z
|
||||
|
|
@ -85,16 +85,32 @@ jobs:
|
|||
- uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Generating License (UTF-8)
|
||||
# Do Not Use pwsh
|
||||
shell: powershell
|
||||
# Use PowerShell 7
|
||||
shell: pwsh
|
||||
run: |
|
||||
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
||||
$PSVersionTable.PSVersion
|
||||
bin/x64-Release/winrar-keygen.exe "utf8:${{env.KEY_USERNAME}}" "${{env.KEY_LICENSE_NAME}}" | Out-File -Encoding ${{env.KEY_ENCODING}} rarreg.key
|
||||
$user = "utf8:${{ env.KEY_USERNAME }}"
|
||||
$license = "${{ env.KEY_LICENSE_NAME }}"
|
||||
|
||||
$allAscii = $true
|
||||
foreach ($c in $license.ToCharArray()) {
|
||||
if ([int][char]$c -gt 127) {
|
||||
$allAscii = $false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $allAscii) {
|
||||
$license = "utf8:" + $license
|
||||
}
|
||||
|
||||
Write-Host "Final license: $license"
|
||||
bin/x64-Release/winrar-keygen.exe "$user" "$license" | Out-File -Encoding utf8NoBOM rarreg.key
|
||||
7z a rarreg.7z rarreg.key -p"${{ env.ZIP_PWD }}"
|
||||
|
||||
- name: Uploading License
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: rarreg_file_${{ env.KEY_ENCODING }}
|
||||
path: rarreg.7z
|
||||
|
|
|
|||
Loading…
Reference in a new issue