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
40
.github/workflows/keygen.yml
vendored
40
.github/workflows/keygen.yml
vendored
|
|
@ -33,17 +33,17 @@ jobs:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v4.2.2
|
||||||
|
|
||||||
- name: Generating License (ASCII)
|
- name: Generating License (ASCII)
|
||||||
# Do Not Use pwsh
|
# Use PowerShell 5
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
||||||
$PSVersionTable.PSVersion
|
$PSVersionTable.PSVersion
|
||||||
bin/x64-Release/winrar-keygen.exe "${{env.KEY_USERNAME}}" "${{env.KEY_LICENSE_NAME}}" | Out-File -Encoding ${{env.KEY_ENCODING}} rarreg.key
|
bin/x64-Release/winrar-keygen.exe "${{ env.KEY_USERNAME }}" "${{ env.KEY_LICENSE_NAME }}" | Out-File -Encoding ${{ env.KEY_ENCODING }} rarreg.key
|
||||||
|
|
||||||
- name: Uploading License
|
- name: Uploading License
|
||||||
uses: actions/upload-artifact@v4.4.3
|
uses: actions/upload-artifact@v4.6.2
|
||||||
with:
|
with:
|
||||||
name: rarreg_file_${{env.KEY_ENCODING}}
|
name: rarreg_file_${{ env.KEY_ENCODING }}
|
||||||
path: rarreg.key
|
path: rarreg.key
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 90
|
retention-days: 90
|
||||||
|
|
@ -67,12 +67,12 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
[System.Text.Encoding]::Default
|
[System.Text.Encoding]::Default
|
||||||
$OutputEncoding
|
$OutputEncoding
|
||||||
bin/x64-Release/winrar-keygen.exe "${{env.KEY_USERNAME}}" "${{env.KEY_LICENSE_NAME}}" | Out-File -Encoding ${{env.KEY_ENCODING}} rarreg.key
|
bin/x64-Release/winrar-keygen.exe "${{ env.KEY_USERNAME }}" "${{ env.KEY_LICENSE_NAME }}" | Out-File -Encoding ${{ env.KEY_ENCODING }} rarreg.key
|
||||||
|
|
||||||
- name: Uploading License
|
- name: Uploading License
|
||||||
uses: actions/upload-artifact@v4.4.3
|
uses: actions/upload-artifact@v4.6.2
|
||||||
with:
|
with:
|
||||||
name: rarreg_file_${{env.KEY_ENCODING}}
|
name: rarreg_file_${{ env.KEY_ENCODING }}
|
||||||
path: rarreg.key
|
path: rarreg.key
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 90
|
retention-days: 90
|
||||||
|
|
@ -91,17 +91,33 @@ jobs:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v4.2.2
|
||||||
|
|
||||||
- name: Generating License (UTF-8)
|
- name: Generating License (UTF-8)
|
||||||
# Do Not Use pwsh
|
# Use PowerShell 7
|
||||||
shell: powershell
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
||||||
$PSVersionTable.PSVersion
|
$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
|
- name: Uploading License
|
||||||
uses: actions/upload-artifact@v4.4.3
|
uses: actions/upload-artifact@v4.6.2
|
||||||
with:
|
with:
|
||||||
name: rarreg_file_${{env.KEY_ENCODING}}
|
name: rarreg_file_${{ env.KEY_ENCODING }}
|
||||||
path: rarreg.key
|
path: rarreg.key
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 90
|
retention-days: 90
|
||||||
|
|
|
||||||
64
.github/workflows/keygen_secrets.yml
vendored
64
.github/workflows/keygen_secrets.yml
vendored
|
|
@ -14,27 +14,27 @@ jobs:
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
env:
|
env:
|
||||||
KEY_ENCODING: ${{ github.event.inputs.KEY_ENCODING }}
|
KEY_ENCODING: ${{ github.event.inputs.KEY_ENCODING }}
|
||||||
KEY_USERNAME: ${{secrets.TEXT1}}
|
KEY_USERNAME: ${{ secrets.TEXT1 }}
|
||||||
KEY_LICENSE_NAME: ${{secrets.TEXT2}}
|
KEY_LICENSE_NAME: ${{ secrets.TEXT2 }}
|
||||||
ZIP_PWD: ${{secrets.PWD}}
|
ZIP_PWD: ${{ secrets.PWD }}
|
||||||
if: github.event.inputs.KEY_ENCODING == 'ascii'
|
if: github.event.inputs.KEY_ENCODING == 'ascii'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v4.2.2
|
||||||
|
|
||||||
- name: Generating License (ASCII)
|
- name: Generating License (ASCII)
|
||||||
# Do Not Use pwsh
|
# Use PowerShell 5
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
||||||
$PSVersionTable.PSVersion
|
$PSVersionTable.PSVersion
|
||||||
bin/x64-Release/winrar-keygen.exe "${{env.KEY_USERNAME}}" "${{env.KEY_LICENSE_NAME}}" | Out-File -Encoding ${{env.KEY_ENCODING}} rarreg.key
|
bin/x64-Release/winrar-keygen.exe "${{ env.KEY_USERNAME }}" "${{ env.KEY_LICENSE_NAME }}" | Out-File -Encoding ${{ env.KEY_ENCODING }} rarreg.key
|
||||||
7z a rarreg.7z rarreg.key -p"${{env.ZIP_PWD}}"
|
7z a rarreg.7z rarreg.key -p"${{ env.ZIP_PWD }}"
|
||||||
|
|
||||||
- name: Uploading License
|
- name: Uploading License
|
||||||
uses: actions/upload-artifact@v4.4.3
|
uses: actions/upload-artifact@v4.6.2
|
||||||
with:
|
with:
|
||||||
name: rarreg_file_${{env.KEY_ENCODING}}
|
name: rarreg_file_${{ env.KEY_ENCODING }}
|
||||||
path: rarreg.7z
|
path: rarreg.7z
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
@ -45,9 +45,9 @@ jobs:
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
env:
|
env:
|
||||||
KEY_ENCODING: ${{ github.event.inputs.KEY_ENCODING }}
|
KEY_ENCODING: ${{ github.event.inputs.KEY_ENCODING }}
|
||||||
KEY_USERNAME: ${{secrets.TEXT1}}
|
KEY_USERNAME: ${{ secrets.TEXT1 }}
|
||||||
KEY_LICENSE_NAME: ${{secrets.TEXT2}}
|
KEY_LICENSE_NAME: ${{ secrets.TEXT2 }}
|
||||||
ZIP_PWD: ${{secrets.PWD}}
|
ZIP_PWD: ${{ secrets.PWD }}
|
||||||
if: github.event.inputs.KEY_ENCODING == 'ansi'
|
if: github.event.inputs.KEY_ENCODING == 'ansi'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -59,13 +59,13 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
[System.Text.Encoding]::Default
|
[System.Text.Encoding]::Default
|
||||||
$OutputEncoding
|
$OutputEncoding
|
||||||
bin/x64-Release/winrar-keygen.exe "${{env.KEY_USERNAME}}" "${{env.KEY_LICENSE_NAME}}" | Out-File -Encoding ${{env.KEY_ENCODING}} rarreg.key
|
bin/x64-Release/winrar-keygen.exe "${{ env.KEY_USERNAME }}" "${{ env.KEY_LICENSE_NAME }}" | Out-File -Encoding ${{ env.KEY_ENCODING }} rarreg.key
|
||||||
7z a rarreg.7z rarreg.key -p"${{env.ZIP_PWD}}"
|
7z a rarreg.7z rarreg.key -p"${{ env.ZIP_PWD }}"
|
||||||
|
|
||||||
- name: Uploading License
|
- name: Uploading License
|
||||||
uses: actions/upload-artifact@v4.4.3
|
uses: actions/upload-artifact@v4.6.2
|
||||||
with:
|
with:
|
||||||
name: rarreg_file_${{env.KEY_ENCODING}}
|
name: rarreg_file_${{ env.KEY_ENCODING }}
|
||||||
path: rarreg.7z
|
path: rarreg.7z
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
@ -76,27 +76,43 @@ jobs:
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
env:
|
env:
|
||||||
KEY_ENCODING: ${{ github.event.inputs.KEY_ENCODING }}
|
KEY_ENCODING: ${{ github.event.inputs.KEY_ENCODING }}
|
||||||
KEY_USERNAME: ${{secrets.TEXT1}}
|
KEY_USERNAME: ${{ secrets.TEXT1 }}
|
||||||
KEY_LICENSE_NAME: ${{secrets.TEXT2}}
|
KEY_LICENSE_NAME: ${{ secrets.TEXT2 }}
|
||||||
ZIP_PWD: ${{secrets.PWD}}
|
ZIP_PWD: ${{ secrets.PWD }}
|
||||||
if: github.event.inputs.KEY_ENCODING == 'utf8'
|
if: github.event.inputs.KEY_ENCODING == 'utf8'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v4.2.2
|
||||||
|
|
||||||
- name: Generating License (UTF-8)
|
- name: Generating License (UTF-8)
|
||||||
# Do Not Use pwsh
|
# Use PowerShell 7
|
||||||
shell: powershell
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
||||||
$PSVersionTable.PSVersion
|
$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 }}"
|
||||||
7z a rarreg.7z rarreg.key -p"${{env.ZIP_PWD}}"
|
$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
|
- name: Uploading License
|
||||||
uses: actions/upload-artifact@v4.4.3
|
uses: actions/upload-artifact@v4.6.2
|
||||||
with:
|
with:
|
||||||
name: rarreg_file_${{env.KEY_ENCODING}}
|
name: rarreg_file_${{ env.KEY_ENCODING }}
|
||||||
path: rarreg.7z
|
path: rarreg.7z
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue