Skip to content

Commit 96c90c0

Browse files
authored
Merge pull request #102 from codemerx/avalonia
Avalonia-based UI
2 parents 2c0883e + 94c6c83 commit 96c90c0

File tree

132 files changed

+4279
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+4279
-31
lines changed

.github/workflows/package.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,77 @@ name: Package
22

33
on:
44
workflow_dispatch:
5+
6+
jobs:
7+
package-windows:
8+
runs-on: windows-2022
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
submodules: true
14+
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v4
17+
with:
18+
dotnet-version: 7.0.x
19+
20+
- name: Publish
21+
run: dotnet publish -r win-x64 -c Release
22+
working-directory: ./engine/CodemerxDecompile
23+
24+
- name: Archive artifacts
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: CodemerxDecompile-windows-x64
28+
path: engine/CodemerxDecompile/bin/Release/net7.0/win-x64/publish
29+
30+
package-linux:
31+
runs-on: ubuntu-22.04
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
with:
36+
submodules: true
37+
38+
- name: Setup .NET
39+
uses: actions/setup-dotnet@v4
40+
with:
41+
dotnet-version: 7.0.x
42+
43+
- name: Publish
44+
run: dotnet publish -r linux-x64 -c Release
45+
working-directory: ./engine/CodemerxDecompile
46+
47+
- name: Archive artifacts
48+
run: tar -czpf CodemerxDecompile-linux-x64.tar.gz -C ./engine/CodemerxDecompile/bin/Release/net7.0/linux-x64/publish .
49+
50+
- name: Upload artifacts
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: CodemerxDecompile-linux-x64
54+
path: CodemerxDecompile-linux-x64.tar.gz
55+
56+
package-macos:
57+
runs-on: macos-14
58+
59+
steps:
60+
- uses: actions/checkout@v4
61+
with:
62+
submodules: true
63+
64+
- name: Publish
65+
run: dotnet publish -r osx-arm64 -c Release
66+
working-directory: ./engine/CodemerxDecompile
67+
68+
- name: Build .app bundle
69+
run: build/macos/build-application-bundle.sh
70+
71+
- name: Archive artifacts
72+
run: tar -czpf CodemerxDecompile-macos-arm64.tar.gz CodemerxDecompile.app
73+
74+
- name: Upload artifacts
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: CodemerxDecompile-macos-arm64
78+
path: CodemerxDecompile-macos-arm64.tar.gz

.github/workflows/packaging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# You should have received a copy of the GNU Affero General Public License
1515
# along with CodemerxDecompile. If not, see<https://www.gnu.org/licenses/>.
1616

17-
name: Package
17+
name: Package-old
1818

1919
env:
2020
NODE_VERSION: 10.22.1

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
CodemerxDecompile-*/
2-
/common/CDKey.snk
1+
CodemerxDecompile-*/
2+
/common/CDKey.snk
3+
.DS_Store

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "engine/AvaloniaEdit"]
2+
path = engine/AvaloniaEdit
3+
url = ../AvaloniaEdit.git

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ CodemerxDecompile is maintained by the original JustDecompile creators and it is
1313
2. Start `CodemerxDecompile.exe`
1414

1515
### Linux
16-
1. Extract the archive using `tar -xzpf ./CodemerxDecompile-linux-x64.tar.gz`
17-
2. Start the app using `./CodemerxDecompile-linux-x64/bin/CodemerxDecompile`
16+
1. Extract the archive using `mkdir CodemerxDecompile && tar -xzpf ./CodemerxDecompile-linux-x64.tar.gz -C CodemerxDecompile`
17+
2. Start the app using `./CodemerxDecompile/CodemerxDecompile`
1818

1919
### MacOS
20-
1. Extract the archive using `tar -xzpf ./CodemerxDecompile-darwin.tar`
21-
2. Start `CodemerxDecompile.app`
20+
1. Extract the archive using `tar -xzpf ./CodemerxDecompile-macos-arm64.tar`
21+
2. Remove the quarantine attribute using `xattr -d com.apple.quarantine CodemerxDecompile.app`. This is necessary as the app is not signed and MacOS reports it as "CodemerxDecompile is damaged and can't be opened.".
22+
3. Start `CodemerxDecompile.app`
2223

2324
## License
2425

build/macos/Info.plist

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleIdentifier</key>
6+
<string>com.codemerx.decompiler</string>
7+
<key>CFBundleName</key>
8+
<string>CodemerxDecompile</string>
9+
<key>CFBundleDisplayName</key>
10+
<string>CodemerxDecompile</string>
11+
<key>CFBundleIconFile</key>
12+
<string>codemerx-logo.icns</string>
13+
<key>CFBundleVersion</key>
14+
<string>1.2.0</string>
15+
<key>CFBundleShortVersionString</key>
16+
<string>1.2.0</string>
17+
<key>CFBundleExecutable</key>
18+
<string>CodemerxDecompile</string>
19+
<key>CFBundleInfoDictionaryVersion</key>
20+
<string>6.0</string>
21+
<key>CFBundlePackageType</key>
22+
<string>APPL</string>
23+
<key>NSHighResolutionCapable</key>
24+
<true/>
25+
</dict>
26+
</plist>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
mkdir -p CodemerxDecompile.app/Contents/{MacOS,Resources}
4+
5+
script_dir=$(dirname $0)
6+
cp $script_dir/Info.plist CodemerxDecompile.app/Contents
7+
cp $script_dir/codemerx-logo.icns CodemerxDecompile.app/Contents/Resources
8+
9+
cp -Rp engine/CodemerxDecompile/bin/Release/net7.0/osx-arm64/publish/ CodemerxDecompile.app/Contents/MacOS

build/macos/codemerx-logo.icns

90.2 KB
Binary file not shown.

engine/.idea/.idea.CodemerxDecompileEngine/.idea/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/.idea/.idea.CodemerxDecompileEngine/.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/.idea/.idea.CodemerxDecompileEngine/.idea/avalonia.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/.idea/.idea.CodemerxDecompileEngine/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/.idea/.idea.CodemerxDecompileEngine/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/AvaloniaEdit

Submodule AvaloniaEdit added at 4aeee6d

engine/CodemerxDecompile.Service/CodemerxDecompile.Service.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<Project Sdk="Microsoft.NET.Sdk.Web">
2020

2121
<PropertyGroup>
22-
<TargetFramework>netcoreapp3.1</TargetFramework>
22+
<TargetFramework>net6.0</TargetFramework>
2323
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
2424
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
2525
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
@@ -50,7 +50,7 @@
5050

5151
<ItemGroup>
5252
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
53-
<PackageReference Include="Grpc.AspNetCore" Version="2.27.0" />
53+
<PackageReference Include="Grpc.AspNetCore" Version="2.60.0" />
5454
</ItemGroup>
5555

5656
<ItemGroup>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
namespace CodemerxDecompile;
2+
3+
public readonly record struct AnalyticsEvent(string Category, string Action);
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
namespace CodemerxDecompile;
2+
3+
public static class AnalyticsEvents
4+
{
5+
public static readonly AnalyticsEvent Startup = new("application", "startup");
6+
public static readonly AnalyticsEvent Shutdown = new("application", "shutdown");
7+
public static readonly AnalyticsEvent OpenFile = new("assemblies", "open-file");
8+
public static readonly AnalyticsEvent CloseAll = new("assemblies", "close-all");
9+
public static readonly AnalyticsEvent OpenViaDragDrop = new("assemblies", "open-via-drag-drop");
10+
public static readonly AnalyticsEvent ResolveReference = new("assemblies", "resolve-reference");
11+
public static readonly AnalyticsEvent GoBack = new("navigation", "go-back");
12+
public static readonly AnalyticsEvent GoForward = new("navigation", "go-forward");
13+
public static readonly AnalyticsEvent GoToDefinition = new("navigation", "go-to-definition");
14+
public static readonly AnalyticsEvent CreateProject2019 = new("create-project", "2019");
15+
public static readonly AnalyticsEvent CreateProject2017 = new("create-project", "2017");
16+
public static readonly AnalyticsEvent CreateProject2015 = new("create-project", "2015");
17+
public static readonly AnalyticsEvent ChangeLanguageToCSharp = new("change-language", "C#");
18+
public static readonly AnalyticsEvent ChangeLanguageToVisualBasic = new("change-language", "VB.NET");
19+
public static readonly AnalyticsEvent ChangeLanguageToIntermediateLanguage = new("change-language", "IL");
20+
public static readonly AnalyticsEvent Search = new("search", "run");
21+
public static readonly AnalyticsEvent NavigateToSearchResult = new("search", "navigate-to-result");
22+
public static readonly AnalyticsEvent DownloadNewVersion = new("new-version", "download");
23+
// TODO: Report the following events to monitor usage of shortcuts
24+
// public static readonly Event OpenFileShortcut = new("shortcut", "open-file");
25+
// public static readonly Event GoBackViaKeyboardShortcut = new("shortcut", "go-back-via-keyboard");
26+
// public static readonly Event GoForwardViaKeyboardShortcut = new("shortcut", "go-forward-via-keyboard");
27+
// public static readonly Event GoBackViaMouseShortcut = new("shortcut", "go-back-via-mouse");
28+
// public static readonly Event GoForwardViaMouseShortcut = new("shortcut", "go-forward-via-mouse");
29+
// public static readonly Event SearchShortcut = new("shortcut", "search");
30+
// public static readonly Event GoToDefinitionViaKeyboardShortcut = new("shortcut", "go-to-definition-via-keyboard");
31+
// public static readonly Event GoToDefinitionViaMouseShortcut = new("shortcut", "go-to-definition-via-mouse");
32+
}

engine/CodemerxDecompile/App.axaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<Application xmlns="https://github.com/avaloniaui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:editing="https://github.com/avaloniaui/avaloniaedit"
4+
x:Class="CodemerxDecompile.App"
5+
RequestedThemeVariant="Light"
6+
Name="CodemerxDecompile">
7+
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
8+
9+
<Application.Styles>
10+
<FluentTheme />
11+
<StyleInclude Source="avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml" />
12+
13+
<Style Selector="TreeViewItem">
14+
<Setter Property="MinHeight" Value="24" />
15+
</Style>
16+
17+
<Style Selector="editing|TextArea">
18+
<Setter Property="SelectionBrush" Value="#9ECCFD" />
19+
</Style>
20+
21+
<Style Selector="GridSplitter">
22+
<Setter Property="Width" Value="1" />
23+
<Setter Property="MinWidth" Value="1" />
24+
<Setter Property="Background" Value="#DFDFDF" />
25+
</Style>
26+
27+
<Style Selector="Button:disabled">
28+
<Setter Property="Opacity" Value="0.5" />
29+
</Style>
30+
</Application.Styles>
31+
32+
</Application>

engine/CodemerxDecompile/App.axaml.cs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using System;
2+
using Avalonia;
3+
using Avalonia.Controls.ApplicationLifetimes;
4+
using Avalonia.Markup.Xaml;
5+
using CodemerxDecompile.Extensions;
6+
using CodemerxDecompile.Services;
7+
using CodemerxDecompile.Views;
8+
using Microsoft.Extensions.DependencyInjection;
9+
10+
namespace CodemerxDecompile;
11+
12+
public partial class App : Application
13+
{
14+
public new static App Current => (App)Application.Current!;
15+
16+
public IServiceProvider Services { get; } = ConfigureServices();
17+
18+
public override void Initialize()
19+
{
20+
AvaloniaXamlLoader.Load(this);
21+
}
22+
23+
public override void OnFrameworkInitializationCompleted()
24+
{
25+
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
26+
{
27+
desktop.MainWindow = Services.GetRequiredService<MainWindow>();
28+
29+
desktop.ShutdownRequested += (_, _) =>
30+
{
31+
var analyticsService = Services.GetRequiredService<IAnalyticsService>();
32+
try
33+
{
34+
analyticsService.TrackEvent(AnalyticsEvents.Shutdown);
35+
}
36+
catch { }
37+
};
38+
}
39+
40+
base.OnFrameworkInitializationCompleted();
41+
}
42+
43+
private static IServiceProvider ConfigureServices() =>
44+
new ServiceCollection()
45+
.ConfigureOptions()
46+
.ConfigureLogging()
47+
.AddViews()
48+
.AddViewModels()
49+
.AddServices()
50+
.AddProviders()
51+
.AddHttpClients()
52+
.BuildServiceProvider();
53+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
using System.Reflection;
3+
4+
namespace CodemerxDecompile;
5+
6+
public static class AssemblyProvider
7+
{
8+
private static readonly Lazy<Assembly> AssemblyHolder = new(() => typeof(AssemblyProvider).Assembly);
9+
10+
public static Assembly Assembly => AssemblyHolder.Value;
11+
}
Lines changed: 17 additions & 0 deletions
Loading
Lines changed: 13 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)