Compare commits

...

60 Commits
1.4.4 ... main

Author SHA1 Message Date
8b1993fe4f pkg
Some checks failed
Java CI / build (push) Has been cancelled
Java CI / buildrpm (push) Has been cancelled
Java CI / buildwin (push) Has been cancelled
Java CI / buildmac (push) Has been cancelled
2025-06-04 23:07:18 -04:00
68c7274ffd more chromium purging 2025-05-20 20:22:52 -04:00
c8dd8625d1 Remove chromium CI and tests 2025-05-20 16:59:05 -04:00
cd1f966aed rip out chrome launchers 2025-05-20 16:01:36 -04:00
284e96ba2d remove chromium java files 2025-05-20 15:39:39 -04:00
b86abed873 rebuild 2025-04-11 22:56:44 -04:00
c89cc0a2d1 rebuild 2025-04-11 22:41:52 -04:00
88b6599011 rebuild 2025-04-11 22:19:44 -04:00
f16b33bf4a move extension scopes into affixed prefs.js 2025-04-11 20:50:34 -04:00
d24a7426b9 Only use wildcards for path, ref for name 2025-03-20 16:25:49 -04:00
cac9d5824c Update changelog 2025-03-20 16:07:00 -04:00
5349d0b8bb use ref_name when uploading artifacts 2025-01-07 21:59:40 -05:00
9e6dd8a094 don't target commit 2025-01-07 21:12:50 -05:00
57c7d7d341 push with push.sh instead so that we get nightly builds 2025-01-07 20:54:13 -05:00
ca91190c63 push with push.sh instead so that we get nightly builds 2025-01-07 20:53:04 -05:00
bc4dbd4d54 push with push.sh instead so that we get nightly builds 2025-01-07 20:52:51 -05:00
c5736f51c9 allow cache cleaning in fedora container to fail silently, the only place that disk space is ever used is in the CI job 2025-01-07 20:20:22 -05:00
a274fe4bbc specify a commit in lieu of a tag for the nightly release 2025-01-07 20:09:29 -05:00
ee480843d3 allow cache cleaning in fedora container to fail silently, the only place that disk space is ever used is in the CI job 2025-01-07 19:56:05 -05:00
b9711689a7 Rename nightly CI job 2025-01-07 19:45:26 -05:00
03a2105daa add nightly builds/releases 2025-01-07 19:44:04 -05:00
f997171dcc Update changelog 2025-01-07 19:36:33 -05:00
7ccaec1748 disable chrome extensions re: mv3 bloodbath. Chrome still works, still sucks, still last-resort only. 2025-01-07 18:23:35 -05:00
48869cf2b5 Open console homepage instead of proxy.i2p 2025-01-07 16:52:56 -05:00
dcfd991aac Tag 2024-10-19 00:19:34 -04:00
c3136fb4b7 Alter TBB less when it's discovered 2024-10-19 00:03:31 -04:00
52086c98df Alter TBB less when it's discovered 2024-10-19 00:03:20 -04:00
1bc9894616 Alter TBB less when it's discovered 2024-10-18 23:59:30 -04:00
b7bbcf4e4b improvements to TBB compatibility 2024-10-07 14:15:26 -04:00
b46abac574 Get rid of unuseful unpacker classes 2024-08-26 20:17:24 -04:00
aca1dd618d Switch around crx3 versions 2024-08-21 00:53:27 -04:00
9f283c4ef5 Use vendored crx3 2024-08-21 00:38:00 -04:00
b1a54e0144 that didn't work 2024-08-20 21:46:46 -04:00
b4c4c20d74 try pinning the older version of crx3 2024-08-20 21:35:32 -04:00
d874caa490 update extensions, add launcher 2024-08-20 20:59:11 -04:00
baec921a37 Enable systray on XFCE 2024-07-08 21:29:48 -04:00
fd0bfb8b3d bail out of search earlier if we start in home 2024-07-08 17:39:29 -04:00
6ac3a2eb55 Don't search the whole home directory for usable Firefoxes 2024-07-08 17:15:43 -04:00
50de466282 Don't search the whole home directory for usable Firefoxes 2024-07-08 17:08:48 -04:00
ad61d69be0 Update changelog 2024-07-08 17:02:39 -04:00
8b1e908bc1 clangFmt 2024-07-08 16:59:28 -04:00
19fb2f5378 If this.chromium=false(default) this.firefox=true(also default) 2024-07-08 16:57:33 -04:00
e0d0a537e7 If this.chromium=false(default) this.firefox=true(also default) 2024-07-08 16:57:02 -04:00
b4371dad07 clangFmt 2024-07-08 16:16:00 -04:00
fbbaffddb9 Null check the directory when searching for nearby browsers. 2024-07-08 16:15:19 -04:00
7f409bfc1f update plugins. Use user's homedir if we're not running in a jpackage. 2024-07-08 13:03:57 -04:00
bdf9ca5548 page generation update for: 2024-03-19 21:28:44.180012645 -0400 EDT m=+386.223210846 2024-03-19 21:28:44 -04:00
397afe0cb7 fix plugin upload script, fix plugin install docs 2024-03-19 21:21:55 -04:00
0df0a380bb update plugin version number in plugin release script 2024-03-19 18:31:23 -04:00
10887da2f7 Get tag from repo not from config 2024-03-19 18:19:43 -04:00
3da4c9ee1e we can distribute signed plugin builds so use the plugin-upload script to do that. 2024-03-19 17:56:52 -04:00
c24a0acea1 Split out plugin upload script 2024-03-19 17:53:11 -04:00
41a4e895cc Start on plugin instructions 2024-03-18 11:21:03 -04:00
ba6275008a Start on plugin instructions 2024-03-18 11:19:12 -04:00
f268f3b459 Update README.md 2024-03-18 10:57:10 -04:00
eb195f7dba Add nektos/act note to BUILD.md 2024-03-18 10:35:20 -04:00
bbd2fdeeec Increase thread delay between ldtg and launch 2024-03-10 00:57:22 -05:00
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
56 changed files with 1906 additions and 1706 deletions

View File

@ -24,7 +24,7 @@ jobs:
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
run: mkdir -p $(go env GOPATH)/bin; wget -O $(go env GOPATH)/bin/crx3 https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/build-tools/crx3-linux; chmod +x $(go env GOPATH)/bin/crx3
- name: install dzip
run: go install github.com/delicb/dzip@latest
- name: install amo-version
@ -32,11 +32,11 @@ jobs:
- 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
- run: cd ../i2p.i2p && ant pkg; true
- name: build with Ant
run: |
export PATH=$PATH:$(go env GOPATH)/bin
ant distclean jpackage debian
ant distclean all jpackage debian
- name: Upload Firefox Profile Strict
uses: actions/upload-artifact@v4
with:
@ -47,16 +47,6 @@ jobs:
with:
name: i2p.firefox.usability.profile.zip
path: ./src/i2p.firefox.usability.profile.zip
- name: Upload Chromium Profile Strict
uses: actions/upload-artifact@v4
with:
name: i2p.chromium.base.profile.zip
path: ./src/i2p.chromium.base.profile.zip
- name: Upload Chromium Profile Usability
uses: actions/upload-artifact@v4
with:
name: i2p.chromium.usability.profile.zip
path: ./src/i2p.chromium.usability.profile.zip
- name: Upload i2pfirefox.jar
uses: actions/upload-artifact@v4
with:
@ -76,7 +66,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: i2pbrowser_amd64.deb
path: ./i2pbrowser_1.0.0_amd64.deb
path: ./i2pbrowser_*_amd64.deb
- name: build plugin with Ant
run: |
export PATH=$PATH:$(go env GOPATH)/bin
@ -107,7 +97,7 @@ jobs:
- 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 clean all && rm -rf /var/cache/dnf && dnf upgrade -y && dnf update -y
- run: dnf install -y temurin-21-jdk
- name: Generate override.properties
run: |
@ -115,7 +105,7 @@ jobs:
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
run: mkdir -p $(go env GOPATH)/bin; wget -O $(go env GOPATH)/bin/crx3 https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/build-tools/crx3-linux; chmod +x $(go env GOPATH)/bin/crx3
- name: install dzip
run: go install github.com/delicb/dzip@latest
- name: install amo-version
@ -133,7 +123,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: i2pbrowser.x86_64.rpm
path: ./i2pbrowser-1.0.0-1.x86_64.rpm
path: ./i2pbrowser-*-1.x86_64.rpm
buildwin:
@ -171,8 +161,8 @@ jobs:
- name: Upload Firefox Profile EXE Installer
uses: actions/upload-artifact@v4
with:
name: i2pbrowser-1.0.0.exe
path: ./i2pbrowser-1.0.0.exe
name: i2pbrowser-${{ github.ref_name }}.exe
path: ./i2pbrowser-*.exe
- name: build msi with Ant
run: |
ant windows-msi
@ -180,8 +170,8 @@ jobs:
- name: Upload Firefox Profile MSI Installer
uses: actions/upload-artifact@v4
with:
name: i2pbrowser-1.0.0.msi
path: ./i2pbrowser-1.0.0.msi
name: i2pbrowser-${{ github.ref_name }}.msi
path: ./i2pbrowser-*.msi
- name: build portable zip with Ant
run: |
ant windows-portable
@ -211,7 +201,7 @@ jobs:
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
run: mkdir -p $(go env GOPATH)/bin; wget -O $(go env GOPATH)/bin/crx3 https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/build-tools/crx3-osx; chmod +x $(go env GOPATH)/bin/crx3
- name: install dzip
run: go install github.com/delicb/dzip@latest
- name: install amo-version
@ -227,8 +217,8 @@ jobs:
- name: Upload Firefox Profile DMG Installer
uses: actions/upload-artifact@v4
with:
name: i2pbrowser-1.0.0.dmg
path: ./i2pbrowser-1.0.0.dmg
name: i2pbrowser-${{ github.ref_name }}.dmg
path: ./i2pbrowser-*.dmg
- name: build pkg with Ant
run: |
ant macos-pkg
@ -236,5 +226,5 @@ jobs:
- name: Upload Firefox Profile PKG Installer
uses: actions/upload-artifact@v4
with:
name: i2pbrowser-1.0.0.pkg
path: ./i2pbrowser-1.0.0.pkg
name: i2pbrowser-${{ github.ref_name }}.pkg
path: ./i2pbrowser-*.pkg

81
.github/workflows/nightly.yml vendored Normal file
View File

@ -0,0 +1,81 @@
name: Nightly
#on: [push]
on:
push:
tags:
- nightly-*
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
CHANGES.md
sparse-checkout-cone-mode: false
- name: sleep 15 minutes
run: |
echo "sleeping 15 minutes to wait for artifacts"
sleep 1m
echo "sleeping 14 minutes to wait for artifacts"
sleep 1m
echo "sleeping 13 minutes to wait for artifacts"
sleep 1m
echo "sleeping 12 minutes to wait for artifacts"
sleep 1m
echo "sleeping 11 minutes to wait for artifacts"
sleep 1m
echo "sleeping 10 minutes to wait for artifacts"
sleep 1m
echo "sleeping 9 minutes to wait for artifacts"
sleep 1m
echo "sleeping 8 minutes to wait for artifacts"
sleep 1m
echo "sleeping 7 minutes to wait for artifacts"
sleep 1m
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:
skip_unpack: true
workflow: ant.yml
if_no_artifact_found: fail
# remove .zip file extension
- run: for f in *.zip; do unzip "$f"; rm "$f"; done
- run: echo "" | tee -a CHANGES.md
- run: echo "## Checksums" | tee -a CHANGES.md
- 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:
name: nightly
prerelease: true
makeLatest: true
allowUpdates: true
artifacts: "*"
bodyFile: "CHANGES.md"

View File

@ -59,7 +59,7 @@ jobs:
workflow: ant.yml
if_no_artifact_found: fail
# remove .zip file extension
- run: for f in *.zip; do unzip "${f%.zip}"; done
- run: for f in *.zip; do unzip "$f"; rm "$f"; done
- run: echo "" | tee -a CHANGES.md
- run: echo "## Checksums" | tee -a CHANGES.md
- run: echo "" | tee -a CHANGES.md

View File

@ -55,6 +55,11 @@
docs/BUILD
</a>
</li>
<li>
<a href="docs/I2P-PLUGIN.html">
docs/I2P-PLUGIN
</a>
</li>
<li>
<a href="docs/I2PBrowser.html">
docs/I2PBrowser

View File

@ -1,3 +1,31 @@
2025 Thu, March 20
------------------
- 2.8.1 release
2025 Tue, Feb 11
----------------
- 2.8.0 release
2025 Tue, January 7
-------------------
- Disable downloading Chrome extensions, begin phasing out Chrome support
Sat, October 19
---------------
- Ignore most changes when running in Tor Browser, only set the proxy
- 2.7.0 release
Mon, July 8
-----------
- Fix a bug which caused the profile manager to fail to detect Firefox on some systems
- Fix a bug which caused the profile manager to use an unwritable directory on some systems
- Fix a bug where if user tried to run it from the home directory, the application would make sure that no firefoxes existed in any subdirectory before running
Thu, March 7
------------
@ -169,4 +197,44 @@ Saturday, August 6
- Implemented firefox detection
- Implemented directory setup
- Implemented processBuilder generator
- Implemented processBuilder generator
## Checksums
```
dc8797cfae23640e27ed7b32a3e6ccec232d24411d64cd9e5b107f8c5384a70a CHANGES.md
9a36e15def2a95077027cd0db5f95b345a87a8edfe5e89ea7f83aaa3c94f5ebb i2p.chromium.base.profile.zip
97ae21d621f813fd2d91f5921fe1eee95ec0d01782bf93db7b3689f959a9f3b8 i2p.chromium.usability.profile.zip
5cd673bb27827e67796b52f26194b7b1504dddf1630ad9d9084ab6a318c6d20a i2p.firefox.base.profile.zip
556fc2df825e64b1463e88ec77a5de46bce61516a475e1136110363d5badabd2 i2p.firefox.usability.profile.zip
6d3882ac113116b8f40ce07985e779859a68f43f14278b40f1628ea5362acca5 i2pbrowser-1.0.0-1.x86_64.rpm
aa7185799b17fd7893818fe7728f3e3cb6b4c8022e033fc0f33f6be81e7b2c2f i2pbrowser-1.0.0.dmg
c307fb6556821258520a3d522cf7fbe2031aa421161fcac3e409f5ce20a1637a i2pbrowser-1.0.0.exe
5eae853ff7f8b9a05c4c7111147882a54aabd1cf581d21396878055a54a3efc7 i2pbrowser-1.0.0.msi
cda1bb2058048a4303bbc65543a0f340ade1c88881ee60704333e767bae10db6 i2pbrowser-1.0.0.pkg
183197aa39e891d5763ef5449957b9d9790bdfaaa06760288526f6283b865d97 i2pbrowser-portable.zip
f017951df66f2e3d2d57886085a95bd2463cc8f7d793683960da30b842b9b17b i2pbrowser.tar.gz
4538172d9753967485566e52f064dbc06a5123971044d973766de28051d53eb1 i2pbrowser_1.0.0_amd64.deb
6b5dd3e4ab1bcb3df4a5a758b5469239453c713bb6266bc5eea8b0d9ec7aa413 i2pfirefox-plugin.jar
85ce64a3c03c72421947c777a72d42be6fc568c5317070927463accb347b703f i2pfirefox.jar
9856613f8229a773ef54a9e7e2a37a6c788755d96393478afce8db7439404e42 plugin.zip
```
```
CHANGES.md: ASCII text
i2p.chromium.base.profile.zip: Zip archive data, at least v2.0 to extract, compression method=store
i2p.chromium.usability.profile.zip: Zip archive data, at least v2.0 to extract, compression method=store
i2p.firefox.base.profile.zip: Zip archive data, at least v2.0 to extract, compression method=store
i2p.firefox.usability.profile.zip: Zip archive data, at least v2.0 to extract, compression method=store
i2pbrowser-1.0.0-1.x86_64.rpm: RPM v3.0 bin i386/x86_64
i2pbrowser-1.0.0.dmg: zlib compressed data
i2pbrowser-1.0.0.exe: PE32+ executable (GUI) x86-64, for MS Windows
i2pbrowser-1.0.0.msi: Composite Document File V2 Document, Little Endian, Os: Windows, Version 6.2, MSI Installer, Code page: 1252, Title: Installation Database, Subject: i2pbrowser, Author: Unknown, Keywords: Installer, Comments: This installer database contains the logic and data required to install i2pbrowser., Template: x64;1033, Revision Number: {6D1D56D8-CB72-4709-BD0B-0FDBF71C6D32}, Create Time/Date: Sun Mar 10 06:04:32 2024, Last Saved Time/Date: Sun Mar 10 06:04:32 2024, Number of Pages: 200, Number of Words: 10, Name of Creating Application: Windows Installer XML Toolset (3.14.0.8606), Security: 2
i2pbrowser-1.0.0.pkg: xar archive compressed TOC: 1244, SHA-1 checksum, contains zlib compressed data
i2pbrowser-portable.zip: Zip archive data, at least v2.0 to extract, compression method=deflate
i2pbrowser.tar.gz: gzip compressed data, from Unix, original size modulo 2^32 725985280
i2pbrowser_1.0.0_amd64.deb: Debian binary package (format 2.0), with control.tar.zs, data compression zst
i2pfirefox-plugin.jar: Java archive data (JAR)
i2pfirefox.jar: Java archive data (JAR)
plugin.zip: Zip archive data, at least v1.0 to extract, compression method=store
```

View File

@ -7,7 +7,7 @@ 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 cat /etc/yum.repos.d/adoptium.repo
RUN dnf clean all && rm -r /var/cache/dnf && dnf upgrade -y && dnf update -y
RUN dnf clean all && rm -rf /var/cache/dnf && dnf upgrade -y && dnf update -y
RUN dnf -y install rpm-build temurin-19-jdk
ADD . /src/i2p.plugins.firefox
WORKDIR /src/i2p.plugins.firefox

View File

@ -55,6 +55,11 @@
docs/BUILD
</a>
</li>
<li>
<a href="docs/I2P-PLUGIN.html">
docs/I2P-PLUGIN
</a>
</li>
<li>
<a href="docs/I2PBrowser.html">
docs/I2PBrowser

View File

@ -11,6 +11,28 @@ trackers, and jerks using off-the-shelf techniques and exploits. It is fundament
to make changes which un-trust your browser vendor, your OS, your package manager or any
other system that exists underneath it. **It is just a profile manager.**
**What is this?**
This is a browser profile manager which pre-configures a browser on the host system, usually
Firefox or Tor Browser, for browsing I2P. When acting as an I2P Plugin, it adds GUI elements to
I2P for launching the browser in a highly restricted "Safe" mode(the default) or a more permissive
"Usability" mode.
This package expresses functionality that has existed in many places at many times, sometimes
bundled with other software. As it has developed here, the border of where the Easy-Install
ends and Firefox Profile Manager begins has become clearer. This repository contains the profile
manager and it's buildsystem, the whole profile manager, and nothing but the profile manager.
It can be used independently of other software, provided an I2P proxy on the host system somewhere.
However, in practice, most people probably get it alongside an I2P router, through the **I2P Easy-Install Bundle for Windows**.
**What version numbers should I pay attention to?**
When I decided to port the `.bat` launcher scripts from the Easy-Install bundle to Java, this project
was created and started using it's own version numbers. This was the practice up until version 1.5.0,
which was the last version to use a different version number than I2P itself. Starting in April 2024,
`i2p.plugins.firefox` will follow along with the Java I2P major and minor version numbers. Incremental
changes may become differing point releases.
**All packages require a running I2P router.**
**[Windows users should see the Easy-Install Bundle](https://i2pgit.org/i2p-hackers/i2p.firefox)**
@ -47,6 +69,7 @@ directory for Firefox, and the `src/i2p.chromium.*.profile/extensions/*.js/*` di
For platform specific instructions, see
- [I2P-PLUGIN.md](docs/I2P-PLUGIN.md)/[I2P-PLUGIN.html](docs/I2P-PLUGIN.html)
- [LINUX.md](docs/LINUX.md)/[LINUX.html](docs/LINUX.html)
- [OSX.md](docs/OSX.md)/[OSX.html](docs/OSX.html)
- [WINDOWS.md](docs/WINDOWS.md)/[WINDOWS.html](docs/WINDOWS.html)

View File

@ -55,6 +55,11 @@
docs/BUILD
</a>
</li>
<li>
<a href="docs/I2P-PLUGIN.html">
docs/I2P-PLUGIN
</a>
</li>
<li>
<a href="docs/I2PBrowser.html">
docs/I2PBrowser
@ -181,7 +186,7 @@ NoScript
11.4.18
https://clients2.google.com/service/update2/crx
LocalCDN
2.6.64
2.6.65
https://clients2.google.com/service/update2/crx
uBlock Origin
1.56.0

View File

@ -6,41 +6,22 @@ Extension Versions
```md
i2p-in-private-browsing
1.48
https://addons.mozilla.org/firefox/downloads/file/4123613/i2p_in_private_browsing-1.48.xpi
2.8.2
https://addons.mozilla.org/firefox/downloads/file/4441161/i2p_in_private_browsing-2.8.2.xpi
noscript
11.4.29
https://addons.mozilla.org/firefox/downloads/file/4206186/noscript-11.4.29.xpi
13.0.6
https://addons.mozilla.org/firefox/downloads/file/4495120/noscript-13.0.6.xpi
localcdn-fork-of-decentraleyes
2.6.64
https://addons.mozilla.org/firefox/downloads/file/4243456/localcdn_fork_of_decentraleyes-2.6.64.xpi
2.6.79
https://addons.mozilla.org/firefox/downloads/file/4464649/localcdn_fork_of_decentraleyes-2.6.79.xpi
onion-in-container-browsing
0.82
https://addons.mozilla.org/firefox/downloads/file/3904685/onion_in_container_browsing-0.82.xpi
javascript-restrictor
0.17
https://addons.mozilla.org/firefox/downloads/file/4190089/javascript_restrictor-0.17.xpi
0.20.2
https://addons.mozilla.org/firefox/downloads/file/4485412/javascript_restrictor-0.20.2.xpi
ublock-origin
1.56.0
https://addons.mozilla.org/firefox/downloads/file/4237670/ublock_origin-1.56.0.xpi
1.64.0
https://addons.mozilla.org/firefox/downloads/file/4492375/ublock_origin-1.64.0.xpi
```
## Chromium
```md
__MSG_extensionName__
1.29
https://clients2.google.com/service/update2/crx
NoScript
11.4.18
https://clients2.google.com/service/update2/crx
LocalCDN
2.6.64
https://clients2.google.com/service/update2/crx
uBlock Origin
1.56.0
https://clients2.google.com/service/update2/crx
__MSG_extensionName__
0.17
https://clients2.google.com/service/update2/crx
```

View File

@ -1 +1 @@
arkenfox.number=105.0
arkenfox.number=135.0

272
build.xml
View File

@ -2,7 +2,7 @@
<project basedir="." default="all" name="i2pfirefox">
<property file="override.properties"/>
<target name="all" depends="clean,versionMd,i2pFirefoxBaseProfileZip,i2pChromiumBaseProfileZip,jar" />
<target name="all" depends="clean,versionMd,jar" />
<target name="tarball">
<exec executable="git">
@ -127,53 +127,9 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<redirector output="USAGE.md" append="true"/>
<arg value="" />
</exec>
<exec executable="echo">
<redirector output="USAGE.md" append="true"/>
<arg value="Chromium in Persistent Mode" />
</exec>
<exec executable="echo">
<redirector output="USAGE.md" append="true"/>
<arg value="" />
</exec>
<exec executable="echo">
<redirector output="USAGE.md" append="true"/>
<arg value="```sh" />
</exec>
<exec executable="cat">
<redirector output="USAGE.md" append="true"/>
<arg value="i2pchromium.cmd" />
</exec>
<exec executable="echo">
<redirector output="USAGE.md" append="true"/>
<arg value="```" />
</exec>
<exec executable="echo">
<redirector output="USAGE.md" append="true"/>
<arg value="" />
</exec>
<exec executable="echo">
<redirector output="USAGE.md" append="true"/>
<arg value="Chromium in Private Browsing Mode" />
</exec>
<exec executable="echo">
<redirector output="USAGE.md" append="true"/>
<arg value="" />
</exec>
<exec executable="echo">
<redirector output="USAGE.md" append="true"/>
<arg value="```sh" />
</exec>
<exec executable="cat">
<redirector output="USAGE.md" append="true"/>
<arg value="i2pchromium-private.cmd" />
</exec>
<exec executable="echo">
<redirector output="USAGE.md" append="true"/>
<arg value="```" />
</exec>
</target>
<target name="jar" depends="versionMd,i2pFirefoxBaseProfileZip,i2pFirefoxUsabilityProfileZip,i2pChromiumBaseProfileZip,i2pChromiumUsabilityProfileZip">
<target name="jar" depends="versionMd,i2pFirefoxBaseProfileZip,i2pFirefoxUsabilityProfileZip">
<ant dir="src" target="jar" />
<ant dir="src" target="pluginjar" />
</target>
@ -202,30 +158,6 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
</exec>
</target>
<target name="i2pChromiumBaseProfileZip">
<exec executable="rm" failonerror="false" dir="src">
<arg value="-rf" />
<arg value="i2p.chromium.base.profile.zip" />
</exec>
<exec executable="dzip" failonerror="true" dir="src">
<arg value="-O"/>
<arg value="i2p.chromium.base.profile.zip"/>
<arg value="i2p.chromium.base.profile"/>
</exec>
</target>
<target name="i2pChromiumUsabilityProfileZip">
<exec executable="rm" failonerror="false" dir="src">
<arg value="-rf" />
<arg value="i2p.chromium.usability.profile.zip" />
</exec>
<exec executable="dzip" failonerror="true" dir="src">
<arg value="-O"/>
<arg value="i2p.chromium.usability.profile.zip"/>
<arg value="i2p.chromium.usability.profile"/>
</exec>
</target>
<target name="freeZip" depends="jar">
<exec executable="rm" failonerror="false" dir="src">
<arg value="-rf" />
@ -285,13 +217,34 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="checkout" />
<arg value="${arkenfox.number}" />
</exec>
<exec executable="grep" osfamily="unix" output="user.js/tmp.user.js">
<arg value="-v" />
<arg value="autoDisableScopes" />
<arg value="user.js/user.js" />
</exec>
<exec executable="grep" osfamily="unix" output="user.js/user.js">
<arg value="-v" />
<arg value="enabledScopes" />
<arg value="user.js/tmp.user.js" />
</exec>
<copy file="user.js/user.js" tofile="src/i2p.firefox.usability.profile/user.js"/>
</target>
<target name="userJs" depends="i2pFirefoxBaseUserJs,i2pFirefoxUsabilityUserJs">
</target>
<target name="i2pFirefoxBaseUserJs" depends="arkenfoxCheckout">
<exec executable="grep" osfamily="unix" output="user.js/user.js">
<arg value="-v" />
<arg value="autoDisableScopes" />
<arg value="user.js/user.js" />
</exec>
<exec executable="grep" osfamily="unix" output="user.js/user.js">
<arg value="-v" />
<arg value="enabledScopes" />
<arg value="user.js/user.js" />
</exec>
<copy file="user.js/user.js" tofile="src/i2p.firefox.base.profile/user.js"/>
<exec executable="sed" osfamily="unix">
<!--<exec executable="sed" osfamily="unix">
<arg value="-i" />
<arg value='s|user_pref("extensions.autoDisableScopes", 15);|user_pref("extensions.autoDisableScopes", 0);|g' />
<arg value="src/i2p.firefox.base.profile/user.js" />
@ -300,7 +253,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="-i" />
<arg value='s|user_pref("extensions.enabledScopes", 5);|user_pref("extensions.enabledScopes", 1);|g' />
<arg value="src/i2p.firefox.base.profile/user.js" />
</exec>
</exec>-->
<exec executable="sed" osfamily="unix">
<arg value="-i" />
<arg value='s|user_pref("dom.security.https_only_mode", true);|user_pref("dom.security.https_only_mode", false);|g' />
@ -308,8 +261,18 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
</exec>
</target>
<target name="i2pFirefoxUsabilityUserJs" depends="arkenfoxCheckout">
<exec executable="grep" osfamily="unix" output="user.js/tmp.user.js">
<arg value="-v" />
<arg value="autoDisableScopes" />
<arg value="user.js/user.js" />
</exec>
<exec executable="grep" osfamily="unix" output="user.js/user.js">
<arg value="-v" />
<arg value="enabledScopes" />
<arg value="user.js/tmp.user.js" />
</exec>
<copy file="user.js/user.js" tofile="src/i2p.firefox.usability.profile/user.js"/>
<exec executable="sed" osfamily="unix">
<!--<exec executable="sed" osfamily="unix">
<arg value="-i" />
<arg value='s|user_pref("extensions.autoDisableScopes", 15);|user_pref("extensions.autoDisableScopes", 0);|g' />
<arg value="src/i2p.firefox.usability.profile/user.js" />
@ -318,7 +281,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="-i" />
<arg value='s|user_pref("extensions.enabledScopes", 5);|user_pref("extensions.enabledScopes", 1);|g' />
<arg value="src/i2p.firefox.usability.profile/user.js" />
</exec>
</exec>-->
<exec executable="sed" osfamily="unix">
<arg value="-i" />
<arg value='s|user_pref("dom.security.https_only_mode", true);|user_pref("dom.security.https_only_mode", false);|g' />
@ -328,7 +291,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<target name="buildNum">
<buildnumber file="scripts/build.number" />
<property name="release.number" value="1.3.0" />
<property name="release.number" value="1.4.991" />
<exec executable="echo" osfamily="unix">
<arg value="${release.number}-${build.number}" />
</exec>
@ -461,10 +424,6 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="src/java/net/i2p/i2pfirefox/I2PBrowser.java"/>
<arg value="src/plugin/net/i2p/i2pfirefox/plugin/plugin/I2PBrowserPlugin.java"/>
<arg value="src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java"/>
<arg value="src/java/net/i2p/i2pfirefox/I2PChromium.java"/>
<arg value="src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java"/>
<arg value="src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java"/>
<arg value="src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java"/>
<arg value="src/java/net/i2p/i2pfirefox/I2PFirefox.java"/>
<arg value="src/java/net/i2p/i2pfirefox/I2PLibreWolf.java"/>
<arg value="src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java"/>
@ -485,10 +444,6 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<delete dir="i2p.firefox.usability.profile" />
<delete dir="i2p.firefox.profile" />
<delete dir="src/i2p.firefox.profile.zip" />
<delete dir="i2p.chromium.base.profile" />
<delete dir="i2p.chromium.usability.profile" />
<delete dir="i2p.chromium.profile" />
<delete dir="src/i2p.chromium.profile.zip" />
<delete file="plugin/i2ptunnel.config" />
<delete file="plugin/plugin.config" />
<delete file="plugin/i2pfirefox.config" />
@ -522,6 +477,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--input"/> <arg value="src/build"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
</exec>
<exec executable="rm" failonerror="true" osfamily="windows">
<arg value="-rf" />
@ -550,13 +506,14 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--linux-deb-maintainer"/> <arg value="hankhill19580@gmail.com"/>
<arg value="--linux-menu-group"/> <arg value="Network;WebBrowser;P2P"/>
<arg value="--linux-app-category"/> <arg value="Network"/>
<arg value="--linux-package-deps"/> <arg value="firefox|chromium|brave|firefox-esr|librewolf|icecat"/>
<arg value="--linux-package-deps"/> <arg value="firefox|firefox-esr|librewolf|icecat"/>
<arg value="--linux-shortcut"/>
<arg value="--license-file"/> <arg value="LICENSE.md"/>
<arg value="--name"/> <arg value="i2pbrowser"/>
<arg value="--icon"/> <arg value="src/icon.png"/>
<arg value="--app-version"/> <arg value="1.0.0"/>
<arg value="--input"/> <arg value="src/build"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
</exec>
@ -567,13 +524,14 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--linux-deb-maintainer"/> <arg value="hankhill19580@gmail.com"/>
<arg value="--linux-menu-group"/> <arg value="Network;WebBrowser;P2P"/>
<arg value="--linux-app-category"/> <arg value="Network"/>
<arg value="--linux-package-deps"/> <arg value="firefox|chromium|brave|firefox-esr|librewolf|icecat"/>
<arg value="--linux-package-deps"/> <arg value="firefox|firefox-esr|librewolf|icecat"/>
<arg value="--linux-shortcut"/>
<arg value="--license-file"/> <arg value="LICENSE.md"/>
<arg value="--name"/> <arg value="i2pbrowser"/>
<arg value="--icon"/> <arg value="src/icon.png"/>
<arg value="--app-version"/> <arg value="${release.number}"/>
<arg value="--input"/> <arg value="src/build"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
</exec>
@ -583,7 +541,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--type"/> <arg value="rpm"/>
<arg value="--linux-menu-group"/> <arg value="Network;WebBrowser;P2P"/>
<arg value="--linux-app-category"/> <arg value="Network"/>
<arg value="--linux-package-deps"/> <arg value="firefox|chromium|brave|firefox-esr|librewolf|icecat"/>
<arg value="--linux-package-deps"/> <arg value="firefox|firefox-esr|librewolf|icecat"/>
<arg value="--linux-shortcut"/>
<arg value="--license-file"/> <arg value="LICENSE.md"/>
<arg value="--name"/> <arg value="i2pbrowser"/>
@ -592,6 +550,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--input"/> <arg value="src/build"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
</exec>
</target>
<target name="fedora-release" depends="jar">
@ -599,7 +558,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--type"/> <arg value="rpm"/>
<arg value="--linux-menu-group"/> <arg value="Network;WebBrowser;P2P"/>
<arg value="--linux-app-category"/> <arg value="Network"/>
<arg value="--linux-package-deps"/> <arg value="firefox|chromium|brave|firefox-esr|librewolf|icecat"/>
<arg value="--linux-package-deps"/> <arg value="firefox|firefox-esr|librewolf|icecat"/>
<arg value="--linux-shortcut"/>
<arg value="--license-file"/> <arg value="LICENSE.md"/>
<arg value="--name"/> <arg value="i2pbrowser"/>
@ -608,9 +567,10 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--input"/> <arg value="src/build"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
</exec>
</target>
<target name="windows" depends="jar">
<target name="windows" depends="all">
<exec executable="jpackage" failonerror="true">
<arg value="--verbose"/>
<arg value="--type"/> <arg value="exe"/>
@ -628,6 +588,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--input"/> <arg value="src/build"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
</exec>
</target>
<target name="windows-release" depends="jar">
@ -648,6 +609,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--input"/> <arg value="src/build"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
</exec>
</target>
<target name="windows-msi" depends="jar">
@ -668,6 +630,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--input"/> <arg value="src/build"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
</exec>
</target>
<target name="windows-msi-release" depends="jar">
@ -688,6 +651,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--input"/> <arg value="src/build"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
</exec>
</target>
<target name="windows-portable" depends="jar">
@ -700,6 +664,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--input"/> <arg value="src/build"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
</exec>
<copy file="LICENSE.md" todir="i2pbrowser-portable" overwrite="true"/>
<delete file="i2pbrowser-portable.zip"/>
@ -719,6 +684,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--input"/> <arg value="src/build"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
</exec>
<copy file="LICENSE.md" todir="i2pbrowser-portable" overwrite="true"/>
<delete file="i2pbrowser-portable.zip"/>
@ -742,6 +708,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--input"/> <arg value="src/build"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
</exec>
</target>
<target name="macos-release" depends="jar">
@ -757,6 +724,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--input"/> <arg value="src/build"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
</exec>
</target>
<target name="macos-pkg" depends="jar">
@ -772,6 +740,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--input"/> <arg value="src/build"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
</exec>
</target>
<target name="macos-pkg-release" depends="jar">
@ -787,10 +756,11 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="--input"/> <arg value="src/build"/>
<arg value="--main-jar"/> <arg value="i2pfirefox.jar"/>
<arg value="--main-class"/> <arg value="net.i2p.i2pfirefox.I2PBrowser"/>
<arg value="--add-launcher"/> <arg value="i2pbrowser-usability=src/usability.properties"/>
</exec>
</target>
<target name="versionMd" depends="i2pFirefoxBaseProfile, i2pFirefoxUsabilityProfile, i2pChromiumBaseProfile, i2pChromiumUsabilityProfile">
<target name="versionMd" depends="i2pFirefoxBaseProfile, i2pFirefoxUsabilityProfile">
<delete file="VERSION.md"></delete>
<exec executable="echo" failonerror="true">
<redirector output="VERSION.md" error="VERSION.md" alwayslog="true" append="true"></redirector>
@ -858,129 +828,9 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<redirector output="VERSION.md" error="VERSION.md" alwayslog="true" append="true"></redirector>
<arg value=""/>
</exec>
<exec executable="echo" failonerror="true">
<redirector output="VERSION.md" error="VERSION.md" alwayslog="true" append="true"></redirector>
<arg value="## Chromium"/>
</exec>
<exec executable="echo" failonerror="true">
<redirector output="VERSION.md" error="VERSION.md" alwayslog="true" append="true"></redirector>
<arg value=""/>
</exec>
<exec executable="echo" failonerror="true">
<redirector output="VERSION.md" error="VERSION.md" alwayslog="true" append="true"></redirector>
<arg value="```md"/>
</exec>
<exec executable="manifest-json-version" failonerror="true">
<redirector output="VERSION.md" error="VERSION.md" alwayslog="true" append="true"></redirector>
<arg value="-mf"/>
<arg value="src/i2p.chromium.base.profile/extensions/i2pchrome.js/manifest.json"/>
</exec>
<exec executable="manifest-json-version" failonerror="true">
<redirector output="VERSION.md" error="VERSION.md" alwayslog="true" append="true"></redirector>
<arg value="-mf"/>
<arg value="src/i2p.chromium.base.profile/extensions/noscript.js/manifest.json"/>
</exec>
<exec executable="manifest-json-version" failonerror="true">
<redirector output="VERSION.md" error="VERSION.md" alwayslog="true" append="true"></redirector>
<arg value="-mf"/>
<arg value="src/i2p.chromium.usability.profile/extensions/localcdn.js/manifest.json"/>
</exec>
<exec executable="manifest-json-version" failonerror="true">
<redirector output="VERSION.md" error="VERSION.md" alwayslog="true" append="true"></redirector>
<arg value="-mf"/>
<arg value="src/i2p.chromium.usability.profile/extensions/ublock.js/manifest.json"/>
</exec>
<exec executable="manifest-json-version" failonerror="true">
<redirector output="VERSION.md" error="VERSION.md" alwayslog="true" append="true"></redirector>
<arg value="-mf"/>
<arg value="src/i2p.chromium.usability.profile/extensions/jshelter.js/manifest.json"/>
</exec>
<exec executable="echo" failonerror="true">
<redirector output="VERSION.md" error="VERSION.md" alwayslog="true" append="true"></redirector>
<arg value="```"/>
</exec>
</target>
<target name="i2pChromiumBaseProfile">
<mkdir dir="src/i2p.chromium.base.profile/extensions/" />
<exec executable="crx3" failonerror="true">
<arg value="download"/>
<arg value="ikdjcmomgldfciocnpekfndklkfgglpe" />
<arg value="-u=true"/>
<arg value="-o" />
<arg value="src/i2p.chromium.base.profile/extensions/i2pchrome.js.crx" />
</exec>
<exec executable="crx3" failonerror="true">
<arg value="download"/>
<arg value="doojmbjmlfjjnbmnoijecmcbfeoakpjm" />
<arg value="-u=true"/>
<arg value="-o" />
<arg value="src/i2p.chromium.base.profile/extensions/noscript.js.crx" />
</exec>
<exec executable="echo" failonerror="true" append="false" output="src/i2p.chromium.base.profile/version.md">
<arg value="Profile Version" />
</exec>
<exec executable="echo" failonerror="true" append="true" output="src/i2p.chromium.base.profile/version.md">
<arg value="===============" />
</exec>
<exec executable="echo" failonerror="true" append="true" output="src/i2p.chromium.base.profile/version.md">
<arg value="" />
</exec>
<exec executable="echo" failonerror="true" append="true" output="src/i2p.chromium.base.profile/version.md">
<arg value="${release.number}-${build.number}" />
</exec>
<exec executable="echo" failonerror="true" append="true" output="src/i2p.chromium.base.profile/version.md">
<arg value="" />
</exec>
</target>
<target name="i2pChromiumUsabilityProfile">
<mkdir dir="src/i2p.chromium.usability.profile/extensions/" />
<exec executable="crx3" failonerror="true">
<arg value="download"/>
<arg value="ikdjcmomgldfciocnpekfndklkfgglpe" />
<arg value="-u=true"/>
<arg value="-o" />
<arg value="src/i2p.chromium.usability.profile/extensions/i2pchrome.js.crx" />
</exec>
<exec executable="crx3" failonerror="true">
<arg value="download"/>
<arg value="cjpalhdlnbpafiamejdnhcphjbkeiagm" />
<arg value="-u=true"/>
<arg value="-o" />
<arg value="src/i2p.chromium.usability.profile/extensions/ublock.js.crx" />
</exec>
<exec executable="crx3" failonerror="true">
<arg value="download"/>
<arg value="ammoloihpcbognfddfjcljgembpibcmb" />
<arg value="-u=true"/>
<arg value="-o" />
<arg value="src/i2p.chromium.usability.profile/extensions/jshelter.js.crx" />
</exec>
<exec executable="crx3" failonerror="true">
<arg value="download"/>
<arg value="njdfdhgcmkocbgbhcioffdbicglldapd" />
<arg value="-u=true"/>
<arg value="-o" />
<arg value="src/i2p.chromium.usability.profile/extensions/localcdn.js.crx" />
</exec>
<exec executable="echo" failonerror="true" append="false" output="src/i2p.chromium.usability.profile/version.md">
<arg value="Profile Version" />
</exec>
<exec executable="echo" failonerror="true" append="true" output="src/i2p.chromium.usability.profile/version.md">
<arg value="===============" />
</exec>
<exec executable="echo" failonerror="true" append="true" output="src/i2p.chromium.usability.profile/version.md">
<arg value="" />
</exec>
<exec executable="echo" failonerror="true" append="true" output="src/i2p.chromium.usability.profile/version.md">
<arg value="${release.number}-${build.number}" />
</exec>
<exec executable="echo" failonerror="true" append="true" output="src/i2p.chromium.usability.profile/version.md">
<arg value="" />
</exec>
</target>
<target name="i2pFirefoxBaseProfile" depends="buildNum">
<target name="i2pFirefoxBaseProfile" depends="buildNum,i2pFirefoxBaseUserJs">
<mkdir dir="src/i2p.firefox.base.profile/extensions/" />
<copy file="src/prefs.js" tofile="src/i2p.firefox.base.profile/prefs.js" />
<copy file="src/user-overrides.js" tofile="src/i2p.firefox.base.profile/user-overrides.js" />
@ -1016,7 +866,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
</exec>
</target>
<target name="i2pFirefoxUsabilityProfile" depends="buildNum">
<target name="i2pFirefoxUsabilityProfile" depends="buildNum, i2pFirefoxUsabilityUserJs">
<mkdir dir="src/i2p.firefox.usability.profile/extensions/" />
<copy file="src/prefs.js" tofile="src/i2p.firefox.usability.profile/prefs.js" />
<copy file="src/user-overrides.js" tofile="src/i2p.firefox.usability.profile/user-overrides.js" />

View File

@ -1,6 +1,6 @@
#! /usr/bin/env sh
export GITHUB_USER=eyedeekay
export GITHUB_REPO=i2p.plugins.firefox
export GITHUB_NAME="Updates extensions, plugin support temporarily removed(Stay on the old version)"
export GITHUB_NAME="Fixes the build system"
export GITHUB_DESCRIPTION=$(cat CHANGES.md VERSION.md)
export GITHUB_TAG=1.4.0
export GITHUB_TAG=$(git describe --tags --abbrev=0)

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser
@ -152,6 +157,42 @@
<h2>
Build Dependencies
</h2>
<p>
<strong>
SHORTCUT:
</strong>
All the build artifacts can be produced by the description in the
<code>
.yaml
</code>
files in
<code>
.github/workflows
</code>
.
These can be run on Github&rsquo;s infrastructure, or on a local PC using
<a href="https://github.com/nektos/act">
https://github.com/nektos/act
</a>
.
Windows targets will require a Windows PC!
Doing things this way deals with all the dependency issues that Windows doesn&rsquo;t really give you a good way to deal with automatically.
It also guarantees that the same base container and environment gets used for every build no matter what machine it runs on.
I highly recommend you use either Github CI or
<code>
nektos/act
</code>
for dev builds of this software, as it
<strong>
automates literally every one of the steps
</strong>
.
CI-based builds follow the
<code>
WSL
</code>
version of the instructions.
</p>
<p>
You will need
<code>

View File

@ -2,6 +2,14 @@
## Build Dependencies
**SHORTCUT:** All the build artifacts can be produced by the description in the `.yaml` files in `.github/workflows`.
These can be run on Github's infrastructure, or on a local PC using https://github.com/nektos/act.
Windows targets will require a Windows PC!
Doing things this way deals with all the dependency issues that Windows doesn't really give you a good way to deal with automatically.
It also guarantees that the same base container and environment gets used for every build no matter what machine it runs on.
I highly recommend you use either Github CI or `nektos/act` for dev builds of this software, as it **automates literally every one of the steps**.
CI-based builds follow the `WSL` version of the instructions.
You will need `ant` and java `java` and for building the jar. You will need
`jpackage` for many of the potential build targets. I've been using Java 18
on Debian mostly, on Debian and Ubuntu, install the dependencies with:

1106
docs/I2P-PLUGIN.html Normal file

File diff suppressed because it is too large Load Diff

23
docs/I2P-PLUGIN.md Normal file
View File

@ -0,0 +1,23 @@
### I2P Plugin Support
Since version `1.5.0`, this package has had basic plugin support in Java I2P.
This means it can be integrated with your I2P installation or portable package, with
the benefit of reduced size requirements, automatic updates, and integration with the I2P UI.
Installation in this way is **platform-independent**, the same package is used for Linux, Windows, and OSX.
In this type of installation, the profile manager install is entirely managed by I2P.
Uninstalling I2P will also uninstall the profile manager.
#### Downloading the Plugin
Right now, the best way to download the plugin is from the Github releases page.
First, download the `i2pfirefox.su3` file from [the latest release](https://github.com/eyedeekay/i2p.plugins.firefox/releases).
Versions ending in `0` will always have a plugin release, starting with `1.5.0`.
Dev builds will not have a reliable plugin release.
#### Install the plugin "From File"
Once you have downloaded the `i2pfirefox.su3` file, open [`http://127.0.0.1:7657/configplugins`](http://127.0.0.1:7657/configplugins) and scroll to the bottom of the page.
Under the heading **Installation from File**, click the "Browse" button.
In the window that appears, select the `i2pfirefox.su3` file you just downloaded.
Finally, click the "Install plugin from File" button.
The plugin will install and start shortly.

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser

View File

@ -55,6 +55,11 @@
BUILD
</a>
</li>
<li>
<a href="I2P-PLUGIN.html">
I2P-PLUGIN
</a>
</li>
<li>
<a href="I2PBrowser.html">
I2PBrowser
@ -163,7 +168,7 @@
</h4>
<p>
<strong>
(Not Recommended! This functionality is already included in the Easy-Install Bundle for Windows)
(Recommended for advanced users ONLY. Most people should be using Easy-Install Bundle for Windows)
</strong>
</p>
<ol>

View File

@ -7,7 +7,7 @@ an unbundled I2P router with an external JVM.
#### Windows Jpackage: `.zip`
**(Not Recommended! This functionality is already included in the Easy-Install Bundle for Windows)**
**(Recommended for advanced users ONLY. Most people should be using Easy-Install Bundle for Windows)**
1. Start your I2P Router
2. Download the latest release `.zip` from [Github](https://github.com/eyedeekay/i2p.plugins.firefox/releases) and verify it's hash.

View File

@ -9,7 +9,7 @@ jpackage --verbose \
--type rpm \
--linux-menu-group "Network;WebBrowser;P2P" \
--linux-app-category "Network" \
--linux-package-deps "firefox|chromium|brave|firefox-esr|librewolf|icecat" \
--linux-package-deps "firefox|firefox-esr|librewolf|icecat" \
--linux-shortcut \
--license-file LICENSE.md \
--name i2pbrowser \
@ -18,4 +18,4 @@ jpackage --verbose \
--input src/build \
--main-jar i2pfirefox.jar \
--main-class net.i2p.i2pfirefox.I2PBrowser
ls *.rpm
ls *.rpm

Binary file not shown.

View File

@ -55,6 +55,11 @@
docs/BUILD
</a>
</li>
<li>
<a href="docs/I2P-PLUGIN.html">
docs/I2P-PLUGIN
</a>
</li>
<li>
<a href="docs/I2PBrowser.html">
docs/I2PBrowser
@ -172,6 +177,48 @@
It is just a profile manager.
</strong>
</p>
<p>
<strong>
What is this?
</strong>
</p>
<p>
This is a browser profile manager which pre-configures a browser on the host system, usually
Firefox or Tor Browser, for browsing I2P. When acting as an I2P Plugin, it adds GUI elements to
I2P for launching the browser in a highly restricted &ldquo;Safe&rdquo; mode(the default) or a more permissive
&ldquo;Usability&rdquo; mode.
</p>
<p>
This package expresses functionality that has existed in many places at many times, sometimes
bundled with other software. As it has developed here, the border of where the Easy-Install
ends and Firefox Profile Manager begins has become clearer. This repository contains the profile
manager and it&rsquo;s buildsystem, the whole profile manager, and nothing but the profile manager.
It can be used independently of other software, provided an I2P proxy on the host system somewhere.
</p>
<p>
However, in practice, most people probably get it alongside an I2P router, through the
<strong>
I2P Easy-Install Bundle for Windows
</strong>
.
</p>
<p>
<strong>
What version numbers should I pay attention to?
</strong>
When I decided to port the
<code>
.bat
</code>
launcher scripts from the Easy-Install bundle to Java, this project
was created and started using it&rsquo;s own version numbers. This was the practice up until version 1.5.0,
which was the last version to use a different version number than I2P itself. Starting in April 2024,
<code>
i2p.plugins.firefox
</code>
will follow along with the Java I2P major and minor version numbers. Incremental
changes may become differing point releases.
</p>
<p>
<strong>
All packages require a running I2P router.
@ -269,6 +316,15 @@
For platform specific instructions, see
</p>
<ul>
<li>
<a href="docs/I2P-PLUGIN.md">
I2P-PLUGIN.md
</a>
/
<a href="docs/I2P-PLUGIN.html">
I2P-PLUGIN.html
</a>
</li>
<li>
<a href="docs/LINUX.md">
LINUX.md

30
plugin-upload.sh Executable file
View File

@ -0,0 +1,30 @@
#! /usr/bin/env sh
. ./config.sh
NUMLINE=`grep release.number build.xml | head -n 1`
sed -i "s|${NUMLINE}| <property name=\"release.number\" value=\"$GITHUB_TAG\" />|g" build.xml
ant distclean versionMd jar plugin
github-release release --user "${GITHUB_USER}" \
--repo "${GITHUB_REPO}" \
--name "${GITHUB_NAME}" \
--description "${GITHUB_DESCRIPTION}" \
--tag "${GITHUB_TAG}"; true
sleep 2s
susum=$(sha256sum i2pfirefox.su3)
github-release upload --user "${GITHUB_USER}" \
--replace \
--repo "${GITHUB_REPO}" \
--tag "${GITHUB_TAG}" \
--label "I2P Browser launcher as an I2P Console Plugin. ${susum}" \
--name "i2pfirefox.su3" \
--file "i2pfirefox.su3"
#susum=$(sha256sum i2pfirefox-update.su3)
#github-release upload --user "${GITHUB_USER}" \
# --replace \
# --repo "${GITHUB_REPO}" \
# --tag "${GITHUB_TAG}" \
# --label "I2P Browser launcher as an I2P Console Plugin, update-only. ${susum}" \
# --name "i2pfirefox-update.su3" \
# --file "i2pfirefox-update.su3"
echo "Uploaded su3 package"

7
push.sh Executable file
View File

@ -0,0 +1,7 @@
#! /usr/bin/env sh
nightly_hash=nightly-$(git log -1 --format=%H)
nightly_date=$(date)
git tag -m "$nightly_date" -s "$nightly_hash"
git push --all
git push --tags

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Thu Mar 07 15:18:16 EST 2024
build.number=709
#Tue May 20 20:19:14 EDT 2025
build.number=827

View File

@ -60,8 +60,6 @@
<jar destfile="build/i2pfirefox-plugin.jar" basedir="./build/obj" includes="**/*.class" >
<fileset file="i2p.firefox.base.profile.zip" />
<fileset file="i2p.firefox.usability.profile.zip" />
<fileset file="i2p.chromium.base.profile.zip" />
<fileset file="i2p.chromium.usability.profile.zip" />
<fileset file="icon.png" />
</jar>
</target>
@ -70,8 +68,6 @@
<jar destfile="build/i2pfirefox.jar" basedir="./build/obj" includes="**/*.class" >
<fileset file="i2p.firefox.base.profile.zip" />
<fileset file="i2p.firefox.usability.profile.zip" />
<fileset file="i2p.chromium.base.profile.zip" />
<fileset file="i2p.chromium.usability.profile.zip" />
<fileset file="icon.png" />
</jar>
</target>

View File

@ -1,27 +1,6 @@
package net.i2p.i2pfirefox;
/*import java.awt.AWTException;
import java.awt.Component;
import java.awt.Image;
import java.awt.Menu;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;*/
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
/**
* I2PBrowser.java
@ -43,13 +22,10 @@ import java.util.Arrays;
*/
public class I2PBrowser extends I2PGenericUnsafeBrowser {
private final I2PFirefox i2pFirefox = new I2PFirefox();
private final I2PChromium i2pChromium = new I2PChromium();
private final I2PGenericUnsafeBrowser i2pGeneral =
new I2PGenericUnsafeBrowser();
public boolean firefox = false;
public boolean chromium = false;
public boolean firefox = true;
public boolean generic = false;
public boolean chromiumFirst = false;
public boolean usability = false;
public int privateBrowsing = 0;
private boolean outputConfig = false;
@ -64,16 +40,6 @@ public class I2PBrowser extends I2PGenericUnsafeBrowser {
i2pFirefox.storeFirefoxDefaults();
i2pFirefox.launch(privateWindow, url);
}
public void launchChromium(int privateWindow, String[] url) {
String priv = privateWindow == 1 ? "private-window" : "long-profile";
logger.info("I2PChromium" + priv);
i2pChromium.usability = usability;
if (url == null)
url = new String[] {"about:blank"};
if (outputConfig)
i2pChromium.storeChromiumDefaults();
i2pChromium.launch(privateWindow, url);
}
private void launchGeneric(int privateWindowInt, String[] url) {
String priv = privateWindowInt == 1 ? "private-window" : "long-profile";
boolean privateWindow = false;
@ -105,23 +71,6 @@ public class I2PBrowser extends I2PGenericUnsafeBrowser {
public void setBrowser(String browserPath) { this.BROWSER = browserPath; }
/**
* Return true if there is a Chromium available
*
* @return true if Chromium is available, false otherwise
* @since 0.0.16
*/
public boolean hasChromium() {
String chrome = i2pChromium.topChromium();
if (chrome == null) {
return false;
}
if (chrome.isEmpty()) {
return false;
}
return true;
}
/**
* Return true if there is a Firefox variant available
*
@ -149,20 +98,8 @@ public class I2PBrowser extends I2PGenericUnsafeBrowser {
* @since 0.0.17
*/
public void launch(int privateWindow, String[] url) {
if (chromiumFirst) {
if (chromium) {
this.launchChromium(privateWindow, url);
} else if (firefox) {
this.launchFirefox(privateWindow, url);
} else {
this.launchGeneric(privateWindow, url);
}
return;
}
if (firefox) {
this.launchFirefox(privateWindow, url);
} else if (chromium) {
this.launchChromium(privateWindow, url);
} else {
this.launchGeneric(privateWindow, url);
}
@ -203,8 +140,6 @@ public class I2PBrowser extends I2PGenericUnsafeBrowser {
boolean r = true;
if (i2pFirefox != null)
r = i2pFirefox.stop();
if (i2pChromium != null)
r = i2pChromium.stop();
if (i2pGeneral != null)
r = i2pGeneral.stop();
return r;
@ -213,8 +148,6 @@ public class I2PBrowser extends I2PGenericUnsafeBrowser {
public boolean running() {
if (i2pFirefox != null)
return i2pFirefox.running();
if (i2pChromium != null)
return i2pChromium.running();
if (i2pGeneral != null)
return i2pGeneral.running();
return false;
@ -243,9 +176,6 @@ public class I2PBrowser extends I2PGenericUnsafeBrowser {
if (arg.equals("-private")) {
this.privateBrowsing = 1;
}
if (arg.equals("-chromium")) {
this.chromium = true;
}
if (arg.equals("-firefox")) {
this.firefox = true;
}

View File

@ -1,842 +0,0 @@
package net.i2p.i2pfirefox;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* I2PChromium.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the MIT License. See LICENSE.md for details.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*
* @author idk
* @since 0.0.1
*/
public class I2PChromium extends I2PChromiumProfileUnpacker {
private final String[] CHROMIUM_SEARCH_PATHS = CHROMIUM_FINDER();
private Process p = null;
private String chromePath;
/**
* Construct an I2PChromium class which manages an instance of Chromium and
* an accompanying Chromium profile. This version includes Chromium variants
* and forks.
*
* @since 0.0.1
*/
public I2PChromium() {
for (String path : CHROMIUM_SEARCH_PATHS) {
File f = new File(path);
if (f.exists()) {
logger.info("Found Chromium at " + path);
return;
}
}
}
public I2PChromium(boolean usability) {
for (String path : CHROMIUM_SEARCH_PATHS) {
File f = new File(path);
if (f.exists()) {
logger.info("Found Chromium at " + path);
return;
}
}
this.usability = true;
}
public void storeChromiumDefaults() {
List<String> list = new ArrayList<String>();
list = Arrays.asList(chromiumPathsWindows());
getProperties().setProperty("chromium.paths.windows",
list.stream().collect(Collectors.joining(",")));
list = Arrays.asList(chromiumPathsUnix());
getProperties().setProperty("chromium.paths.linux",
list.stream().collect(Collectors.joining(",")));
list = Arrays.asList(chromiumPathsOSX());
getProperties().setProperty("chromium.paths.osx",
list.stream().collect(Collectors.joining(",")));
list = Arrays.asList(chromiumBinsWindows());
getProperties().setProperty("chromium.bins.windows",
list.stream().collect(Collectors.joining(",")));
list = Arrays.asList(chromiumBinsUnix());
getProperties().setProperty("chromium.bins.linux",
list.stream().collect(Collectors.joining(",")));
list = Arrays.asList(chromiumBinsUnix());
getProperties().setProperty("chromium.bins.osx",
list.stream().collect(Collectors.joining(",")));
try (OutputStream fos = new FileOutputStream(
new File(runtimeDirectory(""), "browser.config"))) {
getProperties().store(fos, "Chromium Configuration Section");
} catch (IOException ioe) {
logger.warning(ioe.toString());
}
}
private String[] chromiumPathsUnix() {
String chromiumPathsProp =
getProperties().getProperty("chromium.paths.unix");
if (chromiumPathsProp != null)
if (!chromiumPathsProp.equals(""))
return chromiumPathsProp.split(",");
return new String[] {"/usr/bin", "/usr/local/bin", "/opt/chromium/bin",
"/snap/bin"};
}
private String[] chromiumBinsUnix() {
String chromiumPathsProp;
if (isOSX()) {
chromiumPathsProp = getProperties().getProperty("chromium.bins.osx");
if (chromiumPathsProp != null)
if (!chromiumPathsProp.equals(""))
return chromiumPathsProp.split(",");
}
chromiumPathsProp = getProperties().getProperty("chromium.bins.unix");
if (chromiumPathsProp != null)
if (!chromiumPathsProp.equals(""))
return chromiumPathsProp.split(",");
return new String[] {
"ungoogled-chromium", "chromium", "brave", "edge", "msedge", "chrome"};
}
private String[] FIND_CHROMIUM_SEARCH_PATHS_UNIX() {
String[] path = chromiumPathsUnix();
String[] exes = chromiumBinsUnix();
String[] exePath = new String[path.length * exes.length];
int i = 0;
for (String s : path) {
for (String exe : exes) {
exePath[i] = s + "/" + exe;
i++;
}
}
return exePath;
}
private String[] chromiumPathsOSX() {
String chromiumPathsProp =
getProperties().getProperty("chromium.paths.osx");
if (chromiumPathsProp != null)
if (!chromiumPathsProp.equals(""))
return chromiumPathsProp.split(",");
return new String[] {"/Applications/Chromium.app/Contents/MacOS",
"/Applications/Chrome.app/Contents/MacOS",
"/Applications/Brave.app/Contents/MacOS"};
}
private String[] FIND_CHROMIUM_SEARCH_PATHS_OSX() {
String[] path = chromiumPathsOSX();
String[] exes = chromiumBinsUnix();
String[] exePath = new String[path.length * exes.length];
int i = 0;
for (String s : path) {
for (String exe : exes) {
exePath[i] = s + "/" + exe;
i++;
}
}
return exePath;
}
private String[] chromiumPathsWindows() {
String chromiumPathsProp =
getProperties().getProperty("chromium.paths.windows");
if (chromiumPathsProp != null)
if (!chromiumPathsProp.equals(""))
return chromiumPathsProp.split(",");
String programFiles = System.getenv("ProgramFiles");
String localAppData = System.getenv("LOCALAPPDATA");
String programFiles86 = System.getenv("ProgramFiles(x86)");
if (programFiles == null)
programFiles = "C:/Program Files/";
if (programFiles86 == null)
programFiles86 = "C:/Program Files (x86)/";
if (!isWindows())
localAppData = "C:/Users/user/AppData/Local/";
return new String[] {
new File(localAppData, "/Google/Chrome/Application/").toString(),
new File(programFiles, "/Google/Chrome/Application/").toString(),
new File(programFiles86, "/Google/Chrome/Application/").toString(),
new File(localAppData, "/Chromium/Application/").toString(),
new File(programFiles, "/Chromium/Application/").toString(),
new File(programFiles86, "/Chromium/Application/").toString(),
new File(localAppData, "/BraveSoftware/Brave Browser/Application/")
.toString(),
new File(programFiles, "/BraveSoftware/Brave Browser/Application/")
.toString(),
new File(programFiles86, "/BraveSoftware/Brave Browser/Application/")
.toString(),
new File(programFiles86, "/Microsoft/Edge/Application/").toString(),
new File(programFiles, "/Microsoft/Edge/Application/").toString(),
};
}
private String[] chromiumBinsWindows() {
String chromiumPathsProp =
getProperties().getProperty("chromium.bins.windows");
if (chromiumPathsProp != null)
if (!chromiumPathsProp.equals(""))
return chromiumPathsProp.split(",");
return new String[] {"ungoogled-chromium.exe",
"chromium.exe",
"brave.exe",
"edge.exe",
"msedge.exe",
"chrome.exe"};
}
private String[] FIND_CHROMIUM_SEARCH_PATHS_WINDOWS() {
String[] path = chromiumPathsWindows();
String[] exes = chromiumBinsWindows();
String[] exePath = new String[path.length * exes.length];
int i = 0;
for (String s : path) {
for (String exe : exes) {
exePath[i] = s + "\\" + exe;
i++;
}
}
return exePath;
}
private String[] FIND_ALL_CHROMIUM_SEARCH_PATHS() {
String[] Unix = FIND_CHROMIUM_SEARCH_PATHS_UNIX();
String[] Windows = FIND_CHROMIUM_SEARCH_PATHS_WINDOWS();
String[] Mac = FIND_CHROMIUM_SEARCH_PATHS_OSX();
String[] exePath = new String[Unix.length + Windows.length + Mac.length];
int i = 0;
for (String s : Unix) {
exePath[i] = s;
i++;
}
for (String s : Windows) {
exePath[i] = s;
i++;
}
for (String s : Mac) {
exePath[i] = s;
i++;
}
return exePath;
}
private String[] FIND_CHROMIUM_SEARCH_PATHS() {
switch (getOperatingSystem()) {
case "Windows":
return FIND_CHROMIUM_SEARCH_PATHS_WINDOWS();
case "Linux":
return FIND_CHROMIUM_SEARCH_PATHS_UNIX();
case "Mac":
return FIND_CHROMIUM_SEARCH_PATHS_OSX();
case "BSD":
return FIND_CHROMIUM_SEARCH_PATHS_UNIX();
default:
return FIND_ALL_CHROMIUM_SEARCH_PATHS();
}
}
private String[] NEARBY_CHROMIUM_SEARCH_PATHS() {
// obtain the PLUGIN environment variable
String plugin = System.getenv("PLUGIN");
if (plugin != null && !plugin.isEmpty()) {
File pluginDir = new File(plugin);
if (pluginDir.exists()) {
if (isWindows()) {
File searchResult = searchFile(pluginDir, "ungoogled-chromium.exe");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(pluginDir, "brave.exe");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(pluginDir, "chromium.exe");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(pluginDir, "edge.exe");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(pluginDir, "msedge.exe");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(pluginDir, "chrome.exe");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
} else {
File searchResult = searchFile(pluginDir, "ungoogled-chromium");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(pluginDir, "brave");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(pluginDir, "chromium");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(pluginDir, "edge");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(pluginDir, "msedge");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(pluginDir, "chrome");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
}
}
}
// now, do the same thing, but with user.dir instead of plugin
// list the directories in the user.dir directory
File userDir = new File(System.getProperty("user.dir"));
if (userDir.exists()) {
if (isWindows()) {
File searchResult = searchFile(userDir, "ungoogled-chromium.exe");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(userDir, "brave.exe");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(userDir, "chromium.exe");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(userDir, "edge.exe");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(userDir, "msedge.exe");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(userDir, "chrome.exe");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
} else {
File searchResult = searchFile(userDir, "ungoogled-chromium");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(userDir, "brave");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(userDir, "chromium");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(userDir, "edge");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(userDir, "msedge");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
searchResult = searchFile(userDir, "chrome");
if (searchResult != null)
return new String[] {searchResult.getAbsolutePath()};
}
}
return new String[] {};
}
private String[] CHROMIUM_FINDER() {
String[] nearby = NEARBY_CHROMIUM_SEARCH_PATHS();
String[] all = FIND_CHROMIUM_SEARCH_PATHS();
if (nearby != null && nearby.length > 0) {
return nearby;
} else if (all != null && all.length > 0) {
return all;
} else {
return new String[] {};
}
}
/**
* Check our list of chrome paths for a valid chrome binary.
* Just an existence check for now, but should check versions
* in the future.
*
* @return a list of usable Chromiums, or an empty list if none are found.
* @since 0.0.1
*/
public String[] onlyValidChromiums() {
String[] chromees = CHROMIUM_FINDER();
ArrayList<String> validChromiums = new ArrayList<String>();
for (String chrome : chromees) {
File chromeFile = new File(chrome);
if (chromeFile.exists()) {
logger.info("Found valid chromium at " + chrome);
validChromiums.add(chrome);
}
logger.info("chrome at " + chrome + "does not exist");
}
return validChromiums.toArray(new String[validChromiums.size()]);
}
/**
* Return the best available Chromium from the list of Chromiums we have.
*
* @return the path to the best available Chromium, or null if none are found.
* @since 0.0.1
*/
public String topChromium() {
// get the CHROMIUM environment variable
String chrome = System.getenv("CHROMIUM");
// if it is not null and not empty
if (chrome != null && !chrome.isEmpty()) {
// check if the file exists
File chromeFile = new File(chrome);
if (chromeFile.exists()) {
// if it does, return it
chromePath = chrome;
return chrome;
}
}
String[] chromees = onlyValidChromiums();
if (chromees.length > 0) {
chromePath = chromees[0];
return chromees[0];
} else {
return "";
}
}
/**
* Return the best available Chromium from the list of Chromiums we have.
* if override is passed it will be validated and if it validates, it will
* be used.
*
* @param override the path to a valid Chromium binary to use.
* @return the path to the best available Chromium, or null if none are found.
* @since 0.0.1
*/
public String topChromium(String overrideChromium) {
if (overrideChromium != null && !overrideChromium.isEmpty()) {
File chromeFile = new File(overrideChromium);
if (chromeFile.exists()) {
return overrideChromium;
}
}
return topChromium();
}
/**
* Build a ProcessBuilder for the top Chromium binary and
* the default profile.
*
* @return a ProcessBuilder for the top Chromium binary and
* the default profile.
* @since 0.0.1
*/
public ProcessBuilder defaultProcessBuilder() {
return processBuilder(new String[] {});
}
/**
* Build a ProcessBuilder for the top Chromium binary and
* the default profile.
*
* @args the arguments to pass to the Chromium binary
* @return a ProcessBuilder for the top Chromium binary and
* the default profile.
* @since 0.0.1
*/
public ProcessBuilder defaultProcessBuilder(String[] args) {
return processBuilder(args);
}
/**
* Build a ProcessBuilder for the top Chromium binary and
* the default profile.
*
* @return a ProcessBuilder for the top Chromium binary and
* the default profile. Always passes the --incognito flag.
* @since 0.0.1
*/
public ProcessBuilder privateProcessBuilder() {
return processBuilder(new String[] {"--incognito"});
}
/**
* Build a ProcessBuilder for the top Chromium binary and
* the default profile.
*
* @param args the arguments to pass to the Chromium binary.
* @return a ProcessBuilder for the top Chromium binary and
* the default profile. Always passes the --incognito flag.
* @since 0.0.1
*/
public ProcessBuilder privateProcessBuilder(String[] args) {
// return processBuilder(new String[]{});
ArrayList<String> argList = new ArrayList<String>();
argList.add("--incognito");
if (args != null) {
if (args.length > 0) {
for (String arg : args) {
argList.add(arg);
}
}
}
return processBuilder(argList.toArray(new String[argList.size()]));
}
/**
* Build a ProcessBuilder for the top Chromium binary and
* the default profile.
*
* @return a ProcessBuilder for the top Chromium binary and
* the default profile. Always passes the --app flag.
* @since 0.0.1
*/
public ProcessBuilder appProcessBuilder() {
return processBuilder(new String[] {"--app=http://127.0.0.1:7657"});
}
/**
* Build a ProcessBuilder for the top Chromium binary and
* the default profile.
*
* @param args the arguments to pass to the Chromium binary.
* @return a ProcessBuilder for the top Chromium binary and
* the default profile. Always passes the --app flag.
* @since 0.0.1
*/
public ProcessBuilder appProcessBuilder(String[] args) {
ArrayList<String> argList = new ArrayList<String>();
argList.add("--app=http://127.0.0.1:7657");
// argList.add("http://127.0.0.1:7657");
if (args != null) {
if (args.length > 0) {
for (String arg : args) {
argList.add(arg);
}
}
}
return processBuilder(argList.toArray(new String[argList.size()]));
}
/**
1 --user-data-dir="$CHROMIUM_I2P" \
2 --proxy-server="http://127.0.0.1:4444" \
3 --proxy-bypass-list=127.0.0.1:7657 \
4 --user-data-dir=$HOME/WebApps/i2padmin \
5 --safebrowsing-disable-download-protection \
6 --disable-client-side-phishing-detection \
7 --disable-3d-apis \
8 --disable-accelerated-2d-canvas \
9 --disable-remote-fonts \
10 --disable-sync-preferences \
11 --disable-sync \
12 --disable-speech \
13 --disable-webgl \
14 --disable-reading-from-canvas \
15 --disable-gpu \
16 --disable-32-apis \
17 --disable-auto-reload \
18 --disable-background-networking \
19 --disable-d3d11 \
20 --disable-file-system \
*/
/**
* Build a ProcessBuilder for the top Chromium binary and
* the default profile, with a specific set of extended
* arguments.
*
* @param args the extended arguments to pass to the Chromium binary.
* @return a ProcessBuilder for the top Chromium binary and
* default profile, with a specific set of extended arguments.
* @since 0.0.1
*/
public ProcessBuilder processBuilder(String[] args) {
String chrome = topChromium();
if (!chrome.isEmpty()) {
int arglength = 0;
if (args != null)
arglength = args.length;
String[] newArgs = new String[arglength + 32];
newArgs[0] = chrome;
newArgs[1] =
"--user-data-dir=" + this.profileDirectory(this.usabilityMode());
newArgs[2] = "--proxy-server=http://127.0.0.1:4444";
newArgs[3] =
"--proxy-bypass-list=http://localhost:7657,http://127.0.0.1:7657";
newArgs[4] = "--safebrowsing-disable-download-protection";
newArgs[5] = "--disable-client-side-phishing-detection";
newArgs[6] = "--disable-3d-apis";
newArgs[7] = "--disable-accelerated-2d-canvas";
newArgs[8] = "--disable-remote-fonts";
newArgs[9] = "--disable-sync-preferences";
newArgs[10] = "--disable-sync";
newArgs[11] = "--disable-speech";
newArgs[12] = "--disable-webgl";
newArgs[13] = "--disable-reading-from-canvas";
newArgs[14] = "--disable-gpu";
newArgs[15] = "--disable-auto-reload";
newArgs[16] = "--disable-background-networking";
newArgs[17] = "--disable-d3d11";
newArgs[18] = "--disable-file-system";
newArgs[19] = "--reset-variation-state";
newArgs[20] = "--disable-beforeunload";
newArgs[21] = "--disable-grease-tls";
newArgs[22] = "--disable-search-engine-collection";
newArgs[23] = "--fingerprinting-canvas-image-data-noise";
newArgs[24] = "--fingerprinting-canvas-measuretext-noise";
newArgs[25] = "--fingerprinting-client-rects-noise";
newArgs[26] = "--omnibox-autocomplete-filtering";
newArgs[27] = "--popups-to-tabs";
newArgs[28] = "--referrer-directive=noreferrers";
newArgs[29] = "--force-punycode-hostnames";
newArgs[30] = "--disable-sharing-hub";
if (!this.usability) {
newArgs[31] =
"--load-extension=" +
new File(this.profileDirectory("base"), "extensions/i2pchrome.js")
.getAbsolutePath() +
"," +
new File(this.profileDirectory("base"),
"extensions/https-everywhere.js")
.getAbsolutePath() +
"," +
new File(this.profileDirectory("base"), "extensions/noscript.js")
.getAbsolutePath();
} else {
newArgs[31] =
"--load-extension=" +
new File(this.profileDirectory("usability"),
"extensions/i2pchrome.js")
.getAbsolutePath() +
"," +
new File(this.profileDirectory("usability"),
"extensions/https-everywhere.js")
.getAbsolutePath() +
"," +
new File(this.profileDirectory("usability"),
"extensions/jshelter.js")
.getAbsolutePath() +
"," +
new File(this.profileDirectory("usability"),
"extensions/localcdn.js")
.getAbsolutePath() +
"," +
new File(this.profileDirectory("usability"), "extensions/ublock.js")
.getAbsolutePath();
}
if (args != null) {
if (arglength > 0) {
for (int i = 0; i < arglength; i++) {
newArgs[i + 32] = args[i];
}
}
}
if (isOSX()) {
String[] fg = {""};
String[] lastArgs =
Stream.concat(Arrays.stream(newArgs), Arrays.stream(fg))
.toArray(String[] ::new);
// String[] finalArgs = Stream.concat(Arrays.stream(initArgs),
// Arrays.stream(lastArgs)).toArray(String[]::new);
File bashScript = new File("i2pchromium.sh");
if (bashScript.exists()) {
bashScript.delete();
}
try {
FileWriter bWriter = new FileWriter(bashScript);
PrintWriter bpWriter = new PrintWriter(bWriter);
bpWriter.println("#! /usr/bin/env sh");
bpWriter.println(join(lastArgs));
bpWriter.close();
bWriter.close();
if (!bashScript.canExecute()) {
bashScript.setExecutable(true);
}
return new ProcessBuilder(bashScript.getAbsolutePath())
.directory(this.runtimeDirectory(true));
} catch (IOException e) {
logger.warning(e.toString());
}
} else {
return new ProcessBuilder(newArgs).directory(
this.runtimeDirectory(true));
}
}
logger.info("No Chromium found.");
return new ProcessBuilder(args);
}
public Process launchAndDetatch(boolean privateWindow, String[] url) {
int privateWindowInt = 0;
if (privateWindow)
privateWindowInt = 1;
return launchAndDetatch(privateWindowInt, url);
}
public Process launchAndDetatch(int privateWindow, String[] url) {
validateUserDirectory();
if (waitForProxy()) {
String profileDirectory = this.profileDirectory(this.usabilityMode());
if (this.validateProfileDirectory(profileDirectory)) {
logger.info("Valid profile directory: " + profileDirectory);
} else {
logger.info("Invalid profile directory: " + profileDirectory +
" rebuilding...");
if (!this.copyBaseProfiletoProfile()) {
logger.info("Failed to rebuild profile directory: " +
profileDirectory);
return null;
} else {
logger.info("Rebuilt profile directory: " + profileDirectory);
}
}
if (validateProfileFirstRun(profileDirectory))
return null;
ProcessBuilder pb = null;
switch (privateWindow) {
case 0:
pb = this.defaultProcessBuilder(url);
break;
case 1:
pb = this.privateProcessBuilder(url);
break;
case 2:
pb = this.appProcessBuilder(url);
break;
default:
pb = this.defaultProcessBuilder(url);
break;
}
try {
logger.info(pb.command().toString());
p = pb.start();
sleep(2000);
return p;
} catch (Throwable e) {
logger.info(e.toString());
}
}
return null;
}
/**
* Populates a profile directory with a proxy configuration.
* Waits for an HTTP proxy on the port 4444 to be ready.
* Launches Chromium with the profile directory.
*
* @param bool if true, the profile will be ephemeral(i.e. a --private-window
* profile).
* @param String[] a list of URL's to pass to the browser window
* @since 0.0.17
*/
public void launch(boolean privateWindow, String[] url) {
int privateWindowInt = 0;
if (privateWindow)
privateWindowInt = 1;
launch(privateWindowInt, url);
}
public void launch(int privateWindow, String[] url) {
if (waitForProxy()) {
p = launchAndDetatch(privateWindow, url);
if (p == null)
return;
logger.info("I2PChromium");
try {
logger.info("Waiting for I2PChromium to close...");
int exit = p.waitFor();
logger.info("I2PChromium exited with value: " + exit);
} catch (Exception e) {
logger.info("Error: " + e.getMessage());
}
}
}
/**
* Populates a profile directory with a proxy configuration.
* Waits for an HTTP proxy on the port 4444 to be ready.
* Launches Chromium with the profile directory.
*
* @param bool if true, the profile will be ephemeral(i.e. a --private-window
* profile).
* @since 0.0.1
*/
public void launch(boolean privateWindow) { launch(privateWindow, null); }
/**
* Populates a profile directory with a proxy configuration.
* Waits for an HTTP proxy on the port 4444 to be ready.
* Launches Chromium with the profile directory.
*
* @since 0.0.1
*/
public void launch() { launch(false); }
/**
* Stop all running processes managed by the browser manager.
*
* @return true if successful, false if not
*/
public boolean stop() {
if (p != null) {
p.destroy();
return true;
}
return false;
}
public boolean running() {
if (p != null)
return p.isAlive();
return false;
}
private String ValidURL(String inUrl) {
String[] schemes = {"http", "https"};
for (String scheme : schemes) {
if (inUrl.startsWith(scheme)) {
return inUrl;
}
}
return "";
}
public static void main(String[] args) {
int privateBrowsing = 0;
I2PChromium i2pChromium = new I2PChromium();
i2pChromium.validateUserDirectory();
i2pChromium.logger.info("I2PChromium");
i2pChromium.logger.info("checking for private browsing");
ArrayList<String> visitURL = new ArrayList<String>();
if (args != null) {
if (args.length > 0) {
for (String arg : args) {
if (arg.equals("-private")) {
privateBrowsing = 1;
i2pChromium.logger.info(
"private browsing is true, profile will be discarded at end of session");
}
if (arg.equals("-usability")) {
i2pChromium.usability = true;
}
if (arg.equals("-app")) {
privateBrowsing = 2;
i2pChromium.usability = true;
}
if (arg.equals("-noproxycheck")) {
i2pChromium.logger.info("zeroing out proxy check");
i2pChromium.setProxyTimeoutTime(0);
}
if (!arg.startsWith("-")) {
// check if it's a URL
if (privateBrowsing == 2)
visitURL.add("--app=" + i2pChromium.ValidURL(arg));
else
visitURL.add(i2pChromium.ValidURL(arg));
}
}
}
}
i2pChromium.launch(privateBrowsing,
visitURL.toArray(new String[visitURL.size()]));
}
}

View File

@ -1,152 +0,0 @@
package net.i2p.i2pfirefox;
import java.io.File;
/**
* I2PChromiumProfileBuilder.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the MIT License. See LICENSE.md for details.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* I2PChromiumProfileBuilder is a class that builds a profile directory which
* contains the I2P browser profile for the Chromium browser family. It manages
* the base profile directory and copies it's contents to the active profile
* directory, which is actually used by Chromium.
*
* @author idk
* @since 0.0.1
*/
public class I2PChromiumProfileBuilder extends I2PChromiumProfileChecker {
public boolean usability;
private String baseProfileDir(String file, String mode) {
File profileDir = new File(file, "i2p.chromium." + mode + ".profile");
// make sure the directory exists
if (profileDir.exists()) {
return profileDir.getAbsolutePath();
} else {
// create the directory
I2PChromiumProfileUnpacker unpacker = new I2PChromiumProfileUnpacker();
if (!unpacker.unpackProfile(profileDir.getAbsolutePath(), mode)) {
return null;
}
return profileDir.getAbsolutePath();
}
}
/**
* get the base profile directory, creating it if necessary
*
* @return the base profile directory, or null if it could not be created
*/
/*public String baseProfileDirectory() {
return baseProfileDirectory("base");
}*/
public String baseProfileDirectory(String mode) {
String pd = System.getenv("I2P_CHROMIUM_BASE_PROFILE");
if (pd != null && !pd.isEmpty()) {
File pdf = new File(pd);
if (pdf.exists() && pdf.isDirectory()) {
return pd;
} else {
I2PChromiumProfileUnpacker unpacker = new I2PChromiumProfileUnpacker();
if (!unpacker.unpackProfile(pdf.getAbsolutePath(), mode)) {
return null;
}
}
}
String rtd = runtimeDirectory();
return baseProfileDir(rtd, mode);
}
/**
* get the runtime directory, creating it if create=true
*
* @param create if true, create the runtime directory if it does not exist
* @return the runtime directory, or null if it could not be created
* @since 0.0.1
*/
public File runtimeDirectory(boolean create) {
String rtd = runtimeDirectory();
return runtimeDirectory(create, rtd);
}
/**
* get the correct runtime directory
*
* @return the runtime directory, or null if it could not be created or found
* @since 0.0.1
*/
public String runtimeDirectory() {
// get the I2P_CHROMIUM_DIR environment variable
String rtd = System.getenv("I2P_CHROMIUM_DIR");
// if it is not null and not empty
if (rtd != null && !rtd.isEmpty()) {
// check if the file exists
File rtdFile = new File(rtd);
if (rtdFile.exists()) {
// if it does, return it
return runtimeDirectory(rtd);
}
}
return runtimeDirectory("");
}
public String usabilityMode() {
if (usability)
return "usability";
return "base";
}
/**
* Copy the inert base profile directory to the runtime profile directory
*
* @since 0.0.1
*/
public boolean copyBaseProfiletoProfile() {
String baseProfile = baseProfileDirectory(usabilityMode());
String profile = profileDirectory(usabilityMode());
logger.info("Copying base profile to profile directory: " + baseProfile +
" -> " + profile);
if (baseProfile.isEmpty() || profile.isEmpty()) {
return false;
}
File baseProfileDir = new File(baseProfile);
File profileDir = new File(profile);
if (!profileDir.exists()) {
try {
logger.info("Copying base profile to profile directory");
copyDirectory(baseProfileDir, profileDir, "chromium", usabilityMode());
} catch (Exception e) {
logger.info("Error copying base profile to profile" + e);
return false;
}
}
logger.info("Copied base profile to profile directory");
return true;
}
/**
* Construct a new Profile Builder
*
* @since 0.0.1
*/
public I2PChromiumProfileBuilder() {
// I2PChromiumProfileBuilder.strict = false;
}
/**
* Construct a new Profile Builder
* @param strict if true, the strict overrides will be copied to the profile
*
* @since 0.0.1
*/
public I2PChromiumProfileBuilder(boolean strict) {
// I2PChromiumProfileBuilder.strict = strict;
}
}

View File

@ -1,139 +0,0 @@
package net.i2p.i2pfirefox;
import java.io.File;
/**
* I2PChromiumProfileChecker.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the MIT License. See LICENSE.md for details.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* I2PChromiumProfileChecker is a class that checks if the Chromium profile
* directory exists and is valid.
*
* @author idk
* @since 0.0.1
*/
public class I2PChromiumProfileChecker extends I2PCommonBrowser {
/**
* Output feedback if the profile directory is valid or invalid
*
* @description Output feedback if the profile directory is valid or invalid
* @args unused
* @since 0.0.1
*/
public static void main(String[] args) {
I2PChromiumProfileChecker pc = new I2PChromiumProfileChecker();
String profileDirectory = pc.profileDirectory("base");
if (profileDirectory == null) {
pc.logger.info("No profile directory found");
return;
}
pc.logger.info("Profile directory: " + profileDirectory);
boolean ok = pc.validateProfileDirectory(profileDirectory);
if (ok) {
pc.logger.info("Profile directory is valid");
} else {
pc.logger.info("Profile directory is invalid");
}
}
/**
* get the profile directory, creating it if necessary
*
* @return the profile directory, or null if it could not be created
*/
public String profileDirectory(String base) {
return profileDirectory("I2P_CHROMIUM_PROFILE", "chromium", base, false);
}
/**
* Return true if the profile directory is valid.
*
* @param profileDirectory the profile directory to check
* @return true if the profile directory is valid, false otherwise
* @since 0.0.1
*/
public boolean validateProfileDirectory(String profileDirectory) {
File profileDir = new File(profileDirectory);
if (!profileDir.exists()) {
logger.info("Profile directory does not exist");
return false;
}
if (!profileDir.isDirectory()) {
logger.info("Profile directory is not a directory");
return false;
}
if (!profileDir.canRead()) {
logger.info("Profile directory is not readable");
return false;
}
if (!profileDir.canWrite()) {
logger.info("Profile directory is not writable");
return false;
}
if (!validateExtensionDirectory(profileDir + "/extensions")) {
logger.info("extensions directory is invalid");
return false;
}
return true;
}
/**
* Return true if the file is valid.
*
* @param file the file to check
* @return true if the file is valid, false otherwise
* @since 0.0.1
*/
public boolean validateFile(String file) {
File f = new File(file);
if (!f.exists()) {
logger.info("User JavaScript file does not exist");
return false;
}
if (!f.isFile()) {
logger.info("User JavaScript file is not a file");
return false;
}
if (!f.canRead()) {
logger.info("User JavaScript file is not readable");
return false;
}
if (!f.canWrite()) {
logger.info("User JavaScript file is not writable");
return false;
}
return true;
}
/**
* Return true if the extension directory is valid.
*
* @param extensionDirectory the extension directory to check
* @return true if the extension directory is valid, false otherwise
* @since 0.0.1
*/
public boolean validateExtensionDirectory(String extensionDirectory) {
File extensionDir = new File(extensionDirectory);
if (!extensionDir.exists()) {
logger.info("Extension directory does not exist");
return false;
}
if (!extensionDir.isDirectory()) {
logger.info("Extension directory is not a directory");
return false;
}
if (!extensionDir.canRead()) {
logger.info("Extension directory is not readable");
return false;
}
if (!extensionDir.canWrite()) {
logger.info("Extension directory is not writable");
return false;
}
return true;
}
}

View File

@ -1,42 +0,0 @@
package net.i2p.i2pfirefox;
/**
* I2PChromiumProfileUnpacker.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the MIT License. See LICENSE.md for details.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* I2PChromiumProfileUnpacker is a class that unpacks the Chromium profile zip
* file into the Chromium base profile directory. This is not used by the
* Chromium browser instance, it's unpacked to the disk to be copied to the
* active profile directory.
*
* @author idk
* @since 0.0.1
*/
public class I2PChromiumProfileUnpacker extends I2PChromiumProfileBuilder {
public static void main(String[] args) {
I2PChromiumProfileUnpacker pu = new I2PChromiumProfileUnpacker();
String profileDirectory = pu.profileDirectory("base");
if (profileDirectory == null) {
pu.logger.info("No profile directory found");
return;
}
}
/**
* unpack the profile directory
*
* @return true if the profile directory was successfully unpacked
* @since 0.0.1
*/
public boolean unpackProfile(String profileDirectory, String mode) {
logger.info("Unpacking base profile to " + profileDirectory);
return unpackProfile(profileDirectory, "chromium", mode);
}
}

View File

@ -9,11 +9,9 @@ import java.io.OutputStream;
import java.net.Socket;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.Arrays;
import java.util.Properties;
import java.util.logging.FileHandler;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
@ -36,6 +34,7 @@ public class I2PCommonBrowser {
private Properties prop = new Properties();
public Logger logger = Logger.getLogger("browserlauncher");
private FileHandler fh;
private boolean validated = false;
int CONFIGURED_TIMEOUT = 200;
public I2PCommonBrowser() {
@ -75,6 +74,8 @@ public class I2PCommonBrowser {
* @return None No return value.
*/
public void validateUserDirectory() {
if (validated)
return;
logger.info("Validating user directory");
String userDir = System.getProperty("user.dir");
String userHome = System.getProperty("user.home");
@ -123,6 +124,7 @@ public class I2PCommonBrowser {
logger.info(defaultPathFile.getAbsolutePath());
}
System.setProperty("user.dir", defaultPathFile.getAbsolutePath());
validated = true;
}
/**
@ -192,15 +194,17 @@ public class I2PCommonBrowser {
*
* @return the log file for the browser launcher
*/
/*private File logFile() {
// validateUserDirectory();
String userDirectory = System.getProperty("user.dir");
File logDirectory = new File(userDirectory, "logs");
if (!logDirectory.exists()) {
logDirectory.mkdirs();
}
return new File(logDirectory, "browserlauncher.log");
}*/
/*
* private File logFile() {
* // validateUserDirectory();
* String userDirectory = System.getProperty("user.dir");
* File logDirectory = new File(userDirectory, "logs");
* if (!logDirectory.exists()) {
* logDirectory.mkdirs();
* }
* return new File(logDirectory, "browserlauncher.log");
* }
*/
/**
* Get the runtime directory, creating it if create=true.
@ -223,7 +227,7 @@ public class I2PCommonBrowser {
* Returns the runtime directory path based on the given override parameter.
*
* @param override the name of the environment variable to override the
* runtime
* runtime
* directory
* @return the runtime directory path as a string
*/
@ -430,7 +434,7 @@ public class I2PCommonBrowser {
* copied to
* @throws IOException if an I/O error occurs during the file copy process
*/
private void copyFile(File sourceFile, File destinationFile)
public void copyFile(File sourceFile, File destinationFile)
throws IOException {
try (InputStream in = new FileInputStream(sourceFile);
OutputStream out = new FileOutputStream(destinationFile)) {
@ -586,6 +590,13 @@ public class I2PCommonBrowser {
* @return the found file or null if not found
*/
public File searchFile(File directory, String search) {
File hd = new File(System.getProperty("user.home"));
if (hd != null) {
if (directory.getAbsolutePath().equals(hd.getAbsolutePath()))
return null;
}
if (directory == null || !directory.exists() || !directory.canRead())
return null;
if (directory.isDirectory()) {
File[] files = directory.listFiles();
for (File file : files) {
@ -600,4 +611,18 @@ public class I2PCommonBrowser {
}
return null;
}
public File userHomeDir() {
File rd = new File(System.getProperty("user.dir"));
File hd = new File(System.getProperty("user.home"));
if (rd == null || !rd.exists()) {
if (hd == null || !hd.exists()) {
if (rd.getAbsolutePath().equals(hd.getAbsolutePath()))
return null;
}
return rd;
}
logger.info("Runtime directory discovered at: " + rd);
return rd;
}
}

View File

@ -1,9 +1,11 @@
package net.i2p.i2pfirefox;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
@ -27,7 +29,7 @@ import java.util.stream.Stream;
* @author idk
* @since 0.0.1
*/
public class I2PFirefox extends I2PFirefoxProfileUnpacker {
public class I2PFirefox extends I2PFirefoxProfileBuilder {
private final String[] FIREFOX_SEARCH_PATHS = FIREFOX_FINDER();
private Process process = null;
private String firefoxPath;
@ -124,6 +126,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
}
return exePath;
}
public String[] firefoxPathsOSX() {
String firefoxPathsProp = getProperties().getProperty("firefox.paths.osx");
if (firefoxPathsProp != null)
@ -134,6 +137,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
"/Applications/Waterfox.app/Contents/MacOS",
"/Applications/Librewolf.app/Contents/MacOS"};
}
private String[] FIND_FIREFOX_SEARCH_PATHS_OSX() {
String[] path = firefoxPathsOSX();
String[] exes = firefoxBinsUnix();
@ -147,6 +151,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
}
return exePath;
}
public String[] firefoxPathsWindows() {
String firefoxPathsProp =
getProperties().getProperty("firefox.paths.windows");
@ -181,6 +186,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
new File(programFiles, "Librewolf/").toString(),
};
}
private String[] firefoxBinsWindows() {
String firefoxPathsProp =
getProperties().getProperty("firefox.bins.windows");
@ -192,6 +198,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
"waterfox.exe", "waterfox-bin.exe", "librewolf.exe",
};
}
private String[] FIND_FIREFOX_SEARCH_PATHS_WINDOWS() {
String[] path = firefoxPathsWindows();
String[] exes = firefoxBinsWindows();
@ -226,6 +233,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
}
return exePath;
}
private String[] FIND_FIREFOX_SEARCH_PATHS() {
switch (getOperatingSystem()) {
case "Windows":
@ -292,7 +300,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
}
// now, do the same thing, but with user.dir instead of plugin
// list the directories in the user.dir directory
File userDir = new File(System.getProperty("user.dir"));
File userDir = userHomeDir();
if (userDir.exists()) {
if (isWindows()) {
File searchResult = searchFile(userDir, "firefox-esr.exe");
@ -337,6 +345,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
return new String[] {};
}
private String[] FIREFOX_FINDER() {
String[] nearby = NEARBY_FIREFOX_SEARCH_PATHS();
String[] all = FIND_FIREFOX_SEARCH_PATHS();
@ -366,8 +375,9 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
if (firefoxFile.exists()) {
logger.info("Found valid firefox at " + firefox);
validFirefoxes.add(firefox);
} else {
logger.info("firefox at " + firefox + "does not exist");
}
logger.info("firefox at " + firefox + "does not exist");
}
return validFirefoxes.toArray(new String[validFirefoxes.size()]);
}
@ -376,7 +386,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
* Return the best available Firefox from the list of Firefoxes we have.
*
* @return the path to the best available Firefox, or null if none are
* found.
* found.
* @since 0.0.1
*/
public String topFirefox() {
@ -411,7 +421,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
*
* @param override the path to a valid Firefox binary to use.
* @return the path to the best available Firefox, or null if none are
* found.
* found.
* @since 0.0.1
*/
public String topFirefox(String overrideFirefox) {
@ -429,7 +439,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
* the default profile.
*
* @return a ProcessBuilder for the top Firefox binary and
* the default profile.
* the default profile.
* @since 0.0.1
*/
public ProcessBuilder defaultProcessBuilder() {
@ -442,7 +452,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
*
* @param args the args to pass to the Firefox binary
* @return a ProcessBuilder for the top Firefox binary and
* the default profile.
* the default profile.
*/
public ProcessBuilder defaultProcessBuilder(String[] args) {
return processBuilder(args, false);
@ -455,7 +465,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
*
* @param args the arguments to pass to the Firefox binary.
* @return a ProcessBuilder for the top Firefox binary and
* the default profile.
* the default profile.
* @since 0.0.1
*/
public ProcessBuilder privateProcessBuilder() {
@ -469,7 +479,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
*
* @param args the arguments to pass to the Firefox binary
* @return a ProcessBuilder for the top Firefox binary and
* the default profile.
* the default profile.
*/
public ProcessBuilder privateProcessBuilder(String[] args) {
ArrayList<String> argList = new ArrayList<String>();
@ -491,7 +501,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
*
* @param args the arguments to pass to the Firefox binary.
* @return a ProcessBuilder for the top Firefox binary and
* the default profile.
* the default profile.
* @since 0.0.1
*/
public ProcessBuilder appProcessBuilder() {
@ -505,7 +515,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
*
* @param args the arguments to pass to the Firefox binary
* @return a ProcessBuilder for the top Firefox binary and
* the default profile.
* the default profile.
*/
public ProcessBuilder appProcessBuilder(String[] args) {
ArrayList<String> argList = new ArrayList<String>();
@ -526,7 +536,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
*
* @param args the arguments to pass to the Firefox binary
* @return a ProcessBuilder for the top Firefox binary and
* the default profile.
* the default profile.
*/
public ProcessBuilder headlessProcessBuilder(String[] args) {
ArrayList<String> argList = new ArrayList<String>();
@ -548,14 +558,14 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
*
* @param args the extended arguments to pass to the Firefox binary.
* @return a ProcessBuilder for the top Firefox binary and
* default profile, with a specific set of extended arguments.
* default profile, with a specific set of extended arguments.
* @since 0.0.1
*/
/*
public ProcessBuilder processBuilder(String[] args ) {
return processBuilder(args, false);
}
*/
* public ProcessBuilder processBuilder(String[] args ) {
* return processBuilder(args, false);
* }
*/
public ProcessBuilder processBuilder(String[] args, boolean app) {
String firefox = topFirefox();
if (!firefox.isEmpty()) {
@ -683,7 +693,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
pb.environment().put("TOR_SKIP_CONTROLPORTTEST", "1");
pb.environment().put("TOR_NONTOR_PROXY", "1");
return pb;
//}
// }
// return null;
}
@ -693,12 +703,14 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
}
return "base";
}
public Process launchAndDetatch(boolean privateWindow, String[] url) {
int privateWindowInt = 0;
if (privateWindow)
privateWindowInt = 1;
return launchAndDetatch(privateWindowInt, url);
}
public Process launchAndDetatch(int privateWindow, String[] url) {
validateUserDirectory();
boolean app = false;
@ -706,12 +718,13 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
app = true;
if (waitForProxy()) {
String profileDirectory = this.profileDirectory(app, baseMode());
if (this.validateProfileDirectory(profileDirectory)) {
if (this.validateProfileDirectory(profileDirectory) && !isTorBrowser()) {
logger.info("Valid profile directory: " + profileDirectory);
} else {
logger.info("Invalid profile directory: " + profileDirectory +
" rebuilding...");
if (!this.copyBaseProfiletoProfile(usabilityMode(), app)) {
if (!this.copyBaseProfiletoProfile(usabilityMode(), app,
isTorBrowser())) {
logger.info("Failed to rebuild profile directory: " +
profileDirectory);
return null;
@ -720,7 +733,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
}
}
if (validateProfileFirstRun(profileDirectory)) {
if (isWindows()) {
if (isWindows() && !isTorBrowser()) {
ProcessBuilder hpb = headlessProcessBuilder(url);
try {
Process hp = hpb.start();
@ -786,8 +799,8 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
* Waits for an HTTP proxy on the port 4444 to be ready.
* Launches Firefox with the profile directory.
*
* @param bool if true, the profile will be ephemeral(i.e. a
* --private-window profile).
* @param bool if true, the profile will be ephemeral(i.e. a
* --private-window profile).
* @param String[] a list of URL's to pass to the browser window
* @since 0.0.17
*/
@ -797,6 +810,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
priv = 1;
launch(priv, url);
}
public void launch(int privateWindow, String[] url) {
if (waitForProxy()) {
process = launchAndDetatch(privateWindow, url);
@ -820,7 +834,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
* Launches Firefox with the profile directory.
*
* @param bool if true, the profile will be ephemeral(i.e. a
* --private-window profile).
* --private-window profile).
* @since 0.0.1
*/
public void launch(boolean privateWindow) { launch(privateWindow, null); }
@ -902,12 +916,40 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
visitURL.toArray(new String[visitURL.size()]));
}
/*private void sleep(int millis) {
public boolean isTorBrowser() {
String[] args = {"--version"};
ProcessBuilder tpb = defaultProcessBuilder(args);
try {
Thread.sleep(millis);
} catch (InterruptedException bad) {
bad.printStackTrace();
throw new RuntimeException(bad);
Process tp = tpb.start();
BufferedReader reader =
new BufferedReader(new InputStreamReader(tp.getInputStream()));
StringBuilder builder = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
builder.append(line);
builder.append(System.getProperty("line.separator"));
}
String result = builder.toString().toLowerCase();
if (result.contains("tor ")) {
logger.info("running in Tor Browser, modifying only required config");
return true;
} else {
logger.info("running in regular Firefox, using extended config");
return false;
}
} catch (Exception e) {
return false;
}
}*/
}
/*
* private void sleep(int millis) {s
* try {
* Thread.sleep(millis);
* } catch (InterruptedException bad) {
* bad.printStackTrace();
* throw new RuntimeException(bad);
* }
* }
*/
}

View File

@ -1,6 +1,7 @@
package net.i2p.i2pfirefox;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
@ -25,6 +26,44 @@ import java.nio.file.StandardCopyOption;
*/
public class I2PFirefoxProfileBuilder extends I2PFirefoxProfileChecker {
private boolean strict;
private String TBB_BASE =
"user_pref(\"extensions.torbutton.use_nontor_proxy\", true);\n"
+ "user_pref(\"extensions.torlauncher.start_tor\", false);\n"
+ "user_pref(\"extensions.torlauncher.prompt_at_startup\", false);\n"
+
"user_pref(\"network.proxy.no_proxies_on\", \"127.0.0.1:7657,localhost:7657,127.0.0.1:7662,localhost:7662,127.0.0.1:7669,localhost:7669\");\n"
+ "user_pref(\"network.proxy.type\", 1);\n"
+ "user_pref(\"network.proxy.http\", \"127.0.0.1\");\n"
+ "user_pref(\"network.proxy.http_port\", 4444);\n"
+ "user_pref(\"network.proxy.ssl\", \"127.0.0.1\");\n"
+ "user_pref(\"network.proxy.ssl_port\", 4444);\n"
+ "user_pref(\"network.proxy.ftp\", \"127.0.0.1\");"
+ "user_pref(\"network.proxy.ftp_port\", 4444);\n"
+ "user_pref(\"network.proxy.socks\", \"127.0.0.1\");\n"
+ "user_pref(\"network.proxy.socks_port\", 4444);\n"
+ "user_pref(\"network.proxy.share_proxy_settings\", true);\n"
+ "user_pref(\"browser.startup.homepage\", \"about:blank\");\n"
+ "user_pref(\"keyword.enabled\", false);\n"
+ "user_pref(\"extensions.allowPrivateBrowsingByDefault\", true);\n"
+ "user_pref(\"extensions.PrivateBrowsing.notification\", false);\n"
+ "user_pref(\"extensions.pocket.enabled\", false);\n"
+
"user_pref(\"browser.newtabpage.activity-stream.showSponsoredTopSites\", false);\n"
+
"user_pref(\"browser.newtabpage.activity-stream.showSponsored\", false);\n"
+
"user_pref(\"services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsored\", false);\n"
+
"user_pref(\"browser.newtabpage.activity-stream.feeds.section.highlights\", false);\n"
+
"user_pref(\"browser.newtabpage.activity-stream.feeds.section.topstories\", false);\n"
+
"user_pref(\"browser.newtabpage.activity-stream.default.sites\", \"http://planet.i2p/,http://legwork.i2p/,http://i2pwiki.i2p/,http://i2pforums.i2p/,http://zzz.i2p/\");\n"
+
"user_pref(\"browser.newtabpage.activity-stream.feeds.topsites\", true);\n"
+ "user_pref(\"browser.fixup.domainsuffixwhitelist.i2p\", true);\n";
private String userChromeCSS() {
String ret =
"@namespace url(\"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul\")\n";
@ -99,19 +138,24 @@ public class I2PFirefoxProfileBuilder extends I2PFirefoxProfileChecker {
* @return the profile directory, or null if it could not be created
*/
// public String profileDirectory() {
// return profileDirectory("I2P_FIREFOX_PROFILE", "firefox", false);
// return profileDirectory("I2P_FIREFOX_PROFILE", "firefox", false);
// }
private String baseProfileDir(String file, String base) {
private String baseProfileDir(String file, String base,
boolean isTorBrowser) {
File profileDir = new File(file, "i2p.firefox." + base + ".profile");
// make sure the directory exists
if (profileDir.exists()) {
return profileDir.getAbsolutePath();
} else {
// create the directory
I2PFirefoxProfileUnpacker unpacker = new I2PFirefoxProfileUnpacker();
if (!unpacker.unpackProfile(profileDir.getAbsolutePath(), base)) {
return null;
if (!isTorBrowser) {
if (!this.unpackProfile(profileDir.getAbsolutePath(), "firefox",
base)) {
return null;
}
} else {
makeTBBDirectory(profileDir, profileDir);
}
return profileDir.getAbsolutePath();
}
@ -122,21 +166,20 @@ public class I2PFirefoxProfileBuilder extends I2PFirefoxProfileChecker {
*
* @return the base profile directory, or null if it could not be created
*/
public String baseProfileDirectory(String base) {
public String baseProfileDirectory(String base, boolean isTorBrowser) {
String pd = System.getenv("I2P_FIREFOX_BASE_PROFILE");
if (pd != null && !pd.isEmpty()) {
File pdf = new File(pd);
if (pdf.exists() && pdf.isDirectory()) {
return pd;
} else {
I2PFirefoxProfileUnpacker unpacker = new I2PFirefoxProfileUnpacker();
if (!unpacker.unpackProfile(pdf.getAbsolutePath(), base)) {
if (!this.unpackProfile(pdf.getAbsolutePath(), "firefox", base)) {
return null;
}
}
}
String rtd = runtimeDirectory();
return baseProfileDir(rtd, base);
return baseProfileDir(rtd, base, isTorBrowser);
}
/**
@ -177,11 +220,10 @@ public class I2PFirefoxProfileBuilder extends I2PFirefoxProfileChecker {
*
* @since 0.0.1
*/
public boolean copyBaseProfiletoProfile(String base, boolean app) {
String baseProfile = baseProfileDirectory(base);
public boolean copyBaseProfiletoProfile(String base, boolean app,
boolean isTorBrowser) {
String baseProfile = baseProfileDirectory(base, isTorBrowser);
String profile = profileDirectory(app, base);
logger.info("Copying base profile to profile directory: " + baseProfile +
" -> " + profile);
if (baseProfile.isEmpty() || profile.isEmpty()) {
return false;
}
@ -190,24 +232,31 @@ public class I2PFirefoxProfileBuilder extends I2PFirefoxProfileChecker {
if (!profileDir.exists()) {
try {
logger.info("Copying base profile to profile directory");
copyDirectory(baseProfileDir, profileDir, "firefox", base);
if (!isTorBrowser) {
logger.info("Copying base profile to profile directory: " +
baseProfile + " -> " + profile);
copyDirectory(baseProfileDir, profileDir, "firefox", base);
} else {
logger.info("Creating base directory for use with Tor Browser");
makeTBBDirectory(baseProfileDir, profileDir);
}
logger.info("Copied base profile to profile directory");
return true;
} catch (Exception e) {
logger.info("Error copying base profile to profile" + e);
return false;
}
logger.info("Copied base profile to profile directory");
}
// if user.js does not exist yet, make an empty one.
// if (!touch(profileDir.toString(), "user.js")) {
// return false;
//}
// }
// if extensions does not exist yet, make an empty one.
// if (!mkExtensionsDir(profileDir.toString())){
// return false;
//}
// }
return copyStrictOptions(base, app);
return copyStrictOptions(base, app, isTorBrowser);
}
protected boolean writeAppChrome(String profile) {
@ -223,6 +272,7 @@ public class I2PFirefoxProfileBuilder extends I2PFirefoxProfileChecker {
}
return true;
}
protected boolean deleteAppChrome(String profile) {
File dir = new File(profile, "chrome");
if (!dir.exists())
@ -232,15 +282,17 @@ public class I2PFirefoxProfileBuilder extends I2PFirefoxProfileChecker {
f.delete();
return true;
}
/**
* Copy the strict options from the base profile to the profile
*
* @return true if successful, false otherwise
* @since 0.0.1
*/
public boolean copyStrictOptions(String base, boolean app) {
public boolean copyStrictOptions(String base, boolean app,
boolean isTorBrowser) {
logger.info("Checking strict options");
String baseProfile = baseProfileDirectory(base);
String baseProfile = baseProfileDirectory(base, isTorBrowser);
String profile = profileDirectory(app, base);
if (baseProfile.isEmpty() || profile.isEmpty()) {
logger.info("Empty paths");
@ -249,8 +301,8 @@ public class I2PFirefoxProfileBuilder extends I2PFirefoxProfileChecker {
File baseProfileDir = new File(baseProfile);
File profileDir = new File(profile);
setupUserChrome(profileDir, app);
if (!baseProfileDir.exists() || !profileDir.exists()) {
logger.info("Empty directories");
if (!baseProfileDir.exists()) {
logger.info("Empty base directories: " + baseProfileDir);
return false;
}
File baseOverrides = new File(baseProfile, "strict-overrides.js");
@ -317,6 +369,20 @@ public class I2PFirefoxProfileBuilder extends I2PFirefoxProfileChecker {
}
}
protected void makeTBBDirectory(File sourceDir, File destDir) {
logger.info("creating TBB directory");
if (!destDir.exists())
destDir.mkdir();
File workUserJs = new File(destDir, "user.js");
// Write the value of TBB_BASE to the file workUserJs
try (FileWriter writer = new FileWriter(workUserJs)) {
logger.info("writing TBB user.js");
writer.write(TBB_BASE);
} catch (IOException e) {
logger.info("Error writing to file: " + e.getMessage());
}
}
/**
* Construct a new Profile Builder
*
@ -326,6 +392,7 @@ public class I2PFirefoxProfileBuilder extends I2PFirefoxProfileChecker {
/**
* Construct a new Profile Builder
*
* @param strict if true, the strict overrides will be copied to the profile
*
* @since 0.0.1

View File

@ -1,41 +0,0 @@
package net.i2p.i2pfirefox;
/**
* I2PFirefoxProfileUnpacker.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the MIT License. See LICENSE.md for details.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* I2PFirefoxProfileUnpacker is a class that unpacks the I2P Firefox profile
* from a zip file embedded in the `jar` file. The zip is unpacked to a base
* directory where it is left untouched, and the base profile is copied to the
* active profile directory.
*
* @author idk
* @since 0.0.1
*/
public class I2PFirefoxProfileUnpacker extends I2PFirefoxProfileBuilder {
public static void main(String[] args) {
I2PFirefoxProfileUnpacker up = new I2PFirefoxProfileUnpacker();
String profileDirectory = up.profileDirectory(false, "base");
if (profileDirectory == null) {
up.logger.info("No profile directory found");
return;
}
}
/**
* unpack the profile directory
*
* @return true if the profile directory was successfully unpacked
* @since 0.0.1
*/
public boolean unpackProfile(String profileDirectory, String base) {
return unpackProfile(profileDirectory, "firefox", base);
}
}

View File

@ -4,7 +4,6 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

View File

@ -1,8 +1,5 @@
package net.i2p.i2pfirefox;
import java.io.*;
import javax.script.*;
/**
* I2PLibreWolf.java
* Copyright (C) 2022 idk <hankhill19580@gmail.com>

View File

@ -116,7 +116,7 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
_log.info("I2P Browser tray manager not supported");
try {
I2PBrowser i2pBrowser = new I2PBrowser(profileDir.getAbsolutePath());
String[] args = {"http://proxy.i2p"};
String[] args = {"http://127.0.0.1:7657"};
i2pBrowser.launchFirefox(0, args);
} catch (Exception e) {
_log.error("Error starting I2P Browser", e);
@ -124,10 +124,10 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
} else {
try {
_log.info(
"Starting I2P Browser tray manager by testing http://proxy.i2p");
"Starting I2P Browser tray manager by testing http://127.0.0.1:7657");
MenuService dtg = startTrayApp();
try {
Thread.sleep(1000);
Thread.sleep(5000);
} catch (InterruptedException ie) {
}
if (dtg != null) {
@ -144,7 +144,7 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
_log.info("I2P Browser tray manager not found");
}
I2PBrowser i2pBrowser = new I2PBrowser(profileDir.getAbsolutePath());
String[] args = {"http://proxy.i2p"};
String[] args = {"http://127.0.0.1:7657"};
i2pBrowser.launchFirefox(0, args);
} catch (Exception e) {
_log.error("Error starting I2P Browser tray manager", e);
@ -190,8 +190,8 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
// Ubuntu GNOME does not work, SystemTray.isSupported() returns false
String xdg = System.getenv("XDG_CURRENT_DESKTOP");
boolean dflt = SystemVersion.isWindows() || SystemVersion.isMac() ||
//"XFCE".equals(xdg) ||
"KDE".equals(xdg) || "LXDE".equals(xdg);
"XFCE".equals(xdg) || "KDE".equals(xdg) ||
"LXDE".equals(xdg);
return _context.getProperty(PROP_DTG_ENABLED, dflt);
}
@ -211,7 +211,7 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
_log.info("I2P Browser starting up");
try {
I2PBrowser i2pBrowser = new I2PBrowser(profileDir.getAbsolutePath());
String[] args = {"http://proxy.i2p"};
String[] args = {"http://127.0.0.1:7657"};
i2pBrowser.launchFirefox(0, args);
} catch (Exception e) {
_log.error("Error starting I2P Browser", e);
@ -235,7 +235,7 @@ public class I2PBrowserPlugin extends I2PBrowser implements ClientApp {
try {
I2PBrowser i2pBrowser = new I2PBrowser(profileDir.getAbsolutePath());
i2pBrowser.usability = true;
String[] args = {"http://proxy.i2p"};
String[] args = {"http://127.0.0.1:7657"};
i2pBrowser.launchFirefox(0, args);
} catch (Exception e) {
_log.error("Error starting I2P Browser", e);

View File

@ -19,11 +19,6 @@ user_pref("extensions.torlauncher.start_tor", false);
//user_pref("extensions.torlauncher.default_bridge_type", "");
user_pref("extensions.torlauncher.prompt_at_startup", false);
// Resist-fingerprinting and first-party isolation enable
user_pref("privacy.resistFingerprinting", true);
user_pref("privacy.firstparty.isolate", true);
// Use i2p http proxy for all connections and set homepage to safe local form.
// DON'T allow access to the admin panel from the profile we browse i2p with.
@ -39,7 +34,6 @@ user_pref("network.proxy.socks", "127.0.0.1");
user_pref("network.proxy.socks_port", 4444);
user_pref("network.proxy.share_proxy_settings", true);
user_pref("browser.startup.homepage", "about:blank");
user_pref("dom.security.https_only_mode", false);
user_pref("keyword.enabled", false);
user_pref("extensions.allowPrivateBrowsingByDefault", true);
user_pref("extensions.PrivateBrowsing.notification", false);
@ -51,17 +45,8 @@ user_pref("browser.newtabpage.activity-stream.feeds.section.highlights", false);
user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false);
user_pref("browser.newtabpage.activity-stream.default.sites", "http://planet.i2p/,http://legwork.i2p/,http://i2pwiki.i2p/,http://i2pforums.i2p/,http://zzz.i2p/");
user_pref("browser.newtabpage.activity-stream.feeds.topsites", true);
user_pref("ui.use_standins_for_native_colors", true);
user_pref("webgl.disable-extensions", true);
user_pref("webgl.min_capability_mode", true);
user_pref("webgl.disable-fail-if-major-performance-caveat", true);
user_pref("webgl.enable-webgl2", false);
user_pref("media.navigator.enabled", false);
user_pref("dom.w3c_touch_events.enabled", false);
user_pref("browser.privatebrowsing.autostart", false);
user_pref("browser.display.use_system_colors", false);
user_pref("dom.image-lazy-loading.enabled", false);
user_pref("extensions.autoDisableScopes", 0);
user_pref("extensions.enabledScopes", 1);
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", false);
user_pref("browser.fixup.domainsuffixwhitelist.i2p", true);
user_pref("browser.fixup.domainsuffixwhitelist.i2p", true);
// Allow extensions ONLY from the profile directory
user_pref("extensions.enabledScopes", 1); // [HIDDEN PREF]
user_pref("extensions.autoDisableScopes", 0); // [HIDDEN PREF]

2
src/usability.properties Normal file
View File

@ -0,0 +1,2 @@
main-class=net.i2p.i2pfirefox.I2PBrowser
arguments=-usability

View File

@ -172,8 +172,6 @@ user_pref("dom.serviceWorkers.enabled", false);
user_pref("dom.serviceWorkers.interception.enabled", false);
user_pref("dom.storage.enabled", false);
user_pref("dom.webaudio.enabled", false);
user_pref("extensions.autoDisableScopes", 0);
user_pref("extensions.enabledScopes", 1);
user_pref("extensions.getAddons.cache.enabled", false);
user_pref("extensions.getAddons.showPane", false);
user_pref("extensions.pocket.enabled", false);
@ -228,4 +226,22 @@ user_pref("dom.w3c_touch_events.enabled", false);
user_pref("browser.privatebrowsing.autostart", false);
user_pref("browser.display.use_system_colors", false);
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", false);
user_pref("browser.fixup.domainsuffixwhitelist.i2p", true);
user_pref("browser.fixup.domainsuffixwhitelist.i2p", true);
user_pref("ui.use_standins_for_native_colors", true);
user_pref("webgl.disable-extensions", true);
user_pref("webgl.min_capability_mode", true);
user_pref("webgl.disable-fail-if-major-performance-caveat", true);
user_pref("webgl.enable-webgl2", false);
user_pref("media.navigator.enabled", false);
user_pref("dom.w3c_touch_events.enabled", false);
user_pref("browser.privatebrowsing.autostart", false);
user_pref("browser.display.use_system_colors", false);
user_pref("dom.image-lazy-loading.enabled", false);
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", false);
user_pref("dom.security.https_only_mode", false);
// Resist-fingerprinting and first-party isolation enable
user_pref("privacy.resistFingerprinting", true);
user_pref("privacy.firstparty.isolate", true);

View File

@ -1,35 +0,0 @@
#! /usr/bin/env sh
ant distclean
ant jar
rm -rf i2p.chromium.base.profile i2p.chromium.profile i2p.firefox.base.profile i2p.firefox.profile i2p.firefox.usability.profile tor-browser_en-US
echo "Testing Chromium with no private and no URL parameters."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -nosystray -chromium 2> chrome.1.err 1> chrome.1.log
echo "Testing Chromium with local URL parameter."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -nosystray -chromium "http://127.0.0.1:7657" 2> chrome.1.err 1> chrome.1.log
echo "Testing Chromium with remote URL parameter."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -nosystray -chromium "http://idk.i2p" 2> chrome.2.err 1> chrome.2.log
echo "Testing Chromium with remote AND local URL parameter."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -nosystray -chromium "http://127.0.0.1:7657" "http://idk.i2p" 2> fox.3.err 1> fox.3.log
echo "Testing Chromium with private browsing parameter"
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -nosystray -chromium -private "http://127.0.0.1:7657" 2> chrome.4.err 1> chrome.4.log
echo "Chromium tests completed"
sleep 2s
rm -rf i2p.chromium.base.profile i2p.chromium.profile
echo "Testing Chromium with no private and no URL parameters."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -nosystray -chromium -usability 2> chrome.1.err 1> chrome.1.log
echo "Testing Chromium with local URL parameter."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -nosystray -chromium -usability "http://127.0.0.1:7657" 2> chrome.1.err 1> chrome.1.log
echo "Testing Chromium with remote URL parameter."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -nosystray -chromium -usability "http://idk.i2p" 2> chrome.2.err 1> chrome.2.log
echo "Testing Chromium with remote AND local URL parameter."
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -nosystray -chromium -usability "http://127.0.0.1:7657" "http://idk.i2p" 2> fox.3.err 1> fox.3.log
echo "Testing Chromium with private browsing parameter"
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PBrowser -nosystray -chromium -usability -private "http://127.0.0.1:7657" 2> chrome.4.err 1> chrome.4.log
echo "Chromium Usability-Mode tests completed"
rm -rf i2p.chromium.base.profile i2p.chromium.profile i2p.firefox.base.profile i2p.firefox.profile i2p.firefox.usability.profile

43
tools.sh Executable file
View File

@ -0,0 +1,43 @@
#! /usr/bin/env sh
. ./config.sh
#./preprelease.sh
github-release release --user "${GITHUB_USER}" \
--repo "${GITHUB_REPO}" \
--name "Build Tools" \
--description "binaries required for generating the profiles" \
--tag "build-tools"; true
echo "Uploading generated build-tools"
sleep 2s
torsum=$(sha256sum $HOME/go/bin/crx3 | sed "s|$HOME||g")
echo "$torsum"
github-release upload --user "${GITHUB_USER}" \
--replace \
--repo "${GITHUB_REPO}" \
--tag "build-tools" \
--label "crx3 for Linux. ${torsum}" \
--name "crx3-linux" \
--file "$HOME/go/bin/crx3"
echo "Uploaded crx3 linux package"
torsum=$(sha256sum $HOME/go/bin/darwin_amd64/crx3 | sed "s|$HOME||g")
echo "$torsum"
github-release upload --user "${GITHUB_USER}" \
--replace \
--repo "${GITHUB_REPO}" \
--tag "build-tools" \
--label "crx3 for Mac. ${torsum}" \
--name "crx3-osx" \
--file "$HOME/go/bin/darwin_amd64/crx3"
echo "Uploaded crx3 mac package"
torsum=$(sha256sum $HOME/go/bin/windows_amd64/crx3.exe | sed "s|$HOME||g")
echo "$torsum"
github-release upload --user "${GITHUB_USER}" \
--replace \
--repo "${GITHUB_REPO}" \
--tag "build-tools" \
--label "crx3 for Windows. ${torsum}" \
--name "crx3.exe" \
--file "$HOME/go/bin/windows_amd64/crx3.exe"
echo "Uploaded crx3 windows package"
git pull github --tags
git push --all