Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature fail on Mac (even if entitlement file is specified) #314

Closed
2 of 5 tasks
amariottini opened this issue Mar 28, 2023 · 12 comments
Closed
2 of 5 tasks

Signature fail on Mac (even if entitlement file is specified) #314

amariottini opened this issue Mar 28, 2023 · 12 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists feedback Waiting for feedback

Comments

@amariottini
Copy link

I'm submitting a…

  • bug report
  • feature request
  • other

Short description of the issue/suggestion:
Signature fail on Mac, it seems that the path to .app is wrong

Steps to reproduce the issue/enhancement:
Enable signature:

macConfig {
        codesignApp = true
        developerId = "XXXXXXXXXX"
        hardenedCodesign = true
        generatePkg = false
        volumeName = "MyVolumeName"
        entitlements = file("${projectDir}/assets/mac/entitlements.plist")
    }

Do you have outputs, screenshots, demos or samples which demonstrate the problem or enhancement?

Executing command: /bin/sh -c cd '/Users/andrea/Projects/projectname/.' && 'find' /Users/andrea/Projects/projectname/build/projectname/projectname.app -depth -type f -exec codesign -f -o runtime -s XXXXXXXXXX --entitlements /Users/andrea/Projects/projectname/assets/mac/entitlements.plist {} \;
    /Users/andrea/Projects/projectname/build/projectname/projectname.app/Contents/MacOS/universalJavaApplicationStub: code object is not signed at all
    In subcomponent: /Users/andrea/Projects/projectname/build/projectname/projectname app/Contents/PlugIns/jre/Contents/Home/LICENSE
    /Users/andrea/Projects/projectname/build/projectname/projectname.app/Contents/PlugIns/jre/Contents/Home/bin/unpack200: replacing existing signature
    /Users/andrea/Projects/projectname/build/projectname/projectname.app/Contents/PlugIns/jre/Contents/Home/bin/jfr: replacing existing signature
    /Users/andrea/Projects/projectname/build/projectname/projectname.app/Contents/PlugIns/jre/Contents/Home/bin/rmid: replacing existing signature
......
......
Executing command: /bin/sh -c cd '/Users/andrea/Projects/projectname/.' && 'codesign' -f -o runtime --entitlements /Users/andrea/Projects/projectname/assets/mac/entitlements.plist -s XXXXXXXXXX /Users/andrea/Projects/projectname/build/projectname
    /Users/andrea/Projects/projectname/build/projectname: bundle format unrecognized, invalid, or unsuitable

It seems that the last command is missing the application name, shouldn't it be Users/andrea/Projects/projectname/build/projectname/projectname.app?

Please tell us about your environment:
IntelliJ 2022.3.3
Gradle 7.6

  • JavaPackager version: 1.7.0
  • OS version: MacOS 10.15.7
  • JDK version: 11.0.10
  • Build tool:
    • Maven
    • Gradle

Other information (e.g. related issues, suggestions how to fix, links for us to have context)

@fvarrui
Copy link
Owner

fvarrui commented Mar 28, 2023

Hi again @amariottini!
The problem is not related to entitlements but codesigning.

Please, try this:

  1. Build and install the SNAPSHOT version:
git clone https://github.com/fvarrui/JavaPackager --branch devel
cd JavaPackager
./gradlew publishToMavenLocal

You should build it with Java 11 (this is not a problem for you, as I've seen that is your current JDK)

  1. Change your build.gradle to use JP 1.7.1-SNAPSHOT.

  2. Try to build your app again.

Plaese, give me some feedback.
Thanks!

@amariottini
Copy link
Author

Yes it works! Thank you.

When do you plan to release version 1.7.1?

@fvarrui fvarrui added bug Something isn't working duplicate This issue or pull request already exists fixed Issue fixed and release pending labels Mar 28, 2023
@fvarrui
Copy link
Owner

fvarrui commented Mar 28, 2023

I'm closing other pending issues ... I hope it can be released soon!

@EasyG0ing1
Copy link
Contributor

@fvarrui I've been clicking along with my local compile ... is there anything I might be able to do to help you with getting module support into the library? I don't have a lot of in-depth knowledge on the topic outside of using modules, but I'm a quick study.

@EasyG0ing1
Copy link
Contributor

For anyone interested, here is the bug-fixed jar file.

Simply unzip the file and execute this command:

mvn install::install-file -Dfile=javapackager-1.7.1-SNAPSHOT.jar -DgroupId=io.github.fvarrui -DartifactId=javapackager -Dversion=1.7.1-SNAPSHOT -Dpackaging=jar -DgeneratePom=true

Then just change your POM file to reference it ... it will use your local Maven repository to source it:

<plugin>
    <groupId>io.github.fvarrui</groupId>
    <artifactId>javapackager</artifactId>
    <version>1.7.1-SNAPSHOT</version>

javapackager-1.7.1-SNAPSHOT.jar.zip

@amariottini
Copy link
Author

I'm closing other pending issues ... I hope it can be released soon!

@fvarrui , any news?

@fvarrui
Copy link
Owner

fvarrui commented May 4, 2023

Hi @amariottini!
I've just released 1.7.1 to Maven Central.
Sorry for the delay!!

@fvarrui fvarrui closed this as completed May 4, 2023
@amariottini
Copy link
Author

With version 1.7.1 I have this problem:
>Plugin with id 'io.github.fvarrui.javapackager.plugin' not found.

Gradle downloads the plugin from Maven but can't activate it.
This is in my build.gradle (Gradle version = 7.6):

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'io.github.fvarrui:javapackager:1.7.1'
    }
}
plugins {
    id 'application'
    id 'org.jreleaser.jdks' version '1.5.1'
}

apply plugin: 'io.github.fvarrui.javapackager.plugin'

Do you prefer I open another issue?

@fvarrui
Copy link
Owner

fvarrui commented May 5, 2023

With version 1.7.1 I have this problem: >Plugin with id 'io.github.fvarrui.javapackager.plugin' not found.

Gradle downloads the plugin from Maven but can't activate it. This is in my build.gradle (Gradle version = 7.6):

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'io.github.fvarrui:javapackager:1.7.1'
    }
}
plugins {
    id 'application'
    id 'org.jreleaser.jdks' version '1.5.1'
}

apply plugin: 'io.github.fvarrui.javapackager.plugin'

Do you prefer I open another issue?

No, don't worry ... I realized that there was a missing file in JavaPackager's JAR needed for Gradle plugins (META-INF/gradle-plugins/io.github.fvarrui.javapackager.plugin.properties), and I've just released a new version (1.7.2) ... please, could you try this one?

Sorry, this bug was introduced because we upgraded the build.gradle in order to support newer Gradle versions (>=8) and something was wrong, but I think that now it's fixed.

@fvarrui fvarrui added feedback Waiting for feedback and removed fixed Issue fixed and release pending labels May 5, 2023
@amariottini
Copy link
Author

Version 1.7.2 loads the plugin.
Has still the issue #315.

@fvarrui
Copy link
Owner

fvarrui commented May 6, 2023

Version 1.7.2 loads the plugin. Has still the issue #315.

Please, try 1.7.3-20230505.163915-1 SNAPSHOT version and give some feedback.

@amariottini
Copy link
Author

1.7.3-20230505.163915-1 solves all my issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists feedback Waiting for feedback
Projects
None yet
Development

No branches or pull requests

3 participants