Compare commits

...

35 Commits
0.0.5 ... 0.0.6

Author SHA1 Message Date
idk
292cac5e67 update heading 2022-08-08 20:12:02 -04:00
idk
f6c8408f80 update CHANGES.html 2022-08-08 20:10:24 -04:00
idk
fb30909e3a update launcher script to self-discover jar. add some build targets of convenience 2022-08-08 20:10:10 -04:00
idk
5c66b64671 update LICENSE.html 2022-08-08 18:53:03 -04:00
idk
a87a003ceb update I2PFirefoxProfileUnpacker.html 2022-08-08 18:53:00 -04:00
idk
3b68756a32 update I2PFirefoxProfileChecker.html 2022-08-08 18:52:56 -04:00
idk
17b6922728 update I2PFirefoxProfileBuilder.html 2022-08-08 18:52:53 -04:00
idk
49d9acc383 update I2PFirefox.html 2022-08-08 18:52:49 -04:00
idk
529d763e7a update I2PChromiumProfileUnpacker.html 2022-08-08 18:52:46 -04:00
idk
582699ce1f update I2PChromiumProfileChecker.html 2022-08-08 18:52:42 -04:00
idk
6f5390eacd update I2PChromiumProfileBuilder.html 2022-08-08 18:52:38 -04:00
idk
db45db7058 update I2PChromium.html 2022-08-08 18:52:35 -04:00
idk
9693b1383f update CHANGES.html 2022-08-08 18:52:31 -04:00
idk
839d6fddb3 update index.html 2022-08-08 18:52:27 -04:00
idk
7638e5cfec update index.html 2022-08-08 15:29:47 -04:00
idk
b66e8690e2 add javadoc error reports 2022-08-08 13:28:46 -04:00
idk
ce9aeb3b19 add chromium targets to distclean 2022-08-08 13:23:44 -04:00
idk
417fd68f91 update LICENSE.html 2022-08-08 13:18:18 -04:00
idk
3468cbd637 update I2PFirefoxProfileUnpacker.html 2022-08-08 13:18:13 -04:00
idk
acf24565c6 update I2PFirefoxProfileChecker.html 2022-08-08 13:18:08 -04:00
idk
3c505187e7 update I2PFirefoxProfileBuilder.html 2022-08-08 13:18:03 -04:00
idk
cf9ecca991 update I2PFirefox.html 2022-08-08 13:17:59 -04:00
idk
350cab1d33 update I2PChromiumProfileUnpacker.html 2022-08-08 13:17:56 -04:00
idk
717dda7d0b update I2PChromiumProfileChecker.html 2022-08-08 13:17:52 -04:00
idk
f5da9b7ca3 update I2PChromiumProfileBuilder.html 2022-08-08 13:17:48 -04:00
idk
0a17f89b83 update I2PChromium.html 2022-08-08 13:17:43 -04:00
idk
12e82c3d74 update CHANGES.html 2022-08-08 13:17:40 -04:00
idk
eed2811920 update index.html 2022-08-08 13:17:36 -04:00
idk
6e92fcc976 generate markdown from javadoc 2022-08-08 13:17:25 -04:00
idk
8d075794c2 Good morning. 2022-08-08 01:45:11 -04:00
idk
169a3ec988 Adds enough Chromium support that all that needs to be added is extensions 2022-08-08 01:43:30 -04:00
idk
6df7706964 Adds enough Chromium support that all that needs to be added is extensions 2022-08-08 01:38:40 -04:00
idk
b47093009a Adds enough Chromium support that all that needs to be added is extensions 2022-08-08 01:37:52 -04:00
idk
752d7a96d8 Maybe chromium too what the hell 2022-08-07 23:55:25 -04:00
idk
3804c542ad sync tags in releaser script 2022-08-07 22:57:40 -04:00
39 changed files with 12434 additions and 26 deletions

5
.gitignore vendored
View File

@ -3,3 +3,8 @@ src/i2p.firefox.base.profile.zip
*.su3 *.su3
*.xpi2p *.xpi2p
*.zip *.zip
generated/
i2p.chromium.base.profile
i2p.firefox.base.profile
i2p.chromium/profile
i2p.firefox.profile

52
CHANGES.html Normal file → Executable file
View File

@ -7,6 +7,7 @@
<meta name="description" content="i2p.plugins.firefox" /> <meta name="description" content="i2p.plugins.firefox" />
<meta name="keywords" content="main" /> <meta name="keywords" content="main" />
<link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="showhider.css" />
</head> </head>
<body> <body>
<div id="navbar"> <div id="navbar">
@ -26,6 +27,46 @@
CHANGES CHANGES
</a> </a>
</li> </li>
<li>
<a href="I2PChromium.html">
I2PChromium
</a>
</li>
<li>
<a href="I2PChromiumProfileBuilder.html">
I2PChromiumProfileBuilder
</a>
</li>
<li>
<a href="I2PChromiumProfileChecker.html">
I2PChromiumProfileChecker
</a>
</li>
<li>
<a href="I2PChromiumProfileUnpacker.html">
I2PChromiumProfileUnpacker
</a>
</li>
<li>
<a href="I2PFirefox.html">
I2PFirefox
</a>
</li>
<li>
<a href="I2PFirefoxProfileBuilder.html">
I2PFirefoxProfileBuilder
</a>
</li>
<li>
<a href="I2PFirefoxProfileChecker.html">
I2PFirefoxProfileChecker
</a>
</li>
<li>
<a href="I2PFirefoxProfileUnpacker.html">
I2PFirefoxProfileUnpacker
</a>
</li>
<li> <li>
<a href="LICENSE.html"> <a href="LICENSE.html">
LICENSE LICENSE
@ -39,6 +80,17 @@
</div> </div>
</div> </div>
</div> </div>
<h2>
Mon, August 8
</h2>
<ul>
<li>
Add Chromium support. You heard me. Chromium support.
</li>
<li>
Update launcher script so it self-discovers the location of the script and uses that to find the bundled jar.
</li>
</ul>
<h2> <h2>
Sun, August 7 Sun, August 7
</h2> </h2>

6
CHANGES.md Normal file → Executable file
View File

@ -1,3 +1,9 @@
Mon, August 8
-------------
- Add Chromium support. You heard me. Chromium support.
- Update launcher script so it self-discovers the location of the script and uses that to find the bundled jar.
Sun, August 7 Sun, August 7
------------- -------------

1551
I2PChromium.html Normal file

File diff suppressed because it is too large Load Diff

246
I2PChromium.md Normal file
View File

@ -0,0 +1,246 @@
# Class I2PChromium [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java)
>
Access: public
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.File</li>
<li>java.io.IOException</li>
<li>java.net.Socket</li>
<li>java.util.ArrayList</li>
</ul>
</details>
## Member Variables
#### String[] CHROMIUM_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L)
>
+ Access: private
+ Modifiers: final
#### int DEFAULT_TIMEOUT [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L)
>
+ Access: private
+ Modifiers: final
## Methods
### FIND_CHROMIUM_SEARCH_PATHS_UNIX [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L31)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIND_CHROMIUM_SEARCH_PATHS_OSX [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L44)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIND_CHROMIUM_SEARCH_PATHS_WINDOWS [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L57)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIND_ALL_CHROMIUM_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L87)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIND_CHROMIUM_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L107)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### NEARBY_CHROMIUM_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L121)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### CHROMIUM_FINDER [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L165)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### getOperatingSystem [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L177)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
This method has no parameters.
### onlyValidChromiums [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L199)
+ Description:
+ Access: public
+ return: String[]
This method has no parameters.
### topChromium [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L217)
+ Description:
+ Access: public
+ return: String
This method has no parameters.
### topChromium [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L246)
+ Description:
+ Access: public
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| overrideChromium | String | |
### defaultProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L264)
+ Description:
+ Access: public
+ return: ProcessBuilder
This method has no parameters.
### processBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L301)
+ Description:
+ Access: public
+ return: ProcessBuilder
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L340)
+ Description:
+ Access: public
+ return: boolean
This method has no parameters.
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L352)
+ Description:
+ Access: public
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L364)
+ Description:
+ Access: public
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | |
| port | int | |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L377)
+ Description:
+ Access: public
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | |
| port | int | |
| host | String | |
### checkifPortIsOccupied [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L390)
+ Description:
+ Access: private
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| port | int | |
| host | String | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L408)
+ Description:
+ Access: public
+ return: void
This method has no parameters.
### main [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L441)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,161 @@
# Class I2PChromiumProfileBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java)
>
Access: public
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.File</li>
<li>java.io.FileInputStream</li>
<li>java.io.FileOutputStream</li>
<li>java.io.IOException</li>
<li>java.io.InputStream</li>
<li>java.io.OutputStream</li>
<li>java.nio.file.Files</li>
<li>java.nio.file.StandardCopyOption</li>
</ul>
</details>
## Member Variables
#### boolean strict [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L)
>
+ Access: private
+ Modifiers: static
## Methods
### profileDir [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L15)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| file | String | |
### profileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L25)
+ Description:
+ Access: public
+ Modifiers: static
+ return: String
This method has no parameters.
### baseProfileDir [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L37)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| file | String | |
### baseProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L57)
+ Description:
+ Access: public
+ Modifiers: static
+ return: String
This method has no parameters.
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L81)
+ Description:
+ Access: public
+ Modifiers: static
+ return: File
| Name | Type | Description |
| ----- | ----- | ----- |
| create | boolean | |
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L98)
+ Description:
+ Access: public
+ Modifiers: static
+ return: String
This method has no parameters.
### copyBaseProfiletoProfile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L144)
+ Description:
+ Access: public
+ Modifiers: static
+ return: boolean
This method has no parameters.
### copyDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L174)
+ Description:
+ Access: private
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| sourceDirectory | File | |
| destinationDirectory | File | |
### copyDirectoryCompatibityMode [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L184)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| source | File | |
| destination | File | |
### copyFile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L192)
+ Description:
+ Access: private
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| sourceFile | File | |
| destinationFile | File | |
### copyStrictOptions [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L209)
+ Description:
+ Access: public
+ Modifiers: static
+ return: boolean
This method has no parameters.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,70 @@
# Class I2PChromiumProfileChecker [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java)
>
Access: public
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.File</li>
</ul>
</details>
## No member variables in this class
## Methods
### main [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L6)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
### validateProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L20)
+ Description:
+ Access: public
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| profileDirectory | String | |
### validateFile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L44)
+ Description:
+ Access: public
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| file | String | |
### validateExtensionDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L64)
+ Description:
+ Access: public
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| extensionDirectory | String | |

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
# Class I2PChromiumProfileUnpacker [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java)
>
Access: public
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.File</li>
<li>java.io.InputStream</li>
<li>java.nio.file.Files</li>
<li>java.nio.file.StandardCopyOption</li>
<li>java.util.zip.ZipEntry</li>
<li>java.util.zip.ZipInputStream</li>
</ul>
</details>
## No member variables in this class
## Methods
### main [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java#L12)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
### unpackProfile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java#L27)
+ Description:
+ Access: public
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| profileDirectory | String | |

1551
I2PFirefox.html Normal file

File diff suppressed because it is too large Load Diff

246
I2PFirefox.md Normal file
View File

@ -0,0 +1,246 @@
# Class I2PFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java)
>
Access: public
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.File</li>
<li>java.io.IOException</li>
<li>java.net.Socket</li>
<li>java.util.ArrayList</li>
</ul>
</details>
## Member Variables
#### String[] FIREFOX_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L)
>
+ Access: private
+ Modifiers: final
#### int DEFAULT_TIMEOUT [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L)
>
+ Access: private
+ Modifiers: final
## Methods
### FIND_FIREFOX_SEARCH_PATHS_UNIX [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L30)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIND_FIREFOX_SEARCH_PATHS_OSX [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L43)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIND_FIREFOX_SEARCH_PATHS_WINDOWS [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L56)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIND_ALL_FIREFOX_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L84)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIND_FIREFOX_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L104)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### NEARBY_FIREFOX_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L118)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIREFOX_FINDER [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L162)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### getOperatingSystem [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L174)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
This method has no parameters.
### onlyValidFirefoxes [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L196)
+ Description:
+ Access: public
+ return: String[]
This method has no parameters.
### topFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L214)
+ Description:
+ Access: public
+ return: String
This method has no parameters.
### topFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L243)
+ Description:
+ Access: public
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| overrideFirefox | String | |
### defaultProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L261)
+ Description:
+ Access: public
+ return: ProcessBuilder
This method has no parameters.
### processBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L275)
+ Description:
+ Access: public
+ return: ProcessBuilder
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L298)
+ Description:
+ Access: public
+ return: boolean
This method has no parameters.
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L310)
+ Description:
+ Access: public
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L322)
+ Description:
+ Access: public
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | |
| port | int | |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L335)
+ Description:
+ Access: public
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | |
| port | int | |
| host | String | |
### checkifPortIsOccupied [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L348)
+ Description:
+ Access: private
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| port | int | |
| host | String | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L366)
+ Description:
+ Access: public
+ return: void
This method has no parameters.
### main [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L399)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |

File diff suppressed because it is too large Load Diff

161
I2PFirefoxProfileBuilder.md Normal file
View File

@ -0,0 +1,161 @@
# Class I2PFirefoxProfileBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java)
>
Access: public
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.File</li>
<li>java.io.FileInputStream</li>
<li>java.io.FileOutputStream</li>
<li>java.io.IOException</li>
<li>java.io.InputStream</li>
<li>java.io.OutputStream</li>
<li>java.nio.file.Files</li>
<li>java.nio.file.StandardCopyOption</li>
</ul>
</details>
## Member Variables
#### boolean strict [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L)
>
+ Access: private
+ Modifiers: static
## Methods
### profileDir [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L15)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| file | String | |
### profileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L25)
+ Description:
+ Access: public
+ Modifiers: static
+ return: String
This method has no parameters.
### baseProfileDir [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L37)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| file | String | |
### baseProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L57)
+ Description:
+ Access: public
+ Modifiers: static
+ return: String
This method has no parameters.
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L81)
+ Description:
+ Access: public
+ Modifiers: static
+ return: File
| Name | Type | Description |
| ----- | ----- | ----- |
| create | boolean | |
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L98)
+ Description:
+ Access: public
+ Modifiers: static
+ return: String
This method has no parameters.
### copyBaseProfiletoProfile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L144)
+ Description:
+ Access: public
+ Modifiers: static
+ return: boolean
This method has no parameters.
### copyDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L174)
+ Description:
+ Access: private
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| sourceDirectory | File | |
| destinationDirectory | File | |
### copyDirectoryCompatibityMode [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L184)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| source | File | |
| destination | File | |
### copyFile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L192)
+ Description:
+ Access: private
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| sourceFile | File | |
| destinationFile | File | |
### copyStrictOptions [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L209)
+ Description:
+ Access: public
+ Modifiers: static
+ return: boolean
This method has no parameters.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,70 @@
# Class I2PFirefoxProfileChecker [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java)
>
Access: public
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.File</li>
</ul>
</details>
## No member variables in this class
## Methods
### main [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L6)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
### validateProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L20)
+ Description:
+ Access: public
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| profileDirectory | String | |
### validateFile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L52)
+ Description:
+ Access: public
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| file | String | |
### validateExtensionDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L72)
+ Description:
+ Access: public
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| extensionDirectory | String | |

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
# Class I2PFirefoxProfileUnpacker [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java)
>
Access: public
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.File</li>
<li>java.io.InputStream</li>
<li>java.nio.file.Files</li>
<li>java.nio.file.StandardCopyOption</li>
<li>java.util.zip.ZipEntry</li>
<li>java.util.zip.ZipInputStream</li>
</ul>
</details>
## No member variables in this class
## Methods
### main [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java#L12)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
### unpackProfile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java#L27)
+ Description:
+ Access: public
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| profileDirectory | String | |

41
LICENSE.html Normal file → Executable file
View File

@ -7,6 +7,7 @@
<meta name="description" content="i2p.plugins.firefox" /> <meta name="description" content="i2p.plugins.firefox" />
<meta name="keywords" content="main" /> <meta name="keywords" content="main" />
<link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="showhider.css" />
</head> </head>
<body> <body>
<div id="navbar"> <div id="navbar">
@ -26,6 +27,46 @@
CHANGES CHANGES
</a> </a>
</li> </li>
<li>
<a href="I2PChromium.html">
I2PChromium
</a>
</li>
<li>
<a href="I2PChromiumProfileBuilder.html">
I2PChromiumProfileBuilder
</a>
</li>
<li>
<a href="I2PChromiumProfileChecker.html">
I2PChromiumProfileChecker
</a>
</li>
<li>
<a href="I2PChromiumProfileUnpacker.html">
I2PChromiumProfileUnpacker
</a>
</li>
<li>
<a href="I2PFirefox.html">
I2PFirefox
</a>
</li>
<li>
<a href="I2PFirefoxProfileBuilder.html">
I2PFirefoxProfileBuilder
</a>
</li>
<li>
<a href="I2PFirefoxProfileChecker.html">
I2PFirefoxProfileChecker
</a>
</li>
<li>
<a href="I2PFirefoxProfileUnpacker.html">
I2PFirefoxProfileUnpacker
</a>
</li>
<li> <li>
<a href="LICENSE.html"> <a href="LICENSE.html">
LICENSE LICENSE

0
LICENSE.md Normal file → Executable file
View File

5
README.md Normal file → Executable file
View File

@ -24,10 +24,7 @@ To build just the jar. You'll know it worked if you can:
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PFirefox java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PFirefox
``` ```
and a new Firefox instance comes up with a fresh profile. This is just a default Firefox and a new Firefox instance comes up with a fresh profile, ready-to-use for I2P browsing.
profile, configuring it for I2P requires you to put a pre-configured Firefox profile into
the `i2p.firefox.base.profile` directory or otherwise supply a static, pre-configured
profile.
The cooler thing you can do with it is add it to an I2P distribution and somewhere in it, The cooler thing you can do with it is add it to an I2P distribution and somewhere in it,
add a UI element that triggers something along the lines of this: add a UI element that triggers something along the lines of this:

37
build.xml Normal file → Executable file
View File

@ -2,12 +2,16 @@
<project basedir="." default="all" name="i2pfirefox"> <project basedir="." default="all" name="i2pfirefox">
<property file="override.properties"/> <property file="override.properties"/>
<target name="all" depends="clean,i2pFirefoxBaseProfileZip,plugin" /> <target name="all" depends="clean,i2pFirefoxBaseProfileZip,i2pChromiumBaseProfileZip,plugin" />
<target name="war" > <target name="war" >
<ant dir="src" target="build" /> <ant dir="src" target="build" />
</target> </target>
<target name="jar" >
<ant dir="src" target="jar" />
</target>
<target name="i2pFirefoxBaseProfileZip"> <target name="i2pFirefoxBaseProfileZip">
<exec executable="rm" failonerror="false" dir="src"> <exec executable="rm" failonerror="false" dir="src">
<arg value="-rf" /> <arg value="-rf" />
@ -20,6 +24,32 @@
</exec> </exec>
</target> </target>
<target name="i2pChromiumBaseProfileZip">
<exec executable="rm" failonerror="false" dir="src">
<arg value="-rf" />
<arg value="i2p.chromium.base.profile.zip" />
</exec>
<exec executable="zip" failonerror="true" dir="src">
<arg value="-r"/>
<arg value="i2p.chromium.base.profile.zip"/>
<arg value="i2p.chromium.base.profile"/>
</exec>
</target>
<target name="freeZip" depends="jar">
<exec executable="rm" failonerror="false" dir="src">
<arg value="-rf" />
<arg value="i2pbrowser.zip" />
</exec>
<exec executable="zip" failonerror="true">
<arg value="-r"/>
<arg value="src/build/i2pfirefox.jar"/>
<arg value="i2pbrowser.cmd"/>
<arg value="LICENSE.md"/>
<arg value="README.md"/>
</exec>
</target>
<target name="plugin" depends="war"> <target name="plugin" depends="war">
<delete> <delete>
<!-- in installer but not update --> <!-- in installer but not update -->
@ -28,7 +58,7 @@
<delete dir="plugin/eepsite/docroot/torrents/" /> <delete dir="plugin/eepsite/docroot/torrents/" />
<!-- get version number --> <!-- get version number -->
<buildnumber file="scripts/build.number" /> <buildnumber file="scripts/build.number" />
<property name="release.number" value="0.0.5" /> <property name="release.number" value="0.0.6" />
<!-- make the update xpi2p --> <!-- make the update xpi2p -->
<!-- this contains everything except i2ptunnel.config --> <!-- this contains everything except i2ptunnel.config -->
@ -94,6 +124,9 @@
<delete dir="i2p.firefox.base.profile" /> <delete dir="i2p.firefox.base.profile" />
<delete dir="i2p.firefox.profile" /> <delete dir="i2p.firefox.profile" />
<delete dir="src/i2p.firefox.profile.zip" /> <delete dir="src/i2p.firefox.profile.zip" />
<delete dir="i2p.chromium.base.profile" />
<delete dir="i2p.chromium.profile" />
<delete dir="src/i2p.chromium.profile.zip" />
<delete file="plugin/i2ptunnel.config" /> <delete file="plugin/i2ptunnel.config" />
<delete file="plugin/plugin.config" /> <delete file="plugin/plugin.config" />
<delete file="plugin/i2pfirefox.config" /> <delete file="plugin/i2pfirefox.config" />

View File

@ -1,3 +1,3 @@
:; java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PFirefox; exit $? :; dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd); java -cp "$dir"/src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PFirefox; exit $?
@ECHO OFF @ECHO OFF
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PFirefox java -cp %cd%/src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PFirefox

0
i2plogo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

50
index.html Normal file → Executable file
View File

@ -7,6 +7,7 @@
<meta name="description" content="i2p.plugins.firefox" /> <meta name="description" content="i2p.plugins.firefox" />
<meta name="keywords" content="main" /> <meta name="keywords" content="main" />
<link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="showhider.css" />
</head> </head>
<body> <body>
<div id="navbar"> <div id="navbar">
@ -26,6 +27,46 @@
CHANGES CHANGES
</a> </a>
</li> </li>
<li>
<a href="I2PChromium.html">
I2PChromium
</a>
</li>
<li>
<a href="I2PChromiumProfileBuilder.html">
I2PChromiumProfileBuilder
</a>
</li>
<li>
<a href="I2PChromiumProfileChecker.html">
I2PChromiumProfileChecker
</a>
</li>
<li>
<a href="I2PChromiumProfileUnpacker.html">
I2PChromiumProfileUnpacker
</a>
</li>
<li>
<a href="I2PFirefox.html">
I2PFirefox
</a>
</li>
<li>
<a href="I2PFirefoxProfileBuilder.html">
I2PFirefoxProfileBuilder
</a>
</li>
<li>
<a href="I2PFirefoxProfileChecker.html">
I2PFirefoxProfileChecker
</a>
</li>
<li>
<a href="I2PFirefoxProfileUnpacker.html">
I2PFirefoxProfileUnpacker
</a>
</li>
<li> <li>
<a href="LICENSE.html"> <a href="LICENSE.html">
LICENSE LICENSE
@ -68,14 +109,7 @@ cd ..
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PFirefox java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PFirefox
</code></pre> </code></pre>
<p> <p>
and a new Firefox instance comes up with a fresh profile. This is just a default Firefox and a new Firefox instance comes up with a fresh profile, ready-to-use for I2P browsing.
profile, configuring it for I2P requires you to put a pre-configured Firefox profile into
the
<code>
i2p.firefox.base.profile
</code>
directory or otherwise supply a static, pre-configured
profile.
</p> </p>
<p> <p>
The cooler thing you can do with it is add it to an I2P distribution and somewhere in it, The cooler thing you can do with it is add it to an I2P distribution and somewhere in it,

10
javadoc.sh Executable file
View File

@ -0,0 +1,10 @@
#! /usr/bin/env bash
ant distclean
rm -rf docs
~/.cargo/bin/lojidoc src/java/net/i2p/i2pfirefox/ -s -l > report.log
~/.cargo/bin/lojidoc -c src/java/net/i2p/i2pfirefox/ -s
mv -v generated/net/i2p/i2pfirefox/*.md .
rm -rf generated
git add ./*.md

View File

@ -2,12 +2,11 @@
GITHUB_USER=eyedeekay GITHUB_USER=eyedeekay
GITHUB_REPO=i2p.plugins.firefox GITHUB_REPO=i2p.plugins.firefox
GITHUB_NAME="Initial Release" GITHUB_NAME="With a launcher script so you can run it without typing the full java command"
GITHUB_DESCRIPTION=$(cat CHANGES.md) GITHUB_DESCRIPTION=$(cat CHANGES.md)
GITHUB_TAG=0.0.5 GITHUB_TAG=0.0.6
ant distclean ant distclean
cd src && \ ant jar freeZip
ant
github-release release --user "${GITHUB_USER}" \ github-release release --user "${GITHUB_USER}" \
--repo "${GITHUB_REPO}" \ --repo "${GITHUB_REPO}" \
--name "${GITHUB_NAME}" \ --name "${GITHUB_NAME}" \
@ -18,13 +17,13 @@ github-release upload --user "${GITHUB_USER}" \
--repo "${GITHUB_REPO}" \ --repo "${GITHUB_REPO}" \
--tag "${GITHUB_TAG}" \ --tag "${GITHUB_TAG}" \
--name "i2pfirefox.jar" \ --name "i2pfirefox.jar" \
--file "build/i2pfirefox.jar" \ --file "src/build/i2pfirefox.jar" \
--replace --replace
cd ../
zip -r i2pfirefox.zip src/build/i2pfirefox.jar i2pbrowser.cmd LICENSE.md README.md
github-release upload --user "${GITHUB_USER}" \ github-release upload --user "${GITHUB_USER}" \
--repo "${GITHUB_REPO}" \ --repo "${GITHUB_REPO}" \
--tag "${GITHUB_TAG}" \ --tag "${GITHUB_TAG}" \
--name "i2pfirefox.zip" \ --name "i2pfirefox.zip" \
--file "i2pfirefox.zip" \ --file "i2pfirefox.zip" \
--replace --replace
git pull github --tags
git push --all

172
report.log Normal file
View File

@ -0,0 +1,172 @@
Generating documentation from src/java/net/i2p/i2pfirefox/
Javadoc errors for class I2PChromiumProfileChecker
File: src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java
 Missing description for method main (Line: 6)
 Javadoc parameter not found args in method: main (Line: 6)
 Missing description for method validateProfileDirectory (Line: 20)
 Javadoc parameter not found profileDirectory in method: validateProfileDirectory (Line: 20)
 Missing description for method validateFile (Line: 44)
 Javadoc parameter not found file in method: validateFile (Line: 44)
 Missing description for method validateExtensionDirectory (Line: 64)
 Javadoc parameter not found extensionDirectory in method: validateExtensionDirectory (Line: 64)
Javadoc errors for class I2PFirefoxProfileChecker
File: src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java
 Missing description for method main (Line: 6)
 Javadoc parameter not found args in method: main (Line: 6)
 Missing description for method validateProfileDirectory (Line: 20)
 Javadoc parameter not found profileDirectory in method: validateProfileDirectory (Line: 20)
 Missing description for method validateFile (Line: 52)
 Javadoc parameter not found file in method: validateFile (Line: 52)
 Missing description for method validateExtensionDirectory (Line: 72)
 Javadoc parameter not found extensionDirectory in method: validateExtensionDirectory (Line: 72)
Javadoc errors for class I2PFirefoxProfileBuilder
File: src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java
 Missing description for member variable strict (Line: )
 Missing description for method profileDir (Line: 15)
 Javadoc parameter not found file in method: profileDir (Line: 15)
 Missing description for method profileDirectory (Line: 25)
 Missing description for method baseProfileDir (Line: 37)
 Javadoc parameter not found file in method: baseProfileDir (Line: 37)
 Missing description for method baseProfileDirectory (Line: 57)
 Missing description for method runtimeDirectory (Line: 81)
 Javadoc parameter not found create in method: runtimeDirectory (Line: 81)
 Missing description for method runtimeDirectory (Line: 98)
 Missing description for method copyBaseProfiletoProfile (Line: 144)
 Missing description for method copyDirectory (Line: 174)
 Javadoc parameter not found sourceDirectory in method: copyDirectory (Line: 174)
 Javadoc parameter not found destinationDirectory in method: copyDirectory (Line: 174)
 Missing description for method copyDirectoryCompatibityMode (Line: 184)
 Javadoc parameter not found source in method: copyDirectoryCompatibityMode (Line: 184)
 Javadoc parameter not found destination in method: copyDirectoryCompatibityMode (Line: 184)
 Missing description for method copyFile (Line: 192)
 Javadoc parameter not found sourceFile in method: copyFile (Line: 192)
 Javadoc parameter not found destinationFile in method: copyFile (Line: 192)
 Missing description for method copyStrictOptions (Line: 209)
 Missing description for method  (Line: 246)
 Missing description for method  (Line: 256)
 Javadoc parameter not found strict in method: (Line: 256)
Javadoc errors for class I2PChromium
File: src/java/net/i2p/i2pfirefox/I2PChromium.java
 Missing description for member variable String[] CHROMIUM_SEARCH_PATHS (Line: )
 Missing return type for member variable String[] CHROMIUM_SEARCH_PATHS (Line: )
 Missing description for member variable int DEFAULT_TIMEOUT (Line: )
 Missing return type for member variable int DEFAULT_TIMEOUT (Line: )
 Missing description for method  (Line: 20)
 Missing description for method FIND_CHROMIUM_SEARCH_PATHS_UNIX (Line: 31)
 Missing description for method FIND_CHROMIUM_SEARCH_PATHS_OSX (Line: 44)
 Missing description for method FIND_CHROMIUM_SEARCH_PATHS_WINDOWS (Line: 57)
 Missing description for method FIND_ALL_CHROMIUM_SEARCH_PATHS (Line: 87)
 Missing description for method FIND_CHROMIUM_SEARCH_PATHS (Line: 107)
 Missing description for method NEARBY_CHROMIUM_SEARCH_PATHS (Line: 121)
 Missing description for method CHROMIUM_FINDER (Line: 165)
 Missing description for method getOperatingSystem (Line: 177)
 Missing description for method onlyValidChromiums (Line: 199)
 Missing description for method topChromium (Line: 217)
 Missing description for method topChromium (Line: 246)
 Javadoc parameter not found overrideChromium in method: topChromium (Line: 246)
 Missing description for method defaultProcessBuilder (Line: 264)
 Missing description for method processBuilder (Line: 301)
 Javadoc parameter not found args in method: processBuilder (Line: 301)
 Missing description for method waitForProxy (Line: 340)
 Missing description for method waitForProxy (Line: 352)
 Javadoc parameter not found timeout in method: waitForProxy (Line: 352)
 Missing description for method waitForProxy (Line: 364)
 Javadoc parameter not found timeout in method: waitForProxy (Line: 364)
 Javadoc parameter not found port in method: waitForProxy (Line: 364)
 Missing description for method waitForProxy (Line: 377)
 Javadoc parameter not found timeout in method: waitForProxy (Line: 377)
 Javadoc parameter not found port in method: waitForProxy (Line: 377)
 Javadoc parameter not found host in method: waitForProxy (Line: 377)
 Missing description for method checkifPortIsOccupied (Line: 390)
 Javadoc parameter not found port in method: checkifPortIsOccupied (Line: 390)
 Javadoc parameter not found host in method: checkifPortIsOccupied (Line: 390)
 Missing description for method launch (Line: 408)
 Missing description for method main (Line: 441)
 Javadoc parameter not found args in method: main (Line: 441)
Javadoc errors for class I2PFirefoxProfileUnpacker
File: src/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java
 Missing description for method main (Line: 12)
 Javadoc parameter not found args in method: main (Line: 12)
 Missing description for method unpackProfile (Line: 27)
 Javadoc parameter not found profileDirectory in method: unpackProfile (Line: 27)
Javadoc errors for class I2PChromiumProfileUnpacker
File: src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java
 Missing description for method main (Line: 12)
 Javadoc parameter not found args in method: main (Line: 12)
 Missing description for method unpackProfile (Line: 27)
 Javadoc parameter not found profileDirectory in method: unpackProfile (Line: 27)
Javadoc errors for class I2PChromiumProfileBuilder
File: src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java
 Missing description for member variable strict (Line: )
 Missing description for method profileDir (Line: 15)
 Javadoc parameter not found file in method: profileDir (Line: 15)
 Missing description for method profileDirectory (Line: 25)
 Missing description for method baseProfileDir (Line: 37)
 Javadoc parameter not found file in method: baseProfileDir (Line: 37)
 Missing description for method baseProfileDirectory (Line: 57)
 Missing description for method runtimeDirectory (Line: 81)
 Javadoc parameter not found create in method: runtimeDirectory (Line: 81)
 Missing description for method runtimeDirectory (Line: 98)
 Missing description for method copyBaseProfiletoProfile (Line: 144)
 Missing description for method copyDirectory (Line: 174)
 Javadoc parameter not found sourceDirectory in method: copyDirectory (Line: 174)
 Javadoc parameter not found destinationDirectory in method: copyDirectory (Line: 174)
 Missing description for method copyDirectoryCompatibityMode (Line: 184)
 Javadoc parameter not found source in method: copyDirectoryCompatibityMode (Line: 184)
 Javadoc parameter not found destination in method: copyDirectoryCompatibityMode (Line: 184)
 Missing description for method copyFile (Line: 192)
 Javadoc parameter not found sourceFile in method: copyFile (Line: 192)
 Javadoc parameter not found destinationFile in method: copyFile (Line: 192)
 Missing description for method copyStrictOptions (Line: 209)
 Missing description for method  (Line: 246)
 Missing description for method  (Line: 256)
 Javadoc parameter not found strict in method: (Line: 256)
Javadoc errors for class I2PFirefox
File: src/java/net/i2p/i2pfirefox/I2PFirefox.java
 Missing description for member variable String[] FIREFOX_SEARCH_PATHS (Line: )
 Missing return type for member variable String[] FIREFOX_SEARCH_PATHS (Line: )
 Missing description for member variable int DEFAULT_TIMEOUT (Line: )
 Missing return type for member variable int DEFAULT_TIMEOUT (Line: )
 Missing description for method  (Line: 19)
 Missing description for method FIND_FIREFOX_SEARCH_PATHS_UNIX (Line: 30)
 Missing description for method FIND_FIREFOX_SEARCH_PATHS_OSX (Line: 43)
 Missing description for method FIND_FIREFOX_SEARCH_PATHS_WINDOWS (Line: 56)
 Missing description for method FIND_ALL_FIREFOX_SEARCH_PATHS (Line: 84)
 Missing description for method FIND_FIREFOX_SEARCH_PATHS (Line: 104)
 Missing description for method NEARBY_FIREFOX_SEARCH_PATHS (Line: 118)
 Missing description for method FIREFOX_FINDER (Line: 162)
 Missing description for method getOperatingSystem (Line: 174)
 Missing description for method onlyValidFirefoxes (Line: 196)
 Missing description for method topFirefox (Line: 214)
 Missing description for method topFirefox (Line: 243)
 Javadoc parameter not found overrideFirefox in method: topFirefox (Line: 243)
 Missing description for method defaultProcessBuilder (Line: 261)
 Missing description for method processBuilder (Line: 275)
 Javadoc parameter not found args in method: processBuilder (Line: 275)
 Missing description for method waitForProxy (Line: 298)
 Missing description for method waitForProxy (Line: 310)
 Javadoc parameter not found timeout in method: waitForProxy (Line: 310)
 Missing description for method waitForProxy (Line: 322)
 Javadoc parameter not found timeout in method: waitForProxy (Line: 322)
 Javadoc parameter not found port in method: waitForProxy (Line: 322)
 Missing description for method waitForProxy (Line: 335)
 Javadoc parameter not found timeout in method: waitForProxy (Line: 335)
 Javadoc parameter not found port in method: waitForProxy (Line: 335)
 Javadoc parameter not found host in method: waitForProxy (Line: 335)
 Missing description for method checkifPortIsOccupied (Line: 348)
 Javadoc parameter not found port in method: checkifPortIsOccupied (Line: 348)
 Javadoc parameter not found host in method: checkifPortIsOccupied (Line: 348)
 Missing description for method launch (Line: 366)
 Missing description for method main (Line: 399)
 Javadoc parameter not found args in method: main (Line: 399)

10
showhider.css Normal file
View File

@ -0,0 +1,10 @@
/* edgar showhider CSS file */
#show {display:none; }
#hide {display:block; }
#show:target {display: block; }
#hide:target {display: none; }
#shownav {display:none; }
#hidenav {display:block; }
#shownav:target {display: block; }
#hidenav:target {display: none; }

View File

@ -0,0 +1 @@
Set up an extension loadout

View File

@ -0,0 +1 @@
put extensions here.

View File

@ -0,0 +1,446 @@
package net.i2p.i2pfirefox;
import java.io.File;
import java.io.IOException;
import java.net.Socket;
import java.util.ArrayList;
public class I2PChromium {
private final String[] CHROMIUM_SEARCH_PATHS = CHROMIUM_FINDER();
private final int DEFAULT_TIMEOUT = 200;
/*
* 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()) {
System.out.println("Found Chromium at " + path);
return;
}
}
}
private static String[] FIND_CHROMIUM_SEARCH_PATHS_UNIX(){
String[] path = new String[]{"/usr/bin", "/usr/local/bin", "/opt/chrome/bin","/snap/bin"};
String[] exes = new String[]{"ungoogled-chromium", "chromium", "brave", "edge", "ungoogled-chromium", "chrome"};
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 static String[] FIND_CHROMIUM_SEARCH_PATHS_OSX() {
String[] path = new String[]{"/Applications/Chromium.app/Contents/MacOS/", "/Applications/Waterfox.app/Contents/MacOS/", "/Applications/Librewolf.app/Contents/MacOS/"};
String[] exes = new String[]{"ungoogled-chromium", "chromium", "brave", "edge", "ungoogled-chromium", "chrome"};
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 static String[] FIND_CHROMIUM_SEARCH_PATHS_WINDOWS() {
String userHome = System.getProperty("user.home");
String programFiles = System.getenv("ProgramFiles");
String localAppData = System.getenv("LOCALAPPDATA");
String programFiles86 = System.getenv("ProgramFiles(x86)");
String[] path = 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(),
};
String[] exes = new String[]{"ungoogled-chromium.exe", "chromium.exe", "brave.exe", "edge.exe", "ungoogled-chromium.exe", "chrome.exe"};
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 static 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 static 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 static String[] NEARBY_CHROMIUM_SEARCH_PATHS() {
// obtain the PLUGIN environment variable
String plugin = System.getenv("PLUGIN");
// search the plugin directory for anything named "ungoogled-chromium", "chromium", "brave", "edge", "ungoogled-chromium", "chrome"
// up to a depth of 2 directories deep.
// list the directories in the plugin directory
if (plugin != null && !plugin.isEmpty()){
File pluginDir = new File(plugin);
if (pluginDir.exists()) {
File[] pluginDirs = pluginDir.listFiles();
// list the files in the plugin directory
for (File pluginDir1 : pluginDirs) {
File[] pluginFiles = pluginDir1.listFiles();
// list the files in the plugin directory
if (pluginFiles != null){
for (File pluginFile : pluginFiles) {
if (pluginFile.getName().equals("ungoogled-chromium") || pluginFile.getName().equals("chromium") || pluginFile.getName().equals("brave") || pluginFile.getName().equals("edge") || pluginFile.getName().equals("ungoogled-chromium") || pluginFile.getName().equals("chrome")) {
return new String[]{pluginFile.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()) {
File[] userDirs = userDir.listFiles();
// list the files in the user.dir directory
for (File userDir1 : userDirs) {
File[] userFiles = userDir1.listFiles();
// list the files in the user.dir directory
if (userFiles != null){
for (File userFile : userFiles) {
if (userFile.getName().equals("ungoogled-chromium") || userFile.getName().equals("chromium") || userFile.getName().equals("brave") || userFile.getName().equals("edge") || userFile.getName().equals("ungoogled-chromium") || userFile.getName().equals("chrome")) {
return new String[]{userFile.getAbsolutePath()};
}
}
}
}
}
return new String[]{};
}
private static 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[]{};
}
}
private static String getOperatingSystem() {
String os = System.getProperty("os.name");
if (os.startsWith("Windows")) {
return "Windows";
} else if (os.contains("Linux")) {
return "Linux";
} else if (os.contains("BSD")) {
return "BSD";
} else if (os.contains("Mac")) {
return "Mac";
}
return "Unknown";
}
/*
* 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()) {
validChromiums.add(chrome);
}
}
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
return chrome;
}
}
String[] chromees = onlyValidChromiums();
if (chromees.length > 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[]{});
}
/*
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()) {
String[] newArgs = new String[args.length+19];
newArgs[0] = chrome;
newArgs[1] = "--user-data-dir="+I2PChromiumProfileBuilder.profileDirectory();
newArgs[2] = "--proxy-server=http://127.0.0.1:4444";
newArgs[3] = "--proxy-bypass-list=http://localhost: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";
for (int i = 0; i < args.length; i++) {
newArgs[i+19] = args[i];
}
return new ProcessBuilder(newArgs).directory(I2PChromiumProfileBuilder.runtimeDirectory(true));
} else {
return new ProcessBuilder(args);
}
}
/*
* Waits for an HTTP proxy on port 4444 to be ready.
* Returns false on timeout of 200 seconds.
*
* @return true if the proxy is ready, false if it is not.
* @since 0.0.1
*/
public boolean waitForProxy() {
return waitForProxy(DEFAULT_TIMEOUT);
}
/*
* Waits for an HTTP proxy on port 4444 to be ready.
* Returns false on timeout of the specified number of seconds.
*
* @param timeout the number of seconds to wait for the proxy to be ready.
* @return true if the proxy is ready, false if it is not.
* @since 0.0.1
*/
public boolean waitForProxy(int timeout) {
return waitForProxy(timeout, 4444);
}
/*
* Waits for an HTTP proxy on the specified port to be ready.
* Returns false on timeout of the specified number of seconds.
*
* @param timeout the number of seconds to wait for the proxy to be ready.
* @param port the port to wait for the proxy to be ready on.
* @return true if the proxy is ready, false if it is not.
* @since 0.0.1
*/
public boolean waitForProxy(int timeout, int port) {
return waitForProxy(timeout, port, "localhost");
}
/*
* Waits for an HTTP proxy on the specified port to be ready.
* Returns false on timeout of the specified number of seconds.
*
* @param timeout the number of seconds to wait for the proxy to be ready.
* @param port the port to wait for the proxy to be ready on.
* @param host the host to wait for the proxy to be ready on.
* @return true if the proxy is ready, false if it is not.
* @since 0.0.1
*/
public boolean waitForProxy(int timeout, int port, String host) {
for (int i = 0; i < timeout; i++) {
if (checkifPortIsOccupied(port, host)) {
return true;
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
return false;
}
private boolean checkifPortIsOccupied(int port, String host) {
try {
Socket socket = new Socket(host, port);
socket.close();
return true;
} catch (IOException e) {
return false;
}
}
/*
* 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(){
String profileDirectory = I2PChromiumProfileBuilder.profileDirectory();
if (I2PChromiumProfileChecker.validateProfileDirectory(profileDirectory)) {
System.out.println("Valid profile directory: "+profileDirectory);
} else {
System.out.println("Invalid profile directory: "+profileDirectory+" rebuilding...");
if (!I2PChromiumProfileBuilder.copyBaseProfiletoProfile()) {
System.out.println("Failed to rebuild profile directory: "+profileDirectory);
return;
} else {
System.out.println("Rebuilt profile directory: "+profileDirectory);
}
}
if (waitForProxy()){
ProcessBuilder pb = this.defaultProcessBuilder();
Process p = null;
try{
System.out.println(pb.command());
p = pb.start();
}catch(Exception e){
System.out.println("Error: "+e.getMessage());
}finally{
System.out.println("I2PChromium");
try{
System.out.println("Waiting for I2PChromium to close...");
p.waitFor();
}catch(Exception e){
System.out.println("Error: "+e.getMessage());
}
}
}
}
public static void main(String[] args) {
System.out.println("I2PChromium");
I2PChromium i2pChromium = new I2PChromium();
i2pChromium.launch();
}
}

View File

@ -0,0 +1,259 @@
package net.i2p.i2pfirefox;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
public class I2PChromiumProfileBuilder {
private static boolean strict;
private static String profileDir(String file) {
File profileDir = new File(file, "i2p.chromium.profile");
return profileDir.getAbsolutePath();
}
/*
* get the profile directory, creating it if necessary
*
* @return the profile directory, or null if it could not be created
*/
public static String profileDirectory() {
String pd = System.getenv("I2P_FIREFOX_PROFILE");
if (pd != null && !pd.isEmpty()) {
File pdf = new File(pd);
if (pdf.exists() && pdf.isDirectory()) {
return pd;
}
}
String rtd = runtimeDirectory();
return profileDir(rtd);
}
private static String baseProfileDir(String file) {
File profileDir = new File(file, "i2p.chromium.base.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())) {
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 static String baseProfileDirectory() {
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{
I2PChromiumProfileUnpacker unpacker = new I2PChromiumProfileUnpacker();
if (!unpacker.unpackProfile(pdf.getAbsolutePath())) {
return null;
}
}
}
String rtd = runtimeDirectory();
return baseProfileDir(rtd);
}
/*
* 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 static File runtimeDirectory(boolean create) {
String rtd = runtimeDirectory();
File rtdFile = new File(rtd);
if (create) {
if (!rtdFile.exists()) {
rtdFile.mkdir();
}
}
return new File(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 static String runtimeDirectory() {
// get the I2P_FIREFOX_DIR environment variable
String rtd = System.getenv("I2P_FIREFOX_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 rtd;
}
}
// obtain the PLUGIN environment variable
String plugin = System.getenv("PLUGIN");
if (plugin != null && !plugin.isEmpty()) {
File pluginDir = new File(plugin);
if (pluginDir.exists()) {
return pluginDir.toString();
}
}
String userDir = System.getProperty("user.dir");
if (userDir != null && !userDir.isEmpty()) {
File userDir1 = new File(userDir);
if (userDir1.exists()) {
return userDir1.toString();
}
}
String homeDir = System.getProperty("user.home");
if (homeDir != null && !homeDir.isEmpty()) {
File homeDir1 = new File(homeDir+"/.i2p");
if (homeDir1.exists()) {
return homeDir.toString();
}
File homeDir2 = new File(homeDir+"/i2p");
if (homeDir2.exists()) {
return homeDir2.toString();
}
}
return "";
}
/*
* Copy the inert base profile directory to the runtime profile directory
*
* @since 0.0.1
*/
public static boolean copyBaseProfiletoProfile() {
String baseProfile = baseProfileDirectory();
String profile = profileDirectory();
System.out.println("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);
try {
System.out.println("Copying base profile to profile directory");
copyDirectory(baseProfileDir, profileDir);
} catch (Exception e) {
System.out.println("Error copying base profile to profile"+e);
return false;
}
System.out.println("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();
}
private static void copyDirectory(File sourceDirectory, File destinationDirectory) throws IOException {
destinationDirectory = new File(destinationDirectory.toString().replace("i2p.chromium.base.profile", ""));
if (!destinationDirectory.exists()) {
destinationDirectory.mkdir();
}
for (String f : sourceDirectory.list()) {
copyDirectoryCompatibityMode(new File(sourceDirectory, f), new File(destinationDirectory, f));
}
}
public static void copyDirectoryCompatibityMode(File source, File destination) throws IOException {
if (source.isDirectory()) {
copyDirectory(source, destination);
} else {
copyFile(source, destination);
}
}
private static void copyFile(File sourceFile, File destinationFile) throws IOException {
try (InputStream in = new FileInputStream(sourceFile);
OutputStream out = new FileOutputStream(destinationFile)) {
byte[] buf = new byte[1024];
int length;
while ((length = in.read(buf)) > 0) {
out.write(buf, 0, length);
}
}
}
/*
* Copy the strict options from the base profile to the profile
*
* @return true if successful, false otherwise
* @since 0.0.1
*/
public static boolean copyStrictOptions() {
if (!strict){
return true;
}
String baseProfile = baseProfileDirectory();
String profile = profileDirectory();
if (baseProfile.isEmpty() || profile.isEmpty()) {
return false;
}
File baseProfileDir = new File(baseProfile);
File profileDir = new File(profile);
if (!baseProfileDir.exists() || !profileDir.exists()) {
return false;
}
File baseOverrides = new File(baseProfile, "strict-overrides.js");
File userOverrides = new File(baseProfile, "user-overrides.js");
if (!baseOverrides.exists()) {
return false;
}
try {
Files.copy(baseOverrides.toPath(), userOverrides.toPath(), StandardCopyOption.REPLACE_EXISTING);
} catch (Exception e) {
System.out.println("Error copying base profile to profile"+e);
return false;
}
// if user-overrides.js does not exist yet, make an empty one.
//if (!touch(profileDir.toString(), "user-overrides.js")) {
//return false;
//}
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

@ -0,0 +1,84 @@
package net.i2p.i2pfirefox;
import java.io.File;
public class I2PChromiumProfileChecker {
public static void main(String[] args) {
String profileDirectory = I2PChromiumProfileBuilder.profileDirectory();
if (profileDirectory == null) {
System.out.println("No profile directory found");
return;
}
System.out.println("Profile directory: " + profileDirectory);
boolean ok = validateProfileDirectory(profileDirectory);
if (ok) {
System.out.println("Profile directory is valid");
} else {
System.out.println("Profile directory is invalid");
}
}
public static boolean validateProfileDirectory(String profileDirectory) {
File profileDir = new File(profileDirectory);
if (!profileDir.exists()) {
System.out.println("Profile directory does not exist");
return false;
}
if (!profileDir.isDirectory()) {
System.out.println("Profile directory is not a directory");
return false;
}
if (!profileDir.canRead()) {
System.out.println("Profile directory is not readable");
return false;
}
if (!profileDir.canWrite()) {
System.out.println("Profile directory is not writable");
return false;
}
if (!validateExtensionDirectory(profileDir+"/extensions")){
System.out.println("extensions directory is invalid");
return false;
}
return true;
}
public static boolean validateFile(String file) {
File f = new File(file);
if (!f.exists()) {
System.out.println("User JavaScript file does not exist");
return false;
}
if (!f.isFile()) {
System.out.println("User JavaScript file is not a file");
return false;
}
if (!f.canRead()) {
System.out.println("User JavaScript file is not readable");
return false;
}
if (!f.canWrite()) {
System.out.println("User JavaScript file is not writable");
return false;
}
return true;
}
public static boolean validateExtensionDirectory(String extensionDirectory) {
File extensionDir = new File(extensionDirectory);
if (!extensionDir.exists()) {
System.out.println("Extension directory does not exist");
return false;
}
if (!extensionDir.isDirectory()) {
System.out.println("Extension directory is not a directory");
return false;
}
if (!extensionDir.canRead()) {
System.out.println("Extension directory is not readable");
return false;
}
if (!extensionDir.canWrite()) {
System.out.println("Extension directory is not writable");
return false;
}
return true;
}
}

View File

@ -0,0 +1,70 @@
package net.i2p.i2pfirefox;
import java.io.File;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
public class I2PChromiumProfileUnpacker {
public static void main(String[] args) {
String profileDirectory = I2PChromiumProfileBuilder.profileDirectory();
if (profileDirectory == null) {
System.out.println("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) {
System.out.println("Unpacking base profile to " + profileDirectory);
try {
final InputStream resources = this.getClass().getClassLoader().getResourceAsStream("i2p.chromium.base.profile.zip");
if (resources == null) {
System.out.println("Could not find resources");
return false;
}
System.out.println(resources.toString());
// InputStream corresponds to a zip file. Unzip it.
//Files.copy(r, new File(profileDirectory).toPath(), StandardCopyOption.REPLACE_EXISTING);
ZipInputStream zis = new ZipInputStream(resources);
ZipEntry entry;
// while there are entries I process them
while ((entry = zis.getNextEntry()) != null)
{
System.out.println("entry: " + entry.getName() + ", " + entry.getSize());
// consume all the data from this entry
if (entry.isDirectory()) {
System.out.println("Creating directory: " + entry.getName());
File dir = new File(profileDirectory + "/" + entry.getName());
dir.mkdirs();
} else {
System.out.println("Creating file: " + entry.getName());
File file = new File(profileDirectory + "/" + entry.getName());
file.createNewFile();
Files.copy(zis, file.toPath(), StandardCopyOption.REPLACE_EXISTING);
}
while (zis.available() > 0)
zis.read();
// I could close the entry, but getNextEntry does it automatically
// zis.closeEntry()
}
// loop through the Enumeration
} catch (Exception e) {
System.out.println("Error copying profile files: " + e.getMessage());
return false;
}
return true;
}
}

View File

@ -55,8 +55,20 @@ public class I2PFirefox {
} }
private static String[] FIND_FIREFOX_SEARCH_PATHS_WINDOWS() { private static String[] FIND_FIREFOX_SEARCH_PATHS_WINDOWS() {
String userHome = System.getProperty("user.home"); String userHome = System.getProperty("user.home");
String[] tbPath = new String[]{userHome + "/OneDrive/Desktop/Tor Browser/Browser/", userHome + "/Desktop/Tor Browser/Browser/"}; String programFiles = System.getenv("ProgramFiles");
String[] path = new String[]{"C:/Program Files/Mozilla Firefox/", "C:/Program Files (x86)/Mozilla Firefox/", "C:/Program Files/Waterfox/", "C:/Program Files (x86)/Waterfox/", "C:/Program Files/Librewolf/", tbPath[0], tbPath[1]}; //String localAppData = System.getenv("LOCALAPPDATA");
//Is there some way Mozilla does adminless installs to LocalAppData? Don't know for sure.
String programFiles86 = System.getenv("ProgramFiles(x86)");
String[] tbPath = new String[]{new File(userHome, "/OneDrive/Desktop/Tor Browser/Browser/").toString(), new File(userHome, "/Desktop/Tor Browser/Browser/").toString()};
String[] path = new String[]{
new File(programFiles, "Mozilla Firefox/").toString(),
new File(programFiles86, "Mozilla Firefox/").toString(),
new File(programFiles, "Waterfox/").toString(),
new File(programFiles86, "Waterfox/").toString(),
new File(programFiles, "Librewolf/").toString(),
tbPath[0], tbPath[1]};
String[] exes = new String[]{"firefox.exe", "firefox-bin.exe", "firefox-esr.exe", "waterfox.exe", "waterfox-bin.exe", "librewolf.exe"}; String[] exes = new String[]{"firefox.exe", "firefox-bin.exe", "firefox-esr.exe", "waterfox.exe", "waterfox-bin.exe", "librewolf.exe"};
String[] exePath = new String[path.length * exes.length]; String[] exePath = new String[path.length * exes.length];
int i = 0; int i = 0;

0
style.css Normal file → Executable file
View File

8
test-chromium.sh Executable file
View File

@ -0,0 +1,8 @@
#! /usr/bin/env sh
GITHUB_USER=eyedeekay
GITHUB_REPO=i2p.plugins.firefox
ant distclean
cd src && \
ant && cd ../
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PChromium