84 lines
2.7 KiB
PowerShell
84 lines
2.7 KiB
PowerShell
$MobileDir = "D:\07-Logiciels\20-FIN65\fin65_mobile"
|
|
$Manifest = Join-Path $MobileDir "android\app\src\main\AndroidManifest.xml"
|
|
|
|
Write-Host ""
|
|
Write-Host "=========================================="
|
|
Write-Host " FIN65 - Repair AndroidManifest.xml"
|
|
Write-Host "=========================================="
|
|
Write-Host ""
|
|
|
|
if (!(Test-Path $MobileDir)) {
|
|
Write-Host "[ERREUR] Dossier mobile introuvable : $MobileDir" -ForegroundColor Red
|
|
Read-Host "Appuie sur Entree pour fermer"
|
|
exit 1
|
|
}
|
|
|
|
$ManifestDir = Split-Path $Manifest -Parent
|
|
if (!(Test-Path $ManifestDir)) {
|
|
Write-Host "[ERREUR] Dossier Manifest introuvable : $ManifestDir" -ForegroundColor Red
|
|
Read-Host "Appuie sur Entree pour fermer"
|
|
exit 1
|
|
}
|
|
|
|
if (Test-Path $Manifest) {
|
|
$Stamp = Get-Date -Format "yyyyMMdd_HHmmss"
|
|
$Backup = "$Manifest.broken_$Stamp.bak"
|
|
Copy-Item $Manifest $Backup -Force
|
|
Write-Host "Sauvegarde de l'ancien Manifest :"
|
|
Write-Host $Backup
|
|
Write-Host ""
|
|
}
|
|
|
|
$Xml = @'
|
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
<uses-permission android:name="android.permission.INTERNET" />
|
|
|
|
<application
|
|
android:label="FIN65"
|
|
android:name="${applicationName}"
|
|
android:icon="@mipmap/ic_launcher"
|
|
android:roundIcon="@mipmap/ic_launcher_round"
|
|
android:usesCleartextTraffic="true">
|
|
<activity
|
|
android:name=".MainActivity"
|
|
android:exported="true"
|
|
android:launchMode="singleTop"
|
|
android:taskAffinity=""
|
|
android:theme="@style/LaunchTheme"
|
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
|
android:hardwareAccelerated="true"
|
|
android:windowSoftInputMode="adjustResize">
|
|
<meta-data
|
|
android:name="io.flutter.embedding.android.NormalTheme"
|
|
android:resource="@style/NormalTheme" />
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.MAIN" />
|
|
<category android:name="android.intent.category.LAUNCHER" />
|
|
</intent-filter>
|
|
</activity>
|
|
|
|
<meta-data
|
|
android:name="flutterEmbedding"
|
|
android:value="2" />
|
|
</application>
|
|
</manifest>
|
|
'@
|
|
|
|
Set-Content -Path $Manifest -Value $Xml -Encoding UTF8
|
|
|
|
Write-Host "AndroidManifest.xml repare :"
|
|
Write-Host $Manifest
|
|
Write-Host ""
|
|
|
|
Set-Location $MobileDir
|
|
|
|
Write-Host "Verification Flutter..."
|
|
flutter clean
|
|
flutter pub get
|
|
|
|
Write-Host ""
|
|
Write-Host "Termine. Relance maintenant :"
|
|
Write-Host "flutter run"
|
|
Write-Host ""
|
|
Read-Host "Appuie sur Entree pour fermer"
|