mirror of
https://github.com/bitwarden/mobile
synced 2025-12-10 13:23:39 +00:00
hockeyapp
This commit is contained in:
@@ -139,6 +139,7 @@
|
|||||||
<Compile Include="Services\DeviceActionService.cs" />
|
<Compile Include="Services\DeviceActionService.cs" />
|
||||||
<Compile Include="Services\LocalizeService.cs" />
|
<Compile Include="Services\LocalizeService.cs" />
|
||||||
<Compile Include="Utilities\AndroidHelpers.cs" />
|
<Compile Include="Utilities\AndroidHelpers.cs" />
|
||||||
|
<Compile Include="Utilities\HockeyAppCrashManagerListener.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AndroidAsset Include="Assets\FontAwesome.ttf" />
|
<AndroidAsset Include="Assets\FontAwesome.ttf" />
|
||||||
|
|||||||
@@ -30,8 +30,11 @@ namespace Bit.Droid
|
|||||||
private IDeviceActionService _deviceActionService;
|
private IDeviceActionService _deviceActionService;
|
||||||
private IMessagingService _messagingService;
|
private IMessagingService _messagingService;
|
||||||
private IBroadcasterService _broadcasterService;
|
private IBroadcasterService _broadcasterService;
|
||||||
|
private IUserService _userService;
|
||||||
|
private IAppIdService _appIdService;
|
||||||
private PendingIntent _lockAlarmPendingIntent;
|
private PendingIntent _lockAlarmPendingIntent;
|
||||||
private AppOptions _appOptions;
|
private AppOptions _appOptions;
|
||||||
|
private const string HockeyAppId = "d3834185b4a643479047b86c65293d42";
|
||||||
private Java.Util.Regex.Pattern _otpPattern =
|
private Java.Util.Regex.Pattern _otpPattern =
|
||||||
Java.Util.Regex.Pattern.Compile("^.*?([cbdefghijklnrtuv]{32,64})$");
|
Java.Util.Regex.Pattern.Compile("^.*?([cbdefghijklnrtuv]{32,64})$");
|
||||||
|
|
||||||
@@ -47,6 +50,8 @@ namespace Bit.Droid
|
|||||||
_deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
|
_deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
|
||||||
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
|
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
|
||||||
_broadcasterService = ServiceContainer.Resolve<IBroadcasterService>("broadcasterService");
|
_broadcasterService = ServiceContainer.Resolve<IBroadcasterService>("broadcasterService");
|
||||||
|
_userService = ServiceContainer.Resolve<IUserService>("userService");
|
||||||
|
_appIdService = ServiceContainer.Resolve<IAppIdService>("appIdService");
|
||||||
|
|
||||||
TabLayoutResource = Resource.Layout.Tabbar;
|
TabLayoutResource = Resource.Layout.Tabbar;
|
||||||
ToolbarResource = Resource.Layout.Toolbar;
|
ToolbarResource = Resource.Layout.Toolbar;
|
||||||
@@ -57,6 +62,12 @@ namespace Bit.Droid
|
|||||||
Window.AddFlags(Android.Views.WindowManagerFlags.Secure);
|
Window.AddFlags(Android.Views.WindowManagerFlags.Secure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !FDROID
|
||||||
|
var hockeyAppListener = new HockeyAppCrashManagerListener(_appIdService, _userService);
|
||||||
|
var hockeyAppTask = hockeyAppListener.InitAsync();
|
||||||
|
HockeyApp.Android.CrashManager.Register(this, HockeyAppId, hockeyAppListener);
|
||||||
|
#endif
|
||||||
|
|
||||||
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
|
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
|
||||||
Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
||||||
_appOptions = GetOptions();
|
_appOptions = GetOptions();
|
||||||
|
|||||||
65
src/Android/Utilities/HockeyAppCrashManagerListener.cs
Normal file
65
src/Android/Utilities/HockeyAppCrashManagerListener.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
#if !FDROID
|
||||||
|
using HockeyApp.Android;
|
||||||
|
using Bit.App.Abstractions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Android.Runtime;
|
||||||
|
using Bit.Core.Abstractions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Bit.Droid.Utilities
|
||||||
|
{
|
||||||
|
public class HockeyAppCrashManagerListener : CrashManagerListener
|
||||||
|
{
|
||||||
|
private readonly IAppIdService _appIdService;
|
||||||
|
private readonly IUserService _userService;
|
||||||
|
|
||||||
|
private string _userId;
|
||||||
|
private string _appId;
|
||||||
|
|
||||||
|
public HockeyAppCrashManagerListener()
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public HockeyAppCrashManagerListener(System.IntPtr javaRef, JniHandleOwnership transfer)
|
||||||
|
: base(javaRef, transfer)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public HockeyAppCrashManagerListener(
|
||||||
|
IAppIdService appIdService,
|
||||||
|
IUserService userService)
|
||||||
|
{
|
||||||
|
_appIdService = appIdService;
|
||||||
|
_userService = userService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task InitAsync()
|
||||||
|
{
|
||||||
|
_userId = await _userService.GetUserIdAsync();
|
||||||
|
_appId = await _appIdService.GetAppIdAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string Description
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if(_userId != null && _appId != null)
|
||||||
|
{
|
||||||
|
return JsonConvert.SerializeObject(new
|
||||||
|
{
|
||||||
|
AppId = _appId,
|
||||||
|
UserId = _userId
|
||||||
|
}, Formatting.Indented);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool ShouldAutoUploadCrashes()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -56,16 +56,16 @@ $firebaseNode.ParentNode.RemoveChild($firebaseNode);
|
|||||||
|
|
||||||
$xml.Save($androidPath);
|
$xml.Save($androidPath);
|
||||||
|
|
||||||
#echo "##### Uninstall from App.csproj"
|
echo "##### Uninstall from App.csproj"
|
||||||
#
|
|
||||||
#$xml=New-Object XML;
|
$xml=New-Object XML;
|
||||||
#$xml.Load($appPath);
|
$xml.Load($appPath);
|
||||||
#
|
|
||||||
#$hockeyNode=$xml.SelectSingleNode("/Project/ItemGroup/PackageReference[@Include='HockeySDK.Xamarin']");
|
$hockeyNode=$xml.SelectSingleNode("/Project/ItemGroup/PackageReference[@Include='HockeySDK.Xamarin']");
|
||||||
#$hockeyNode.ParentNode.RemoveChild($hockeyNode);
|
$hockeyNode.ParentNode.RemoveChild($hockeyNode);
|
||||||
#
|
|
||||||
#$xml.Save($appPath);
|
$xml.Save($appPath);
|
||||||
#
|
|
||||||
echo "##### Restore NuGet"
|
echo "##### Restore NuGet"
|
||||||
|
|
||||||
$nugetPath = $($rootPath + "\nuget.exe");
|
$nugetPath = $($rootPath + "\nuget.exe");
|
||||||
|
|||||||
@@ -13,10 +13,11 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="HockeySDK.Xamarin" Version="5.2.0" />
|
||||||
<PackageReference Include="Plugin.Fingerprint" Version="1.4.9" />
|
<PackageReference Include="Plugin.Fingerprint" Version="1.4.9" />
|
||||||
<PackageReference Include="Refractored.FloatingActionButtonForms" Version="2.1.0" />
|
<PackageReference Include="Refractored.FloatingActionButtonForms" Version="2.1.0" />
|
||||||
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
|
||||||
<PackageReference Include="Xamarin.FFImageLoading.Forms" Version="2.4.10.972" />
|
<PackageReference Include="Xamarin.FFImageLoading.Forms" Version="2.4.11.982" />
|
||||||
<PackageReference Include="Xamarin.Forms" Version="3.6.0.344457" />
|
<PackageReference Include="Xamarin.Forms" Version="3.6.0.344457" />
|
||||||
<PackageReference Include="ZXing.Net.Mobile.Forms" Version="2.1.47" />
|
<PackageReference Include="ZXing.Net.Mobile.Forms" Version="2.1.47" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user