-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated translations and fixed linux native messaging issue
- Loading branch information
subhra74
committed
May 21, 2020
1 parent
fe50900
commit 29153d1
Showing
13 changed files
with
983 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,12 @@ public class NativeMessagingHostInstaller { | |
|
||
private static final String FIREFOX_EXTENSION_IDS = String.join(",", "\"[email protected]\""); | ||
|
||
private static final String CHROME_LINUX_LOCATION = "~/.config/google-chrome/NativeMessagingHosts", | ||
FIREFOX_LINUX_LOCATION = "~/.mozilla/native-messaging-hosts", | ||
CHROME_MAC_LOCATION = "~/Library/Application Support/Google/Chrome/NativeMessagingHosts", | ||
FIREFOX_MAC_LOCATION = "~/Library/Application Support/Mozilla/NativeMessagingHosts", | ||
CHROMIUM_LINUX_LOCATION = "~/.config/chromium/NativeMessagingHosts", | ||
CHROMIUM_MAC_LOCATION = "~/Library/Application Support/Chromium/NativeMessagingHosts"; | ||
private static final String CHROME_LINUX_LOCATION = ".config/google-chrome/NativeMessagingHosts", | ||
FIREFOX_LINUX_LOCATION = ".mozilla/native-messaging-hosts", | ||
CHROME_MAC_LOCATION = "Library/Application Support/Google/Chrome/NativeMessagingHosts", | ||
FIREFOX_MAC_LOCATION = "Library/Application Support/Mozilla/NativeMessagingHosts", | ||
CHROMIUM_LINUX_LOCATION = ".config/chromium/NativeMessagingHosts", | ||
CHROMIUM_MAC_LOCATION = "Library/Application Support/Chromium/NativeMessagingHosts"; | ||
|
||
public static final synchronized void installNativeMessagingHostForChrome() { | ||
installNativeMessagingHostForChrome(XDMUtils.detectOS(), false); | ||
|
@@ -51,9 +51,7 @@ private static final void installNativeMessagingHostForChrome(int os, boolean ch | |
} | ||
} | ||
File manifestFile = new File(Config.getInstance().getDataFolder(), "xdm_chrome.native_host.json"); | ||
File nativeHostFile = new File(XDMUtils.getJarFile().getParentFile(), | ||
System.getProperty("os.name").toLowerCase().contains("windows") ? "native_host.exe" | ||
: "native_host"); | ||
File nativeHostFile = new File(XDMUtils.getJarFile().getParentFile(), "native_host.exe"); | ||
createNativeManifest(manifestFile, nativeHostFile, BrowserType.Chrome); | ||
try { | ||
Advapi32Util.registrySetStringValue(WinReg.HKEY_CURRENT_USER, | ||
|
@@ -65,18 +63,14 @@ private static final void installNativeMessagingHostForChrome(int os, boolean ch | |
return; | ||
} | ||
} else { | ||
File manifestFolder = new File(os == XDMUtils.MAC ? (chromium ? CHROMIUM_MAC_LOCATION : CHROME_MAC_LOCATION) | ||
: (chromium ? CHROMIUM_LINUX_LOCATION : CHROME_LINUX_LOCATION)); | ||
File manifestFolder = new File(System.getProperty("user.home"), | ||
os == XDMUtils.MAC ? (chromium ? CHROMIUM_MAC_LOCATION : CHROME_MAC_LOCATION) | ||
: (chromium ? CHROMIUM_LINUX_LOCATION : CHROME_LINUX_LOCATION)); | ||
if (!manifestFolder.exists()) { | ||
manifestFolder.mkdirs(); | ||
} | ||
File manifestFile = new File( | ||
os == XDMUtils.MAC ? (chromium ? CHROMIUM_MAC_LOCATION : CHROME_MAC_LOCATION) | ||
: (chromium ? CHROMIUM_LINUX_LOCATION : CHROME_LINUX_LOCATION), | ||
"xdm_chrome.native_host.json"); | ||
File nativeHostFile = new File(XDMUtils.getJarFile().getParentFile(), | ||
System.getProperty("os.name").toLowerCase().contains("windows") ? "native_host.exe" | ||
: "native_host"); | ||
File manifestFile = new File(manifestFolder, "xdm_chrome.native_host.json"); | ||
File nativeHostFile = new File(XDMUtils.getJarFile().getParentFile(), "native_host"); | ||
createNativeManifest(manifestFile, nativeHostFile, BrowserType.Chrome); | ||
} | ||
|
||
|
@@ -95,9 +89,7 @@ public static final void installNativeMessagingHostForFireFox(int os) { | |
} | ||
|
||
File manifestFile = new File(Config.getInstance().getDataFolder(), "xdmff.native_host.json"); | ||
File nativeHostFile = new File(XDMUtils.getJarFile().getParentFile(), | ||
System.getProperty("os.name").toLowerCase().contains("windows") ? "native_host.exe" | ||
: "native_host"); | ||
File nativeHostFile = new File(XDMUtils.getJarFile().getParentFile(), "native_host.exe"); | ||
createNativeManifest(manifestFile, nativeHostFile, BrowserType.Firefox); | ||
try { | ||
Advapi32Util.registrySetStringValue(WinReg.HKEY_CURRENT_USER, | ||
|
@@ -109,15 +101,13 @@ public static final void installNativeMessagingHostForFireFox(int os) { | |
return; | ||
} | ||
} else { | ||
File manifestFolder = new File(os == XDMUtils.MAC ? FIREFOX_MAC_LOCATION : FIREFOX_LINUX_LOCATION); | ||
File manifestFolder = new File(System.getProperty("user.home"), | ||
os == XDMUtils.MAC ? FIREFOX_MAC_LOCATION : FIREFOX_LINUX_LOCATION); | ||
if (!manifestFolder.exists()) { | ||
manifestFolder.mkdirs(); | ||
} | ||
File manifestFile = new File(os == XDMUtils.MAC ? FIREFOX_MAC_LOCATION : FIREFOX_LINUX_LOCATION, | ||
"xdmff.native_host.json"); | ||
File nativeHostFile = new File(XDMUtils.getJarFile().getParentFile(), | ||
System.getProperty("os.name").toLowerCase().contains("windows") ? "native_host.exe" | ||
: "native_host"); | ||
File manifestFile = new File(manifestFolder, "xdmff.native_host.json"); | ||
File nativeHostFile = new File(XDMUtils.getJarFile().getParentFile(), "native_host"); | ||
createNativeManifest(manifestFile, nativeHostFile, BrowserType.Firefox); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.