Initial upload: fin65-mobile
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$ManifestPath
|
||||
)
|
||||
|
||||
if (!(Test-Path $ManifestPath)) {
|
||||
Write-Host "[ERREUR] AndroidManifest.xml introuvable : $ManifestPath" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
$text = Get-Content $ManifestPath -Raw
|
||||
|
||||
# Remplace les attributs existants.
|
||||
$text = [regex]::Replace($text, 'android:label="[^"]*"', 'android:label="FIN65"')
|
||||
$text = [regex]::Replace($text, 'android:icon="[^"]*"', 'android:icon="@mipmap/ic_launcher"')
|
||||
$text = [regex]::Replace($text, 'android:roundIcon="[^"]*"', 'android:roundIcon="@mipmap/ic_launcher_round"')
|
||||
|
||||
# Ajoute les attributs s'ils n'existaient pas.
|
||||
if ($text -notmatch 'android:label=') {
|
||||
$text = $text -replace '<application', '<application android:label="FIN65"'
|
||||
}
|
||||
if ($text -notmatch 'android:icon=') {
|
||||
$text = $text -replace '<application', '<application android:icon="@mipmap/ic_launcher"'
|
||||
}
|
||||
if ($text -notmatch 'android:roundIcon=') {
|
||||
$text = $text -replace '<application', '<application android:roundIcon="@mipmap/ic_launcher_round"'
|
||||
}
|
||||
|
||||
Set-Content -Path $ManifestPath -Value $text -Encoding UTF8
|
||||
Write-Host "AndroidManifest.xml mis a jour."
|
||||
Reference in New Issue
Block a user