re-add javadoc into docs directory

This commit is contained in:
idk
2022-12-18 22:20:21 +00:00
parent 3703fb2ecf
commit d7928fd854
12 changed files with 2159 additions and 0 deletions

261
docs/I2PBrowser.md Normal file
View File

@ -0,0 +1,261 @@
# Class I2PBrowser [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java)
> */
Access: public
Description:
> I2PBrowser.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @description I2PBrowser is a that is used to open a browser window to the I2P network. It automatically detects the operating system and available browsers and selects the best one to use with Tor Browser at the top for Firefox and Brave at the top for Chrome.
Author: idk
Parent class: I2PCommonBrowser
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.awt.Image</li>
<li>java.awt.Menu</li>
<li>java.awt.MenuItem</li>
<li>java.awt.PopupMenu</li>
<li>java.awt.SystemTray</li>
<li>java.awt.Toolkit</li>
<li>java.awt.TrayIcon</li>
<li>java.awt.event.ActionEvent</li>
<li>java.awt.event.ActionListener</li>
<li>java.io.File</li>
<li>java.io.FileOutputStream</li>
<li>java.io.FileWriter</li>
<li>java.io.IOException</li>
<li>java.io.InputStream</li>
<li>java.io.OutputStream</li>
<li>java.util.ArrayList</li>
<li>java.util.Arrays</li>
</ul>
</details>
## Member Variables
#### I2PFirefox i2pFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L)
>
+ Access: private
+ Modifiers: final
#### I2PChromium i2pChromium [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L)
>
+ Access: private
+ Modifiers: final
#### I2PGenericUnsafeBrowser i2pGeneral [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L)
>
+ Access: private
+ Modifiers: final
#### boolean firefox [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L)
>
+ Access: public
#### boolean chromium [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L)
>
+ Access: public
#### boolean generic [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L)
>
+ Access: public
#### boolean chromiumFirst [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L)
>
+ Access: public
#### boolean usability [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L)
>
+ Access: public
#### boolean outputConfig [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L)
>
+ Access: private
+ Modifiers: static
#### boolean useSystray [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L)
>
+ Access: private
+ Modifiers: static
## Methods
### launchFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L52)
+ Description:
+ Access: private
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | int | |
| url | String[] | |
### launchChromium [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L59)
+ Description:
+ Access: private
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | int | |
| url | String[] | |
### launchGeneric [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L66)
+ Description:
+ Access: private
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindowInt | int | |
| url | String[] | |
### setBrowser [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L94)
+ Description:
+ Access: public
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| browserPath | String | |
### hasChromium [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L104)
+ Description: Return true if there is a Chromium available
+ Access: public
+ return: true if Chromium is available false otherwise
This method has no parameters.
### hasFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L121)
+ Description: Return true if there is a Firefox variant available
+ Access: public
+ return: true if Firefox variant is available false otherwise
This method has no parameters.
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L141)
+ Description: Populates a profile directory with a proxy configuration. Waits for an HTTP proxy on the port 4444 to be ready. Launches either Firefox or Chromium with the profile directory.
+ Access: public
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | int | |
| url | String[] | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L186)
+ Description: Populates a profile directory with a proxy configuration. Waits for an HTTP proxy on the port 4444 to be ready. Launches either Firefox or Chromium with the profile directory.
+ Access: public
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L200)
+ Description: Populates a profile directory with a proxy configuration. Waits for an HTTP proxy on the port 4444 to be ready. Launches either Firefox or Chromium with the profile directory.
+ Access: public
+ return: void
This method has no parameters.
### ValidURL [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L202)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| inUrl | String | |
### main [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L212)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
### systrayIsRunningExternally [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L276)
+ Description:
+ Access: private
+ Modifiers: static
+ return: boolean
This method has no parameters.
### shutdownSystray [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L293)
+ Description:
+ Access: private
+ Modifiers: static
+ return: void
This method has no parameters.
### systray [[src]](src/java/net/i2p/i2pfirefox/I2PBrowser.java#L299)
+ Description:
+ Access: public
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |

372
docs/I2PChromium.md Normal file
View File

@ -0,0 +1,372 @@
# Class I2PChromium [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java)
> */
Access: public
Description:
> I2PChromium.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Author: idk
Parent class: I2PCommonBrowser
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.File</li>
<li>java.io.FileOutputStream</li>
<li>java.io.FileWriter</li>
<li>java.io.IOException</li>
<li>java.io.OutputStream</li>
<li>java.io.PrintWriter</li>
<li>java.util.ArrayList</li>
<li>java.util.Arrays</li>
<li>java.util.List</li>
<li>java.util.stream.Collectors</li>
<li>java.util.stream.Stream</li>
</ul>
</details>
## Member Variables
#### String[] CHROMIUM_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L)
>
+ Access: private
+ Modifiers: final
#### Process p [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L)
>
+ Access: private
## Methods
### storeChromiumDefaults [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L60)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
This method has no parameters.
### chromiumPathsUnix [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L89)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### chromiumBinsUnix [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L98)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIND_CHROMIUM_SEARCH_PATHS_UNIX [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L114)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### chromiumPathsOSX [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L128)
+ 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#L137)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### chromiumPathsWindows [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L151)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### chromiumBinsWindows [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L184)
+ 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#L196)
+ 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#L210)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIND_CHROMIUM_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L230)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### NEARBY_CHROMIUM_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L244)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### CHROMIUM_FINDER [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L337)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### onlyValidChromiums [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L358)
+ Description: Check our list of chrome paths for a valid chrome binary. Just an existence check for now but should check versions in the future.
+ Access: public
+ return: a list of usable Chromiums or an empty list if none are found.
This method has no parameters.
### topChromium [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L378)
+ Description: Return the best available Chromium from the list of Chromiums we have.
+ Access: public
+ return: the path to the best available Chromium or null if none are found.
This method has no parameters.
### topChromium [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L407)
+ Description: 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.
+ Access: public
+ return: the path to the best available Chromium or null if none are found.
| Name | Type | Description |
| ----- | ----- | ----- |
| overrideChromium | String | |
### defaultProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L425)
+ Description: Build a ProcessBuilder for the top Chromium binary and the default profile.
+ Access: public
+ return: a ProcessBuilder for the top Chromium binary and the default profile.
This method has no parameters.
### defaultProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L438)
+ Description: Build a ProcessBuilder for the top Chromium binary and the default profile. @args the arguments to pass to the Chromium binary
+ Access: public
+ return: a ProcessBuilder for the top Chromium binary and the default profile.
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
### privateProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L450)
+ Description: Build a ProcessBuilder for the top Chromium binary and the default profile.
+ Access: public
+ return: a ProcessBuilder for the top Chromium binary and the default profile. Always passes the --incognito flag.
This method has no parameters.
### privateProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L463)
+ Description: Build a ProcessBuilder for the top Chromium binary and the default profile.
+ Access: public
+ return: a ProcessBuilder for the top Chromium binary and the default profile. Always passes the --incognito flag.
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | the arguments to pass to the Chromium binary. |
### appProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L485)
+ Description: Build a ProcessBuilder for the top Chromium binary and the default profile.
+ Access: public
+ return: a ProcessBuilder for the top Chromium binary and the default profile. Always passes the --app flag.
This method has no parameters.
### appProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L498)
+ Description: Build a ProcessBuilder for the top Chromium binary and the default profile.
+ Access: public
+ return: a ProcessBuilder for the top Chromium binary and the default profile. Always passes the --app flag.
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | the arguments to pass to the Chromium binary. |
### processBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L545)
+ Description: Build a ProcessBuilder for the top Chromium binary and the default profile with a specific set of extended arguments.
+ Access: public
+ return: a ProcessBuilder for the top Chromium binary and default profile with a specific set of extended arguments.
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | the extended arguments to pass to the Chromium binary. |
### launchAndDetatch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L666)
+ Description:
+ Access: public
+ return: Process
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
| url | String[] | |
### launchAndDetatch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L673)
+ Description:
+ Access: public
+ return: Process
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | int | |
| url | String[] | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L731)
+ Description: 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.
+ Access: public
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
| url | String[] | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L737)
+ Description:
+ Access: public
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | int | |
| url | String[] | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L762)
+ Description: 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.
+ Access: public
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L771)
+ Description: 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.
+ Access: public
+ return: void
This method has no parameters.
### ValidURL [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L773)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| inUrl | String | |
### main [[src]](src/java/net/i2p/i2pfirefox/I2PChromium.java#L783)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |

View File

@ -0,0 +1,113 @@
# Class I2PChromiumProfileBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java)
> */
Access: public
Description:
> I2PChromiumProfileBuilder.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I2PChromiumProfileBuilder is a that builds a profile directory which contains the I2P browser profile for the Chromium browser family. It manages the base profile directory and copies it's contents to the active profile directory which is actually used by Chromium.
Author: idk
Parent class: I2PCommonBrowser
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.File</li>
</ul>
</details>
## Member Variables
#### boolean usability [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L)
>
+ Access: public
+ Modifiers: static
## Methods
### profileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L31)
+ Description: get the profile directory creating it if necessary
+ Access: public
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| base | String | |
### baseProfileDir [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L35)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| file | String | |
| mode | String | |
### baseProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L59)
+ Description:
+ Access: public
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| mode | String | |
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L83)
+ Description: get the runtime directory creating it if create=true
+ Access: public
+ Modifiers: static
+ return: the runtime directory or null if it could not be created
| Name | Type | Description |
| ----- | ----- | ----- |
| create | boolean | if true create the runtime directory if it does not exist |
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L94)
+ Description: get the correct runtime directory
+ Access: public
+ Modifiers: static
+ return: the runtime directory or null if it could not be created or found
This method has no parameters.
### usabilityMode [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L109)
+ Description:
+ Access: public
+ Modifiers: static
+ return: String
This method has no parameters.
### copyBaseProfiletoProfile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileBuilder.java#L120)
+ Description: Copy the inert base profile directory to the runtime profile directory
+ Access: public
+ Modifiers: static
+ return: boolean
This method has no parameters.

View File

@ -0,0 +1,75 @@
# Class I2PChromiumProfileChecker [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java)
> */
Access: public
Description:
> I2PChromiumProfileChecker.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I2PChromiumProfileChecker is a that checks if the Chromium profile directory exists and is valid.
Author: idk
Parent class: I2PCommonBrowser
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#L29)
+ Description: Output feedback if the profile directory is valid or invalid @description Output feedback if the profile directory is valid or invalid @args unused
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
### validateProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L51)
+ Description: Return true if the profile directory is valid.
+ Access: public
+ Modifiers: static
+ return: true if the profile directory is valid false otherwise
| Name | Type | Description |
| ----- | ----- | ----- |
| profileDirectory | String | the profile directory to check |
### validateFile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L82)
+ Description: Return true if the file is valid.
+ Access: public
+ Modifiers: static
+ return: true if the file is valid false otherwise
| Name | Type | Description |
| ----- | ----- | ----- |
| file | String | the file to check |
### validateExtensionDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileChecker.java#L109)
+ Description: Return true if the extension directory is valid.
+ Access: public
+ Modifiers: static
+ return: true if the extension directory is valid false otherwise
| Name | Type | Description |
| ----- | ----- | ----- |
| extensionDirectory | String | the extension directory to check |

View File

@ -0,0 +1,50 @@
# Class I2PChromiumProfileUnpacker [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java)
> */
Access: public
Description:
> I2PChromiumProfileUnpacker.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I2PChromiumProfileUnpacker is a that unpacks the Chromium profile zip file into the Chromium base profile directory. This is not used by the Chromium browser instance it's unpacked to the disk to be copied to the active profile directory.
Author: idk
Parent class: I2PCommonBrowser
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
</ul>
</details>
## No member variables in this class
## Methods
### main [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java#L23)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
### unpackProfile [[src]](src/java/net/i2p/i2pfirefox/I2PChromiumProfileUnpacker.java#L38)
+ Description: unpack the profile directory
+ Access: public
+ return: true if the profile directory was successfully unpacked
| Name | Type | Description |
| ----- | ----- | ----- |
| profileDirectory | String | |
| mode | String | |

310
docs/I2PCommonBrowser.md Normal file
View File

@ -0,0 +1,310 @@
# Class I2PCommonBrowser [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java)
>
Access: public
Description:
> I2PCommonBrowser.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Author: idk
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.net.Socket</li>
<li>java.nio.file.Files</li>
<li>java.nio.file.StandardCopyOption</li>
<li>java.util.Arrays</li>
<li>java.util.Properties</li>
<li>java.util.logging.FileHandler</li>
<li>java.util.logging.Logger</li>
<li>java.util.logging.SimpleFormatter</li>
<li>java.util.zip.ZipEntry</li>
<li>java.util.zip.ZipInputStream</li>
</ul>
</details>
## Member Variables
#### Properties prop [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L)
>
+ Access: public
+ Modifiers: static
#### Logger logger [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L)
>
+ Access: public
+ Modifiers: static
#### [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L39)
> static FileHandler fh;
+ Access: private
+ Modifiers: final
#### [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L40)
> // private final int DEFAULT_TIMEOUT = 200;
+ Access: private
+ Modifiers: static
## Methods
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L180)
+ Description: get the runtime directory creating it if create=true
+ Access: protected
+ Modifiers: static
+ return: the runtime directory or null if it could not be created
| Name | Type | Description |
| ----- | ----- | ----- |
| create | boolean | if true create the runtime directory if it does not exist |
| override | String | |
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L197)
+ Description: get the correct runtime directory
+ Access: protected
+ Modifiers: static
+ return: the runtime directory or null if it could not be created or found
| Name | Type | Description |
| ----- | ----- | ----- |
| override | String | |
### profileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L245)
+ Description: get the profile directory creating it if necessary
+ Access: protected
+ Modifiers: static
+ return: the profile directory or null if it could not be created
| Name | Type | Description |
| ----- | ----- | ----- |
| envVar | String | |
| browser | String | |
| base | String | |
| app | boolean | |
### profileDir [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L258)
+ Description:
+ Access: protected
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| file | String | |
| browser | String | |
| base | String | |
| app | boolean | |
### unpackProfile [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L269)
+ Description:
+ Access: protected
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| profileDirectory | String | |
| browser | String | |
| base | String | |
### copyDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L315)
+ Description:
+ Access: protected
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| sourceDirectory | File | |
| destinationDirectory | File | |
| browser | String | |
| base | String | |
### copyDirectoryCompatibilityMode [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L330)
+ Description:
+ Access: private
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| source | File | |
| destination | File | |
| browser | String | |
| base | String | |
### copy [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L339)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| source | InputStream | |
| target | OutputStream | |
### copyFile [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L348)
+ Description:
+ Access: private
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| sourceFile | File | |
| destinationFile | File | |
### validateProfileFirstRun [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L359)
+ Description:
+ Access: public
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| profileDirectory | String | |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L385)
+ Description: Waits for an HTTP proxy on port 4444 to be ready. Returns false on timeout of 200 seconds.
+ Access: public
+ return: true if the proxy is ready false if it is not.
This method has no parameters.
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L395)
+ Description: Waits for an HTTP proxy on port 4444 to be ready. Returns false on timeout of the specified number of seconds.
+ Access: public
+ return: true if the proxy is ready false if it is not.
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | the number of seconds to wait for the proxy to be ready. |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L407)
+ Description: Waits for an HTTP proxy on the specified port to be ready. Returns false on timeout of the specified number of seconds.
+ Access: public
+ return: true if the proxy is ready false if it is not.
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | the number of seconds to wait for the proxy to be ready. |
| port | int | the port to wait for the proxy to be ready on. |
### waitForProxy [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L422)
+ Description: Waits for an HTTP proxy on the specified port to be ready. Returns false on timeout of the specified number of seconds. If the timeout is zero or less the check is disabled and always returns true.
+ Access: public
+ return: true if the proxy is ready false if it is not.
| Name | Type | Description |
| ----- | ----- | ----- |
| timeout | int | the number of seconds to wait for the proxy to be ready. |
| port | int | the port to wait for the proxy to be ready on. |
| host | String | the host to wait for the proxy to be ready on. |
### checkifPortIsOccupied [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L440)
+ Description:
+ Access: public
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| port | int | |
| host | String | |
### setProxyTimeoutTime [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L455)
+ Description: Alters the proxy timeout to customized value time in seconds. May be zero.
+ Access: public
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| time | int | |
### join [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L460)
+ Description:
+ Access: protected
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| arr | String[] | |
### sleep [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L469)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| millis | int | |
### searchFile [[src]](src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java#L477)
+ Description:
+ Access: public
+ Modifiers: static
+ return: File
| Name | Type | Description |
| ----- | ----- | ----- |
| file | File | |
| search | String | |

411
docs/I2PFirefox.md Normal file
View File

@ -0,0 +1,411 @@
# Class I2PFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java)
> */
Access: public
Description:
> I2PFirefox.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Author: idk
Parent class: I2PCommonBrowser
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.File</li>
<li>java.io.FileOutputStream</li>
<li>java.io.FileWriter</li>
<li>java.io.IOException</li>
<li>java.io.OutputStream</li>
<li>java.io.PrintWriter</li>
<li>java.util.ArrayList</li>
<li>java.util.Arrays</li>
<li>java.util.List</li>
<li>java.util.concurrent.TimeUnit</li>
<li>java.util.stream.Collectors</li>
<li>java.util.stream.Stream</li>
</ul>
</details>
## Member Variables
#### String[] FIREFOX_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L)
>
+ Access: private
+ Modifiers: final
#### Process p [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L)
>
+ Access: private
#### boolean usability [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L)
>
+ Access: public
+ Modifiers: static
## Methods
### baseMode [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L35)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
This method has no parameters.
### storeFirefoxDefaults [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L58)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
This method has no parameters.
### firefoxPathsUnix [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L87)
+ Description:
+ Access: public
+ Modifiers: static
+ return: String[]
This method has no parameters.
### firefoxBinsUnix [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L96)
+ Description:
+ Access: public
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIND_FIREFOX_SEARCH_PATHS_UNIX [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L113)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### firefoxPathsOSX [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L126)
+ Description:
+ Access: public
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIND_FIREFOX_SEARCH_PATHS_OSX [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L136)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### firefoxPathsWindows [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L149)
+ Description:
+ Access: public
+ Modifiers: static
+ return: String[]
This method has no parameters.
### firefoxBinsWindows [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L182)
+ 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#L192)
+ 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#L206)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIND_FIREFOX_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L226)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### NEARBY_FIREFOX_SEARCH_PATHS [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L241)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### FIREFOX_FINDER [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L335)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String[]
This method has no parameters.
### onlyValidFirefoxes [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L356)
+ Description: Check our list of firefox paths for a valid firefox binary. Just an existence check for now but should check versions in the future.
+ Access: public
+ return: a list of usable Firefoxes or an empty list if none are found.
This method has no parameters.
### topFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L377)
+ Description: Return the best available Firefox from the list of Firefoxes we have.
+ Access: public
+ return: the path to the best available Firefox or null if none are found.
This method has no parameters.
### topFirefox [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L407)
+ Description: Return the best available Firefox from the list of Firefoxes we have. if override is passed it will be validated and if it validates it will be used.
+ Access: public
+ return: the path to the best available Firefox or null if none are found.
| Name | Type | Description |
| ----- | ----- | ----- |
| overrideFirefox | String | |
### defaultProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L425)
+ Description: Build a ProcessBuilder for the top Firefox binary and the default profile.
+ Access: public
+ return: a ProcessBuilder for the top Firefox binary and the default profile.
This method has no parameters.
### defaultProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L437)
+ Description: Build a ProcessBuilder for the top Firefox binary and the default profile.
+ Access: public
+ return: ProcessBuilder
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | the args to pass to the Firefox binary |
### privateProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L451)
+ Description: Build a ProcessBuilder for the top Firefox binary and the default profile. Pass the --private-window flag to open a window.
+ Access: public
+ return: a ProcessBuilder for the top Firefox binary and the default profile.
This method has no parameters.
### privateProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L464)
+ Description: Build a ProcessBuilder for the top Firefox binary and the default profile. Pass the --private-window flag to open a window.
+ Access: public
+ return: ProcessBuilder
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | the arguments to pass to the Firefox binary |
### appProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L487)
+ Description: Build a ProcessBuilder for the top Firefox binary and the default profile. Pass the --private-window flag to open a window.
+ Access: public
+ return: a ProcessBuilder for the top Firefox binary and the default profile.
This method has no parameters.
### appProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L500)
+ Description: Build a ProcessBuilder for the top Firefox binary and the default profile. Pass the --private-window flag to open a window.
+ Access: public
+ return: ProcessBuilder
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | the arguments to pass to the Firefox binary |
### headlessProcessBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L521)
+ Description: Build a ProcessBuilder for the top Firefox binary and the default profile. Pass the --headless flag to open without a window.
+ Access: public
+ return: ProcessBuilder
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | the arguments to pass to the Firefox binary |
### processBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L549)
+ Description:
+ Access: public
+ return: ProcessBuilder
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
| app | boolean | |
### usabilityMode [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L614)
+ Description:
+ Access: private
+ return: String
This method has no parameters.
### launchAndDetatch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L620)
+ Description:
+ Access: public
+ return: Process
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
| url | String[] | |
### launchAndDetatch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L626)
+ Description:
+ Access: public
+ return: Process
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | int | |
| url | String[] | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L720)
+ Description: Populates a profile directory with a proxy configuration. Waits for an HTTP proxy on the port 4444 to be ready. Launches Firefox with the profile directory.
+ Access: public
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
| url | String[] | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L726)
+ Description:
+ Access: public
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | int | |
| url | String[] | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L752)
+ Description: Populates a profile directory with a proxy configuration. Waits for an HTTP proxy on the port 4444 to be ready. Launches Firefox with the profile directory.
+ Access: public
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L762)
+ Description: Populates a profile directory with a proxy configuration. Waits for an HTTP proxy on the port 4444 to be ready. Launches Firefox with the profile directory. Uses a semi-permanent profile.
+ Access: public
+ return: void
This method has no parameters.
### ValidURL [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L764)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| inUrl | String | |
### main [[src]](src/java/net/i2p/i2pfirefox/I2PFirefox.java#L775)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |

View File

@ -0,0 +1,170 @@
# Class I2PFirefoxProfileBuilder [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java)
> */
Access: public
Description:
> I2PFirefoxProfileBuilder.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I2PFirefoxProfileBuilder is a that builds a profile directory which contains the I2P browser profile for the Firefox browser family. It manages the base profile directory and copies it's contents to the active profile directory which is actually used by Firefox.
Author: idk
Parent class: I2PCommonBrowser
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.File</li>
<li>java.io.IOException</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
### userChromeCSS [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L28)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
This method has no parameters.
### profileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L110)
+ Description: get the profile directory creating it if necessary
+ Access: public
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| app | boolean | |
| base | String | |
### baseProfileDir [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L114)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| file | String | |
| base | String | |
### baseProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L134)
+ Description: get the base profile directory creating it if necessary
+ Access: public
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| base | String | |
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L158)
+ Description: get the runtime directory creating it if create=true
+ Access: public
+ Modifiers: static
+ return: the runtime directory or null if it could not be created
| Name | Type | Description |
| ----- | ----- | ----- |
| create | boolean | if true create the runtime directory if it does not exist |
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L169)
+ Description: get the correct runtime directory
+ Access: public
+ Modifiers: static
+ return: the runtime directory or null if it could not be created or found
This method has no parameters.
### copyBaseProfiletoProfile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L189)
+ Description: Copy the inert base profile directory to the runtime profile directory
+ Access: public
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| base | String | |
| app | boolean | |
### writeAppChrome [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L222)
+ Description:
+ Access: protected
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| profile | String | |
### deleteAppChrome [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L235)
+ Description:
+ Access: protected
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| profile | String | |
### copyStrictOptions [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L250)
+ Description: Copy the strict options from the base profile to the profile
+ Access: public
+ Modifiers: static
+ return: true if successful false otherwise
| Name | Type | Description |
| ----- | ----- | ----- |
| base | String | |
| app | boolean | |
### setupUserChrome [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileBuilder.java#L285)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| profileDir | File | |
| app | boolean | |

View File

@ -0,0 +1,131 @@
# Class I2PFirefoxProfileChecker [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java)
> */
Access: public
Description:
> I2PFirefoxProfileChecker.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I2PFirefoxProfileChecker is a that checks if the Firefox profile directory exists and is valid.
Author: idk
Parent class: I2PCommonBrowser
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.BufferedReader</li>
<li>java.io.File</li>
<li>java.io.FileNotFoundException</li>
<li>java.io.FileReader</li>
<li>java.io.FileWriter</li>
<li>java.io.IOException</li>
<li>java.util.Scanner</li>
</ul>
</details>
## No member variables in this class
## Methods
### main [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L32)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
### validateProfileDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L54)
+ Description: Return true if the profile directory is valid.
+ Access: public
+ Modifiers: static
+ return: true if the profile directory is valid false otherwise
| Name | Type | Description |
| ----- | ----- | ----- |
| profileDirectory | String | the profile directory to check |
### deRestrictHTTPSAndSetupHomepage [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L87)
+ Description:
+ Access: private
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| profile | String | |
### undoHttpsOnlyMode [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L110)
+ Description:
+ Access: private
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| fileToBeModified | File | |
### undoHomepage [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L116)
+ Description:
+ Access: private
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| fileToBeModified | File | |
### undoValue [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L139)
+ Description:
+ Access: public
+ Modifiers: static
+ return: boolean
| Name | Type | Description |
| ----- | ----- | ----- |
| oldString | String | |
| newString | String | |
| fileToBeModified | File | |
### validateFile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L173)
+ Description: Return true if the file is valid.
+ Access: public
+ Modifiers: static
+ return: true if the file is valid false otherwise
| Name | Type | Description |
| ----- | ----- | ----- |
| file | String | the file to check |
### validateExtensionDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileChecker.java#L200)
+ Description: Return true if the extension directory is valid.
+ Access: public
+ Modifiers: static
+ return: true if the extension directory is valid false otherwise
| Name | Type | Description |
| ----- | ----- | ----- |
| extensionDirectory | String | the extension directory to check |

View File

@ -0,0 +1,50 @@
# Class I2PFirefoxProfileUnpacker [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java)
> */
Access: public
Description:
> I2PFirefoxProfileUnpacker.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I2PFirefoxProfileUnpacker is a that unpacks the I2P Firefox profile from a zip file embedded in the `jar` file. The zip is unpacked to a base directory where it is left untouched and the base profile is copied to the active profile directory.
Author: idk
Parent class: I2PCommonBrowser
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
</ul>
</details>
## No member variables in this class
## Methods
### main [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java#L23)
+ Description:
+ Access: public
+ Modifiers: static
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| args | String[] | |
### unpackProfile [[src]](src/java/net/i2p/i2pfirefox/I2PFirefoxProfileUnpacker.java#L38)
+ Description: unpack the profile directory
+ Access: public
+ return: true if the profile directory was successfully unpacked
| Name | Type | Description |
| ----- | ----- | ----- |
| profileDirectory | String | |
| base | String | |

View File

@ -0,0 +1,215 @@
# Class I2PGenericUnsafeBrowser [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java)
>
Access: public
Description:
> I2PChromiumProfileChecker.java Copyright C 2022 idk <hankhill19580@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the MIT License. See LICENSE.md for details. This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. I2PGenericUnsafeBrowser is a wrapper which sets common environment variables for the process controlled by a processbuilder. ALWAYS ALWAYS ALWAYS try the Firefox and Chromium specific launchers first.
Author: idk
Parent class: I2PCommonBrowser
package: net.i2p.i2pfirefox
## Dependencies
<details>
<summary>
Show dependencies
</summary>
<ul>
<li>java.io.File</li>
<li>java.io.FileOutputStream</li>
<li>java.io.IOException</li>
<li>java.io.OutputStream</li>
<li>java.net.Socket</li>
<li>java.util.ArrayList</li>
<li>java.util.Arrays</li>
<li>java.util.List</li>
<li>java.util.Scanner</li>
<li>java.util.stream.Collectors</li>
</ul>
</details>
## Member Variables
#### int DEFAULT_TIMEOUT [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L)
>
+ Access: private
+ Modifiers: final
#### String BROWSER [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L)
>
+ Access: public
+ Modifiers: static
#### Process p [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L)
>
+ Access: private
## Methods
### getDefaultWindowsBrowser [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L101)
+ Description: Obtains the default browser for the Windows platform which by now should be Edgium in the worst-case scenario but in case it isn't we can use this function to figure it out. It can find: 1. The current user's HTTPS default browser if they configured it to be non-default 2. The current user's HTTP default browser if they configured it to be non-default 3. Edgium if it's available 4. iexplore if it's not and it will return the first one we find in exactly that order. Adapted from:
+ Access: public
+ Modifiers: static
+ return: path to command[0] and target URL[1] to the default browser ready for execution or null if not found
This method has no parameters.
### registryQuery [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L142)
+ Description: obtains a value matching a key contained in the windows registry at a path represented by hkeyquery
+ Access: private
+ Modifiers: static
+ return: either a registry "Default" value or null if one does not exist/is empty
| Name | Type | Description |
| ----- | ----- | ----- |
| hkeyquery | String | registry entry to ask for. |
| key | String | key to retrieve value from |
### followUserConfiguredBrowserToCommand [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L180)
+ Description: If following a query back to the Default value doesn't work then what we have is a "ProgID" which will be registered in \HKEY_CLASSES_ROOT\%ProgId% and will have an entry \shell\open\command where \shell\open\command yields the value that contains the command it needs. This function takes a registry query in the same format as getDefaultOutOfRegistry but instead of looking for the default entry
+ Access: private
+ Modifiers: static
+ return: the command required to run the application referenced in hkeyquery or null
| Name | Type | Description |
| ----- | ----- | ----- |
| hkeyquery | String | |
### followProgIdToCommand [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L196)
+ Description: Cross-references a progId obtained by followUserConfiguredBrowserToCommand against HKEY_CLASSES_ROOT\%ProgId%\shell\open\command which holds the value of the command which we need to run to launch the default browser.
+ Access: private
+ Modifiers: static
+ return: the command required to run the application referenced in hkeyquery or null
| Name | Type | Description |
| ----- | ----- | ----- |
| progid | String | |
### getDefaultOutOfRegistry [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L215)
+ Description: obtains a default browsing command out of the Windows registry.
+ Access: private
+ Modifiers: static
+ return: either a registry "Default" value or null if one does not exist/is empty
| Name | Type | Description |
| ----- | ----- | ----- |
| hkeyquery | String | registry entry to ask for. |
### scanAPath [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L230)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| dir | String | |
### getAnyUnixBrowser [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L245)
+ Description: Find any browser in our list within a UNIX path
+ Access: public
+ Modifiers: static
+ return: String
This method has no parameters.
### findUnsafeBrowserAnywhere [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L264)
+ Description: Find any usable browser and output the whole path
+ Access: public
+ Modifiers: static
+ return: String
This method has no parameters.
### deleteRuntimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L325)
+ Description: delete the runtime directory
+ Access: public
+ Modifiers: static
+ return: boolean
This method has no parameters.
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L341)
+ Description: get the runtime directory creating it if create=true
+ Access: public
+ Modifiers: static
+ return: the runtime directory or null if it could not be created
| Name | Type | Description |
| ----- | ----- | ----- |
| create | boolean | if true create the runtime directory if it does not exist |
### runtimeDirectory [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L353)
+ Description: get the correct runtime directory
+ Access: public
+ Modifiers: static
+ return: the runtime directory or null if it could not be created or found
This method has no parameters.
### launchAndDetatch [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L368)
+ Description:
+ Access: public
+ return: Process
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
| url | String[] | |
### launch [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L390)
+ Description:
+ Access: public
+ return: void
| Name | Type | Description |
| ----- | ----- | ----- |
| privateWindow | boolean | |
| url | String[] | |
### ValidURL [[src]](src/java/net/i2p/i2pfirefox/I2PGenericUnsafeBrowser.java#L408)
+ Description:
+ Access: private
+ Modifiers: static
+ return: String
| Name | Type | Description |
| ----- | ----- | ----- |
| inUrl | String | |

View File

@ -4,6 +4,7 @@ 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
mkdir -p docs
mv -v generated/net/i2p/i2pfirefox/*.md ./docs/
rm -rf generated
git add ./*.md