无法在MacOS Catalina下安装经过公证的Java应用

时间:2019-11-22 17:26:36

标签: java macos-catalina notarize

我有一个用Java编写的应用程序。我使用appbundler将JVM与应用程序捆绑在一起,然后使用pkgbuild创建.pkg安装程序。在我添加公证并升级到Catalina之前,此方法一直很好。公证和装订工作就可以了。但是.pkg安装程序会生成错误“尝试安装到系统卷”。

我已经更新到最新版本的appbundler。它会创建一个嵌入jdk1.8.0_151.jdk的应用。

这是我的应享权利。plist:

<!DOCTYPE html>
<html>
	<head>

		<title>STRONA GŁÓWNA</title>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Comaptible" content="IE=edge">
		<link rel="stylesheet" type="text/css" href="styleindex.css">

	</head>
	<body>

		<header>

			<h1 class="logo">DRUGA WOJNA ŚWIATOWA</h1>
			<nav>

				<ul class="menu">
					<li><a href="#">Strona Główna</li></a>
					<li><a href="#">Fronty wojny</li></a>
					<li><a href="#">Nowe technologie</li></a>
					<li><a href="#">Mapy polityczne</li></a>
					<li><a href="#">Materiały źródłowe</li></a>
					<li><a href="./strona1.html">Logowanie</li></a>
					<li><a href="#">Kontakt</li></a>

				</ul>

			</nav>

		</header>

		<main>
				
			<section>

				<div class="one">

					<header>
					
						<h1>INTRODUCTION</h1>
						<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pulvinar nibh id dolor placerat, et luctus libero pretium. Vivamus eget arcu ligula. Vivamus blandit diam non sapien cursus malesuada. In vulputate facilisis velit ut interdum. Nam commodo ex quis ipsum rutrum, convallis venenatis ex tincidunt. Praesent tincidunt semper ex, eget semper ante porta vel. Integer egestas turpis vitae ullamcorper ultricies. Ut arcu tortor, imperdiet vel felis et, fermentum rutrum dolor. Vestibulum bibendum eu massa et tincidunt. Integer a porta enim. Curabitur quis imperdiet ante, aliquam tincidunt felis. Praesent nec est ac massa hendrerit tempus. Vivamus in mattis quam.
						</p>

					</header>

				</div>
				<div class="two">
						
					<article id="Lorem">
							
						<h1>Lorem ipsum</h1>
						<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pulvinar nibh id dolor placerat, et luctus libero pretium. Vivamus eget arcu ligula. Vivamus blandit diam non sapien cursus malesuada. In vulputate facilisis velit ut interdum. Nam commodo ex quis ipsum rutrum, convallis venenatis ex tincidunt. Praesent tincidunt semper ex, eget semper ante porta vel. Integer egestas turpis vitae ullamcorper ultricies. Ut arcu tortor, imperdiet vel felis et, fermentum rutrum dolor. Vestibulum bibendum eu massa et tincidunt. Integer a porta enim. Curabitur quis imperdiet ante, aliquam tincidunt felis. Praesent nec est ac massa hendrerit tempus. Vivamus in mattis quam.</p>

					</article>

				</div>

			</section>

		</main>

			<footer>
				
				<div class="footer">
					
					<p>II WOJNA ŚWIATOWA &copy wszelkie prawa zastrzeżone. Dzięki za odwiedzenie i zapraszam ponownie.</p>

				</div>

			</footer>

	</body>

</html>

我使用以下命令创建安装程序:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/    PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.cs.allow-dyld-environment-variables</key>
    <true/>
    <key>com.apple.security.cs.disable-library-validation</key>
    <true/>
    <key>com.apple.security.cs.disable-executable-page-protection</key>
    <true/>
    <key>com.apple.security.cs.allow-jit</key>
    <true/>
    <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
    <true/>
</dict>
</plist>

当我在查找器中双击Myapp.app时,它运行正常。如果我运行Myapp.pkg,则安装程序将成功运行,但是它将替换开发目录中的副本。要在“应用程序”目录中安装Myapp,必须运行$ ant # creates appBundle/Myapp.app $ codesign -s "Developer ID Application" --timestamp --options runtime -fv --entitlements entitlements.plist --deep appBundle/Myapp.app $ /usr/bin/ditto -c -k --keepParent appBundle/Myapp.app Myapp.zip $ xcrun altool --notarize-app --primary-bundle-id "com.myapp.tony.Myapp" -u "developer@myapp.com" -p <xxx> --file Myapp.zip $ xcrun altool --notarization-info <xxx> -u "developer@myapp.com" -p <xxx> $ xcrun stapler staple appBundle/Myapp.app $ pkgbuild --root appBundle Myapp.pkg 。然后,当我再次运行Myapp.pkg时,安装程​​序要求输入密码后,它会报告:“此软件包与该版本的macOS不兼容。该软件包正在尝试将内容安装到系统卷中。”这与尝试首次安装的用户向我报告的内容相同。

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

艰苦的运行时仍然会导致Java问题。我也一样尝试删除强化的运行时选项(删除:--options runtime),它会暂时发出警告。

PS .:您正在装订另一个文件,然后在altool中。是真的吗?