Compare commits

...

26 Commits
1.3.1 ... 1.4.7

Author SHA1 Message Date
ecfc447125 speedup run by validating only once 2024-03-07 22:37:47 -05:00
238f3fd839 unzip un changes generation phase 2024-03-07 22:18:13 -05:00
c01312a1a5 unzip un changes generation phase 2024-03-07 22:17:07 -05:00
b72dd14310 unzip un changes generation phase 2024-03-07 21:41:15 -05:00
64aac910a6 Fix changes 2024-03-07 21:23:38 -05:00
246c27627b don't skip unpacking 2024-03-07 21:21:14 -05:00
d529f353e4 Version 1.4.1 2024-03-07 21:14:09 -05:00
89cff0c444 Version 1.4.0 2024-03-07 20:47:18 -05:00
ff19ea685b more CI 2024-03-07 16:14:20 -05:00
e5f6f335ee more CI 2024-03-07 15:53:21 -05:00
bcfbf90be2 more CI 2024-03-07 15:25:21 -05:00
63922c3880 more CI 2024-03-07 15:23:06 -05:00
35570a119d more CI 2024-03-07 15:02:33 -05:00
b877b6141d sleep longer for releases 2024-03-07 14:44:52 -05:00
62f23d360d sleep longer for releases 2024-03-07 14:32:53 -05:00
c78614fea5 sleep longer for releases 2024-03-07 14:30:06 -05:00
44cc27b968 sleep for releases 2024-03-07 14:24:24 -05:00
274748d08b Add checksums to release body 2024-03-07 14:18:19 -05:00
b4840b7355 Add checksums to release body 2024-03-07 14:11:37 -05:00
6072b8552e skip unpacking artifacts, only checkout changelog 2024-03-07 13:48:05 -05:00
7c0070cd15 skip unpacking artifacts, only checkout changelog 2024-03-07 13:43:09 -05:00
8083c6c652 skip unpacking artifacts, only checkout changelog 2024-03-07 13:40:26 -05:00
d9d13fac70 check out repo prior to release 2024-03-07 13:33:50 -05:00
75049fa08e fix plugin build 2024-03-07 13:25:50 -05:00
113caaa922 Attempt release upload in CI 2024-03-07 13:19:19 -05:00
bf1b923750 redownload artifacts from ant.yml in release release.yml 2024-03-07 13:12:50 -05:00
6 changed files with 137 additions and 265 deletions

View File

@ -40,42 +40,42 @@ jobs:
- name: Upload Firefox Profile Strict - name: Upload Firefox Profile Strict
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2p.firefox.base.profile-${{ github.sha }}.zip name: i2p.firefox.base.profile.zip
path: ./src/i2p.firefox.base.profile.zip path: ./src/i2p.firefox.base.profile.zip
- name: Upload Firefox Profile Usability - name: Upload Firefox Profile Usability
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2p.firefox.usability.profile-${{ github.sha }}.zip name: i2p.firefox.usability.profile.zip
path: ./src/i2p.firefox.usability.profile.zip path: ./src/i2p.firefox.usability.profile.zip
- name: Upload Chromium Profile Strict - name: Upload Chromium Profile Strict
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2p.chromium.base.profile-${{ github.sha }}.zip name: i2p.chromium.base.profile.zip
path: ./src/i2p.chromium.base.profile.zip path: ./src/i2p.chromium.base.profile.zip
- name: Upload Chromium Profile Usability - name: Upload Chromium Profile Usability
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2p.chromium.usability.profile-${{ github.sha }}.zip name: i2p.chromium.usability.profile.zip
path: ./src/i2p.chromium.usability.profile.zip path: ./src/i2p.chromium.usability.profile.zip
- name: Upload i2pfirefox.jar - name: Upload i2pfirefox.jar
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2pfirefox-${{ github.sha }}.jar name: i2pfirefox.jar
path: ./src/build/i2pfirefox.jar path: ./src/build/i2pfirefox.jar
- name: Upload i2pfirefox-plugin.jar - name: Upload i2pfirefox-plugin.jar
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2pfirefox-plugin-${{ github.sha }}.jar name: i2pfirefox-plugin.jar
path: ./src/build/i2pfirefox-plugin.jar path: ./src/build/i2pfirefox-plugin.jar
- name: Upload i2pbrowser.tar.gz - name: Upload i2pbrowser.tar.gz
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2pbrowser-${{ github.sha }}.tar.gz name: i2pbrowser.tar.gz
path: ./i2pbrowser.tar.gz path: ./i2pbrowser.tar.gz
- name: Upload i2pbrowser.deb - name: Upload i2pbrowser.deb
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2pbrowser_${{ github.sha }}_amd64.deb name: i2pbrowser_amd64.deb
path: ./i2pbrowser_1.0.0_amd64.deb path: ./i2pbrowser_1.0.0_amd64.deb
- name: build plugin with Ant - name: build plugin with Ant
run: | run: |
@ -84,7 +84,7 @@ jobs:
- name: Upload i2pfirefox.zip (unsigned plugin) - name: Upload i2pfirefox.zip (unsigned plugin)
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2pfirefox-${{ github.sha }}.zip name: i2pfirefox.zip
path: ./plugin.zip path: ./plugin.zip
@ -132,7 +132,7 @@ jobs:
- name: Upload i2pbrowser.rpm - name: Upload i2pbrowser.rpm
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2pbrowser-${{ github.sha }}.x86_64.rpm name: i2pbrowser.x86_64.rpm
path: ./i2pbrowser-1.0.0-1.x86_64.rpm path: ./i2pbrowser-1.0.0-1.x86_64.rpm
@ -171,7 +171,7 @@ jobs:
- name: Upload Firefox Profile EXE Installer - name: Upload Firefox Profile EXE Installer
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2pbrowser-1.0.0-${{ github.sha }}.exe name: i2pbrowser-1.0.0.exe
path: ./i2pbrowser-1.0.0.exe path: ./i2pbrowser-1.0.0.exe
- name: build msi with Ant - name: build msi with Ant
run: | run: |
@ -180,7 +180,7 @@ jobs:
- name: Upload Firefox Profile MSI Installer - name: Upload Firefox Profile MSI Installer
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2pbrowser-1.0.0-${{ github.sha }}.msi name: i2pbrowser-1.0.0.msi
path: ./i2pbrowser-1.0.0.msi path: ./i2pbrowser-1.0.0.msi
- name: build portable zip with Ant - name: build portable zip with Ant
run: | run: |
@ -189,7 +189,7 @@ jobs:
- name: Upload Firefox Profile Portable Zip - name: Upload Firefox Profile Portable Zip
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2pbrowser-portable-${{ github.sha }}.zip name: i2pbrowser-portable.zip
path: ./i2pbrowser-portable.zip path: ./i2pbrowser-portable.zip
buildmac: buildmac:
@ -227,7 +227,7 @@ jobs:
- name: Upload Firefox Profile DMG Installer - name: Upload Firefox Profile DMG Installer
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2pbrowser-1.0.0-${{ github.sha }}.dmg name: i2pbrowser-1.0.0.dmg
path: ./i2pbrowser-1.0.0.dmg path: ./i2pbrowser-1.0.0.dmg
- name: build pkg with Ant - name: build pkg with Ant
run: | run: |
@ -236,5 +236,5 @@ jobs:
- name: Upload Firefox Profile PKG Installer - name: Upload Firefox Profile PKG Installer
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: i2pbrowser-1.0.0-${{ github.sha }}.pkg name: i2pbrowser-1.0.0.pkg
path: ./i2pbrowser-1.0.0.pkg path: ./i2pbrowser-1.0.0.pkg

View File

@ -1,5 +1,7 @@
name: Release name: Release
#on: [push]
on: on:
push: push:
# Sequence of patterns matched against refs/tags # Sequence of patterns matched against refs/tags
@ -9,237 +11,68 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
steps: contents: write
- name: dependencies
run: sudo apt install gettext golang-go git ant
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name : Generate override.properties
run: |
rm -f override.properties
echo "build.built-by=GitHub Actions" >> override.properties
echo "noExe=true" >> override.properties
- name: install crx3
run: go install github.com/mediabuyerbot/go-crx3/crx3@latest
- name: install dzip
run: go install github.com/delicb/dzip@latest
- name: install amo-version
run: go install github.com/eyedeekay/amo-version@a4f4119eac453a14d6b6184b656320eb72b5da3c
- name: install manifest-json-version
run: go install github.com/eyedeekay/manifest-json-version@latest
- run: git clone https://github.com/i2p/i2p.i2p ../i2p.i2p
- run: cd ../i2p.i2p && ant builddep
- name: build with Ant
run: |
export PATH=$PATH:$(go env GOPATH)/bin
ant distclean jpackage debian
- name: Upload Firefox Profile Strict
uses: actions/upload-artifact@v4
with:
name: i2p.firefox.base.profile-${{ github.sha }}.zip
path: ./src/i2p.firefox.base.profile.zip
- name: Upload Firefox Profile Usability
uses: actions/upload-artifact@v4
with:
name: i2p.firefox.usability.profile-${{ github.sha }}.zip
path: ./src/i2p.firefox.usability.profile.zip
- name: Upload Chromium Profile Strict
uses: actions/upload-artifact@v4
with:
name: i2p.chromium.base.profile-${{ github.sha }}.zip
path: ./src/i2p.chromium.base.profile.zip
- name: Upload Chromium Profile Usability
uses: actions/upload-artifact@v4
with:
name: i2p.chromium.usability.profile-${{ github.sha }}.zip
path: ./src/i2p.chromium.usability.profile.zip
- name: Upload i2pfirefox.jar
uses: actions/upload-artifact@v4
with:
name: i2pfirefox-${{ github.sha }}.jar
path: ./src/build/i2pfirefox.jar
- name: Upload i2pfirefox-plugin.jar
uses: actions/upload-artifact@v4
with:
name: i2pfirefox-plugin-${{ github.sha }}.jar
path: ./src/build/i2pfirefox-plugin.jar
- name: Upload i2pbrowser.tar.gz
uses: actions/upload-artifact@v4
with:
name: i2pbrowser-${{ github.sha }}.tar.gz
path: ./i2pbrowser.tar.gz
- name: Upload i2pbrowser.deb
uses: actions/upload-artifact@v4
with:
name: i2pbrowser_${{ github.sha }}_amd64.deb
path: ./i2pbrowser_1.0.0_amd64.deb
- name: build plugin with Ant
run: |
export PATH=$PATH:$(go env GOPATH)/bin
ant distclean pluginzip
- name: Upload i2pfirefox.zip (unsigned plugin)
uses: actions/upload-artifact@v4
with:
name: i2pfirefox-${{ github.sha }}.zip
path: ./plugin.zip
- name: Run release upload script
run: |
./preprelease.sh
./release.sh
buildrpm:
runs-on: ubuntu-latest
container: fedora
steps:
- name: dependencies
run: sudo yum install -y gettext golang-go git ant jq wget curl gpg xz ca-certificates rpm-build
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- run: echo [Adoptium] >> /etc/yum.repos.d/adoptium.repo
- run: echo name=Adoptium >> /etc/yum.repos.d/adoptium.repo
- run: . /etc/os-release; echo baseurl=https://packages.adoptium.net/artifactory/rpm/fedora/$VERSION_ID/x86_64/ >> /etc/yum.repos.d/adoptium.repo
- run: echo enabled=1 >> /etc/yum.repos.d/adoptium.repo
- run: echo gpgcheck=1 >> /etc/yum.repos.d/adoptium.repo
- run: echo gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public >> /etc/yum.repos.d/adoptium.repo
- run: dnf clean all && rm -r /var/cache/dnf && dnf upgrade -y && dnf update -y
- run: dnf install -y temurin-21-jdk
- name: Generate override.properties
run: |
rm -f override.properties
echo "build.built-by=GitHub Actions" >> override.properties
echo "noExe=true" >> override.properties
- name: install crx3
run: go install github.com/mediabuyerbot/go-crx3/crx3@latest
- name: install dzip
run: go install github.com/delicb/dzip@latest
- name: install amo-version
run: go install github.com/eyedeekay/amo-version@a4f4119eac453a14d6b6184b656320eb72b5da3c
- name: install manifest-json-version
run: go install github.com/eyedeekay/manifest-json-version@latest
- run: git clone https://github.com/i2p/i2p.i2p ../i2p.i2p
- run: cd ../i2p.i2p && ant builddep
- name: build with Ant
run: |
export PATH=$PATH:$(go env GOPATH)/bin
ant distclean jpackage fedora
find . -name '*.rpm'
- name: Upload i2pbrowser.rpm
uses: actions/upload-artifact@v4
with:
name: i2pbrowser-${{ github.sha }}.x86_64.rpm
path: ./i2pbrowser-1.0.0-1.x86_64.rpm
buildwin:
runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with: with:
java-version: '21' sparse-checkout: |
distribution: 'temurin' CHANGES.md
- uses: actions/setup-go@v5 sparse-checkout-cone-mode: false
with: - name: sleep 15 minutes
go-version: '1.21'
- name : Generate override.properties
run: | run: |
bash -c 'rm -f override.properties' echo "sleeping 15 minutes to wait for artifacts"
bash -c 'echo "build.built-by=GitHub Actions" >> override.properties' sleep 1m
bash -c 'echo "noExe=true" >> override.properties' echo "sleeping 14 minutes to wait for artifacts"
- name: install crx3 sleep 1m
run: go install github.com/mediabuyerbot/go-crx3/crx3@latest echo "sleeping 13 minutes to wait for artifacts"
- name: install dzip sleep 1m
run: go install github.com/delicb/dzip@latest echo "sleeping 12 minutes to wait for artifacts"
- name: install amo-version sleep 1m
run: go install github.com/eyedeekay/amo-version@a4f4119eac453a14d6b6184b656320eb72b5da3c echo "sleeping 11 minutes to wait for artifacts"
- name: install manifest-json-version sleep 1m
run: go install github.com/eyedeekay/manifest-json-version@latest echo "sleeping 10 minutes to wait for artifacts"
- run: git clone https://github.com/i2p/i2p.i2p ../i2p.i2p sleep 1m
- run: cd ../i2p.i2p && ant builddep echo "sleeping 9 minutes to wait for artifacts"
- name: build exe with Ant sleep 1m
run: | echo "sleeping 8 minutes to wait for artifacts"
ant windows sleep 1m
bash -c 'ls *.exe' echo "sleeping 7 minutes to wait for artifacts"
- name: Upload Firefox Profile EXE Installer sleep 1m
uses: actions/upload-artifact@v4 echo "sleeping 6 minutes to wait for artifacts"
sleep 1m
echo "sleeping 5 minutes to wait for artifacts"
sleep 1m
echo "sleeping 4 minutes to wait for artifacts"
sleep 1m
echo "sleeping 3 minutes to wait for artifacts"
sleep 1m
echo "sleeping 2 minutes to wait for artifacts"
sleep 1m
echo "sleeping 1 minutes to wait for artifacts"
sleep 1m
- name: Download artifacts
id: download-artifact
uses: dawidd6/action-download-artifact@v3
with: with:
name: i2pbrowser-1.0.0-${{ github.sha }}.exe skip_unpack: true
path: ./i2pbrowser-1.0.0.exe workflow: ant.yml
- name: build msi with Ant if_no_artifact_found: fail
run: | # remove .zip file extension
ant windows-msi - run: for f in *.zip; do unzip "$f"; rm "$f"; done
bash -c 'ls *.msi' - run: echo "" | tee -a CHANGES.md
- name: Upload Firefox Profile MSI Installer - run: echo "## Checksums" | tee -a CHANGES.md
uses: actions/upload-artifact@v4 - run: echo "" | tee -a CHANGES.md
- run: echo '```' | tee -a CHANGES.md
- run: sha256sum * | tee -a CHANGES.md
- run: echo '```' | tee -a CHANGES.md
- run: echo "" | tee -a CHANGES.md
- run: echo '```' | tee -a CHANGES.md
- run: file * | tee -a CHANGES.md
- run: echo '```' | tee -a CHANGES.md
- run: echo "" | tee -a CHANGES.md
- name: Upload artifacts
uses: ncipollo/release-action@v1
with: with:
name: i2pbrowser-1.0.0-${{ github.sha }}.msi artifacts: "*"
path: ./i2pbrowser-1.0.0.msi bodyFile: "CHANGES.md"
- name: build portable zip with Ant
run: |
ant windows-portable
bash -c 'ls *.zip'
- name: Upload Firefox Profile Portable Zip
uses: actions/upload-artifact@v4
with:
name: i2pbrowser-portable-${{ github.sha }}.zip
path: ./i2pbrowser-portable.zip
buildmac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name : Generate override.properties
run: |
bash -c 'rm -f override.properties'
bash -c 'echo "build.built-by=GitHub Actions" >> override.properties'
bash -c 'echo "noExe=true" >> override.properties'
- name: install crx3
run: go install github.com/mediabuyerbot/go-crx3/crx3@latest
- name: install dzip
run: go install github.com/delicb/dzip@latest
- name: install amo-version
run: go install github.com/eyedeekay/amo-version@a4f4119eac453a14d6b6184b656320eb72b5da3c
- name: install manifest-json-version
run: go install github.com/eyedeekay/manifest-json-version@latest
- run: git clone https://github.com/i2p/i2p.i2p ../i2p.i2p
- run: cd ../i2p.i2p && ant builddep
- name: build dmg with Ant
run: |
ant macos
bash -c 'ls *.dmg'
- name: Upload Firefox Profile DMG Installer
uses: actions/upload-artifact@v4
with:
name: i2pbrowser-1.0.0-${{ github.sha }}.dmg
path: ./i2pbrowser-1.0.0.dmg
- name: build pkg with Ant
run: |
ant macos-pkg
bash -c 'ls *.pkg'
- name: Upload Firefox Profile PKG Installer
uses: actions/upload-artifact@v4
with:
name: i2pbrowser-1.0.0-${{ github.sha }}.pkg
path: ./i2pbrowser-1.0.0.pkg

View File

@ -3,4 +3,4 @@ export GITHUB_USER=eyedeekay
export GITHUB_REPO=i2p.plugins.firefox export GITHUB_REPO=i2p.plugins.firefox
export GITHUB_NAME="Updates extensions, plugin support temporarily removed(Stay on the old version)" export GITHUB_NAME="Updates extensions, plugin support temporarily removed(Stay on the old version)"
export GITHUB_DESCRIPTION=$(cat CHANGES.md VERSION.md) export GITHUB_DESCRIPTION=$(cat CHANGES.md VERSION.md)
export GITHUB_TAG=1.3.1 export GITHUB_TAG=1.4.0

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Thu Mar 07 12:01:15 EST 2024 #Thu Mar 07 15:18:16 EST 2024
build.number=707 build.number=709

View File

@ -36,6 +36,7 @@ public class I2PCommonBrowser {
private Properties prop = new Properties(); private Properties prop = new Properties();
public Logger logger = Logger.getLogger("browserlauncher"); public Logger logger = Logger.getLogger("browserlauncher");
private FileHandler fh; private FileHandler fh;
private boolean validated = false;
int CONFIGURED_TIMEOUT = 200; int CONFIGURED_TIMEOUT = 200;
public I2PCommonBrowser() { public I2PCommonBrowser() {
@ -75,6 +76,8 @@ public class I2PCommonBrowser {
* @return None No return value. * @return None No return value.
*/ */
public void validateUserDirectory() { public void validateUserDirectory() {
if (validated)
return;
logger.info("Validating user directory"); logger.info("Validating user directory");
String userDir = System.getProperty("user.dir"); String userDir = System.getProperty("user.dir");
String userHome = System.getProperty("user.home"); String userHome = System.getProperty("user.home");
@ -123,6 +126,7 @@ public class I2PCommonBrowser {
logger.info(defaultPathFile.getAbsolutePath()); logger.info(defaultPathFile.getAbsolutePath());
} }
System.setProperty("user.dir", defaultPathFile.getAbsolutePath()); System.setProperty("user.dir", defaultPathFile.getAbsolutePath());
validated = true;
} }
/** /**

View File

@ -44,6 +44,10 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
private final File profileDir; private final File profileDir;
private MenuHandle lmhs; private MenuHandle lmhs;
private MenuHandle lmhf; private MenuHandle lmhf;
/**
* @since 1.4.0
* @return
*/
public I2PBrowserPlugin() { public I2PBrowserPlugin() {
_context = new I2PAppContext(); _context = new I2PAppContext();
_mgr = null; _mgr = null;
@ -52,6 +56,10 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
pluginDir = new File(_context.getAppDir(), "plugins/i2pfirefox/"); pluginDir = new File(_context.getAppDir(), "plugins/i2pfirefox/");
profileDir = new File(pluginDir, "profile/"); profileDir = new File(pluginDir, "profile/");
} }
/**
* @since 1.4.0
* @return
*/
public I2PBrowserPlugin(I2PAppContext ctx, ClientAppManager mgr, public I2PBrowserPlugin(I2PAppContext ctx, ClientAppManager mgr,
String args[]) { String args[]) {
_context = ctx; _context = ctx;
@ -61,9 +69,26 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
pluginDir = new File(_context.getAppDir(), "plugins/i2pfirefox/"); pluginDir = new File(_context.getAppDir(), "plugins/i2pfirefox/");
profileDir = new File(pluginDir, "profile/"); profileDir = new File(pluginDir, "profile/");
} }
/**
* @since 1.4.0
* @return
*/
public String getDisplayName() { return "I2P Browser"; } public String getDisplayName() { return "I2P Browser"; }
/**
* @since 1.4.0
* @return
*/
public String getName() { return "I2P Browser"; } public String getName() { return "I2P Browser"; }
/**
* @since 1.4.0
* @return
*/
public ClientAppState getState() { return ClientAppState.STOPPED; } public ClientAppState getState() { return ClientAppState.STOPPED; }
/**
* @since 1.4.0
* @return
*/
public void shutdown(String[] args) { public void shutdown(String[] args) {
if (!isSystrayEnabled()) { if (!isSystrayEnabled()) {
_log.info("I2P Browser tray manager not supported"); _log.info("I2P Browser tray manager not supported");
@ -81,6 +106,10 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
} }
changeState(ClientAppState.STOPPED); changeState(ClientAppState.STOPPED);
} }
/**
* @since 1.4.0
* @return
*/
public void startup() { public void startup() {
changeState(ClientAppState.STOPPED); changeState(ClientAppState.STOPPED);
if (!isSystrayEnabled()) { if (!isSystrayEnabled()) {
@ -103,10 +132,12 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
} }
if (dtg != null) { if (dtg != null) {
_log.info("I2P Browser integrating with I2P tray manager"); _log.info("I2P Browser integrating with I2P tray manager");
lmhs = dtg.addMenu("Launch I2P Browser (Safe Mode)", new Starter(dtg)); lmhs =
dtg.addMenu("Launch I2P Browser (Safe Mode)", new Starter(dtg));
dtg.showMenu(lmhs); dtg.showMenu(lmhs);
dtg.enableMenu(lmhs); dtg.enableMenu(lmhs);
lmhf = dtg.addMenu("Launch I2P Browser (Flexible Mode)", new FlexStarter(dtg)); lmhf = dtg.addMenu("Launch I2P Browser (Flexible Mode)",
new FlexStarter(dtg));
dtg.showMenu(lmhf); dtg.showMenu(lmhf);
dtg.enableMenu(lmhf); dtg.enableMenu(lmhf);
} else { } else {
@ -122,6 +153,10 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
} }
// Copied directly from I2PSnark-standalone // Copied directly from I2PSnark-standalone
/**
* @since 1.4.0
* @return
*/
private MenuService startTrayApp() { private MenuService startTrayApp() {
try { try {
if (isSystrayEnabled()) { if (isSystrayEnabled()) {
@ -141,6 +176,10 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
// whether to launchFirefox the tray app Our environment should basically // whether to launchFirefox the tray app Our environment should basically
// never be headless, that doesn't make any sense, but something tells me I // never be headless, that doesn't make any sense, but something tells me I
// should leave that check in. // should leave that check in.
/**
* @since 1.4.0
* @return
*/
private boolean isSystrayEnabled() { private boolean isSystrayEnabled() {
if (GraphicsEnvironment.isHeadless()) if (GraphicsEnvironment.isHeadless())
return false; return false;
@ -157,8 +196,10 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
} }
/** /**
* Callback when Start I2PBrowser is clicked in systray * Callback when Start I2PBrowser is clicked in systray
* @since 0.9.61 *
* @since 1.4.0
* @return
*/ */
public class Starter implements MenuCallback { public class Starter implements MenuCallback {
private final MenuService _ms; private final MenuService _ms;
@ -179,9 +220,13 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
} }
} }
/**
* @since 1.4.0
* @return
*/
public class FlexStarter implements MenuCallback { public class FlexStarter implements MenuCallback {
private final MenuService _ms; private final MenuService _ms;
public Starter(MenuService ms) { _ms = ms; } public FlexStarter(MenuService ms) { _ms = ms; }
public void clicked(MenuHandle menu) { public void clicked(MenuHandle menu) {
// Thread t = new I2PAppThread(new StarterThread(), // Thread t = new I2PAppThread(new StarterThread(),
//"I2PBrowser-Launcher start", true); //"I2PBrowser-Launcher start", true);
@ -199,20 +244,10 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
} }
} }
public class StarterThread implements Runnable { /**
public void run() { * @since 1.4.0
_log.info("I2P Browser starting up"); * @return
try { */
I2PBrowser i2pBrowser = new I2PBrowser(profileDir.getAbsolutePath());
String[] args = {"http://proxy.i2p"};
i2pBrowser.launchFirefox(0, args);
} catch (Exception e) {
_log.error("Error starting I2P Browser", e);
}
_log.info("I2P Browser ran");
}
}
private synchronized void changeState(ClientAppState state) { private synchronized void changeState(ClientAppState state) {
if (_mgr != null) if (_mgr != null)
_mgr.notify(this, state, null, null); _mgr.notify(this, state, null, null);