Skip to content

Commit 26a930e

Browse files
committed
macOS codesign fixes
Fixes both having no entitlements file and signing the wrong path in `codesign` fixes #306
1 parent 326df53 commit 26a930e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: src/main/java/io/github/fvarrui/javapackager/packagers/MacPackager.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@ private File preparePrecompiledStartupStub() throws Exception {
195195

196196
private void codesign(String developerId, File entitlements, File appFile) throws Exception {
197197

198-
prepareEntitlementFile(entitlements);
198+
entitlements = prepareEntitlementFile(entitlements);
199199

200200
manualDeepSign(appFile, developerId, entitlements);
201201

202202
}
203203

204-
private void prepareEntitlementFile(File entitlements) throws Exception {
204+
private File prepareEntitlementFile(File entitlements) throws Exception {
205205
// if entitlements.plist file not specified, use a default one
206206
if (entitlements == null) {
207207
Logger.warn("Entitlements file not specified. Using defaults!");
@@ -210,6 +210,7 @@ private void prepareEntitlementFile(File entitlements) throws Exception {
210210
} else if (!entitlements.exists()) {
211211
throw new Exception("Entitlements file doesn't exist: " + entitlements);
212212
}
213+
return entitlements;
213214
}
214215

215216
private void manualDeepSign(File appFolder, String developerCertificateName, File entitlements) throws IOException, CommandLineException {
@@ -237,7 +238,6 @@ private void manualDeepSign(File appFolder, String developerCertificateName, Fil
237238

238239
// finally, sign the top level directory
239240
codesign(entitlements, developerCertificateName, appFolder);
240-
241241
}
242242

243243
private void codesign(File entitlements, String developerCertificateName, File file) throws IOException, CommandLineException {
@@ -248,7 +248,7 @@ private void codesign(File entitlements, String developerCertificateName, File f
248248
arguments.add(entitlements);
249249
arguments.add("-s");
250250
arguments.add(developerCertificateName);
251-
arguments.add(appFolder);
251+
arguments.add(file);
252252
CommandUtils.execute("codesign", arguments);
253253
}
254254

0 commit comments

Comments
 (0)