Skip to content

Commit

Permalink
un-do changes for passing additional arguments to REG QUERY
Browse files Browse the repository at this point in the history
  • Loading branch information
eyedeekay committed Oct 26, 2022
1 parent 2389ab5 commit f001630
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions apps/systray/java/src/net/i2p/apps/systray/UrlLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,6 @@ public String getDefaultWindowsBrowser(String url) {
return "C:\\Program Files\\Internet Explorer\\iexplore.exe";
}

/**
* obtains a value matching a key contained in the windows registry at a path
* represented by hkeyquery
*
* @param hkeyquery registry entry to ask for.
* @param key key to retrieve value from
* @return either a registry "Default" value or null if one does not exist/is empty
* @since 2.0.0
*/
private String registryQuery(String hkeyquery, String key) {
return registryQuery(hkeyquery, key, null);
}
/**
* obtains a value matching a key contained in the windows registry at a path
* represented by hkeyquery
Expand All @@ -242,14 +230,11 @@ private String registryQuery(String hkeyquery, String key) {
* @return either a registry "Default" value or null if one does not exist/is empty
* @since 2.0.0
*/
private String registryQuery(String hkeyquery, String key, String[] additionalArgs) {
private String registryQuery(String hkeyquery, String key) {
try {
// Get registry where we find the default browser
String[] cmd = {"REG", "QUERY", hkeyquery};
ArrayList<String> cmdList = new ArrayList<String>(Arrays.asList(cmd));
if (additionalArgs != null)
cmdList.addAll(Arrays.asList(additionalArgs));
Process process = Runtime.getRuntime().exec(cmdList.toArray(cmd));
Process process = Runtime.getRuntime().exec(cmd);
Scanner kb = new Scanner(process.getInputStream());
while (kb.hasNextLine()) {
String line = kb.nextLine().trim();
Expand Down

0 comments on commit f001630

Please sign in to comment.