Skip to content
Merged
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
4 changes: 3 additions & 1 deletion lib/package/macos.ex
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,8 @@ defmodule Desktop.Deployment.Package.MacOS do
end

defp uid_to_string(uid) when is_list(uid), do: List.to_string(uid)
# DirectoryString as decoded by :public_key, e.g. {:utf8String, "..."}
defp uid_to_string({_type, uid}), do: uid_to_string(uid)
defp uid_to_string(uid), do: to_string(uid)

def maybe_import_p12(file, password, uids, keychain_password \\ nil) do
Expand Down Expand Up @@ -796,7 +798,7 @@ defmodule Desktop.Deployment.Package.MacOS do
end

defp scan({:AttributeTypeAndValue, @friendly_attribute, friendly}) do
case Regex.scan(~r/\(([^)]+)\)$/, friendly) do
case Regex.scan(~r/\(([^)]+)\)$/, uid_to_string(friendly)) do
[[_full, uid]] -> [uid]
_ -> []
end
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ defmodule Desktop.Deployment.MixProject do
defp deps do
[
# Credo
{:httpoison, "~> 2.0", runtime: false},
{:httpoison, "~> 3.0", runtime: false},
{:credo, "~> 1.5", only: [:dev, :test], runtime: false},
# 1.3.0+ (icon embedding) is on GitHub; switch to Hex once published.
{:libpe, github: "elixir-desktop/libpe", branch: "master"},
{:poison, "~> 3.0"}
{:poison, "~> 6.0"}
]
end
end
2 changes: 2 additions & 0 deletions test/codesign_test.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
defmodule CodesignTest do
use ExUnit.Case

@moduletag :macos

test "codesign a new binary" do
{_, 0} = System.cmd("gcc", ["test/priv/main.c", "-o", "unsigned_main"])
Desktop.Deployment.Package.MacOS.codesign_executable("unsigned_main")
Expand Down
3 changes: 2 additions & 1 deletion test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ExUnit.start()
exclude = if match?({:unix, :darwin}, :os.type()), do: [], else: [:macos]
ExUnit.start(exclude: exclude)
Loading