[Git][java-team/icedtea-web][upstream] 4 commits: New upstream version 1.8.5
Emmanuel Bourg (@ebourg)
gitlab at salsa.debian.org
Thu May 5 12:46:44 BST 2022
Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / icedtea-web
Commits:
f398da77 by Emmanuel Bourg at 2022-05-05T13:12:23+02:00
New upstream version 1.8.5
- - - - -
d1289de1 by Emmanuel Bourg at 2022-05-05T13:13:10+02:00
New upstream version 1.8.6
- - - - -
13c62630 by Emmanuel Bourg at 2022-05-05T13:13:23+02:00
New upstream version 1.8.7
- - - - -
422bb9df by Emmanuel Bourg at 2022-05-05T13:14:01+02:00
New upstream version 1.8.8
- - - - -
30 changed files:
- + .gitattributes
- + .github/workflows/build.yml
- + .github/workflows/windows_build.sh
- + .github/workflows/windows_sign.sh
- ChangeLog
- Makefile.am
- NEWS
- acinclude.m4
- autogen.sh
- configure.ac
- netx/net/sourceforge/jnlp/Launcher.java
- netx/net/sourceforge/jnlp/OptionsDefinitions.java
- netx/net/sourceforge/jnlp/cache/CacheEntry.java
- netx/net/sourceforge/jnlp/cache/CacheUtil.java
- netx/net/sourceforge/jnlp/cache/CachedDaemonThreadPoolProvider.java
- netx/net/sourceforge/jnlp/cache/ResourceDownloader.java
- netx/net/sourceforge/jnlp/cache/ResourceTracker.java
- netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java
- netx/net/sourceforge/jnlp/config/Defaults.java
- netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
- netx/net/sourceforge/jnlp/resources/Messages.properties
- netx/net/sourceforge/jnlp/runtime/Boot.java
- netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java
- netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
- netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java
- netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java
- netx/net/sourceforge/jnlp/tools/JarCertVerifier.java
- netx/net/sourceforge/jnlp/util/PropertiesFile.java
- netx/net/sourceforge/nanoxml/XMLElement.java
- + tests/netx/unit/net/sourceforge/jnlp/runtime/CachedJarFileCallbackTest.java
Changes:
=====================================
.gitattributes
=====================================
@@ -0,0 +1,5 @@
+# Declare files that will always have LF line endings on checkout.
+*.sh eol=lf
+
+# Declare files that will always have CRLF line endings on checkout.
+*.bat text eol=crlf
\ No newline at end of file
=====================================
.github/workflows/build.yml
=====================================
@@ -0,0 +1,481 @@
+name: Build
+on:
+ workflow_dispatch:
+ inputs:
+ release:
+ description: 'Set to True if are running a release'
+ required: true
+ default: 'False'
+ version:
+ description: 'If running a release, set the version e.g (icedtea-web-1.8.4)'
+ required: true
+ default: 'icedtea-web-1.8.x'
+ pull_request:
+ branches:
+ - 1.8
+jobs:
+ release:
+ if: github.event.inputs.release == 'True'
+ name: Create Draft release
+ runs-on: ubuntu-latest
+ outputs:
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+ steps:
+ - name: Create Draft Release
+ id: create_release
+ uses: actions/create-release at v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: ${{ github.event.inputs.version }}
+ release_name: 'Official Release of ${{ github.event.inputs.version }}'
+ draft: true
+ prerelease: false
+
+ linux:
+ if: always()
+ needs: release
+ name: Linux
+ runs-on: ubuntu-latest
+ container: centos:7
+ steps:
+ - uses: actions/checkout at v2
+ with:
+ path: icedtea-web
+
+ - name: Install Dependencies
+ run: |
+ yum -y install autoconf bind-utils bzip2 cpio elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel \
+ gmp-devel java-1.8.0-openjdk-devel libcurl-devel make mpfr-devel perl unzip which zip
+ curl -o tagsoup.jar "https://repo1.maven.org/maven2/org/ccil/cowan/tagsoup/tagsoup/1.2.1/tagsoup-1.2.1.jar"
+ sha256sum tagsoup.jar | awk '$1!="ac97f7b4b1d8e9337edfa0e34044f8d0efe7223f6ad8f3a85d54cc1018ea2e04"{exit 1}'
+ curl -o rhino.zip "https://ftp.mozilla.org/pub/mozilla.org/js/rhino1_6R7.zip"
+ sha256sum rhino.zip | awk '$1!="c94c6de3a29b3acbc4eee732e688f75a5d94bd02c9878be4ceb4d3cd220f3866"{exit 1}'
+ unzip -j rhino.zip "*/js.jar"
+
+ - name: Compile rust
+ run: |
+ curl -o rust.tar.gz "https://static.rust-lang.org/dist/rust-1.34.1-x86_64-unknown-linux-gnu.tar.gz"
+ sha256sum rust.tar.gz | awk '$1!="8e2eead11bd5bf61409e29018d007c6fc874bcda2ff54db3d04d1691e779c14e"{exit 1}'
+ tar -zxf rust.tar.gz
+ cd rust-1.34.1-x86_64-unknown-linux-gnu
+ ./install.sh
+
+ - name: Compile pkg-config
+ run: |
+ curl -o pkg-config.tar.gz "https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz"
+ sha256sum pkg-config.tar.gz | awk '$1!="6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591"{exit 1}'
+ tar -zxf pkg-config.tar.gz
+ cd pkg-config-0.29.2
+ ./configure --with-internal-glib
+ make install
+
+ - name: Compile automake
+ run: |
+ curl -o automake-1.13.1.tar.gz "https://ftp.gnu.org/gnu/automake/automake-1.13.1.tar.gz"
+ sha256sum automake-1.13.1.tar.gz | awk '$1!="51bc10031847e9965c4f2c16a0a66552309ce28ea82b1afa8cef736643ebaa27"{exit 1}'
+ tar -zxf automake-1.13.1.tar.gz
+ cd automake-1.13.1
+ bash configure
+ make && make install
+ rm -rf /usr/local/bin/automake
+ ln -s /usr/local/bin/automake-1.13 /usr/local/bin/automake
+
+ - name: Build
+ run: |
+ export ICEDTEAWEB_INSTALL="/icedtea-web-image"
+ export JAVA_EXE="$(which java)"
+ export JAVA_PATH="$(readlink -e "${JAVA_EXE}")"
+ export BIN_PATH="$(dirname "${JAVA_PATH}")"
+ export JRE_PATH="$(dirname "${BIN_PATH}")"
+ export JAVA_HOME="$(dirname "${JRE_PATH}")"
+ export TAGSOUP="${PWD}/tagsoup.jar"
+ export RHINO="${PWD}/js.jar"
+ export ACLOCAL_PATH="/usr/local/share/aclocal"
+ export PATH="/usr/local/bin:${PATH}"
+ export WORKSPACE="${PWD}"
+ pkg-config --version
+ cd icedtea-web
+ echo "Invoking autogen.sh"
+ ./autogen.sh
+ echo "Incoking IcedTea-Web configure"
+ ./configure --disable-native-plugin --prefix="${ICEDTEAWEB_INSTALL}" --with-itw-libs=BUNDLED --with-rhino="${RHINO}" --with-tagsoup="${TAGSOUP}" --with-jdk-home="${JAVA_HOME}"
+ echo "Build IcedTea-Web"
+ make DESTDIR="${WORKSPACE}"
+
+ - name: Build Distribution
+ run: |
+ export WORKSPACE="${PWD}"
+ echo "Create IcedTea-Web Distribution"
+ cd icedtea-web
+ make linux-bin-dist DESTDIR="${WORKSPACE}"
+ find . -name "icedtea-web-*.linux.bin.zip"
+ for zip in icedtea-web-*.linux.bin.zip; do
+ sha256sum "$zip" > "$zip.sha256.txt"
+ done
+
+ - uses: actions/upload-artifact at v2
+ with:
+ name: icedtea-web_build_x86-64_linux
+ path: |
+ icedtea-web/icedtea-web-*.linux.bin.*
+
+ - name: Upload binary
+ uses: actions/upload-release-asset at v1
+ if: github.event.inputs.release == 'True'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.release.outputs.upload_url }}
+ asset_path: icedtea-web/${{ github.event.inputs.version }}.linux.bin.zip
+ asset_name: ${{ github.event.inputs.version }}.linux.bin.zip
+ asset_content_type: application/zip
+
+ - name: Upload shasum
+ uses: actions/upload-release-asset at v1
+ if: github.event.inputs.release == 'True'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.release.outputs.upload_url }}
+ asset_path: icedtea-web/${{ github.event.inputs.version }}.linux.bin.zip.sha256.txt
+ asset_name: ${{ github.event.inputs.version }}.linux.bin.zip.sha256.txt
+ asset_content_type: application/zip
+
+ portable:
+ if: always()
+ needs: release
+ name: Portable
+ runs-on: ubuntu-latest
+ container: centos:7
+ steps:
+ - uses: actions/checkout at v2
+ with:
+ path: icedtea-web
+
+ - name: Install Dependencies
+ run: |
+ yum -y install autoconf bind-utils bzip2 cpio elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel \
+ gmp-devel java-1.8.0-openjdk-devel libcurl-devel make mpfr-devel perl unzip which zip
+ curl -o tagsoup.jar "https://repo1.maven.org/maven2/org/ccil/cowan/tagsoup/tagsoup/1.2.1/tagsoup-1.2.1.jar"
+ sha256sum tagsoup.jar | awk '$1!="ac97f7b4b1d8e9337edfa0e34044f8d0efe7223f6ad8f3a85d54cc1018ea2e04"{exit 1}'
+ curl -o mslinks.jar "https://repo1.maven.org/maven2/com/github/vatbub/mslinks/1.0.5/mslinks-1.0.5.jar"
+ sha256sum mslinks.jar | awk '$1!="e14d756f81b310b75baeb5baf219d25592b6a8635eb215c4059f17493b0cea5c"{exit 1}'
+ curl -o rhino.zip "https://ftp.mozilla.org/pub/mozilla.org/js/rhino1_6R7.zip"
+ sha256sum rhino.zip | awk '$1!="c94c6de3a29b3acbc4eee732e688f75a5d94bd02c9878be4ceb4d3cd220f3866"{exit 1}'
+ unzip -j rhino.zip "*/js.jar"
+
+ - name: Compile pkg-config
+ run: |
+ curl -o pkg-config.tar.gz "https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz"
+ sha256sum pkg-config.tar.gz | awk '$1!="6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591"{exit 1}'
+ tar -zxf pkg-config.tar.gz
+ cd pkg-config-0.29.2
+ ./configure --with-internal-glib
+ make install
+
+ - name: Compile automake
+ run: |
+ curl -o automake-1.13.1.tar.gz "https://ftp.gnu.org/gnu/automake/automake-1.13.1.tar.gz"
+ sha256sum automake-1.13.1.tar.gz | awk '$1!="51bc10031847e9965c4f2c16a0a66552309ce28ea82b1afa8cef736643ebaa27"{exit 1}'
+ tar -zxf automake-1.13.1.tar.gz
+ cd automake-1.13.1
+ bash configure
+ make && make install
+ rm -rf /usr/local/bin/automake
+ ln -s /usr/local/bin/automake-1.13 /usr/local/bin/automake
+
+ - name: Build
+ run: |
+ export ICEDTEAWEB_INSTALL="/icedtea-web-image"
+ export JAVA_EXE="$(which java)"
+ export JAVA_PATH="$(readlink -e "${JAVA_EXE}")"
+ export BIN_PATH="$(dirname "${JAVA_PATH}")"
+ export JRE_PATH="$(dirname "${BIN_PATH}")"
+ export JAVA_HOME="$(dirname "${JRE_PATH}")"
+ export WORKSPACE="${PWD}"
+ pkg-config --version
+ cd icedtea-web
+ echo "Invoking autogen.sh"
+ ./autogen.sh
+ echo "Incoking IcedTea-Web configure"
+ ./configure --disable-native-plugin --enable-bats-on-linux --enable-shell-launchers --prefix="${ICEDTEAWEB_INSTALL}" --with-itw-libs=BUNDLED --with-rhino="${WORKSPACE}/js.jar" --with-mslinks="${WORKSPACE}/mslinks.jar" --with-tagsoup="${WORKSPACE}/tagsoup.jar" --with-jdk-home="${JAVA_HOME}"
+ echo "Build IcedTea-Web"
+ make DESTDIR="${WORKSPACE}/dest"
+
+ - name: Build Distribution
+ run: |
+ export WORKSPACE="${PWD}"
+ echo "Create IcedTea-Web Distribution"
+ cd icedtea-web
+ make linux-bin-dist DESTDIR="${WORKSPACE}/dest"
+ find . -name "icedtea-web-*.linux.bin.zip"
+ for zip in icedtea-web-*.linux.bin.zip; do
+ zip_rename="${zip/linux/portable}"
+ mv "$zip" "$zip_rename"
+ sha256sum "$zip_rename" > "$zip_rename.sha256.txt"
+ done
+
+ - uses: actions/upload-artifact at v2
+ with:
+ name: icedtea-web_build_x86-64_portable
+ path: |
+ icedtea-web/icedtea-web-*.portable.bin.*
+
+ - name: Upload binary
+ uses: actions/upload-release-asset at v1
+ if: github.event.inputs.release == 'True'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.release.outputs.upload_url }}
+ asset_path: icedtea-web/${{ github.event.inputs.version }}.portable.bin.zip
+ asset_name: ${{ github.event.inputs.version }}.portable.bin.zip
+ asset_content_type: application/zip
+
+ - name: Upload shasum
+ uses: actions/upload-release-asset at v1
+ if: github.event.inputs.release == 'True'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.release.outputs.upload_url }}
+ asset_path: icedtea-web/${{ github.event.inputs.version }}.portable.bin.zip.sha256.txt
+ asset_name: ${{ github.event.inputs.version }}.portable.bin.zip.sha256.txt
+ asset_content_type: application/zip
+
+ macos:
+ if: always()
+ needs: release
+ name: macOS
+ runs-on: macos-latest
+ steps:
+ - uses: actions/checkout at v2
+ with:
+ path: icedtea-web
+
+ - name: Install Dependencies
+ run: |
+ brew install autoconf automake coreutils freetype gnu-sed rust
+ curl -o tagsoup.jar "https://repo1.maven.org/maven2/org/ccil/cowan/tagsoup/tagsoup/1.2.1/tagsoup-1.2.1.jar"
+ sha256sum tagsoup.jar | awk '$1!="ac97f7b4b1d8e9337edfa0e34044f8d0efe7223f6ad8f3a85d54cc1018ea2e04"{exit 1}'
+ curl -o rhino.zip "https://ftp.mozilla.org/pub/mozilla.org/js/rhino1_6R7.zip"
+ sha256sum rhino.zip | awk '$1!="c94c6de3a29b3acbc4eee732e688f75a5d94bd02c9878be4ceb4d3cd220f3866"{exit 1}'
+ unzip -j rhino.zip "*/js.jar"
+
+ - name: Build
+ run: |
+ export ICEDTEAWEB_INSTALL="/icedtea-web-image"
+ export PATH="/usr/local/opt/gnu-sed/libexec/gnubin/:/usr/local/opt/coreutils/bin/:$PATH"
+ export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
+ export TAGSOUP="${PWD}/tagsoup.jar"
+ export RHINO="${PWD}/js.jar"
+ export ACLOCAL_PATH="/usr/local/share/aclocal"
+ export WORKSPACE="${PWD}"
+ pkg-config --version
+ cd icedtea-web
+ echo "Invoking autogen.sh"
+ ./autogen.sh
+ echo "Incoking IcedTea-Web configure"
+ ./configure --disable-native-plugin --prefix="${ICEDTEAWEB_INSTALL}" --with-itw-libs=BUNDLED --with-rhino="${RHINO}" --with-tagsoup="${TAGSOUP}" --with-jdk-home="${JAVA_HOME}" --with-jre-home="${JAVA_HOME}/jre"
+ echo "Build IcedTea-Web"
+ make DESTDIR="${WORKSPACE}"
+
+ - name: Build Distribution
+ run: |
+ export WORKSPACE="${PWD}"
+ echo "Create IcedTea-Web Distribution"
+ cd icedtea-web
+ make macos-bin-dist DESTDIR="${WORKSPACE}"
+ find . -name "icedtea-web-*.linux.bin.zip"
+ for zip in icedtea-web-*.macos.bin.zip; do
+ sha256sum "$zip" > "$zip.sha256.txt"
+ done
+
+ - uses: actions/upload-artifact at v2
+ with:
+ name: icedtea-web_build_x86-64_macos
+ path: |
+ icedtea-web/icedtea-web-*.macos.bin.*
+
+ - name: Upload binary
+ uses: actions/upload-release-asset at v1
+ if: github.event.inputs.release == 'True'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.release.outputs.upload_url }}
+ asset_path: icedtea-web/${{ github.event.inputs.version }}.macos.bin.zip
+ asset_name: ${{ github.event.inputs.version }}.macos.bin.zip
+ asset_content_type: application/zip
+
+ - name: Upload shasum
+ uses: actions/upload-release-asset at v1
+ if: github.event.inputs.release == 'True'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.release.outputs.upload_url }}
+ asset_path: icedtea-web/${{ github.event.inputs.version }}.macos.bin.zip.sha256.txt
+ asset_name: ${{ github.event.inputs.version }}.macos.bin.zip.sha256.txt
+ asset_content_type: application/zip
+
+ windows:
+ if: always()
+ needs: release
+ name: Windows
+ runs-on: windows-latest
+ steps:
+ - name: Restore cygwin packages from cache
+ id: cygwin
+ uses: actions/cache at v2
+ with:
+ path: C:\cygwin_packages
+ key: cygwin-packages-${{ runner.os }}-v1
+
+ - name: Download Cygwin
+ run: |
+ Invoke-WebRequest -UseBasicParsing 'https://cygwin.com/setup-x86_64.exe' -OutFile 'C:\temp\cygwin.exe'
+ Invoke-WebRequest -UseBasicParsing 'https://cygwin.com/setup-x86_64.exe.sig' -OutFile 'C:\temp\cygwin.exe.sig'
+
+ - name: Download Cygwin keys
+ shell: bash {0}
+ run: |
+ gpg -v --keyserver keys.gnupg.net --recv-key 1A698DE9E2E56300
+ gpg -v --keyserver keys.gnupg.net --recv-key 676041BA
+ gpg -v --keyserver ipv4.pool.sks-keyservers.net --recv-key 1A698DE9E2E56300
+ gpg -v --keyserver ipv4.pool.sks-keyservers.net --recv-key 676041BA
+ gpg -v --keyserver keyserver.ubuntu.com --recv-key 1A698DE9E2E56300
+ gpg -v --keyserver keyserver.ubuntu.com --recv-key 676041BA
+ exit 0
+
+ - name: Check Cygwin sig
+ run: |
+ gpg --keyid-format=long --with-fingerprint --verify 'C:\temp\cygwin.exe.sig' 'C:\temp\cygwin.exe'
+ Start-Process -Wait -FilePath 'C:\temp\cygwin.exe' -ArgumentList '--packages autoconf,automake,cpio,curl,gcc,git,gnupg,grep,libtool,make,mingw64-x86_64-gcc-core,perl,pkg-config,unzip,wget,zip --quiet-mode --download --local-install --delete-orphans --site https://mirrors.kernel.org/sourceware/cygwin/ --local-package-dir C:\cygwin_packages --root C:\cygwin64'
+
+ - name: Set PATH
+ run: echo "C:\cygwin64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+
+ - name: Cygwin git configuration
+ shell: bash
+ run: mkdir $HOME && git config --system core.autocrlf false
+
+ - uses: actions/checkout at v2
+
+ - name: Install Dependencies
+ run: |
+ # Create C:/cygwin64/usr/share/java if it doesn't exist
+ New-Item -Path C:\cygwin64\usr\share\java -Type Directory
+ # Retrieve tagsoup jar
+ Invoke-WebRequest -UseBasicParsing 'https://repo1.maven.org/maven2/org/ccil/cowan/tagsoup/tagsoup/1.2.1/tagsoup-1.2.1.jar' -OutFile 'C:\cygwin64\usr\share\java\tagsoup.jar'
+ $checksum = (Get-FileHash -Algorithm SHA256 'C:\cygwin64\usr\share\java\tagsoup.jar' | Select-Object -ExpandProperty Hash)
+ If ($checksum -ne "AC97F7B4B1D8E9337EDFA0E34044F8D0EFE7223F6AD8F3A85D54CC1018EA2E04") {
+ Write-Host "Checksums did not match!"
+ exit 1
+ }
+ # Retrieve mslinks jar
+ Invoke-WebRequest -UseBasicParsing 'https://repo1.maven.org/maven2/com/github/vatbub/mslinks/1.0.5/mslinks-1.0.5.jar' -OutFile 'C:\cygwin64\usr\share\java\mslinks.jar'
+ $checksum = (Get-FileHash -Algorithm SHA256 'C:\cygwin64\usr\share\java\mslinks.jar' | Select-Object -ExpandProperty Hash)
+ If ($checksum -ne "E14D756F81B310B75BAEB5BAF219D25592B6A8635EB215C4059F17493B0CEA5C") {
+ Write-Host "Checksums did not match!"
+ exit 1
+ }
+ # Retrieve Wixgen jar
+ Invoke-WebRequest -UseBasicParsing 'https://github.com/akashche/wixgen/releases/download/1.7/wixgen.jar' -OutFile 'C:\cygwin64\usr\share\java\wixgen.jar'
+ $checksum = (Get-FileHash -Algorithm SHA256 'C:\cygwin64\usr\share\java\wixgen.jar' | Select-Object -ExpandProperty Hash)
+ If ($checksum -ne "57E68A91C46A2F4B1B41A3F93793E331D62D6D151DDC222FA4D3EC9CE876F967") {
+ Write-Host "Checksums did not match!"
+ exit 1
+ }
+ # Retrieve Rhino
+ Invoke-WebRequest -UseBasicParsing 'https://ftp.mozilla.org/pub/mozilla.org/js/rhino1_6R7.zip' -OutFile 'rhino1_6R7.zip'
+ $checksum = (Get-FileHash -Algorithm SHA256 'rhino1_6R7.zip' | Select-Object -ExpandProperty Hash)
+ If ($checksum -ne "C94C6DE3A29B3ACBC4EEE732E688F75A5D94BD02C9878BE4CEB4D3CD220F3866") {
+ Write-Host "Checksums did not match!"
+ exit 1
+ }
+ 7z.exe x rhino1_6R7.zip
+ Move-Item -Path rhino1_6R7\js.jar -Destination C:\cygwin64\usr\share\java
+ # Retrieve AzureSignTool
+ New-Item -Path C:\AzureSignTool -Type Directory
+ Invoke-WebRequest -UseBasicParsing 'https://github.com/vcsjones/AzureSignTool/releases/download/1.0.1/AzureSignTool.zip' -OutFile 'AzureSignTool.zip'
+ $checksum = (Get-FileHash -Algorithm SHA256 'AzureSignTool.zip' | Select-Object -ExpandProperty Hash)
+ If ($checksum -ne "4178B8E5DC6423E75DA2184C3B0D78167A0A59B82A20842884B780B1E815BA89") {
+ Write-Host "Checksums did not match!"
+ exit 1
+ }
+ Expand-Archive -LiteralPath 'AzureSignTool.zip' -DestinationPath 'C:\AzureSignTool'
+
+ - name: Enable 8dot3 shortnames
+ run: |
+ fsutil behavior set disable8dot3 0
+ cmd /c dir /x "C:\Program Files (x86)"
+ fsutil file setshortname "C:\Program Files (x86)\WiX Toolset v3.11" "WIXTOO~1.14"
+ shell: cmd
+
+ - name: Build
+ run: bash .github/workflows/windows_build.sh
+ shell: cmd
+
+ - uses: actions/upload-artifact at v2
+ with:
+ name: icedtea-web_build_x86-64_win
+ path: |
+ icedtea-web-*.win.bin.*
+ win-installer.build/icedtea-web-*.msi*
+
+ - name: Codesign
+ run: bash .github/workflows/windows_sign.sh
+ if: github.event.inputs.release == 'True'
+ env:
+ description_url: 'https://adoptopenjdk.net'
+ key_vault_url: 'https://adoptopenjdk-codesign.vault.azure.net'
+ key_vault_certificate: 'LondonJavaCommunity'
+ key_vault_client_id: ${{ secrets.key_vault_client_id }}
+ key_vault_client_secret: ${{ secrets.key_vault_client_secret }}
+ shell: cmd
+
+ - name: Upload binary
+ uses: actions/upload-release-asset at v1.0.1
+ if: github.event.inputs.release == 'True'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.release.outputs.upload_url }}
+ asset_path: release/${{ github.event.inputs.version }}.win.bin.zip
+ asset_name: ${{ github.event.inputs.version }}.win.bin.zip
+ asset_content_type: application/zip
+
+ - name: Upload shasum
+ uses: actions/upload-release-asset at v1.0.1
+ if: github.event.inputs.release == 'True'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.release.outputs.upload_url }}
+ asset_path: release/${{ github.event.inputs.version }}.win.bin.zip.sha256.txt
+ asset_name: ${{ github.event.inputs.version }}.win.bin.zip.sha256.txt
+ asset_content_type: application/zip
+
+ - name: Upload MSI
+ uses: actions/upload-release-asset at v1.0.1
+ if: github.event.inputs.release == 'True'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.release.outputs.upload_url }}
+ asset_path: release/${{ github.event.inputs.version }}.msi
+ asset_name: ${{ github.event.inputs.version }}.msi
+ asset_content_type: application/zip
+
+ - name: Upload MSI shasum
+ uses: actions/upload-release-asset at v1.0.1
+ if: github.event.inputs.release == 'True'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.release.outputs.upload_url }}
+ asset_path: release/${{ github.event.inputs.version }}.msi.sha256.txt
+ asset_name: ${{ github.event.inputs.version }}.msi.sha256.txt
+ asset_content_type: application/zip
=====================================
.github/workflows/windows_build.sh
=====================================
@@ -0,0 +1,27 @@
+#!/bin/bash
+export WORKSPACE="${PWD}"
+export RUSTFLAGS="-C target-feature=+crt-static"
+export ICEDTEAWEB_INSTALL="$(cygpath -u "${WORKSPACE}/icedtea-web-image")"
+export WIXPATH="$(cygpath -u "C:/PROGRA~2/WIXTOO~1.14/bin")"
+export WIXGEN="$(cygpath -u "C:/cygwin64/usr/share/java/wixgen.jar")"
+export PATH="${PATH}:/cygdrive/c/rust/bin:${WIXPATH}"
+export JVM_HOME_SHORT="$(cygpath -d "${JAVA_HOME}")"
+export JVMPATH="$(cygpath -u ${JVM_HOME_SHORT})"
+echo "Configure IcedTea-Web"
+./autogen.sh
+./configure --disable-native-plugin --prefix="${ICEDTEAWEB_INSTALL}" --with-wix=${WIXPATH} --with-wixgen=${WIXGEN} --with-itw-libs=BUNDLED --with-jdk-home="${JVMPATH}"
+echo "Build IcedTea-Web"
+make
+echo "Create IcedTea-Web Distribution"
+make win-bin-dist
+find . -name "icedtea-web-*.win.bin.zip"
+echo "Create IcedTea-Web MSI"
+make win-installer
+find . -name "icedtea-web-*.msi"
+echo "Generate shasums"
+for zip in icedtea-web-*.win.bin.zip; do
+ shasum -a 256 "$zip" > "$zip.sha256.txt"
+done
+for msi in **/icedtea-web-*.msi; do
+ shasum -a 256 "$msi" > "$msi.sha256.txt"
+done
\ No newline at end of file
=====================================
.github/workflows/windows_sign.sh
=====================================
@@ -0,0 +1,44 @@
+#!/bin/bash
+export WORKSPACE="${PWD}"
+export TMP_PATH="$(cygpath -u "${WORKSPACE}/tmp")"
+export RELEASE_PATH="$(cygpath -u "${WORKSPACE}/release")"
+export ARCHIVE_NAME_WITH_PATH="$(find . -name "icedtea-web-*.win.bin.zip")"
+export ARCHIVE_NAME="$(basename "${ARCHIVE_NAME_WITH_PATH}")"
+export MSI_NAME_WITH_PATH="$(find . -name "icedtea-web-*.msi")"
+export MSI_NAME="$(basename "${MSI_NAME_WITH_PATH}")"
+
+mkdir ${TMP_PATH}
+mkdir ${RELEASE_PATH}
+
+unzip -q ${ARCHIVE_NAME} -d ${TMP_PATH}
+cd ${TMP_PATH}
+
+echo "Signing Binary"
+find . -type f -name '*.exe' > sign.txt
+
+/cygdrive/c/AzureSignTool/AzureSignTool.exe sign --file-digest sha256 --description-url "$description_url" \
+--no-page-hashing --timestamp-rfc3161 http://timestamp.digicert.com --timestamp-digest sha256 \
+--azure-key-vault-url "$key_vault_url" --azure-key-vault-client-id "$key_vault_client_id" \
+--azure-key-vault-client-secret "$key_vault_client_secret" --azure-key-vault-certificate "$key_vault_certificate" \
+--input-file-list sign.txt
+
+zip -rq ${ARCHIVE_NAME} *
+cp ${ARCHIVE_NAME} ${RELEASE_PATH}/${ARCHIVE_NAME}
+
+echo "Signing Installer"
+cp ${WORKSPACE}/win-installer.build/${MSI_NAME} ${TMP_PATH}/${MSI_NAME}
+
+/cygdrive/c/AzureSignTool/AzureSignTool.exe sign "${MSI_NAME}" --file-digest sha256 \
+--description-url "$description_url" --no-page-hashing --timestamp-rfc3161 http://timestamp.digicert.com \
+--timestamp-digest sha256 --azure-key-vault-url "$key_vault_url" --azure-key-vault-client-id "$key_vault_client_id" \
+--azure-key-vault-client-secret "$key_vault_client_secret" --azure-key-vault-certificate "$key_vault_certificate"
+
+cp ${TMP_PATH}/${MSI_NAME} ${RELEASE_PATH}/${MSI_NAME}
+
+ls ${RELEASE_PATH}
+
+cd $RELEASE_PATH
+
+for zip in icedtea-web-*; do
+ shasum -a 256 "$zip" > "$zip.sha256.txt"
+done
\ No newline at end of file
=====================================
ChangeLog
=====================================
@@ -1,3 +1,28 @@
+2021-10-28 Philippe Doussot <douphi at free.fr>
+
+ Release change
+ * Application cannot be started with JDK 13 - AWTSecurityManager was removed : Backport of #438 by https://github.com/AdoptOpenJDK/IcedTea-Web/pull/792
+
+2021-05-27 Philippe Doussot <douphi at free.fr>
+
+ Release changes
+ * Webstarted application tries to load resources from server incorrectly : Backport of https://github.com/AdoptOpenJDK/IcedTea-Web/pull/467 fix https://github.com/AdoptOpenJDK/IcedTea-Web/issues/89
+
+2021-02-23 George Adams <gadams at microsoft.com>
+
+ Release changes
+ * Fix missing mslinks in Windows build
+
+2021-02-22 Hendrik Ebbers <hendrik.ebbers at web.de>
+
+ Release changes
+ * Change so that it can also be built under freebsd
+ * fix for cargo test sometimes fails when make runs with several simultaneous jobs
+ * JARs downloaded with URI-escaped characters don't get loaded
+ * Reduced number of threads spawned for downloading of resources
+ * handle broken XML in jnlp
+ * Migrated to GitHub Action release support
+
2020-06-03 Hendrik Ebbers <hendrik.ebbers at web.de>
Release changes
=====================================
Makefile.am
=====================================
@@ -77,6 +77,7 @@ export BASH_CMPL_DEST_DIR=$(DESTDIR)@bashcompdir@
export WIN_ALL_DEPS=$(DESTDIR)$(prefix)/win-deps-all
export WIN_RUN_DEPS=$(DESTDIR)$(prefix)/win-deps-runtime
export LINUX_BIN_DIST_DEPS=$(DESTDIR)$(prefix)/linux-deps-runtime
+export MACOS_BIN_DIST_DEPS=$(DESTDIR)$(prefix)/macos-deps-runtime
export REPORT_STYLES_DIRNAME=report-styles
@@ -196,6 +197,10 @@ endif
endif
# Flags
+# macOS requires this flag, see https://youtrack.jetbrains.com/issue/IDEA-72010
+if MACOS
+ export JAVACFLAGS="-XDignore.symbol.file"
+endif
export IT_CFLAGS=$(CFLAGS) $(ARCHFLAG)
export IT_JAVAC_SETTINGS=-g -encoding utf-8 $(JAVACFLAGS) $(MEMORY_LIMIT) $(PREFER_SOURCE)
export IT_LANGUAGE_SOURCE_VERSION=8
@@ -486,6 +491,28 @@ endif
if [ ! -e $(DESTDIR)$(bindir)/$(MODULARJDK_ARGS_FILE) ] ; then cp $(MODULARJDK_ARGS_LOCATION) $(DESTDIR)$(bindir)/$(MODULARJDK_ARGS_FILE) ; fi
(cd $(DESTDIR)$(prefix)/.. && $(ZIP) -qr $(TOP_BUILD_DIR)/$(distdir).linux.bin.zip `basename $(DESTDIR)$(prefix)` );
+macos-bin-dist: install
+ rm -f $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY)
+ mkdir -p $(MACOS_BIN_DIST_DEPS)
+if WITH_RHINO
+ filteredName=`basename $(RHINO_JAR) | sed "s/[^a-zA-Z]//g" | sed "s/jar$$/.jar/"` ; \
+ cp -v $(RHINO_JAR) $(MACOS_BIN_DIST_DEPS)/$$filteredName
+endif
+if HAVE_TAGSOUP
+ filteredName=`basename $(TAGSOUP_JAR) | sed "s/[^a-zA-Z]//g" | sed "s/jar$$/.jar/"` ; \
+ cp -v $(TAGSOUP_JAR) $(MACOS_BIN_DIST_DEPS)/$$filteredName
+endif
+ cp $(NETX_DIR)/lib/src.zip $(DESTDIR)$(prefix)/netx.src.zip
+if ENABLE_PLUGINJAR
+ cp $(TOP_BUILD_DIR)/liveconnect/lib/src.zip $(DESTDIR)$(prefix)/plugin.src.zip
+endif
+if ENABLE_DOCS
+ cp -r $(DOCS_DIR)/html $(DESTDIR)$(prefix)/icedtea-web-docs
+endif
+ if [ ! -e $(DESTDIR)$(bindir)/$(MODULARJDK_ARGS_FILE) ] ; then cp $(MODULARJDK_ARGS_LOCATION) $(DESTDIR)$(bindir)/$(MODULARJDK_ARGS_FILE) ; fi
+ (cd $(DESTDIR)$(prefix)/.. && $(ZIP) -qr $(TOP_BUILD_DIR)/$(distdir).macos.bin.zip `basename $(DESTDIR)$(prefix)` );
+
+
win-bin-dist: win-only-image
(cd $(DESTDIR)$(prefix)/.. && $(ZIP) -qr $(TOP_BUILD_DIR)/$(distdir).win.bin.zip `basename $(DESTDIR)$(prefix)` );
@@ -729,12 +756,18 @@ clean-plugin: $(ICEDTEAPLUGIN_CLEAN)
liveconnect-source-files.txt:
if WINDOWS
- echo "Using WEmbeddedFrame" ; \
- sed "s;sun.awt.X11.XEmbeddedFrame;sun.awt.windows.WEmbeddedFrame;" -i $(LIVECONNECT_SRCS)/$(SUN_APPLET_DIRS)/PluginAppletViewer.java ; \
- sed "s;XEmbeddedFrame;WEmbeddedFrame;" -i $(LIVECONNECT_SRCS)/$(SUN_APPLET_DIRS)/PluginAppletViewer.java ; \
- sed "s;super(handle, true);super(handle);" -i $(LIVECONNECT_SRCS)/$(SUN_APPLET_DIRS)/PluginAppletViewer.java ;
+ echo "Using WEmbeddedFrame" ; \
+ sed "s;sun.awt.X11.XEmbeddedFrame;sun.awt.windows.WEmbeddedFrame;" -i $(LIVECONNECT_SRCS)/$(SUN_APPLET_DIRS)/PluginAppletViewer.java ; \
+ sed "s;XEmbeddedFrame;WEmbeddedFrame;" -i $(LIVECONNECT_SRCS)/$(SUN_APPLET_DIRS)/PluginAppletViewer.java ; \
+ sed "s;super(handle, true);super(handle);" -i $(LIVECONNECT_SRCS)/$(SUN_APPLET_DIRS)/PluginAppletViewer.java ;
+endif
+if MACOS
+ echo "Using CEmbeddedFrame" ; \
+ sed "s;sun.awt.X11.XEmbeddedFrame;sun.lwawt.macosx.CEmbeddedFrame;" -i $(LIVECONNECT_SRCS)/$(SUN_APPLET_DIRS)/PluginAppletViewer.java ; \
+ sed "s;XEmbeddedFrame;CEmbeddedFrame;" -i $(LIVECONNECT_SRCS)/$(SUN_APPLET_DIRS)/PluginAppletViewer.java ;
+ sed "s;super(handle, true);super();" -i $(LIVECONNECT_SRCS)/$(SUN_APPLET_DIRS)/PluginAppletViewer.java ;
else
- echo "Using XEmbeddedFrame" ;
+ echo "Using XEmbeddedFrame" ;
endif
if test "x${LIVECONNECT_DIR}" != x; then \
find $(LIVECONNECT_SRCS) -name '*.java' | sort > $@ ; \
@@ -956,10 +989,10 @@ if ENABLE_NATIVE_LAUNCHERS
# there is curently harecoded sh, so it can somehow basically work
# see the DESKTOP_SUFFIX for final tuning
launcher.build/$(javaws) launcher.build/$(itweb_settings) launcher.build/$(policyeditor): rust-launcher/src/main.rs rust-launcher/Cargo.toml
- export ITW_TMP_REPLACEMENT=$(TESTS_DIR)/rust_tests_tmp ; \
- mkdir -p $$ITW_TMP_REPLACEMENT; \
filename=`basename $@` ; \
type=$${filename%.*} ; \
+ export ITW_TMP_REPLACEMENT=$(TESTS_DIR)/rust_tests_tmp/$$type ; \
+ mkdir -p $$ITW_TMP_REPLACEMENT; \
srcs=$(TOP_SRC_DIR)/rust-launcher ; \
outs=$(TOP_BUILD_DIR)/launcher.in.$$type ; \
mkdir -p launcher.build ; \
=====================================
NEWS
=====================================
@@ -8,6 +8,23 @@ GX - http://bugs.gentoo.org/show_bug.cgi?id=X
CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY
+New in release 1.8.8 (2021-10-28):
+* Application cannot be started with JDK 13 - AWTSecurityManager was removed / Backport of https://github.com/AdoptOpenJDK/IcedTea-Web/pull/438 fix https://github.com/AdoptOpenJDK/IcedTea-Web/issues/437
+
+New in release 1.8.7 (2021-05-27):
+* Backport of https://github.com/AdoptOpenJDK/IcedTea-Web/pull/467 fix https://github.com/AdoptOpenJDK/IcedTea-Web/issues/89
+
+New in release 1.8.6 (2021-02-23):
+* Fix missing mslinks in Windows build
+
+New in release 1.8.5 (2021-02-22):
+* Change so that it can also be built under freebsd
+* fix for cargo test sometimes fails when make runs with several simultaneous jobs
+* JARs downloaded with URI-escaped characters don't get loaded
+* Reduced number of threads spawned for downloading of resources
+* handle broken XML in jnlp
+* Migrated to GitHub Action release support
+
New in release 1.8.4 (2020-06-03):
* Backport of https://github.com/AdoptOpenJDK/IcedTea-Web/pull/389
* Backport of https://github.com/AdoptOpenJDK/IcedTea-Web/pull/384
=====================================
acinclude.m4
=====================================
@@ -130,6 +130,10 @@ AC_DEFUN_ONCE([FIND_JAVAC],
[
AC_REQUIRE([IT_CHECK_FOR_JDK])
JAVAC=${SYSTEM_JDK_DIR}/bin/javac
+ # macOS requires this flag, see https://youtrack.jetbrains.com/issue/IDEA-72010
+ AM_COND_IF([MACOS], [
+ JAVACFLAGS="-XDignore.symbol.file"
+ ])
IT_FIND_JAVAC
IT_FIND_ECJ
IT_USING_ECJ
=====================================
autogen.sh
=====================================
@@ -11,7 +11,7 @@ for AUTOCONF in autoconf autoconf259 autoconf2.59; do
AUTOCONF_VERSION=`${AUTOCONF} --version | head -1 | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
# echo ${AUTOCONF_VERSION}
case ${AUTOCONF_VERSION} in
- 2.59* | 2.6[0-9]* )
+ 2.59* | 2.6[0-9]* | 2.7[0-9]* )
HAVE_AUTOCONF=true
break;
;;
@@ -28,7 +28,7 @@ for AUTOHEADER in autoheader autoheader259 autoheader2.59; do
AUTOHEADER_VERSION=`${AUTOHEADER} --version | head -1 | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
# echo ${AUTOHEADER_VERSION}
case ${AUTOHEADER_VERSION} in
- 2.59* | 2.6[0-9]* )
+ 2.59* | 2.6[0-9]* | 2.7[0-9]* )
HAVE_AUTOHEADER=true
break;
;;
@@ -45,7 +45,7 @@ for AUTOM4TE in autom4te autom4te259 autom4te2.59; do
AUTOM4TE_VERSION=`${AUTOM4TE} --version | head -1 | sed 's/^[^ ]* [^0-9]*\([0-9.][0-9.]*\).*/\1/'`
# echo ${AUTOM4TE_VERSION}
case ${AUTOM4TE_VERSION} in
- 2.59* | 2.6[0-9]* )
+ 2.59* | 2.6[0-9]* | 2.7[0-9]* )
HAVE_AUTOM4TE=true
break;
;;
@@ -62,7 +62,7 @@ for AUTORECONF in autoreconf autoreconf2.59; do
AUTORECONF_VERSION=`${AUTORECONF} --version | head -1 | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
# echo ${AUTORECONF_VERSION}
case ${AUTORECONF_VERSION} in
- 2.59* | 2.6[0-9]* )
+ 2.59* | 2.6[0-9]* | 2.7[0-9]* )
HAVE_AUTORECONF=true
break;
;;
@@ -72,25 +72,25 @@ done
if test ${HAVE_AUTOCONF} = false; then
echo "No proper autoconf was found."
- echo "You must have autoconf 2.59 or later installed."
+ echo "You must have autoconf 2.59, 2.6x or 2.7x installed."
exit 1
fi
if test ${HAVE_AUTOHEADER} = false; then
echo "No proper autoheader was found."
- echo "You must have autoconf 2.59 or later installed."
+ echo "You must have autoheader 2.59, 2.6x or 2.7x installed."
exit 1
fi
if test ${HAVE_AUTOM4TE} = false; then
echo "No proper autom4te was found."
- echo "You must have autom4te 2.59 or later installed."
+ echo "You must have autom4te 2.59, 2.6x or 2.7x installed."
exit 1
fi
if test ${HAVE_AUTORECONF} = false; then
echo "No proper autoreconf was found."
- echo "You must have autoconf 2.59 or later installed."
+ echo "You must have autoreconf 2.59, 2.6x or 2.7x installed."
exit 1
fi
=====================================
configure.ac
=====================================
@@ -1,4 +1,4 @@
-AC_INIT([icedtea-web],[1.8.4],[distro-pkg-dev at openjdk.java.net], [icedtea-web], [http://icedtea.classpath.org/wiki/IcedTea-Web])
+AC_INIT([icedtea-web],[1.8.8],[distro-pkg-dev at openjdk.java.net], [icedtea-web], [http://icedtea.classpath.org/wiki/IcedTea-Web])
AM_INIT_AUTOMAKE([1.9 tar-pax foreign])
AC_CONFIG_FILES([Makefile netx.manifest])
AM_MAINTAINER_MODE([enable])
@@ -70,19 +70,24 @@ AM_CONDITIONAL([ENABLE_NATIVE_LAUNCHERS], [test ! x"$RUSTC" = x -a ! x"$CARGO" =
build_linux=no
build_windows=no
+build_macos=no
case "${host_os}" in
- linux*)
+ linux*|freebsd*)
build_linux=yes
;;
cygwin*)
build_windows=yes
;;
+ darwin*)
+ build_macos=yes
+ ;;
*)
AC_MSG_ERROR(["OS $host_os is not supported"])
;;
esac
AM_CONDITIONAL([LINUX], [test "$build_linux" = "yes"])
AM_CONDITIONAL([WINDOWS], [test "$build_windows" = "yes"])
+AM_CONDITIONAL([MACOS], [test "$build_macos" = "yes"])
# the images built with this switch on linux, are not exactly windows friendly (see removed jars in make log, which are made in favor of clean linux build)
AC_MSG_CHECKING([whether to include also bat lunchers during linux build])
@@ -173,6 +178,9 @@ IT_CHECK_FOR_CLASS(SUN_NET_WWW_PROTOCOL_JAR_URLJARFILECALLBACK, [sun.net.www.pro
if test "x$build_linux" = xyes ; then
IT_CHECK_FOR_CLASS(SUN_AWT_X11_XEMBEDDEDFRAME, [sun.awt.X11.XEmbeddedFrame], [some.pkg], [$JAVA_DESKTOP])
fi
+if test "x$build_macos" = xyes ; then
+ IT_CHECK_FOR_CLASS(SUN_LWAWT_CEMBEDDEDFRAME, [sun.lwawt.macosx.CEmbeddedFrame], [some.pkg], [$JAVA_DESKTOP])
+fi
if test "x$build_windows" = xyes ; then
IT_CHECK_FOR_CLASS(SUN_AWT_WEMBEDDEDFRAME, [sun.awt.windows.WEmbeddedFrame], [some.pkg], [$JAVA_DESKTOP])
fi
=====================================
netx/net/sourceforge/jnlp/Launcher.java
=====================================
@@ -552,7 +552,7 @@ public class Launcher {
}
OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Starting application [" + mainName + "] ...");
-
+
Class<?> mainClass = app.getClassLoader().loadClass(mainName);
Method main = mainClass.getMethod("main", new Class<?>[] { String[].class });
@@ -572,6 +572,7 @@ public class Launcher {
main.setAccessible(true);
+ JNLPRuntime.addStartupTrackingEntry("invoking main()");
OutputController.getLogger().log("Invoking main() with args: " + Arrays.toString(args));
main.invoke(null, new Object[] { args });
=====================================
netx/net/sourceforge/jnlp/OptionsDefinitions.java
=====================================
@@ -78,6 +78,7 @@ public class OptionsDefinitions {
JNLP("-jnlp","BOJnlp", NumberOfArguments.ONE),
HTML("-html","BOHtml", NumberOfArguments.ONE_OR_MORE),
BROWSER("-browser", "BrowserArg", NumberOfArguments.ONE_OR_MORE),
+ STARTUP_TRACKER("-startuptracker","BOStartupTracker"),
//itweb settings
LIST("-list", "IBOList"),
GET("-get", "name", "IBOGet", NumberOfArguments.ONE_OR_MORE),
@@ -222,7 +223,8 @@ public class OptionsDefinitions {
OPTIONS.TRUSTNONE,
OPTIONS.JNLP,
OPTIONS.HTML,
- OPTIONS.BROWSER
+ OPTIONS.BROWSER,
+ OPTIONS.STARTUP_TRACKER
});
}
=====================================
netx/net/sourceforge/jnlp/cache/CacheEntry.java
=====================================
@@ -47,6 +47,8 @@ public class CacheEntry {
/** info about the cached file */
private final PropertiesFile properties;
+ private File localFile;
+
/**
* Create a CacheEntry for the resources specified as a remote
* URL.
@@ -58,8 +60,8 @@ public class CacheEntry {
this.location = location;
this.version = version;
- File infoFile = CacheUtil.getCacheFile(location, version);
- infoFile = new File(infoFile.getPath() + CacheDirectory.INFO_SUFFIX); // replace with something that can't be clobbered
+ this.localFile = CacheUtil.getCacheFile(location, version);
+ File infoFile = new File(localFile.getPath() + CacheDirectory.INFO_SUFFIX); // replace with something that can't be clobbered
properties = new PropertiesFile(infoFile, R("CAutoGen"));
}
@@ -130,7 +132,11 @@ public class CacheEntry {
* @return whether the cache contains the version
*/
public boolean isCurrent(long lastModified) {
- boolean cached = isCached();
+ return isCurrent(lastModified, null);
+ }
+
+ public boolean isCurrent(long lastModified, File cachedFile) {
+ boolean cached = isCached(cachedFile);
OutputController.getLogger().log("isCurrent:isCached " + cached);
if (!cached) {
@@ -153,7 +159,16 @@ public class CacheEntry {
* @return true if the resource is in the cache
*/
public boolean isCached() {
- File localFile = getCacheFile();
+ return isCached(null);
+ }
+
+ public boolean isCached(File cachedFile) {
+ final File localFile;
+ if (null == version && null != cachedFile) {
+ localFile = cachedFile;
+ } else {
+ localFile = getCacheFile();
+ }
if (!localFile.exists())
return false;
@@ -224,4 +239,7 @@ public class CacheEntry {
return properties.isHeldByCurrentThread();
}
+ public File getLocalFile() {
+ return localFile;
+ }
}
=====================================
netx/net/sourceforge/jnlp/cache/CacheUtil.java
=====================================
@@ -422,14 +422,13 @@ public class CacheUtil {
* @return whether the cache contains the version
* @throws IllegalArgumentException if the source is not cacheable
*/
- public static boolean isCurrent(URL source, Version version, long lastModifed) {
+ public static boolean isCurrent(URL source, Version version, long lastModifed, CacheEntry entry, File cachedFile) {
if (!isCacheable(source, version))
throw new IllegalArgumentException(R("CNotCacheable", source));
try {
- CacheEntry entry = new CacheEntry(source, version); // could pool this
- boolean result = entry.isCurrent(lastModifed);
+ boolean result = entry.isCurrent(lastModifed, cachedFile);
OutputController.getLogger().log("isCurrent: " + source + " = " + result);
@@ -796,6 +795,8 @@ public class CacheUtil {
}
URL undownloaded[] = urlList.toArray(new URL[urlList.size()]);
+ final int maxUrls = Integer.parseInt(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_MAX_URLS_DOWNLOAD_INDICATOR));
+
listener = indicator.getListener(app, title, undownloaded);
do {
@@ -810,20 +811,30 @@ public class CacheUtil {
int percent = (int) ((100 * read) / Math.max(1, total));
+ int urlCounter = 0;
for (URL url : undownloaded) {
+ if (urlCounter > maxUrls) {
+ break;
+ }
listener.progress(url, "version",
tracker.getAmountRead(url),
tracker.getTotalSize(url),
percent);
+ urlCounter += 1;
}
} while (!tracker.waitForResources(resources, indicator.getUpdateRate()));
// make sure they read 100% until indicator closes
+ int urlCounter = 0;
for (URL url : undownloaded) {
+ if (urlCounter > maxUrls) {
+ break;
+ }
listener.progress(url, "version",
tracker.getTotalSize(url),
tracker.getTotalSize(url),
100);
+ urlCounter += 1;
}
} catch (InterruptedException ex) {
OutputController.getLogger().log(ex);
=====================================
netx/net/sourceforge/jnlp/cache/CachedDaemonThreadPoolProvider.java
=====================================
@@ -36,9 +36,14 @@
exception statement from your version. */
package net.sourceforge.jnlp.cache;
+import net.sourceforge.jnlp.config.DeploymentConfiguration;
+import net.sourceforge.jnlp.runtime.JNLPRuntime;
+
import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
public class CachedDaemonThreadPoolProvider {
@@ -81,6 +86,19 @@ public class CachedDaemonThreadPoolProvider {
}
}
- public static final ExecutorService DAEMON_THREAD_POOL = Executors.newCachedThreadPool(new DaemonThreadFactory());
+ public static synchronized ExecutorService getThreadPool() {
+ if (null == DAEMON_THREAD_POOL) {
+ final int nThreads = Integer.parseInt(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_BACKGROUND_THREADS_COUNT));
+ ThreadPoolExecutor pool = new ThreadPoolExecutor(nThreads, nThreads,
+ 60L, TimeUnit.SECONDS,
+ new LinkedBlockingQueue<Runnable>(),
+ new DaemonThreadFactory());
+ pool.allowCoreThreadTimeOut(true);
+ DAEMON_THREAD_POOL = pool;
+ }
+ return DAEMON_THREAD_POOL;
+ }
+
+ private static ExecutorService DAEMON_THREAD_POOL = null;
}
=====================================
netx/net/sourceforge/jnlp/cache/ResourceDownloader.java
=====================================
@@ -153,7 +153,12 @@ public class ResourceDownloader implements Runnable {
URLConnection connection = ConnectionFactory.getConnectionFactory().openConnection(location.URL); // this won't change so should be okay not-synchronized
connection.addRequestProperty("Accept-Encoding", "pack200-gzip, gzip");
- File localFile = CacheUtil.getCacheFile(resource.getLocation(), resource.getDownloadVersion());
+ File localFile = null;
+ if (resource.getRequestVersion() == resource.getDownloadVersion()) {
+ localFile = entry.getLocalFile();
+ } else {
+ localFile = CacheUtil.getCacheFile(resource.getLocation(), resource.getDownloadVersion());
+ }
Long size = location.length;
if (size == null) {
size = connection.getContentLengthLong();
@@ -162,7 +167,7 @@ public class ResourceDownloader implements Runnable {
if (lm == null) {
lm = connection.getLastModified();
}
- boolean current = CacheUtil.isCurrent(resource.getLocation(), resource.getRequestVersion(), lm) && resource.getUpdatePolicy() != UpdatePolicy.FORCE;
+ boolean current = CacheUtil.isCurrent(resource.getLocation(), resource.getRequestVersion(), lm, entry, localFile) && resource.getUpdatePolicy() != UpdatePolicy.FORCE;
if (!current) {
if (entry.isCached()) {
entry.markForDelete();
=====================================
netx/net/sourceforge/jnlp/cache/ResourceTracker.java
=====================================
@@ -28,10 +28,7 @@ import static net.sourceforge.jnlp.cache.Resource.Status.PROCESSING;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.List;
+import java.util.*;
import net.sourceforge.jnlp.DownloadOptions;
import net.sourceforge.jnlp.Version;
@@ -105,6 +102,7 @@ public class ResourceTracker {
/** the resources known about by this resource tracker */
private final List<Resource> resources = new ArrayList<>();
+ private final HashMap<String, Resource> resourcesMap = new HashMap<>();
/** download listeners for this tracker */
private final List<DownloadListener> listeners = new ArrayList<>();
@@ -155,6 +153,7 @@ public class ResourceTracker {
return;
resource.addTracker(this);
resources.add(resource);
+ resourcesMap.put(location.toString(), resource);
}
if (options == null) {
@@ -190,6 +189,7 @@ public class ResourceTracker {
if (resource != null) {
resources.remove(resource);
+ resourcesMap.remove(location.toString());
resource.removeTracker(this);
}
@@ -508,7 +508,7 @@ public class ResourceTracker {
* @param resource resource to be download
*/
protected void startDownloadThread(Resource resource) {
- CachedDaemonThreadPoolProvider.DAEMON_THREAD_POOL.execute(new ResourceDownloader(resource, lock));
+ CachedDaemonThreadPoolProvider.getThreadPool().execute(new ResourceDownloader(resource, lock));
}
static Resource selectByFilter(Collection<Resource> source, Filter<Resource> filter) {
@@ -569,6 +569,12 @@ public class ResourceTracker {
*/
private Resource getResource(URL location) {
synchronized (resources) {
+ if (null != location) {
+ Resource res = resourcesMap.get(location.toString());
+ if (null != res && UrlUtils.urlEquals(res.getLocation(), location)) {
+ return res;
+ }
+ }
for (Resource resource : resources) {
if (UrlUtils.urlEquals(resource.getLocation(), location))
return resource;
=====================================
netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java
=====================================
@@ -38,6 +38,7 @@ package net.sourceforge.jnlp.cache;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -101,6 +102,7 @@ public class ResourceUrlCreator {
if (!noHttpsPreffered) {
//preffering https and owerriding case, when applciation was moved to https, but the jnlp stayed intacted
List<URL> urlsCopy = new LinkedList<>(urls);
+ Collections.reverse(urlsCopy);
for (URL u : urlsCopy) {
if (u.getProtocol().equals("http") && u.getPort() < 0) {
try {
=====================================
netx/net/sourceforge/jnlp/config/Defaults.java
=====================================
@@ -466,6 +466,21 @@ public class Defaults {
BasicValueValidators.getRangedIntegerValidator(0, 1000),
String.valueOf(10)// treshold when applet is considered as too small
},
+ {
+ DeploymentConfiguration.KEY_ENABLE_CACHE_FSYNC,
+ BasicValueValidators.getBooleanValidator(),
+ String.valueOf(false)
+ },
+ {
+ DeploymentConfiguration.KEY_BACKGROUND_THREADS_COUNT,
+ BasicValueValidators.getRangedIntegerValidator(1, 16),
+ String.valueOf(3)
+ },
+ {
+ DeploymentConfiguration.KEY_MAX_URLS_DOWNLOAD_INDICATOR,
+ BasicValueValidators.getRangedIntegerValidator(1, 1024),
+ String.valueOf(16)
+ },
//**************
//* Native (rust) only - beggin
//**************
=====================================
netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
=====================================
@@ -250,7 +250,10 @@ public final class DeploymentConfiguration {
public static final String KEY_SMALL_SIZE_OVERRIDE_TRESHOLD = "deployment.small.size.treshold";
public static final String KEY_SMALL_SIZE_OVERRIDE_WIDTH = "deployment.small.size.override.width";
public static final String KEY_SMALL_SIZE_OVERRIDE_HEIGHT = "deployment.small.size.override.height";
-
+ public static final String KEY_ENABLE_CACHE_FSYNC = "deployment.enable.cache.fsync";
+ public static final String KEY_BACKGROUND_THREADS_COUNT = "deployment.background.threads.count";
+ public static final String KEY_MAX_URLS_DOWNLOAD_INDICATOR = "deployment.max.urls.download.indicator";
+
public static final String TRANSFER_TITLE = "Legacy configuration and cache found. Those will be now transported to new locations";
private ConfigurationException loadingException = null;
=====================================
netx/net/sourceforge/jnlp/resources/Messages.properties
=====================================
@@ -357,6 +357,7 @@ BXoffline = Prevent ITW network connection. Only cache will be used. Applicati
BOHelp1 = Prints out information about supported command and basic usage.
BOHelp2 = Prints out information about supported command and basic usage. Can also take an parameter, and then it prints detailed help for this command.
BOTrustnone = Instead of asking user, will foretold all answers as no.
+BOStartupTracker = Enable startup time tracker
# Itweb-settings boot commands
IBOList=Shows a list of all the IcedTea-Web settings and their current values.
=====================================
netx/net/sourceforge/jnlp/runtime/Boot.java
=====================================
@@ -107,6 +107,10 @@ public final class Boot implements PrivilegedAction<Void> {
optionParser = new OptionParser(argsIn, OptionsDefinitions.getJavaWsOptions());
+ if (optionParser.hasOption(OptionsDefinitions.OPTIONS.STARTUP_TRACKER)) {
+ JNLPRuntime.initStartupTracker();
+ }
+
if (optionParser.hasOption(OptionsDefinitions.OPTIONS.VERBOSE)) {
JNLPRuntime.setDebug(true);
}
=====================================
netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java
=====================================
@@ -103,7 +103,7 @@ final class CachedJarFileCallback implements URLJarFileCallBack {
if (UrlUtils.isLocalFile(localUrl)) {
// if it is known to us, just return the cached file
- JarFile returnFile = new JarFile(localUrl.getPath());
+ JarFile returnFile = new JarFile(UrlUtils.decodeUrlQuietly(localUrl).getPath());
try {
=====================================
netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
=====================================
@@ -14,7 +14,39 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package net.sourceforge.jnlp.runtime;
-import static net.sourceforge.jnlp.runtime.Translator.R;
+import net.sourceforge.jnlp.AppletDesc;
+import net.sourceforge.jnlp.ApplicationDesc;
+import net.sourceforge.jnlp.ExtensionDesc;
+import net.sourceforge.jnlp.JARDesc;
+import net.sourceforge.jnlp.JNLPFile;
+import net.sourceforge.jnlp.JNLPMatcher;
+import net.sourceforge.jnlp.JNLPMatcherException;
+import net.sourceforge.jnlp.LaunchDesc;
+import net.sourceforge.jnlp.LaunchException;
+import net.sourceforge.jnlp.NullJnlpFileException;
+import net.sourceforge.jnlp.OptionsDefinitions;
+import net.sourceforge.jnlp.ParseException;
+import net.sourceforge.jnlp.ParserSettings;
+import net.sourceforge.jnlp.PluginBridge;
+import net.sourceforge.jnlp.ResourcesDesc;
+import net.sourceforge.jnlp.SecurityDesc;
+import net.sourceforge.jnlp.Version;
+import net.sourceforge.jnlp.cache.CacheUtil;
+import net.sourceforge.jnlp.cache.IllegalResourceDescriptorException;
+import net.sourceforge.jnlp.cache.NativeLibraryStorage;
+import net.sourceforge.jnlp.cache.ResourceTracker;
+import net.sourceforge.jnlp.cache.UpdatePolicy;
+import net.sourceforge.jnlp.config.DeploymentConfiguration;
+import net.sourceforge.jnlp.jdk89acesses.JarIndexAccess;
+import net.sourceforge.jnlp.security.AppVerifier;
+import net.sourceforge.jnlp.security.JNLPAppVerifier;
+import net.sourceforge.jnlp.security.PluginAppVerifier;
+import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation;
+import net.sourceforge.jnlp.tools.JarCertVerifier;
+import net.sourceforge.jnlp.util.JarFile;
+import net.sourceforge.jnlp.util.StreamUtils;
+import net.sourceforge.jnlp.util.UrlUtils;
+import net.sourceforge.jnlp.util.logging.OutputController;
import java.io.File;
import java.io.FileInputStream;
@@ -57,39 +89,6 @@ import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.Manifest;
-import net.sourceforge.jnlp.AppletDesc;
-import net.sourceforge.jnlp.ApplicationDesc;
-import net.sourceforge.jnlp.ExtensionDesc;
-import net.sourceforge.jnlp.JARDesc;
-import net.sourceforge.jnlp.JNLPFile;
-import net.sourceforge.jnlp.JNLPMatcher;
-import net.sourceforge.jnlp.JNLPMatcherException;
-import net.sourceforge.jnlp.jdk89acesses.JarIndexAccess;
-import net.sourceforge.jnlp.LaunchDesc;
-import net.sourceforge.jnlp.LaunchException;
-import net.sourceforge.jnlp.NullJnlpFileException;
-import net.sourceforge.jnlp.OptionsDefinitions;
-import net.sourceforge.jnlp.ParseException;
-import net.sourceforge.jnlp.ParserSettings;
-import net.sourceforge.jnlp.PluginBridge;
-import net.sourceforge.jnlp.ResourcesDesc;
-import net.sourceforge.jnlp.SecurityDesc;
-import net.sourceforge.jnlp.Version;
-import net.sourceforge.jnlp.cache.CacheUtil;
-import net.sourceforge.jnlp.cache.IllegalResourceDescriptorException;
-import net.sourceforge.jnlp.cache.NativeLibraryStorage;
-import net.sourceforge.jnlp.cache.ResourceTracker;
-import net.sourceforge.jnlp.cache.UpdatePolicy;
-import net.sourceforge.jnlp.config.DeploymentConfiguration;
-import net.sourceforge.jnlp.security.AppVerifier;
-import net.sourceforge.jnlp.security.JNLPAppVerifier;
-import net.sourceforge.jnlp.security.PluginAppVerifier;
-import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation;
-import net.sourceforge.jnlp.tools.JarCertVerifier;
-import net.sourceforge.jnlp.util.JarFile;
-import net.sourceforge.jnlp.util.StreamUtils;
-import net.sourceforge.jnlp.util.UrlUtils;
-import net.sourceforge.jnlp.util.logging.OutputController;
import static net.sourceforge.jnlp.runtime.Translator.R;
/**
@@ -709,7 +708,9 @@ public class JNLPClassLoader extends URLClassLoader {
fillInPartJars(initialJars); // add in each initial part's lazy jars
}
+ JNLPRuntime.addStartupTrackingEntry("JARs download enter");
waitForJars(initialJars); //download the jars first.
+ JNLPRuntime.addStartupTrackingEntry("JARs download complete");
//A ZipException will propagate later on if the jar is invalid and not checked here
if (shouldFilterInvalidJars()) {
@@ -2082,7 +2083,9 @@ public class JNLPClassLoader extends URLClassLoader {
}
// Codebase
- addToCodeBaseLoader(extLoader.file.getCodeBase());
+ if (this.enableCodeBase) {
+ addToCodeBaseLoader(extLoader.file.getCodeBase());
+ }
// native search paths
for (File nativeDirectory : extLoader.nativeLibraryStorage.getSearchDirectories()) {
=====================================
netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java
=====================================
@@ -170,6 +170,7 @@ public class JNLPRuntime {
private static Boolean onlineDetected = null;
+ private static long startupTrackerMoment = 0;
/**
* Header is not checked and so eg
@@ -891,6 +892,19 @@ public class JNLPRuntime {
JNLPRuntime.ignoreHeaders = ignoreHeaders;
}
+ // may only be called from Boot
+ public static void initStartupTracker() {
+ startupTrackerMoment = System.currentTimeMillis();
+ }
+
+ public static void addStartupTrackingEntry(String message) {
+ if (startupTrackerMoment > 0) {
+ long time = (System.currentTimeMillis() - startupTrackerMoment)/1000;
+ String msg = "Startup tracker: seconds elapsed: [" + time + "], message: [" + message + "]";
+ OutputController.getLogger().log(OutputController.Level.ERROR_ALL, msg);
+ }
+ }
+
private static boolean isPluginDebug() {
if (pluginDebug == null) {
try {
=====================================
netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java
=====================================
@@ -29,7 +29,6 @@ import net.sourceforge.jnlp.services.ServiceUtil;
import net.sourceforge.jnlp.util.logging.OutputController;
import net.sourceforge.jnlp.util.WeakList;
import net.sourceforge.swing.SwingUtils;
-import sun.awt.AWTSecurityManager;
import sun.awt.AppContext;
/**
@@ -47,7 +46,7 @@ import sun.awt.AppContext;
* @author <a href="mailto:jmaxwell at users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
* @version $Revision: 1.17 $
*/
-class JNLPSecurityManager extends AWTSecurityManager {
+class JNLPSecurityManager extends SecurityManager {
// todo: some apps like JDiskReport can close the VM even when
// an exit class is set - fix!
@@ -423,33 +422,6 @@ class JNLPSecurityManager extends AWTSecurityManager {
exitAllowed = false;
}
- /**
- * This returns the appropriate {@link AppContext}. Hooks in AppContext
- * check if the current {@link SecurityManager} is an instance of
- * AWTSecurityManager and if so, call this method to give it a chance to
- * return the appropriate appContext based on the application that is
- * running.
- * <p>
- * This can be called from any thread (possibly a swing thread) to find out
- * the AppContext for the thread (which may correspond to a particular
- * applet).
- * </p>
- */
- @Override
- public AppContext getAppContext() {
- ApplicationInstance app = getApplication();
- if (app == null) {
- /*
- * if we cannot find an application based on the code on the stack,
- * then assume it is the main application
- */
- return mainAppContext;
- } else {
- return app.getAppContext();
- }
-
- }
-
/**
* Tests if a client can get access to the AWT event queue. This version allows
* complete access to the EventQueue for its own AppContext-specific EventQueue.
=====================================
netx/net/sourceforge/jnlp/tools/JarCertVerifier.java
=====================================
@@ -39,15 +39,18 @@ import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Vector;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Future;
import java.util.jar.JarEntry;
import java.util.regex.Pattern;
import net.sourceforge.jnlp.JARDesc;
import net.sourceforge.jnlp.JNLPFile;
import net.sourceforge.jnlp.LaunchException;
+import net.sourceforge.jnlp.cache.CachedDaemonThreadPoolProvider;
import net.sourceforge.jnlp.cache.ResourceTracker;
import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate;
+import net.sourceforge.jnlp.runtime.JNLPRuntime;
import net.sourceforge.jnlp.security.AppVerifier;
import net.sourceforge.jnlp.security.CertVerifier;
import net.sourceforge.jnlp.security.CertificateUtils;
@@ -226,37 +229,36 @@ public class JarCertVerifier implements CertVerifier {
private void verifyJars(List<JARDesc> jars, ResourceTracker tracker)
throws Exception {
+ List<String> filesToVerify = new ArrayList<>();
for (JARDesc jar : jars) {
+ File jarFile = tracker.getCacheFile(jar.getLocation());
- try {
-
- File jarFile = tracker.getCacheFile(jar.getLocation());
-
- // some sort of resource download/cache error. Nothing to add
- // in that case ... but don't fail here
- if (jarFile == null) {
- continue;
- }
+ // some sort of resource download/cache error. Nothing to add
+ // in that case ... but don't fail here
+ if (jarFile == null) {
+ continue;
+ }
- String localFile = jarFile.getAbsolutePath();
- if (verifiedJars.contains(localFile)
- || unverifiedJars.contains(localFile)) {
- continue;
- }
+ String localFile = jarFile.getAbsolutePath();
+ if (verifiedJars.contains(localFile)
+ || unverifiedJars.contains(localFile)) {
+ continue;
+ }
- VerifyResult result = verifyJar(localFile);
+ filesToVerify.add(localFile);
+ }
- if (result == VerifyResult.UNSIGNED) {
- unverifiedJars.add(localFile);
- } else if (result == VerifyResult.SIGNED_NOT_OK) {
- verifiedJars.add(localFile);
- } else if (result == VerifyResult.SIGNED_OK) {
- verifiedJars.add(localFile);
- }
- } catch (Exception e) {
- // We may catch exceptions from using verifyJar()
- // or from checkTrustedCerts
- throw e;
+ List<VerifiedJarFile> verified = verifyJarsParallel(filesToVerify);
+
+ for (VerifiedJarFile vjf : verified) {
+ VerifyResult result = verifyJarEntryCerts(vjf.file, vjf.hasManifest, vjf.entriesVec);
+ String localFile = vjf.file;
+ if (result == VerifyResult.UNSIGNED) {
+ unverifiedJars.add(localFile);
+ } else if (result == VerifyResult.SIGNED_NOT_OK) {
+ verifiedJars.add(localFile);
+ } else if (result == VerifyResult.SIGNED_OK) {
+ verifiedJars.add(localFile);
}
}
@@ -264,6 +266,31 @@ public class JarCertVerifier implements CertVerifier {
checkTrustedCerts(certPath);
}
+ private List<VerifiedJarFile> verifyJarsParallel(List<String> files) throws Exception {
+ JNLPRuntime.addStartupTrackingEntry("JARs verification enter");
+ List<Callable<VerifiedJarFile>> callables = new ArrayList<>(files.size());
+ for (final String fi : files) {
+ callables.add(new Callable<VerifiedJarFile>() {
+ @Override
+ public VerifiedJarFile call() throws Exception {
+ return verifyJar(fi);
+ }
+ });
+ }
+ List<Future<VerifiedJarFile>> futures = CachedDaemonThreadPoolProvider.getThreadPool().invokeAll(callables);
+ List<VerifiedJarFile> results = new ArrayList<>(files.size());
+ try {
+ for (Future<VerifiedJarFile> fu : futures) {
+ results.add(fu.get());
+ }
+ } catch (Exception e) {
+ OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e);
+ throw e;
+ }
+ JNLPRuntime.addStartupTrackingEntry("JARs verification complete");
+ return results;
+ }
+
/**
* Checks through all the jar entries of jarName for signers, storing all the common ones in the certs hash map.
*
@@ -273,15 +300,15 @@ public class JarCertVerifier implements CertVerifier {
* @throws Exception
* Will be thrown if there are any problems with the jar.
*/
- private VerifyResult verifyJar(String jarName) throws Exception {
+ private VerifiedJarFile verifyJar(String jarName) throws Exception {
try (JarFile jarFile = new JarFile(jarName, true)) {
- Vector<JarEntry> entriesVec = new Vector<JarEntry>();
+ List<JarEntry> entriesVec = new ArrayList<>();
byte[] buffer = new byte[8192];
Enumeration<JarEntry> entries = jarFile.entries();
while (entries.hasMoreElements()) {
JarEntry je = entries.nextElement();
- entriesVec.addElement(je);
+ entriesVec.add(je);
InputStream is = jarFile.getInputStream(je);
try {
@@ -295,8 +322,7 @@ public class JarCertVerifier implements CertVerifier {
}
}
}
- return verifyJarEntryCerts(jarName, jarFile.getManifest() != null,
- entriesVec);
+ return new VerifiedJarFile(jarName, null != jarFile.getManifest(), entriesVec);
} catch (Exception e) {
OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e);
@@ -318,7 +344,7 @@ public class JarCertVerifier implements CertVerifier {
* Will be thrown if there are issues with entries.
*/
VerifyResult verifyJarEntryCerts(String jarName, boolean jarHasManifest,
- Vector<JarEntry> entries) throws Exception {
+ List<JarEntry> entries) throws Exception {
// Contains number of entries the cert with this CertPath has signed.
Map<CertPath, Integer> jarSignCount = new HashMap<>();
int numSignableEntriesInJar = 0;
@@ -629,4 +655,16 @@ public class JarCertVerifier implements CertVerifier {
}
return sum;
}
+
+ private static class VerifiedJarFile {
+ final String file;
+ final boolean hasManifest;
+ private final List<JarEntry> entriesVec;
+
+ private VerifiedJarFile(String file, boolean hasManifest, List<JarEntry> entriesVec) {
+ this.file = file;
+ this.hasManifest = hasManifest;
+ this.entriesVec = entriesVec;
+ }
+ }
}
=====================================
netx/net/sourceforge/jnlp/util/PropertiesFile.java
=====================================
@@ -23,6 +23,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
+import net.sourceforge.jnlp.config.DeploymentConfiguration;
+import net.sourceforge.jnlp.runtime.JNLPRuntime;
import net.sourceforge.jnlp.util.lockingfile.LockedFile;
import net.sourceforge.jnlp.util.logging.OutputController;
@@ -168,7 +170,9 @@ public class PropertiesFile extends Properties {
store(s, header);
// fsync()
- s.getChannel().force(true);
+ if (Boolean.parseBoolean(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_ENABLE_CACHE_FSYNC))) {
+ s.getChannel().force(true);
+ }
lastStore = file.lastModified();
} finally {
if (s != null) s.close();
=====================================
netx/net/sourceforge/nanoxml/XMLElement.java
=====================================
@@ -1002,7 +1002,8 @@ public class XMLElement {
}
if (buf.length() == 0) {
while (ch != '/') {
- if (ch == '!') {
+ // jnlp files from a MFSys25 contain '<?-- JViewerVersion 3.30a -->', Treat as a comment
+ if (ch == '!' || ch == '?') {
ch = this.readChar();
if (ch != '-') {
throw this.expectedInput("Comment or Element");
=====================================
tests/netx/unit/net/sourceforge/jnlp/runtime/CachedJarFileCallbackTest.java
=====================================
@@ -0,0 +1,55 @@
+package net.sourceforge.jnlp.runtime;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.List;
+import java.util.jar.JarFile;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import net.sourceforge.jnlp.util.FileTestUtils;
+import net.sourceforge.jnlp.util.FileUtils;
+
+public class CachedJarFileCallbackTest {
+ private File tempDirectory;
+
+ @Before
+ public void before() throws IOException {
+ tempDirectory = FileTestUtils.createTempDirectory();
+ }
+
+ @After
+ public void after() throws IOException {
+ FileUtils.recursiveDelete(tempDirectory, tempDirectory.getParentFile());
+ }
+
+ @Test
+ public void testRetrieve() throws Exception {
+ List<String> names = Arrays.asList("test1.0.jar", "test at 1.0.jar");
+
+ for (String name: names) {
+ // URL-encode the filename
+ name = URLEncoder.encode(name, StandardCharsets.UTF_8.name());
+ // create temp jar file
+ File jarFile = new File(tempDirectory, name);
+ FileTestUtils.createJarWithContents(jarFile /* no contents */);
+
+ // JNLPClassLoader.activateJars uses toUri().toURL() to get the local file URL
+ URL localUrl = jarFile.toURI().toURL();
+ URL remoteUrl = new URL("http://localhost/" + name);
+ // add jar to cache
+ CachedJarFileCallback cachedJarFileCallback = CachedJarFileCallback.getInstance();
+ cachedJarFileCallback.addMapping(remoteUrl, localUrl);
+ // retrieve from cache (throws exception if file not found)
+ try (JarFile fromCacheJarFile = cachedJarFileCallback.retrieve(remoteUrl)) {
+ // nothing to do, we just wanted to make sure that the local file existed
+ }
+ }
+ }
+}
View it on GitLab: https://salsa.debian.org/java-team/icedtea-web/-/compare/1a1cd7926eae341a93a560b1820805f7214c1012...422bb9dfa4f777b4e66dd6b96f3fb1ce180e6a86
--
View it on GitLab: https://salsa.debian.org/java-team/icedtea-web/-/compare/1a1cd7926eae341a93a560b1820805f7214c1012...422bb9dfa4f777b4e66dd6b96f3fb1ce180e6a86
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20220505/146c64e2/attachment.htm>
More information about the pkg-java-commits
mailing list