mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
Tracing bundles (#842)
* Output to bundle (play store build only) and enable startup tracing * Update ci build script to recognize bundle (.aab) for Google Play build * Added bundle awareness to `appveyor.yml` and `Program.cs` * Log upload exception * Restore original apk creation alongside the bundle * Remove link skip as AOT doesn't support linking
This commit is contained in:
parent
ae66a781d1
commit
5a78cbef02
5 changed files with 39 additions and 18 deletions
|
@ -98,6 +98,7 @@ build_script:
|
||||||
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
|
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
|
||||||
.\src\Android\ci-build-apks.ps1
|
.\src\Android\ci-build-apks.ps1
|
||||||
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
|
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
|
||||||
|
Push-AppveyorArtifact .\com.x8bit.bitwarden.aab
|
||||||
Push-AppveyorArtifact .\com.x8bit.bitwarden.apk
|
Push-AppveyorArtifact .\com.x8bit.bitwarden.apk
|
||||||
Push-AppveyorArtifact .\com.x8bit.bitwarden-fdroid.apk
|
Push-AppveyorArtifact .\com.x8bit.bitwarden-fdroid.apk
|
||||||
}
|
}
|
||||||
|
@ -114,7 +115,7 @@ on_success:
|
||||||
cd store\google\Publisher\bin\Release\netcoreapp2.0
|
cd store\google\Publisher\bin\Release\netcoreapp2.0
|
||||||
dotnet Publisher.dll `
|
dotnet Publisher.dll `
|
||||||
$env:APPVEYOR_BUILD_FOLDER\store\google\Publisher\play_creds.json `
|
$env:APPVEYOR_BUILD_FOLDER\store\google\Publisher\play_creds.json `
|
||||||
$env:APPVEYOR_BUILD_FOLDER\com.x8bit.bitwarden.apk `
|
$env:APPVEYOR_BUILD_FOLDER\com.x8bit.bitwarden.aab `
|
||||||
alpha
|
alpha
|
||||||
cd $env:APPVEYOR_BUILD_FOLDER
|
cd $env:APPVEYOR_BUILD_FOLDER
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
||||||
<NuGetPackageImportStamp>
|
<NuGetPackageImportStamp>
|
||||||
</NuGetPackageImportStamp>
|
</NuGetPackageImportStamp>
|
||||||
<AndroidLinkSkip>Xamarin.GooglePlayServices.Base;Xamarin.GooglePlayServices.Basement;Xamarin.GooglePlayServices.Measurement;Xamarin.GooglePlayServices.Gcm;BitwardenAndroid;BitwardenApp;BitwardenCore;Xamarin.Android.Net;Xamarin.Android.Net.OldAndroidSSLSocketFactory;LiteDB;Microsoft.AppCenter.Crashes</AndroidLinkSkip>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
@ -45,7 +44,7 @@
|
||||||
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
|
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
|
||||||
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
|
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
|
||||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
||||||
<AndroidLinkMode>Full</AndroidLinkMode>
|
<AndroidEnableProfiledAot>true</AndroidEnableProfiledAot>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'FDroid|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'FDroid|AnyCPU'">
|
||||||
<DebugSymbols>false</DebugSymbols>
|
<DebugSymbols>false</DebugSymbols>
|
||||||
|
@ -61,7 +60,7 @@
|
||||||
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
|
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
|
||||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
||||||
<AndroidLinkMode>Full</AndroidLinkMode>
|
<AndroidEnableProfiledAot>true</AndroidEnableProfiledAot>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Mono.Android" />
|
<Reference Include="Mono.Android" />
|
||||||
|
@ -89,7 +88,7 @@
|
||||||
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0" />
|
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0" />
|
||||||
<PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0" />
|
<PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0" />
|
||||||
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.1.0" />
|
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.1.0" />
|
||||||
<PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.2" />
|
<PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.4" />
|
||||||
<PackageReference Include="Xamarin.GooglePlayServices.SafetyNet">
|
<PackageReference Include="Xamarin.GooglePlayServices.SafetyNet">
|
||||||
<Version>71.1600.0</Version>
|
<Version>71.1600.0</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
|
@ -29,16 +29,33 @@ Invoke-Expression "& `"$secureFilePath`" -decrypt $($encKeystorePath) -secret $(
|
||||||
Invoke-Expression "& `"$secureFilePath`" -decrypt $($encUploadKeystorePath) -secret $($env:upload_keystore_dec_secret)"
|
Invoke-Expression "& `"$secureFilePath`" -decrypt $($encUploadKeystorePath) -secret $($env:upload_keystore_dec_secret)"
|
||||||
|
|
||||||
echo "########################################"
|
echo "########################################"
|
||||||
echo "##### Sign Release Configuration"
|
echo "##### Sign Google Play Bundle Release Configuration"
|
||||||
echo "########################################"
|
echo "########################################"
|
||||||
|
|
||||||
msbuild "$($androidPath)" "/t:SignAndroidPackage" "/p:Configuration=Release" "/p:AndroidKeyStore=true" `
|
msbuild "$($androidPath)" "/t:SignAndroidPackage" "/p:Configuration=Release" "/p:AndroidKeyStore=true" `
|
||||||
"/p:AndroidSigningKeyAlias=upload" "/p:AndroidSigningKeyPass=$($env:upload_keystore_password)" `
|
"/p:AndroidSigningKeyAlias=upload" "/p:AndroidSigningKeyPass=$($env:upload_keystore_password)" `
|
||||||
"/p:AndroidSigningKeyStore=upload-keystore.jks" "/p:AndroidSigningStorePass=$($env:upload_keystore_password)" `
|
"/p:AndroidSigningKeyStore=upload-keystore.jks" "/p:AndroidSigningStorePass=$($env:upload_keystore_password)" `
|
||||||
"/v:quiet"
|
"/p:AndroidPackageFormat=aab" "/v:quiet"
|
||||||
|
|
||||||
echo "########################################"
|
echo "########################################"
|
||||||
echo "##### Copy Release apk to project root"
|
echo "##### Copy Google Play Bundle to project root"
|
||||||
|
echo "########################################"
|
||||||
|
|
||||||
|
$signedAabPath = $($rootPath + "\src\Android\bin\Release\com.x8bit.bitwarden-Signed.aab");
|
||||||
|
$signedAabDestPath = $($rootPath + "\com.x8bit.bitwarden.aab");
|
||||||
|
|
||||||
|
Copy-Item $signedAabPath $signedAabDestPath
|
||||||
|
|
||||||
|
echo "########################################"
|
||||||
|
echo "##### Sign APK Release Configuration"
|
||||||
|
echo "########################################"
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
echo "########################################"
|
||||||
|
echo "##### Copy Release APK to project root"
|
||||||
echo "########################################"
|
echo "########################################"
|
||||||
|
|
||||||
$signedApkPath = $($rootPath + "\src\Android\bin\Release\com.x8bit.bitwarden-Signed.apk");
|
$signedApkPath = $($rootPath + "\src\Android\bin\Release\com.x8bit.bitwarden-Signed.apk");
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace Bit.Publisher
|
||||||
{
|
{
|
||||||
private const string Package = "com.x8bit.bitwarden";
|
private const string Package = "com.x8bit.bitwarden";
|
||||||
|
|
||||||
private static string _apkFilePath;
|
private static string _aabFilePath;
|
||||||
private static string _credsFilePath;
|
private static string _credsFilePath;
|
||||||
private static string _track;
|
private static string _track;
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ namespace Bit.Publisher
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_credsFilePath = args[0];
|
_credsFilePath = args[0];
|
||||||
_apkFilePath = args[1];
|
_aabFilePath = args[1];
|
||||||
|
|
||||||
var track = args[2].Substring(0, 1).ToLower();
|
var track = args[2].Substring(0, 1).ToLower();
|
||||||
if (track == "a")
|
if (track == "a")
|
||||||
|
@ -83,31 +83,35 @@ namespace Bit.Publisher
|
||||||
|
|
||||||
Console.WriteLine("Created edit with id {0}.", edit.Id);
|
Console.WriteLine("Created edit with id {0}.", edit.Id);
|
||||||
|
|
||||||
Apk apk = null;
|
Bundle aab = null;
|
||||||
using (var stream = new FileStream(_apkFilePath, FileMode.Open))
|
using (var stream = new FileStream(_aabFilePath, FileMode.Open))
|
||||||
{
|
{
|
||||||
var uploadMedia = service.Edits.Apks.Upload(Package, edit.Id, stream,
|
var uploadMedia = service.Edits.Bundles.Upload(Package, edit.Id, stream,
|
||||||
"application/vnd.android.package-archive");
|
"application/octet-stream");
|
||||||
|
|
||||||
var progress = await uploadMedia.UploadAsync();
|
var progress = await uploadMedia.UploadAsync();
|
||||||
if (progress.Status == Google.Apis.Upload.UploadStatus.Completed)
|
if (progress.Status == Google.Apis.Upload.UploadStatus.Completed)
|
||||||
{
|
{
|
||||||
apk = uploadMedia.ResponseBody;
|
aab = uploadMedia.ResponseBody;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (progress.Exception != null)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Upload exception: {0}", progress.Exception);
|
||||||
|
}
|
||||||
throw new Exception("Upload failed.");
|
throw new Exception("Upload failed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine("Version code {0} has been uploaded.", apk.VersionCode);
|
Console.WriteLine("Version code {0} has been uploaded.", aab.VersionCode);
|
||||||
|
|
||||||
var trackRequest = service.Edits.Tracks.Update(new Track
|
var trackRequest = service.Edits.Tracks.Update(new Track
|
||||||
{
|
{
|
||||||
TrackValue = _track,
|
TrackValue = _track,
|
||||||
Releases = new List<TrackRelease>
|
Releases = new List<TrackRelease>
|
||||||
{
|
{
|
||||||
new TrackRelease { VersionCodes = new List<long?> { apk.VersionCode }, Status = "completed" }
|
new TrackRelease { VersionCodes = new List<long?> { aab.VersionCode }, Status = "completed" }
|
||||||
}
|
}
|
||||||
}, Package, edit.Id, _track);
|
}, Package, edit.Id, _track);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Google.Apis.AndroidPublisher.v3" Version="1.45.0.1908" />
|
<PackageReference Include="Google.Apis.AndroidPublisher.v3" Version="1.45.0.1916" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
Loading…
Reference in a new issue