2018-01-11 06:10:32 +03:00
|
|
|
|
$rootPath = $env:APPVEYOR_BUILD_FOLDER;
|
|
|
|
|
$androidPath = $($rootPath + "\src\Android\Android.csproj");
|
|
|
|
|
|
|
|
|
|
echo "##### Increment Version"
|
|
|
|
|
|
|
|
|
|
$androidManifest = $($rootPath + "\src\Android\Properties\AndroidManifest.xml");
|
|
|
|
|
|
|
|
|
|
$xml=New-Object XML;
|
|
|
|
|
$xml.Load($androidManifest);
|
|
|
|
|
|
|
|
|
|
$node=$xml.SelectNodes("/manifest");
|
|
|
|
|
$node.SetAttribute("android:versionCode", $env:APPVEYOR_BUILD_NUMBER);
|
|
|
|
|
|
|
|
|
|
$xml.Save($androidManifest);
|
|
|
|
|
|
|
|
|
|
echo "##### Decrypt Keystore"
|
|
|
|
|
|
|
|
|
|
$encKeystorePath = $($rootPath + "\src\Android\8bit.keystore.enc");
|
2018-01-11 06:30:30 +03:00
|
|
|
|
$secureFilePath = $($rootPath + "\secure-file\tools\secure-file.exe");
|
2018-01-11 06:20:22 +03:00
|
|
|
|
|
2018-01-11 06:30:30 +03:00
|
|
|
|
Invoke-Expression "& `"$secureFilePath`" -decrypt $($encKeystorePath) -secret $($env:keystore_dec_secret)"
|
2018-01-11 06:10:32 +03:00
|
|
|
|
|
|
|
|
|
echo "##### Sign Release Configuration"
|
|
|
|
|
|
2018-01-11 07:00:10 +03:00
|
|
|
|
msbuild "$($androidPath)" "/t:SignAndroidPackage" "/p:Configuration=Release" "/p:AndroidKeyStore=true" "/p:AndroidSigningKeyAlias=bitwarden" "/p:AndroidSigningKeyPass=$($env:keystore_password)" "/p:AndroidSigningKeyStore=8bit.keystore" "/p:AndroidSigningStorePass=$($env:keystore_password)" "/v:quiet"
|
2018-01-11 06:10:32 +03:00
|
|
|
|
|
|
|
|
|
echo "##### Copy Release apk to project root"
|
|
|
|
|
|
|
|
|
|
$signedApkPath = $($rootPath + "\src\Android\bin\Release\com.x8bit.bitwarden-Signed.apk");
|
|
|
|
|
$signedApkDestPath = $($rootPath + "\com.x8bit.bitwarden-" + $env:APPVEYOR_BUILD_NUMBER + ".apk");
|
|
|
|
|
|
|
|
|
|
Copy-Item $signedApkPath $signedApkDestPath
|
|
|
|
|
|
|
|
|
|
echo "##### Build and Sign FDroid Configuration"
|
|
|
|
|
|
2018-01-11 07:00:10 +03:00
|
|
|
|
msbuild "$($androidPath)" "/t:SignAndroidPackage" "/p:Configuration=FDroid" "/p:AndroidKeyStore=true" "/p:AndroidSigningKeyAlias=bitwarden" "/p:AndroidSigningKeyPass=$($env:keystore_password)" "/p:AndroidSigningKeyStore=8bit.keystore" "/p:AndroidSigningStorePass=$($env:keystore_password)" "/v:quiet"
|
2018-01-11 06:10:32 +03:00
|
|
|
|
|
|
|
|
|
echo "##### Copy FDroid apk to project root"
|
|
|
|
|
|
|
|
|
|
$signedApkPath = $($rootPath + "\src\Android\bin\FDroid\com.x8bit.bitwarden-Signed.apk");
|
|
|
|
|
$signedApkDestPath = $($rootPath + "\com.x8bit.bitwarden-fdroid-" + $env:APPVEYOR_BUILD_NUMBER + ".apk");
|
|
|
|
|
|
|
|
|
|
Copy-Item $signedApkPath $signedApkDestPath
|
|
|
|
|
|
|
|
|
|
echo "##### Done"
|