Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,5 @@ paket-files/
/Secrets/client_id.json
/libmp3lame.32.dll
/libmp3lame.64.dll

/Tools/
17 changes: 0 additions & 17 deletions App.xaml.cs

This file was deleted.

2 changes: 2 additions & 0 deletions CopySettingsToUserFolder.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copy-Item "GAssistant\Secrets\client_id.json" -Destination $env:APPDATA\GAssistant\
Copy-Item "GAssistant\settings.json" -Destination $env:APPDATA\GAssistant\
13 changes: 13 additions & 0 deletions DownloadTools.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
New-Item Tools -type directory -Force

Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Grpc.Tools/ -OutFile grpc.zip

Remove-Item Tools\Grpc\* -recurse
Expand-Archive grpc.zip -DestinationPath Tools\Grpc
Remove-Item grpc.zip

Invoke-WebRequest -Uri https://github.com/google/protobuf/releases/download/v3.5.0/protoc-3.5.0-win32.zip -OutFile protoc.zip

Remove-Item Tools\Protoc\* -recurse
Expand-Archive protoc.zip -DestinationPath Tools\Protoc
Remove-Item protoc.zip
62 changes: 62 additions & 0 deletions GAssistant.Store/GAssistant.Store.wapproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '15.0'">
<VisualStudioVersion>15.0</VisualStudioVersion>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
</PropertyGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
<PropertyGroup>
<ProjectGuid>fa7bbace-16a0-4c8c-a5e6-f3f149add7bf</ProjectGuid>
<TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
<DefaultLanguage>en-US</DefaultLanguage>
<PackageCertificateKeyFile>GAssistant.Store_TemporaryKey.pfx</PackageCertificateKeyFile>
<EntryPointProjectUniqueName>..\GAssistant\GoogleAssistantWindows.csproj</EntryPointProjectUniqueName>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="GAssistant.Store_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<Content Include="Images\LockScreenLogo.scale-200.png" />
<Content Include="Images\Square150x150Logo.scale-200.png" />
<Content Include="Images\Square44x44Logo.scale-200.png" />
<Content Include="Images\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Images\StoreLogo.png" />
<Content Include="Images\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GAssistant\GoogleAssistantWindows.csproj" />
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
</Project>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GAssistant.Store/Images/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions GAssistant.Store/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap mp rescap">

<Identity
Name="6ecf4456-043f-44b8-80be-934f18a1bf83"
Publisher="CN=Pieter"
Version="1.0.0.0" />

<Properties>
<DisplayName>GAssistant.Store</DisplayName>
<PublisherDisplayName>Pieter</PublisherDisplayName>
<Logo>Images\StoreLogo.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate"/>
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="GAssistant.Store"
Description="GAssistant.Store"
BackgroundColor="transparent"
Square150x150Logo="Images\Square150x150Logo.png"
Square44x44Logo="Images\Square44x44Logo.png">
<uap:DefaultTile
Wide310x150Logo="Images\Wide310x150Logo.png" />
</uap:VisualElements>
</Application>
</Applications>

<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>
16 changes: 8 additions & 8 deletions App.config → GAssistant/App.config
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.25.0.0" newVersion="1.25.0.0" />
<assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.25.0.0" newVersion="1.25.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Auth.PlatformServices" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.25.0.0" newVersion="1.25.0.0" />
<assemblyIdentity name="Google.Apis.Auth.PlatformServices" publicKeyToken="4b01fa6e34db77ab" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.25.0.0" newVersion="1.25.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
3 changes: 1 addition & 2 deletions App.xaml → GAssistant/App.xaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Application x:Class="GoogleAssistantWindows.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GoogleAssistantWindows"
StartupUri="MainWindow.xaml">
xmlns:local="clr-namespace:GoogleAssistantWindows">
<Application.Resources>

</Application.Resources>
Expand Down
73 changes: 73 additions & 0 deletions GAssistant/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using Autofac;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;

namespace GoogleAssistantWindows
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();

public static IContainer Container { get; private set; }

protected override void OnStartup(StartupEventArgs e)
{
Application.Current.DispatcherUnhandledException += OnUnhandledException;

var builder = new ContainerBuilder();
builder.RegisterType<MainWindow>();
builder.RegisterType<SettingsWindow>();
builder.RegisterType<WelcomeWindow>();

builder.RegisterType<Assistant>()
.SingleInstance();
builder.RegisterType<UserManager>()
.SingleInstance();
builder.RegisterType<DeviceRegistration>();

builder.RegisterType<Settings>()
.OnActivating(settings =>
{
settings.Instance.Load();
})
.SingleInstance();

Container = builder.Build();

MainWindow mainWindow = Container.Resolve<MainWindow>();
mainWindow.Show();
}

void OnUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
string typeName = GetTypeName(e.Exception);
if(typeName != null)
logger.Error("Unhandled Exception at \"{0}\": {1}", typeName, e.Exception.Message);
else
logger.Error("Unhandled Exception: {0}", e.Exception.Message);
}

private string GetTypeName(Exception ex)
{
try
{
StackTrace stackTrace = new StackTrace(ex);
return stackTrace.GetFrame(0).GetMethod().DeclaringType.FullName;
}
catch
{
return null;
}
}
}
}
Loading