Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8243511

[macos] jpackage sings .app with Oracle certificate and then fails to resign

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 14
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      os_x

      Description

      ADDITIONAL SYSTEM INFORMATION :
      macOS 10.13.6

      A DESCRIPTION OF THE PROBLEM :
      jpackage started with --mac-sign option fails to sign the .app file because it is already signed with some Oracle certificate
      Codesign utility is called without -f option so it will not replace existing signature and fail.


      jpacker output:

      MacBook-Pro-User:build user$ ~/Desktop/jdk-14.jdk/Contents/Home/bin/jpackage --input app --main-jar CompanyName.jar --name CompanyName --dest dmg --icon CompanyName.icns --mac-package-identifier CompanyName --mac-package-name CompanyName --mac-sign --temp tmp
      WARNING: Using incubator modules: jdk.incubator.jpackage
      java.io.IOException: Command [codesign, -s, Developer ID Application: CompanyName Ltd. (***), -vvvv, tmp/images/image-13885023430950711627/CompanyName.app] exited with 1 code


      Then I check the signature and see:

      MacBook-Pro-User:build user$ codesign -dvvvv tmp/images/image-13885023430950711627/CompanyName.app
      Executable=/Users/user/IdeaProjects/CompanyName/build/tmp/images/image-13885023430950711627/CompanyName.app/Contents/MacOS/CompanyName
      Identifier=jpackageapplauncher
      Format=app bundle with Mach-O thin (x86_64)
      CodeDirectory v=20500 size=383 flags=0x10000(runtime) hashes=3+5 location=embedded
      VersionPlatform=1
      VersionMin=657664
      VersionSDK=658944
      Hash type=sha256 size=32
      CandidateCDHash sha1=aa04c6adeac031e731ada82702d486ebb8fbf48d
      CandidateCDHash sha256=c34c5c3c88de5c3ae6167d6494776da87b288c86
      Hash choices=sha1,sha256
      Page size=4096
      CDHash=c34c5c3c88de5c3ae6167d6494776da87b288c86
      Signature size=9059
      Authority=Developer ID Application: Oracle America, Inc. (VB5E2TV963)
      Authority=Developer ID Certification Authority
      Authority=Apple Root CA
      Timestamp=Feb 6, 2020 at 21:03:52
      Info.plist=not bound
      TeamIdentifier=VB5E2TV963
      Runtime Version=10.14.0


      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tongwan Andrew Wang
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: