Compare commits
35 Commits
Author | SHA1 | Date | |
---|---|---|---|
292cac5e67 | |||
f6c8408f80 | |||
fb30909e3a | |||
5c66b64671 | |||
a87a003ceb | |||
3b68756a32 | |||
17b6922728 | |||
49d9acc383 | |||
529d763e7a | |||
582699ce1f | |||
6f5390eacd | |||
db45db7058 | |||
9693b1383f | |||
839d6fddb3 | |||
7638e5cfec | |||
b66e8690e2 | |||
ce9aeb3b19 | |||
417fd68f91 | |||
3468cbd637 | |||
acf24565c6 | |||
3c505187e7 | |||
cf9ecca991 | |||
350cab1d33 | |||
717dda7d0b | |||
f5da9b7ca3 | |||
0a17f89b83 | |||
12e82c3d74 | |||
eed2811920 | |||
6e92fcc976 | |||
8d075794c2 | |||
169a3ec988 | |||
6df7706964 | |||
b47093009a | |||
752d7a96d8 | |||
3804c542ad |
5
.gitignore
vendored
5
.gitignore
vendored
@ -3,3 +3,8 @@ src/i2p.firefox.base.profile.zip
|
||||
*.su3
|
||||
*.xpi2p
|
||||
*.zip
|
||||
generated/
|
||||
i2p.chromium.base.profile
|
||||
i2p.firefox.base.profile
|
||||
i2p.chromium/profile
|
||||
i2p.firefox.profile
|
||||
|
52
CHANGES.html
Normal file → Executable file
52
CHANGES.html
Normal file → Executable file
@ -7,6 +7,7 @@
|
||||
<meta name="description" content="i2p.plugins.firefox" />
|
||||
<meta name="keywords" content="main" />
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="showhider.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="navbar">
|
||||
@ -26,6 +27,46 @@
|
||||
CHANGES
|
||||
</a>
|
||||
</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>
|
||||
<a href="LICENSE.html">
|
||||
LICENSE
|
||||
@ -39,6 +80,17 @@
|
||||
</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>
|
||||
Sun, August 7
|
||||
</h2>
|
||||
|
6
CHANGES.md
Normal file → Executable file
6
CHANGES.md
Normal file → Executable 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
|
||||
-------------
|
||||
|
||||
|
1551
I2PChromium.html
Normal file
1551
I2PChromium.html
Normal file
File diff suppressed because it is too large
Load Diff
246
I2PChromium.md
Normal file
246
I2PChromium.md
Normal 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[] | |
|
||||
|
||||
|
1340
I2PChromiumProfileBuilder.html
Normal file
1340
I2PChromiumProfileBuilder.html
Normal file
File diff suppressed because it is too large
Load Diff
161
I2PChromiumProfileBuilder.md
Normal file
161
I2PChromiumProfileBuilder.md
Normal 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.
|
||||
|
||||
|
1107
I2PChromiumProfileChecker.html
Normal file
1107
I2PChromiumProfileChecker.html
Normal file
File diff suppressed because it is too large
Load Diff
70
I2PChromiumProfileChecker.md
Normal file
70
I2PChromiumProfileChecker.md
Normal 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 | |
|
||||
|
||||
|
1059
I2PChromiumProfileUnpacker.html
Normal file
1059
I2PChromiumProfileUnpacker.html
Normal file
File diff suppressed because it is too large
Load Diff
50
I2PChromiumProfileUnpacker.md
Normal file
50
I2PChromiumProfileUnpacker.md
Normal 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
1551
I2PFirefox.html
Normal file
File diff suppressed because it is too large
Load Diff
246
I2PFirefox.md
Normal file
246
I2PFirefox.md
Normal 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[] | |
|
||||
|
||||
|
1340
I2PFirefoxProfileBuilder.html
Normal file
1340
I2PFirefoxProfileBuilder.html
Normal file
File diff suppressed because it is too large
Load Diff
161
I2PFirefoxProfileBuilder.md
Normal file
161
I2PFirefoxProfileBuilder.md
Normal 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.
|
||||
|
||||
|
1107
I2PFirefoxProfileChecker.html
Normal file
1107
I2PFirefoxProfileChecker.html
Normal file
File diff suppressed because it is too large
Load Diff
70
I2PFirefoxProfileChecker.md
Normal file
70
I2PFirefoxProfileChecker.md
Normal 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 | |
|
||||
|
||||
|
1059
I2PFirefoxProfileUnpacker.html
Normal file
1059
I2PFirefoxProfileUnpacker.html
Normal file
File diff suppressed because it is too large
Load Diff
50
I2PFirefoxProfileUnpacker.md
Normal file
50
I2PFirefoxProfileUnpacker.md
Normal 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
41
LICENSE.html
Normal file → Executable file
@ -7,6 +7,7 @@
|
||||
<meta name="description" content="i2p.plugins.firefox" />
|
||||
<meta name="keywords" content="main" />
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="showhider.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="navbar">
|
||||
@ -26,6 +27,46 @@
|
||||
CHANGES
|
||||
</a>
|
||||
</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>
|
||||
<a href="LICENSE.html">
|
||||
LICENSE
|
||||
|
0
LICENSE.md
Normal file → Executable file
0
LICENSE.md
Normal file → Executable file
5
README.md
Normal file → Executable file
5
README.md
Normal file → Executable 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
|
||||
```
|
||||
|
||||
and a new Firefox instance comes up with a fresh profile. This is just a default Firefox
|
||||
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.
|
||||
and a new Firefox instance comes up with a fresh profile, ready-to-use for I2P browsing.
|
||||
|
||||
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:
|
||||
|
37
build.xml
Normal file → Executable file
37
build.xml
Normal file → Executable file
@ -2,12 +2,16 @@
|
||||
<project basedir="." default="all" name="i2pfirefox">
|
||||
<property file="override.properties"/>
|
||||
|
||||
<target name="all" depends="clean,i2pFirefoxBaseProfileZip,plugin" />
|
||||
<target name="all" depends="clean,i2pFirefoxBaseProfileZip,i2pChromiumBaseProfileZip,plugin" />
|
||||
|
||||
<target name="war" >
|
||||
<ant dir="src" target="build" />
|
||||
</target>
|
||||
|
||||
<target name="jar" >
|
||||
<ant dir="src" target="jar" />
|
||||
</target>
|
||||
|
||||
<target name="i2pFirefoxBaseProfileZip">
|
||||
<exec executable="rm" failonerror="false" dir="src">
|
||||
<arg value="-rf" />
|
||||
@ -20,6 +24,32 @@
|
||||
</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="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">
|
||||
<delete>
|
||||
<!-- in installer but not update -->
|
||||
@ -28,7 +58,7 @@
|
||||
<delete dir="plugin/eepsite/docroot/torrents/" />
|
||||
<!-- get version 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 -->
|
||||
<!-- this contains everything except i2ptunnel.config -->
|
||||
@ -94,6 +124,9 @@
|
||||
<delete dir="i2p.firefox.base.profile" />
|
||||
<delete dir="i2p.firefox.profile" />
|
||||
<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/plugin.config" />
|
||||
<delete file="plugin/i2pfirefox.config" />
|
||||
|
@ -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
|
||||
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
0
i2plogo.png
Normal file → Executable file
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
50
index.html
Normal file → Executable file
50
index.html
Normal file → Executable file
@ -7,6 +7,7 @@
|
||||
<meta name="description" content="i2p.plugins.firefox" />
|
||||
<meta name="keywords" content="main" />
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="showhider.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="navbar">
|
||||
@ -26,6 +27,46 @@
|
||||
CHANGES
|
||||
</a>
|
||||
</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>
|
||||
<a href="LICENSE.html">
|
||||
LICENSE
|
||||
@ -68,14 +109,7 @@ cd ..
|
||||
java -cp ./src/build/i2pfirefox.jar net.i2p.i2pfirefox.I2PFirefox
|
||||
</code></pre>
|
||||
<p>
|
||||
and a new Firefox instance comes up with a fresh profile. This is just a default Firefox
|
||||
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.
|
||||
and a new Firefox instance comes up with a fresh profile, ready-to-use for I2P browsing.
|
||||
</p>
|
||||
<p>
|
||||
The cooler thing you can do with it is add it to an I2P distribution and somewhere in it,
|
||||
|
10
javadoc.sh
Executable file
10
javadoc.sh
Executable 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
|
13
release.sh
13
release.sh
@ -2,12 +2,11 @@
|
||||
|
||||
GITHUB_USER=eyedeekay
|
||||
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_TAG=0.0.5
|
||||
GITHUB_TAG=0.0.6
|
||||
ant distclean
|
||||
cd src && \
|
||||
ant
|
||||
ant jar freeZip
|
||||
github-release release --user "${GITHUB_USER}" \
|
||||
--repo "${GITHUB_REPO}" \
|
||||
--name "${GITHUB_NAME}" \
|
||||
@ -18,13 +17,13 @@ github-release upload --user "${GITHUB_USER}" \
|
||||
--repo "${GITHUB_REPO}" \
|
||||
--tag "${GITHUB_TAG}" \
|
||||
--name "i2pfirefox.jar" \
|
||||
--file "build/i2pfirefox.jar" \
|
||||
--file "src/build/i2pfirefox.jar" \
|
||||
--replace
|
||||
cd ../
|
||||
zip -r i2pfirefox.zip src/build/i2pfirefox.jar i2pbrowser.cmd LICENSE.md README.md
|
||||
github-release upload --user "${GITHUB_USER}" \
|
||||
--repo "${GITHUB_REPO}" \
|
||||
--tag "${GITHUB_TAG}" \
|
||||
--name "i2pfirefox.zip" \
|
||||
--file "i2pfirefox.zip" \
|
||||
--replace
|
||||
git pull github --tags
|
||||
git push --all
|
172
report.log
Normal file
172
report.log
Normal file
@ -0,0 +1,172 @@
|
||||
|
||||
Generating documentation from src/java/net/i2p/i2pfirefox/
|
||||
|
||||
[1;32mJavadoc errors for class [0mI2PChromiumProfileChecker
|
||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java[0m
|
||||
[33m Missing description for method [0mmain (Line: 6)
|
||||
[33m Javadoc parameter not found [0margs in method: main (Line: 6)
|
||||
[33m Missing description for method [0mvalidateProfileDirectory (Line: 20)
|
||||
[33m Javadoc parameter not found [0mprofileDirectory in method: validateProfileDirectory (Line: 20)
|
||||
[33m Missing description for method [0mvalidateFile (Line: 44)
|
||||
[33m Javadoc parameter not found [0mfile in method: validateFile (Line: 44)
|
||||
[33m Missing description for method [0mvalidateExtensionDirectory (Line: 64)
|
||||
[33m Javadoc parameter not found [0mextensionDirectory in method: validateExtensionDirectory (Line: 64)
|
||||
|
||||
[1;32mJavadoc errors for class [0mI2PFirefoxProfileChecker
|
||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java[0m
|
||||
[33m Missing description for method [0mmain (Line: 6)
|
||||
[33m Javadoc parameter not found [0margs in method: main (Line: 6)
|
||||
[33m Missing description for method [0mvalidateProfileDirectory (Line: 20)
|
||||
[33m Javadoc parameter not found [0mprofileDirectory in method: validateProfileDirectory (Line: 20)
|
||||
[33m Missing description for method [0mvalidateFile (Line: 52)
|
||||
[33m Javadoc parameter not found [0mfile in method: validateFile (Line: 52)
|
||||
[33m Missing description for method [0mvalidateExtensionDirectory (Line: 72)
|
||||
[33m Javadoc parameter not found [0mextensionDirectory in method: validateExtensionDirectory (Line: 72)
|
||||
|
||||
[1;32mJavadoc errors for class [0mI2PFirefoxProfileBuilder
|
||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java[0m
|
||||
[33m Missing description for member variable [0mstrict (Line: )
|
||||
[33m Missing description for method [0mprofileDir (Line: 15)
|
||||
[33m Javadoc parameter not found [0mfile in method: profileDir (Line: 15)
|
||||
[33m Missing description for method [0mprofileDirectory (Line: 25)
|
||||
[33m Missing description for method [0mbaseProfileDir (Line: 37)
|
||||
[33m Javadoc parameter not found [0mfile in method: baseProfileDir (Line: 37)
|
||||
[33m Missing description for method [0mbaseProfileDirectory (Line: 57)
|
||||
[33m Missing description for method [0mruntimeDirectory (Line: 81)
|
||||
[33m Javadoc parameter not found [0mcreate in method: runtimeDirectory (Line: 81)
|
||||
[33m Missing description for method [0mruntimeDirectory (Line: 98)
|
||||
[33m Missing description for method [0mcopyBaseProfiletoProfile (Line: 144)
|
||||
[33m Missing description for method [0mcopyDirectory (Line: 174)
|
||||
[33m Javadoc parameter not found [0msourceDirectory in method: copyDirectory (Line: 174)
|
||||
[33m Javadoc parameter not found [0mdestinationDirectory in method: copyDirectory (Line: 174)
|
||||
[33m Missing description for method [0mcopyDirectoryCompatibityMode (Line: 184)
|
||||
[33m Javadoc parameter not found [0msource in method: copyDirectoryCompatibityMode (Line: 184)
|
||||
[33m Javadoc parameter not found [0mdestination in method: copyDirectoryCompatibityMode (Line: 184)
|
||||
[33m Missing description for method [0mcopyFile (Line: 192)
|
||||
[33m Javadoc parameter not found [0msourceFile in method: copyFile (Line: 192)
|
||||
[33m Javadoc parameter not found [0mdestinationFile in method: copyFile (Line: 192)
|
||||
[33m Missing description for method [0mcopyStrictOptions (Line: 209)
|
||||
[33m Missing description for method [0m (Line: 246)
|
||||
[33m Missing description for method [0m (Line: 256)
|
||||
[33m Javadoc parameter not found [0mstrict in method: (Line: 256)
|
||||
|
||||
[1;32mJavadoc errors for class [0mI2PChromium
|
||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PChromium.java[0m
|
||||
[33m Missing description for member variable [0mString[] CHROMIUM_SEARCH_PATHS (Line: )
|
||||
[33m Missing return type for member variable [0mString[] CHROMIUM_SEARCH_PATHS (Line: )
|
||||
[33m Missing description for member variable [0mint DEFAULT_TIMEOUT (Line: )
|
||||
[33m Missing return type for member variable [0mint DEFAULT_TIMEOUT (Line: )
|
||||
[33m Missing description for method [0m (Line: 20)
|
||||
[33m Missing description for method [0mFIND_CHROMIUM_SEARCH_PATHS_UNIX (Line: 31)
|
||||
[33m Missing description for method [0mFIND_CHROMIUM_SEARCH_PATHS_OSX (Line: 44)
|
||||
[33m Missing description for method [0mFIND_CHROMIUM_SEARCH_PATHS_WINDOWS (Line: 57)
|
||||
[33m Missing description for method [0mFIND_ALL_CHROMIUM_SEARCH_PATHS (Line: 87)
|
||||
[33m Missing description for method [0mFIND_CHROMIUM_SEARCH_PATHS (Line: 107)
|
||||
[33m Missing description for method [0mNEARBY_CHROMIUM_SEARCH_PATHS (Line: 121)
|
||||
[33m Missing description for method [0mCHROMIUM_FINDER (Line: 165)
|
||||
[33m Missing description for method [0mgetOperatingSystem (Line: 177)
|
||||
[33m Missing description for method [0monlyValidChromiums (Line: 199)
|
||||
[33m Missing description for method [0mtopChromium (Line: 217)
|
||||
[33m Missing description for method [0mtopChromium (Line: 246)
|
||||
[33m Javadoc parameter not found [0moverrideChromium in method: topChromium (Line: 246)
|
||||
[33m Missing description for method [0mdefaultProcessBuilder (Line: 264)
|
||||
[33m Missing description for method [0mprocessBuilder (Line: 301)
|
||||
[33m Javadoc parameter not found [0margs in method: processBuilder (Line: 301)
|
||||
[33m Missing description for method [0mwaitForProxy (Line: 340)
|
||||
[33m Missing description for method [0mwaitForProxy (Line: 352)
|
||||
[33m Javadoc parameter not found [0mtimeout in method: waitForProxy (Line: 352)
|
||||
[33m Missing description for method [0mwaitForProxy (Line: 364)
|
||||
[33m Javadoc parameter not found [0mtimeout in method: waitForProxy (Line: 364)
|
||||
[33m Javadoc parameter not found [0mport in method: waitForProxy (Line: 364)
|
||||
[33m Missing description for method [0mwaitForProxy (Line: 377)
|
||||
[33m Javadoc parameter not found [0mtimeout in method: waitForProxy (Line: 377)
|
||||
[33m Javadoc parameter not found [0mport in method: waitForProxy (Line: 377)
|
||||
[33m Javadoc parameter not found [0mhost in method: waitForProxy (Line: 377)
|
||||
[33m Missing description for method [0mcheckifPortIsOccupied (Line: 390)
|
||||
[33m Javadoc parameter not found [0mport in method: checkifPortIsOccupied (Line: 390)
|
||||
[33m Javadoc parameter not found [0mhost in method: checkifPortIsOccupied (Line: 390)
|
||||
[33m Missing description for method [0mlaunch (Line: 408)
|
||||
[33m Missing description for method [0mmain (Line: 441)
|
||||
[33m Javadoc parameter not found [0margs in method: main (Line: 441)
|
||||
|
||||
[1;32mJavadoc errors for class [0mI2PFirefoxProfileUnpacker
|
||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java[0m
|
||||
[33m Missing description for method [0mmain (Line: 12)
|
||||
[33m Javadoc parameter not found [0margs in method: main (Line: 12)
|
||||
[33m Missing description for method [0munpackProfile (Line: 27)
|
||||
[33m Javadoc parameter not found [0mprofileDirectory in method: unpackProfile (Line: 27)
|
||||
|
||||
[1;32mJavadoc errors for class [0mI2PChromiumProfileUnpacker
|
||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java[0m
|
||||
[33m Missing description for method [0mmain (Line: 12)
|
||||
[33m Javadoc parameter not found [0margs in method: main (Line: 12)
|
||||
[33m Missing description for method [0munpackProfile (Line: 27)
|
||||
[33m Javadoc parameter not found [0mprofileDirectory in method: unpackProfile (Line: 27)
|
||||
|
||||
[1;32mJavadoc errors for class [0mI2PChromiumProfileBuilder
|
||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java[0m
|
||||
[33m Missing description for member variable [0mstrict (Line: )
|
||||
[33m Missing description for method [0mprofileDir (Line: 15)
|
||||
[33m Javadoc parameter not found [0mfile in method: profileDir (Line: 15)
|
||||
[33m Missing description for method [0mprofileDirectory (Line: 25)
|
||||
[33m Missing description for method [0mbaseProfileDir (Line: 37)
|
||||
[33m Javadoc parameter not found [0mfile in method: baseProfileDir (Line: 37)
|
||||
[33m Missing description for method [0mbaseProfileDirectory (Line: 57)
|
||||
[33m Missing description for method [0mruntimeDirectory (Line: 81)
|
||||
[33m Javadoc parameter not found [0mcreate in method: runtimeDirectory (Line: 81)
|
||||
[33m Missing description for method [0mruntimeDirectory (Line: 98)
|
||||
[33m Missing description for method [0mcopyBaseProfiletoProfile (Line: 144)
|
||||
[33m Missing description for method [0mcopyDirectory (Line: 174)
|
||||
[33m Javadoc parameter not found [0msourceDirectory in method: copyDirectory (Line: 174)
|
||||
[33m Javadoc parameter not found [0mdestinationDirectory in method: copyDirectory (Line: 174)
|
||||
[33m Missing description for method [0mcopyDirectoryCompatibityMode (Line: 184)
|
||||
[33m Javadoc parameter not found [0msource in method: copyDirectoryCompatibityMode (Line: 184)
|
||||
[33m Javadoc parameter not found [0mdestination in method: copyDirectoryCompatibityMode (Line: 184)
|
||||
[33m Missing description for method [0mcopyFile (Line: 192)
|
||||
[33m Javadoc parameter not found [0msourceFile in method: copyFile (Line: 192)
|
||||
[33m Javadoc parameter not found [0mdestinationFile in method: copyFile (Line: 192)
|
||||
[33m Missing description for method [0mcopyStrictOptions (Line: 209)
|
||||
[33m Missing description for method [0m (Line: 246)
|
||||
[33m Missing description for method [0m (Line: 256)
|
||||
[33m Javadoc parameter not found [0mstrict in method: (Line: 256)
|
||||
|
||||
[1;32mJavadoc errors for class [0mI2PFirefox
|
||||
File: [34msrc/java/net/i2p/i2pfirefox/I2PFirefox.java[0m
|
||||
[33m Missing description for member variable [0mString[] FIREFOX_SEARCH_PATHS (Line: )
|
||||
[33m Missing return type for member variable [0mString[] FIREFOX_SEARCH_PATHS (Line: )
|
||||
[33m Missing description for member variable [0mint DEFAULT_TIMEOUT (Line: )
|
||||
[33m Missing return type for member variable [0mint DEFAULT_TIMEOUT (Line: )
|
||||
[33m Missing description for method [0m (Line: 19)
|
||||
[33m Missing description for method [0mFIND_FIREFOX_SEARCH_PATHS_UNIX (Line: 30)
|
||||
[33m Missing description for method [0mFIND_FIREFOX_SEARCH_PATHS_OSX (Line: 43)
|
||||
[33m Missing description for method [0mFIND_FIREFOX_SEARCH_PATHS_WINDOWS (Line: 56)
|
||||
[33m Missing description for method [0mFIND_ALL_FIREFOX_SEARCH_PATHS (Line: 84)
|
||||
[33m Missing description for method [0mFIND_FIREFOX_SEARCH_PATHS (Line: 104)
|
||||
[33m Missing description for method [0mNEARBY_FIREFOX_SEARCH_PATHS (Line: 118)
|
||||
[33m Missing description for method [0mFIREFOX_FINDER (Line: 162)
|
||||
[33m Missing description for method [0mgetOperatingSystem (Line: 174)
|
||||
[33m Missing description for method [0monlyValidFirefoxes (Line: 196)
|
||||
[33m Missing description for method [0mtopFirefox (Line: 214)
|
||||
[33m Missing description for method [0mtopFirefox (Line: 243)
|
||||
[33m Javadoc parameter not found [0moverrideFirefox in method: topFirefox (Line: 243)
|
||||
[33m Missing description for method [0mdefaultProcessBuilder (Line: 261)
|
||||
[33m Missing description for method [0mprocessBuilder (Line: 275)
|
||||
[33m Javadoc parameter not found [0margs in method: processBuilder (Line: 275)
|
||||
[33m Missing description for method [0mwaitForProxy (Line: 298)
|
||||
[33m Missing description for method [0mwaitForProxy (Line: 310)
|
||||
[33m Javadoc parameter not found [0mtimeout in method: waitForProxy (Line: 310)
|
||||
[33m Missing description for method [0mwaitForProxy (Line: 322)
|
||||
[33m Javadoc parameter not found [0mtimeout in method: waitForProxy (Line: 322)
|
||||
[33m Javadoc parameter not found [0mport in method: waitForProxy (Line: 322)
|
||||
[33m Missing description for method [0mwaitForProxy (Line: 335)
|
||||
[33m Javadoc parameter not found [0mtimeout in method: waitForProxy (Line: 335)
|
||||
[33m Javadoc parameter not found [0mport in method: waitForProxy (Line: 335)
|
||||
[33m Javadoc parameter not found [0mhost in method: waitForProxy (Line: 335)
|
||||
[33m Missing description for method [0mcheckifPortIsOccupied (Line: 348)
|
||||
[33m Javadoc parameter not found [0mport in method: checkifPortIsOccupied (Line: 348)
|
||||
[33m Javadoc parameter not found [0mhost in method: checkifPortIsOccupied (Line: 348)
|
||||
[33m Missing description for method [0mlaunch (Line: 366)
|
||||
[33m Missing description for method [0mmain (Line: 399)
|
||||
[33m Javadoc parameter not found [0margs in method: main (Line: 399)
|
||||
|
||||
|
10
showhider.css
Normal file
10
showhider.css
Normal 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; }
|
1
src/i2p.chromium.base.profile/TODO.md
Normal file
1
src/i2p.chromium.base.profile/TODO.md
Normal file
@ -0,0 +1 @@
|
||||
Set up an extension loadout
|
1
src/i2p.chromium.base.profile/extensions/TODO.md
Normal file
1
src/i2p.chromium.base.profile/extensions/TODO.md
Normal file
@ -0,0 +1 @@
|
||||
put extensions here.
|
446
src/java/net/i2p/i2pfirefox/I2PChromium.java
Normal file
446
src/java/net/i2p/i2pfirefox/I2PChromium.java
Normal 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();
|
||||
}
|
||||
}
|
259
src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java
Normal file
259
src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java
Normal 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;
|
||||
}
|
||||
}
|
84
src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java
Normal file
84
src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java
Normal 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;
|
||||
}
|
||||
}
|
70
src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java
Normal file
70
src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -55,8 +55,20 @@ public class I2PFirefox {
|
||||
}
|
||||
private static String[] FIND_FIREFOX_SEARCH_PATHS_WINDOWS() {
|
||||
String userHome = System.getProperty("user.home");
|
||||
String[] tbPath = new String[]{userHome + "/OneDrive/Desktop/Tor Browser/Browser/", userHome + "/Desktop/Tor Browser/Browser/"};
|
||||
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 programFiles = System.getenv("ProgramFiles");
|
||||
//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[] exePath = new String[path.length * exes.length];
|
||||
int i = 0;
|
||||
|
8
test-chromium.sh
Executable file
8
test-chromium.sh
Executable 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
|
Reference in New Issue
Block a user