Upload via GUI (8346 Dateien)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Erzeugt den Upload-Schlüssel (Keystore) für die Veröffentlichung im Play Store.
|
||||
|
||||
.DESCRIPTION
|
||||
Der Keystore wird außerhalb des Projekts abgelegt (Standard: %USERPROFILE%\deskhub-keys\deskhub-release.jks).
|
||||
Passwort wird abgefragt und nie angezeigt oder gespeichert. DIESE DATEI UND DAS PASSWORT SICHERN (mindestens zwei Orte):
|
||||
Ohne sie kann die App später nicht mehr aktualisiert werden. Niemals einchecken oder weitergeben.
|
||||
#>
|
||||
param([string]$StoreFile = (Join-Path $env:USERPROFILE 'deskhub-keys\deskhub-release.jks'), [string]$Alias = 'deskhub')
|
||||
$ErrorActionPreference = 'Stop'
|
||||
if (Test-Path -LiteralPath $StoreFile) { throw "Keystore existiert bereits: $StoreFile (nicht überschrieben)." }
|
||||
New-Item -ItemType Directory -Force (Split-Path $StoreFile) | Out-Null
|
||||
$s1 = Read-Host 'Neues Keystore-Passwort (mindestens 12 Zeichen)' -AsSecureString
|
||||
$s2 = Read-Host 'Passwort wiederholen' -AsSecureString
|
||||
$p1 = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($s1))
|
||||
$p2 = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($s2))
|
||||
if ($p1 -ne $p2) { throw 'Die Passwörter stimmen nicht überein.' }
|
||||
if ($p1.Length -lt 12) { throw 'Das Passwort ist zu kurz (mindestens 12 Zeichen).' }
|
||||
$dname = Read-Host 'Name für das Zertifikat (z. B. CN=M_Viper, O=DeskHub, C=DE)'
|
||||
if ([string]::IsNullOrWhiteSpace($dname)) { $dname = 'CN=DeskHub, O=DeskHub, C=DE' }
|
||||
$env:DH_KS_PW = $p1
|
||||
try {
|
||||
keytool -genkeypair -v -keystore $StoreFile -alias $Alias -keyalg RSA -keysize 4096 -validity 10000 `
|
||||
-storepass:env DH_KS_PW -keypass:env DH_KS_PW -dname $dname
|
||||
if ($LASTEXITCODE -ne 0) { throw 'keytool ist fehlgeschlagen.' }
|
||||
} finally { Remove-Item Env:\DH_KS_PW -ErrorAction SilentlyContinue }
|
||||
Write-Host "`nFertig: $StoreFile (Alias $Alias). SICHERN: Datei + Passwort. Danach: .\build-release.ps1"
|
||||
Reference in New Issue
Block a user