Alistair Neil
The app launcher is here in the default package which should not normally be
used. The method java uses to launche its apps is not fully compatible with
various Linux launchers panels such as Dockbarx or Unity launchers and thus
confuses those apps. By putting this simple launch handle here in the default
package the Linux dockpanel launchers should function correctly when it
commes to application pinning.
Handle for controllerEventFired should be overridden by parent class
java.net.Socket
createSocks4aSocket(java.lang.String socksaddr,
int socksport,
java.lang.String remotehost,
int remoteport)
Create a Socks4a socket Taken from Wikipedia SOCKS4a is a simple
extension to SOCKS4 protocol that allows a client that cannot resolve the
destination host's domain name to specify it.
public final java.util.ArrayList<java.lang.String> sendCommand(java.lang.String command)
Send a command to tor client
Parameters:
command -
Returns:
Arraylist containing the result of the command
createTorSocketToURL
public java.net.Socket createTorSocketToURL(java.lang.String url,
boolean nowww)
Create a socks4a socket to this URL on this tor connection, if nowww is
true then remove www. from domain
Parameters:
url -
nowww -
Returns:
socket
createSocks4aSocket
public java.net.Socket createSocks4aSocket(java.lang.String socksaddr,
int socksport,
java.lang.String remotehost,
int remoteport)
Create a Socks4a socket Taken from Wikipedia SOCKS4a is a simple
extension to SOCKS4 protocol that allows a client that cannot resolve the
destination host's domain name to specify it.
The client should set the first three bytes of DSTIP to NULL and the last
byte to a non-zero value. (This corresponds to IP address 0.0.0.x, with x
nonzero, an inadmissible destination address and thus should never occur
if the client can resolve the domain name.) Following the NULL byte
terminating USERID, the client must send the destination domain name and
terminate it with another NULL byte. This is used for both "connect" and
"bind" requests.
Client to SOCKS server: field 1: SOCKS version number, 1 byte, must be
0x04 for this version field 2: command code, 1 byte: 0x01 = establish a
TCP/IP stream connection 0x02 = establish a TCP/IP port binding field 3:
network byte order port number, 2 bytes field 4: deliberate invalid IP
address, 4 bytes, first three must be 0x00 and the last one must not be
0x00 field 5: the user ID string, variable length, terminated with a null
(0x00) field 6: the domain name of the host we want to contact, variable
length, terminated with a null (0x00)
Server to SOCKS client: field 1: null byte field 2: status, 1 byte: 0x5a
= request granted 0x5b = request rejected or failed 0x5c = request failed
because client is not running identd (or not reachable from the server)
0x5d = request failed because client's identd could not confirm the user
ID string in the request field 3: network byte order port number, 2 bytes
field 4: network byte order IP address, 4 bytes
A server using protocol SOCKS4A must check the DSTIP in the request
packet. If it represents address 0.0.0.x with nonzero x, the server must
read in the domain name that the client sends in the packet. The server
should resolve the domain name and make connection to the destination
host if it can.
public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
Specified by:
getTableCellRendererComponent in interface javax.swing.table.TableCellRenderer
Overrides:
getTableCellRendererComponent in class javax.swing.table.DefaultTableCellRenderer
This populates the the current folder whose name is derived from the
listening port with data from the given source folder derived by the
given port number.
data - line data from standard output of Tor client
setSilentBootEnabled
public final void setSilentBootEnabled(boolean enabled)
Enable/Disable bootstrap message events on startup
Parameters:
enabled -
getEventMessage
public java.lang.String getEventMessage(int event)
Get textual representation on an event
Parameters:
event -
Returns:
Event as text
torProcessEventFired
public void torProcessEventFired(int event,
java.lang.String data)
Called if an event was fired, will be overidden by sub class
Parameters:
event -
data -
setControlPassword
public final void setControlPassword(java.lang.String secret,
java.lang.String hashpass)
getSecret
public final java.lang.String getSecret()
Get the currently set authentification secret
Returns:
String
setBridges
public final void setBridges(java.lang.String bridges)
Set Tor bridges, supports multiple addresses
Parameters:
bridges -
validateBridges
public boolean validateBridges(java.lang.String bridges)
Validate bridge addresses
Parameters:
bridges -
Returns:
true if valid
validateHostPort
public final boolean validateHostPort(java.lang.String hostport)
Validate a host:port ipv4 address
Parameters:
hostport -
Returns:
true if valid
getBridges
public final java.lang.String getBridges()
Get bridges
Returns:
bridges as csv string
setOwnershipID
public void setOwnershipID(java.lang.String processid)
Set Ownership process id, useful for proper process termination in event
of a crash
Parameters:
processid -
getOwnershipID
public java.lang.String getOwnershipID()
Return the currently set process ownership ID
Returns:
String process id
setGeoIP4
public final void setGeoIP4(java.lang.String filepath)
Set the path to the geoip file
Parameters:
filepath - File location
setGeoIP6
public final void setGeoIP6(java.lang.String filepath)
Set the path to the geoip file
Parameters:
filepath - File location
getClientLocation
public final java.lang.String getClientLocation()
Get Tor client location as a filepath
Returns:
filepath as string
getConfigFilePath
public final java.lang.String getConfigFilePath()
Get the path to the configuration file
Returns:
String Path to configuration file
getCLIOptions
public final java.lang.String getCLIOptions(java.lang.String option)
Get a previously added tor option string
Parameters:
option - Tor option key
Returns:
String Tor option value
setCLIOption
public final void setCLIOption(java.lang.String option,
java.lang.String value)
Add a tor option string which is passed to the tor client on startup. See
Tor documentation for valid options.
Parameters:
option -
value -
setBoolTorOption
public final void setBoolTorOption(java.lang.String option,
boolean value)
Add a tor option boolean value
Parameters:
option -
value -
getTorrcOption
public final java.lang.String getTorrcOption(java.lang.String option)
Get a previously added tor option string
Parameters:
option - Tor option key
Returns:
String Tor option value
setTorrcOption
public final void setTorrcOption(java.lang.String option,
java.lang.String value)
Add a torrc option string See Tor documentation for valid options.
Parameters:
option -
value -
getTorrcOptionsAsString
public final java.lang.String getTorrcOptionsAsString()
Gets all the currently set torrc options as single String
Returns:
String Tor client formatted cli arguments
clearTorrcOption
public final void clearTorrcOption(java.lang.String option)
Remove previously add torrc option
Parameters:
option -
getCLIOptionBool
public final boolean getCLIOptionBool(java.lang.String option)
Get a previously added tor option boolean value
Parameters:
option - Tor option key
Returns:
Boolean value
clearCLIOption
public final void clearCLIOption(java.lang.String option)
Remove previously add tor option
Parameters:
option -
getCLIOptionsAsString
public final java.lang.String getCLIOptionsAsString()
Gets all the currently set tor options as single String for use as
arguments passed to tor client
Returns:
String Tor cleint formatted cli arguments
getListenPort
public final int getListenPort()
Get the listening port
Returns:
port
getControlPort
public final int getControlPort()
Get the control port
Returns:
port
createDefaultConfig
public final void createDefaultConfig()
Creates the default Tor config file
deleteConfigFile
public final void deleteConfigFile()
Delete the configuration file
createDataFolder
public final void createDataFolder()
Creates a data folder for the Tor client to put its cache data
getDataFolder
public final java.lang.String getDataFolder()
Get the datafolder being used by tor client
Returns:
Path to datafolder
getCacheAge
public float getCacheAge()
Get the age of the file cache in minutes
Returns:
age of cache in minutes
deleteCacheData
public final void deleteCacheData()
Delete Tor cache data
setCachedDataFolder
public final void setCachedDataFolder(int port)
This populates the the current folder whose name is derived from the
listening port with data from the given source folder derived by the
given port number. This effectively allows each Tor client spawned to
have its Tor cache data copied from the first Tor client launched instead
of having to go to the net and fetch it and thus start up is a lot
faster. I was actually mildly suprised that this actually works.
Parameters:
port -
getCachedDataFolder
public final java.lang.String getCachedDataFolder()
Get the currently set cached data folder
Returns:
path to cached data folder as String
setStdoutTextArea
public void setStdoutTextArea(javax.swing.JTextArea jta)
Set the text area that will receive Stdout output
Parameters:
jta -
setMaxHistory
public void setMaxHistory(int lines)
Set the maximum no of lines to display in the Stdout output
getExitNodes(boolean all,
boolean omitfailednodes)
Get a list of exitnodes, if all is false then it returns only favourited
nodes, if omitfailednodes is true then don't include nodes that failed
testing
Get a string of comma separated exitnodes, if all is false then it
returns only favourited nodes, if omitfailednodes is true then don't
include nodes that failed testing
public final java.util.ArrayList<java.lang.String> getExitNodes(boolean all,
boolean omitfailednodes)
Get a list of exitnodes, if all is false then it returns only favourited
nodes, if omitfailednodes is true then don't include nodes that failed
testing
Parameters:
all -
omitfailednodes -
Returns:
ArrayList of exit nodes
getExitNodesAsString
public final java.lang.String getExitNodesAsString(boolean all,
boolean omitfailednodes)
Get a string of comma separated exitnodes, if all is false then it
returns only favourited nodes, if omitfailednodes is true then don't
include nodes that failed testing
Parameters:
all -
omitfailednodes -
Returns:
String of exitnodes in csv format
getGuardNodes
public final java.util.ArrayList<java.lang.String> getGuardNodes()
Get a list of all guard nodes guard nodes
Returns:
ArrayList of guard nodes
getGuardFavouritesAsCSV
public final java.lang.String getGuardFavouritesAsCSV()
Get guard favourites
Returns:
CSV string of guard entry fingerprints
refreshGuardTableModel
public final void refreshGuardTableModel()
Update the guard node table model
refreshExitTableModel
public final void refreshExitTableModel(java.lang.String isocountry)
Update the table model based on supplied country
Parameters:
isocountry - in the format "GB,Great Britain"
getNumberOfFavs
public int getNumberOfFavs()
Get the number of active favourites
Returns:
number of favs as int
terminate
public final void terminate()
Ensures any threaded actions will terminate themselves
Get a list of exitnodes, if all is false then it returns only favourited
nodes, if omitfailednodes is true then don't include nodes that failed
testing
Get a string of comma separated exitnodes, if all is false then it
returns only favourited nodes, if omitfailednodes is true then don't
include nodes that failed testing
This populates the the current folder whose name is derived from the
listening port with data from the given source folder derived by the
given port number.
Create a Socks4a socket Taken from Wikipedia SOCKS4a is a simple
extension to SOCKS4 protocol that allows a client that cannot resolve the
destination host's domain name to specify it.
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
Overview
The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
Package
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
Interfaces (italic)
Classes
Enums
Exceptions
Errors
Annotation Types
Class/Interface
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
Class inheritance diagram
Direct Subclasses
All Known Subinterfaces
All Known Implementing Classes
Class/interface declaration
Class/interface description
Nested Class Summary
Field Summary
Constructor Summary
Method Summary
Field Detail
Constructor Detail
Method Detail
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
Annotation Type
Each annotation type has its own separate page with the following sections:
Annotation Type declaration
Annotation Type description
Required Element Summary
Optional Element Summary
Element Detail
Enum
Each enum has its own separate page with the following sections:
Enum declaration
Enum description
Enum Constant Summary
Enum Constant Detail
Use
Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
Tree (Class Hierarchy)
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
Deprecated API
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
Index
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
Prev/Next
These links take you to the next or previous class, interface, package, or related page.
Frames/No Frames
These links show and hide the HTML frames. All pages are available with or without frames.
All Classes
The All Classes link shows all classes and interfaces except non-static nested types.
Serialized Form
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
selektor-3.13.73/SelekTOR.pro 0000644 0001750 0001750 00000032111 13302030722 015200 0 ustar bannor bannor
-libraryjars /usr/lib/jvm/default-java/jre/lib/resources.jar
-libraryjars /usr/lib/jvm/default-java/jre/lib/rt.jar
-libraryjars /usr/lib/jvm/default-java/jre/lib/jsse.jar
-libraryjars /usr/lib/jvm/default-java/jre/lib/charsets.jar
-libraryjars /usr/lib/jvm/default-java/jre/lib/management-agent.jar
-libraryjars /usr/lib/jvm/default-java/jre/lib/jce.jar
-libraryjars /usr/lib/jvm/default-java/jre/lib/ext/dnsns.jar
-libraryjars /usr/lib/jvm/default-java/jre/lib/ext/localedata.jar
-libraryjars /usr/lib/jvm/default-java/jre/lib/ext/sunjce_provider.jar
-libraryjars /usr/lib/jvm/default-java/jre/lib/ext/sunpkcs11.jar
-target 1.7
-optimizations !code/allocation/*
-optimizationpasses 2
-dontobfuscate
-overloadaggressively
-verbose
-ignorewarnings
-keepclasseswithmembers class * {
*** styleFactory;
}
# Keep names - Native method names. Keep all native class/method names.
-keepclasseswithmembers,allowshrinking class * {
native ;
}
# Keep - Applications. Keep all application classes, along with their 'main'
# methods.
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}
# Also keep - Enumerations. Keep the special static methods that are required in
# enumeration classes.
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
# Also keep - Database drivers. Keep all implementations of java.sql.Driver.
-keep class * extends java.sql.Driver
# Also keep - Swing UI L&F. Keep all extensions of javax.swing.plaf.ComponentUI,
# along with the special 'createUI' method.
-keep class * extends javax.swing.plaf.ComponentUI {
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent);
}
# Remove - Math method calls. Remove all invocations of Math
# methods without side effects whose return values are not used.
-assumenosideeffects public class java.lang.Math {
public static double sin(double);
public static double cos(double);
public static double tan(double);
public static double asin(double);
public static double acos(double);
public static double atan(double);
public static double toRadians(double);
public static double toDegrees(double);
public static double exp(double);
public static double log(double);
public static double log10(double);
public static double sqrt(double);
public static double cbrt(double);
public static double IEEEremainder(double,double);
public static double ceil(double);
public static double floor(double);
public static double rint(double);
public static double atan2(double,double);
public static double pow(double,double);
public static int round(float);
public static long round(double);
public static double random();
public static int abs(int);
public static long abs(long);
public static float abs(float);
public static double abs(double);
public static int max(int,int);
public static long max(long,long);
public static float max(float,float);
public static double max(double,double);
public static int min(int,int);
public static long min(long,long);
public static float min(float,float);
public static double min(double,double);
public static double ulp(double);
public static float ulp(float);
public static double signum(double);
public static float signum(float);
public static double sinh(double);
public static double cosh(double);
public static double tanh(double);
public static double hypot(double,double);
public static double expm1(double);
public static double log1p(double);
}
# Remove - Number method calls. Remove all invocations of Number
# methods without side effects whose return values are not used.
-assumenosideeffects public class java.lang.* extends java.lang.Number {
public static java.lang.String toString(byte);
public static java.lang.Byte valueOf(byte);
public static byte parseByte(java.lang.String);
public static byte parseByte(java.lang.String,int);
public static java.lang.Byte valueOf(java.lang.String,int);
public static java.lang.Byte valueOf(java.lang.String);
public static java.lang.Byte decode(java.lang.String);
public int compareTo(java.lang.Byte);
public static java.lang.String toString(short);
public static short parseShort(java.lang.String);
public static short parseShort(java.lang.String,int);
public static java.lang.Short valueOf(java.lang.String,int);
public static java.lang.Short valueOf(java.lang.String);
public static java.lang.Short valueOf(short);
public static java.lang.Short decode(java.lang.String);
public static short reverseBytes(short);
public int compareTo(java.lang.Short);
public static java.lang.String toString(int,int);
public static java.lang.String toHexString(int);
public static java.lang.String toOctalString(int);
public static java.lang.String toBinaryString(int);
public static java.lang.String toString(int);
public static int parseInt(java.lang.String,int);
public static int parseInt(java.lang.String);
public static java.lang.Integer valueOf(java.lang.String,int);
public static java.lang.Integer valueOf(java.lang.String);
public static java.lang.Integer valueOf(int);
public static java.lang.Integer getInteger(java.lang.String);
public static java.lang.Integer getInteger(java.lang.String,int);
public static java.lang.Integer getInteger(java.lang.String,java.lang.Integer);
public static java.lang.Integer decode(java.lang.String);
public static int highestOneBit(int);
public static int lowestOneBit(int);
public static int numberOfLeadingZeros(int);
public static int numberOfTrailingZeros(int);
public static int bitCount(int);
public static int rotateLeft(int,int);
public static int rotateRight(int,int);
public static int reverse(int);
public static int signum(int);
public static int reverseBytes(int);
public int compareTo(java.lang.Integer);
public static java.lang.String toString(long,int);
public static java.lang.String toHexString(long);
public static java.lang.String toOctalString(long);
public static java.lang.String toBinaryString(long);
public static java.lang.String toString(long);
public static long parseLong(java.lang.String,int);
public static long parseLong(java.lang.String);
public static java.lang.Long valueOf(java.lang.String,int);
public static java.lang.Long valueOf(java.lang.String);
public static java.lang.Long valueOf(long);
public static java.lang.Long decode(java.lang.String);
public static java.lang.Long getLong(java.lang.String);
public static java.lang.Long getLong(java.lang.String,long);
public static java.lang.Long getLong(java.lang.String,java.lang.Long);
public static long highestOneBit(long);
public static long lowestOneBit(long);
public static int numberOfLeadingZeros(long);
public static int numberOfTrailingZeros(long);
public static int bitCount(long);
public static long rotateLeft(long,int);
public static long rotateRight(long,int);
public static long reverse(long);
public static int signum(long);
public static long reverseBytes(long);
public int compareTo(java.lang.Long);
public static java.lang.String toString(float);
public static java.lang.String toHexString(float);
public static java.lang.Float valueOf(java.lang.String);
public static java.lang.Float valueOf(float);
public static float parseFloat(java.lang.String);
public static boolean isNaN(float);
public static boolean isInfinite(float);
public static int floatToIntBits(float);
public static int floatToRawIntBits(float);
public static float intBitsToFloat(int);
public static int compare(float,float);
public boolean isNaN();
public boolean isInfinite();
public int compareTo(java.lang.Float);
public static java.lang.String toString(double);
public static java.lang.String toHexString(double);
public static java.lang.Double valueOf(java.lang.String);
public static java.lang.Double valueOf(double);
public static double parseDouble(java.lang.String);
public static boolean isNaN(double);
public static boolean isInfinite(double);
public static long doubleToLongBits(double);
public static long doubleToRawLongBits(double);
public static double longBitsToDouble(long);
public static int compare(double,double);
public boolean isNaN();
public boolean isInfinite();
public int compareTo(java.lang.Double);
public byte byteValue();
public short shortValue();
public int intValue();
public long longValue();
public float floatValue();
public double doubleValue();
public int compareTo(java.lang.Object);
public boolean equals(java.lang.Object);
public int hashCode();
public java.lang.String toString();
}
# Remove - String method calls. Remove all invocations of String
# methods without side effects whose return values are not used.
-assumenosideeffects public class java.lang.String {
public static java.lang.String copyValueOf(char[]);
public static java.lang.String copyValueOf(char[],int,int);
public static java.lang.String valueOf(boolean);
public static java.lang.String valueOf(char);
public static java.lang.String valueOf(char[]);
public static java.lang.String valueOf(char[],int,int);
public static java.lang.String valueOf(double);
public static java.lang.String valueOf(float);
public static java.lang.String valueOf(int);
public static java.lang.String valueOf(java.lang.Object);
public static java.lang.String valueOf(long);
public boolean contentEquals(java.lang.StringBuffer);
public boolean endsWith(java.lang.String);
public boolean equalsIgnoreCase(java.lang.String);
public boolean equals(java.lang.Object);
public boolean matches(java.lang.String);
public boolean regionMatches(boolean,int,java.lang.String,int,int);
public boolean regionMatches(int,java.lang.String,int,int);
public boolean startsWith(java.lang.String);
public boolean startsWith(java.lang.String,int);
public byte[] getBytes();
public byte[] getBytes(java.lang.String);
public char charAt(int);
public char[] toCharArray();
public int compareToIgnoreCase(java.lang.String);
public int compareTo(java.lang.Object);
public int compareTo(java.lang.String);
public int hashCode();
public int indexOf(int);
public int indexOf(int,int);
public int indexOf(java.lang.String);
public int indexOf(java.lang.String,int);
public int lastIndexOf(int);
public int lastIndexOf(int,int);
public int lastIndexOf(java.lang.String);
public int lastIndexOf(java.lang.String,int);
public int length();
public java.lang.CharSequence subSequence(int,int);
public java.lang.String concat(java.lang.String);
public java.lang.String replaceAll(java.lang.String,java.lang.String);
public java.lang.String replace(char,char);
public java.lang.String replaceFirst(java.lang.String,java.lang.String);
public java.lang.String[] split(java.lang.String);
public java.lang.String[] split(java.lang.String,int);
public java.lang.String substring(int);
public java.lang.String substring(int,int);
public java.lang.String toLowerCase();
public java.lang.String toLowerCase(java.util.Locale);
public java.lang.String toString();
public java.lang.String toUpperCase();
public java.lang.String toUpperCase(java.util.Locale);
public java.lang.String trim();
}
# Remove - StringBuffer method calls. Remove all invocations of StringBuffer
# methods without side effects whose return values are not used.
-assumenosideeffects public class java.lang.StringBuffer {
public java.lang.String toString();
public char charAt(int);
public int capacity();
public int codePointAt(int);
public int codePointBefore(int);
public int indexOf(java.lang.String,int);
public int lastIndexOf(java.lang.String);
public int lastIndexOf(java.lang.String,int);
public int length();
public java.lang.String substring(int);
public java.lang.String substring(int,int);
}
# Remove - StringBuilder method calls. Remove all invocations of StringBuilder
# methods without side effects whose return values are not used.
-assumenosideeffects public class java.lang.StringBuilder {
public java.lang.String toString();
public char charAt(int);
public int capacity();
public int codePointAt(int);
public int codePointBefore(int);
public int indexOf(java.lang.String,int);
public int lastIndexOf(java.lang.String);
public int lastIndexOf(java.lang.String,int);
public int length();
public java.lang.String substring(int);
public java.lang.String substring(int,int);
}
# Remove debugging - Throwable_printStackTrace calls. Remove all invocations of
# Throwable.printStackTrace().
-assumenosideeffects public class java.lang.Throwable {
public void printStackTrace();
}
# Remove debugging - Thread_dumpStack calls. Remove all invocations of
# Thread.dumpStack().
-assumenosideeffects public class java.lang.Thread {
public static void dumpStack();
}
selektor-3.13.73/COPYING 0000644 0001750 0001750 00000043254 13302030722 014073 0 ustar bannor bannor GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
selektor-3.13.73/src/ 0000755 0001750 0001750 00000000000 13302030722 013617 5 ustar bannor bannor selektor-3.13.73/src/SelekTOR.java 0000644 0001750 0001750 00000003173 13302030722 016116 0 ustar bannor bannor /*
* Copyright (C) 2014 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* Explanation of why this is in the default package
*
* @author Alistair Neil
*
* The app launcher is here in the default package which should not normally be
* used. The method java uses to launche its apps is not fully compatible with
* various Linux launchers panels such as Dockbarx or Unity launchers and thus
* confuses those apps. By putting this simple launch handle here in the default
* package the Linux dockpanel launchers should function correctly when it
* commes to application pinning.
*
*/
public class SelekTOR {
/**
* @param args the command line arguments
*/
public static void main(final String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
new client.SelekTOR(args);
}
});
}
}
selektor-3.13.73/src/client/ 0000755 0001750 0001750 00000000000 13302030722 015075 5 ustar bannor bannor selektor-3.13.73/src/client/TorProcess.java 0000644 0001750 0001750 00000061651 13302030722 020054 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import javax.swing.JTextArea;
import javax.swing.text.BadLocationException;
import lib.ClientProcess;
import lib.SimpleFile;
/**
*
* @author Alistair Neil
*/
public class TorProcess extends ClientProcess {
public static final int LOG_DEBUG = 0;
public static final int LOG_INFO = 1;
public static final int LOG_NOTICE = 2;
private static final String TORCONFIGFILE = "torrc";
public static final String EMPTYSTRING = "";
// Event constants
public static final int TOR_MESSAGE = 0;
public static final int TOR_BOOT_TIMEOUT = 1;
public static final int TOR_BOOT_FATAL = 2;
public static final int TOR_BOOT_ERROR = 3;
public static final int TOR_CLOCK_ERROR = 4;
public static final int TOR_NOROUTE = 5;
public static final int TOR_BOOTED = 6;
public static final int TOR_RESTARTED = 7;
public static final int TOR_NOEXITS = 8;
public static final int TOR_STOPPED = 9;
public static final int TOR_BRIDGE = 10;
public static final int TOR_NEWCIRC = 11;
public static final int TOR_DIRINFO_STALE = 12;
public static final int TOR_NOHOP0 = 13;
public static final int TOR_NONET_ACTIVITY = 14;
private static final String[] EVENTMESSAGES = new String[]{
"TOR_MESSAGE", "TOR_BOOT_TIMEOUT", "TOR_BOOT_FATAL", "TOR_BOOT_ERROR",
"TOR_CLOCK_ERROR", "TOR_NOROUTE", "TOR_BOOTED", "TOR_RESTARTED",
"TOR_NOEXITS", "TOR_STOPPED", "TOR_BRIDGE", "TOR_NEWCIRC",
"TOR_DIRINFO_STALE", "TOR_NOHOP0", "TOR_NONET_ACTIVITY"
};
private final LinkedHashMap lhmCLIOptions;
private final LinkedHashMap lhmTorrcOptions;
private final String strClientLocation;
private final String strConfigFolder;
private String strSecret;
private String strCachedDataFolder;
private String invCommas = "\"";
private String strExternalArgs = "";
private String strBridges = "";
private int intListenPort;
private int intInitialBootEvent;
private int loglev = LOG_NOTICE;
private float version = 9999;
private int maxlines = 50;
private int nolines;
private JTextArea jtxtstdout;
private boolean boolSilentBoot;
/**
* Constructor
*
* @param clientpath Path to Tor client
* @param configfolder Filepath to torrc
*/
public TorProcess(String clientpath, String configfolder) {
setSilentBootEnabled(false);
strClientLocation = clientpath;
this.intInitialBootEvent = TOR_BOOTED;
this.strConfigFolder = configfolder;
this.lhmCLIOptions = new LinkedHashMap<>();
this.lhmTorrcOptions = new LinkedHashMap<>();
// All our initialisation
if (SimpleFile.getSeparator().compareTo("/") == 0) {
this.invCommas = "";
}
}
/**
* Starts Tor process, and issues booted event on completion
*
*/
public final void startProcess() {
setStartupTimeout(45);
// Cache age check
float age = getCacheAge();
Logger.getGlobal().logp(Level.INFO, TorProcess.class.getName(),
"start() on Port=" + getListenPort(), "Cache age = " + (int) age + " minutes.");
if (age > 180) {
deleteCacheData();
Logger.getGlobal().logp(Level.INFO, TorProcess.class.getName(),
"start() on Port=" + getListenPort(), "Cache stale, deleting old cache data.");
}
// Some essential initialisation
String strConfig = strClientLocation
+ " -f " + invCommas
+ getConfigFilePath()
+ invCommas
+ " " + getCLIOptionsAsString()
+ " " + strExternalArgs;
super.start(strConfig);
}
/**
* Set the Tor stdout log level
*
* @param lev
*/
public final void setLogLevel(int lev) {
loglev = lev;
}
/**
* Set external user provided startup arguments
*
* @param torargs
*/
public final void setExternalArgs(String torargs) {
strExternalArgs = torargs;
}
/**
* Set the listening port
*
* @param port
*/
public final void setListenPort(int port) {
// Setup listening port and control port
if (intListenPort == port) {
return;
}
intListenPort = port;
setCLIOption("SocksPort", String.valueOf(port));
setCLIOption("ControlPort", String.valueOf(port + 1));
// Finish of by creating the default config file and data folders
createDataFolder();
}
/**
* Set the event that is issued on process boot completion
*
* @param event
*/
public final void setInitialBootEvent(int event) {
intInitialBootEvent = event;
}
/**
* Client event handler, can be overriden by parent class
*
* @param data line data from standard output of Tor client
*/
@Override
public final void clientProcessEventFired(String data) {
Logger.getGlobal().logp(Level.FINER, TorProcess.class.getName(),
"clientProcessEventFired() on Port=" + getListenPort(), data);
if (!data.isEmpty()) {
appendStdout(data);
}
// Check for process stopped
if (getClientStatus() == CLIENT_STOPPED) {
torProcessEventFired(TOR_STOPPED, null);
return;
}
// Check for timeout
if (getClientStatus() == CLIENT_TIMEDOUT) {
torProcessEventFired(TOR_BOOT_TIMEOUT, null);
return;
}
if (getClientStatus() == CLIENT_RUNNING) {
// Check to see if we need to copy cache
if (strCachedDataFolder != null) {
SimpleFile.copyFolderContents(strCachedDataFolder, getDataFolder() + SimpleFile.getSeparator(), "torrc");
strCachedDataFolder = null;
}
// Check for fatal tor process startup errors
if (data.contains("[warn] Our clock")) {
torProcessEventFired(TOR_CLOCK_ERROR, data);
return;
}
// Check for errors
if (data.contains("exception") || data.contains("[err]")) {
torProcessEventFired(TOR_BOOT_FATAL, data);
return;
}
// Check for network unreachable
if (data.contains("NOROUTE")) {
torProcessEventFired(TOR_NOROUTE, data);
return;
}
// Check new tor bridge
if (data.contains("[notice] new bridge")) {
torProcessEventFired(TOR_BRIDGE, data);
return;
}
// Check for conditions that may prevent circuit building
if (data.contains("directory information is no longer up-to-date")) {
torProcessEventFired(TOR_DIRINFO_STALE, data);
return;
}
// Check for conditions that will prevent circuit building
if (data.contains("All routers are down")) {
torProcessEventFired(TOR_NOEXITS, data);
return;
}
// Check for Tor retrying on new circuit
if (data.contains("Retrying on a new circuit")) {
torProcessEventFired(TOR_NEWCIRC, data);
return;
}
// Check for Tor failed to find hop zero
if (data.contains("Failed to find node for hop 0")) {
torProcessEventFired(TOR_NOHOP0, data);
return;
}
// Check for no net activity
if (data.contains("Tor has not observed any network activity")) {
torProcessEventFired(TOR_NONET_ACTIVITY, data);
return;
}
// Check for a bootstrap message
if (data.contains("Bootstrapped")) {
// If silent then dont fire bootstrapping messages
if (!boolSilentBoot) {
torProcessEventFired(TOR_MESSAGE, data.substring(data.indexOf(']') + 2));
}
int percent = getPercentage(data);
// Set startup timeout based on percentage of Tor progression
if (percent >= 15) {
setStartupTimeout(60);
}
if (percent >= 40) {
setStartupTimeout(120);
}
if (percent >= 80) {
setStartupTimeout(30);
}
// Check for initial bootup completion
if (percent >= 100) {
setStartupTimeout(-1);
torProcessEventFired(intInitialBootEvent, null);
intInitialBootEvent = TOR_BOOTED;
setSilentBootEnabled(false);
}
}
}
}
/**
* Get percentage value from bootstrap message
*
* @param data
* @return percentage as and int
*/
private int getPercentage(String data) {
int result = -1;
int idx1 = data.indexOf("Bootstrapped ");
if (idx1 > -1) {
idx1 += 13;
int idx2 = data.indexOf('%', idx1);
if (idx2 > -1) {
String temp = data.substring(idx1, idx2);
result = Integer.parseInt(temp);
}
}
return result;
}
/**
* Enable/Disable bootstrap message events on startup
*
* @param enabled
*/
public final void setSilentBootEnabled(boolean enabled) {
boolSilentBoot = enabled;
}
/**
* Get textual representation on an event
*
* @param event
* @return Event as text
*/
public String getEventMessage(int event) {
return EVENTMESSAGES[event];
}
/**
* Called if an event was fired, will be overidden by sub class
*
* @param event
* @param data
*/
public void torProcessEventFired(int event, String data) {
}
public final void setControlPassword(String secret, String hashpass) {
strSecret = secret;
setCLIOption("hashedcontrolpassword", hashpass);
}
/**
* Get the currently set authentification secret
*
* @return String
*/
public final String getSecret() {
return strSecret;
}
/**
* Set Tor bridges, supports multiple addresses
*
* @param bridges
*/
public final void setBridges(String bridges) {
clearCLIOption("UseBridges");
clearCLIOption("Bridge");
clearCLIOption("UpdateBridgesFromAuthority");
strBridges = "";
if (bridges == null || bridges.isEmpty()) {
return;
}
StringBuilder sbBridgesOption = new StringBuilder();
String sep = "";
String[] arrBridges = Pattern.compile(",").split(bridges);
for (String s : arrBridges) {
sbBridgesOption.append(sep);
sbBridgesOption.append(s);
if (sep.isEmpty()) {
sep = " --Bridge ";
}
}
strBridges = bridges;
setCLIOption("UseBridges", "1");
setCLIOption("UpdateBridgesFromAuthority", "1");
setCLIOption("Bridge", sbBridgesOption.toString());
}
/**
* Validate bridge addresses
*
* @param bridges
* @return true if valid
*/
public boolean validateBridges(String bridges) {
if (bridges.isEmpty()) {
return true;
}
String[] arrBridges = Pattern.compile(",").split(bridges);
for (String s : arrBridges) {
if (!validateHostPort(s)) {
return false;
}
}
return true;
}
/**
* Validate a host:port ipv4 address
*
* @param hostport
* @return true if valid
*/
public final boolean validateHostPort(String hostport) {
try {
URI uri = new URI("my://" + hostport); // may throw URISyntaxException
if (uri.getHost() == null || uri.getPort() == -1) {
return false;
}
} catch (Exception ex) {
return false;
}
return true;
}
/**
* Get bridges
*
* @return bridges as csv string
*/
public final String getBridges() {
return strBridges;
}
/**
* Set Ownership process id, useful for proper process termination in event
* of a crash
*
* @param processid
*/
public void setOwnershipID(String processid) {
this.setCLIOption("__OwningControllerProcess", processid);
}
/**
* Return the currently set process ownership ID
*
* @return String process id
*/
public String getOwnershipID() {
return getCLIOptions("__OwningControllerProcess");
}
/**
* Set the path to the geoip file
*
* @param filepath File location
*/
public final void setGeoIP4(String filepath) {
if (filepath != null) {
if (SimpleFile.exists(filepath)) {
setTorrcOption("GeoIPFile", invCommas + filepath + invCommas);
} else {
clearTorrcOption("GeoIPFile");
}
} else {
clearTorrcOption("GeoIPFile");
}
}
/**
* Set the path to the geoip file
*
* @param filepath File location
*/
public final void setGeoIP6(String filepath) {
if (filepath != null) {
if (SimpleFile.exists(filepath)) {
setTorrcOption("GeoIPv6File", invCommas + filepath + invCommas);
} else {
clearTorrcOption("GeoIPv6File");
}
} else {
clearTorrcOption("GeoIPv6File");
}
}
/**
* Get Tor client location as a filepath
*
* @return filepath as string
*/
public final String getClientLocation() {
return strClientLocation;
}
/**
* Get the path to the configuration file
*
* @return String Path to configuration file
*/
public final String getConfigFilePath() {
return getDataFolder() + File.separator + TORCONFIGFILE;
}
/**
* Get a previously added tor option string
*
* @param option Tor option key
* @return String Tor option value
*/
public final String getCLIOptions(String option) {
return lhmCLIOptions.get(option);
}
/**
* Add a tor option string which is passed to the tor client on startup. See
* Tor documentation for valid options.
*
* @param option
* @param value
*/
public final void setCLIOption(String option, String value) {
lhmCLIOptions.put(option, value);
}
/**
* Add a tor option boolean value
*
* @param option
* @param value
*/
public final void setBoolTorOption(String option, boolean value) {
lhmCLIOptions.remove(option);
if (value) {
lhmCLIOptions.put(option, "1");
} else {
lhmCLIOptions.put(option, "0");
}
}
/**
* Get a previously added tor option string
*
* @param option Tor option key
* @return String Tor option value
*/
public final String getTorrcOption(String option) {
return lhmTorrcOptions.get(option);
}
/**
* Add a torrc option string See Tor documentation for valid options.
*
* @param option
* @param value
*/
public final void setTorrcOption(String option, String value) {
if (value.startsWith("\"")) {
value = value.replace('\\', '/');
}
lhmTorrcOptions.put(option, value);
}
/**
* Gets all the currently set torrc options as single String
*
* @return String Tor client formatted cli arguments
*/
public final String getTorrcOptionsAsString() {
Iterator iterator = lhmTorrcOptions.keySet().iterator();
String key;
StringBuilder sbResult = new StringBuilder();
while (iterator.hasNext()) {
key = iterator.next();
sbResult.append(key);
sbResult.append(" ");
sbResult.append(lhmTorrcOptions.get(key));
sbResult.append("\r\n");
}
return sbResult.toString();
}
/**
* Remove previously add torrc option
*
* @param option
*/
public final void clearTorrcOption(String option) {
lhmTorrcOptions.remove(option);
}
/**
* Get a previously added tor option boolean value
*
* @param option Tor option key
* @return Boolean value
*/
public final boolean getCLIOptionBool(String option) {
return lhmCLIOptions.get(option).contentEquals("1");
}
/**
* Remove previously add tor option
*
* @param option
*/
public final void clearCLIOption(String option) {
lhmCLIOptions.remove(option);
}
/**
* Gets all the currently set tor options as single String for use as
* arguments passed to tor client
*
* @return String Tor cleint formatted cli arguments
*/
public final String getCLIOptionsAsString() {
Iterator iterator = lhmCLIOptions.keySet().iterator();
String key;
String value;
StringBuilder sbResult = new StringBuilder();
while (iterator.hasNext()) {
key = iterator.next();
sbResult.append("--");
sbResult.append(key);
sbResult.append(" ");
value = lhmCLIOptions.get(key);
if (!value.isEmpty()) {
sbResult.append(value);
sbResult.append(" ");
}
}
return sbResult.toString().trim();
}
/**
* Get the listening port
*
* @return port
*/
public final int getListenPort() {
return intListenPort;
}
/**
* Get the control port
*
* @return port
*/
public final int getControlPort() {
return intListenPort + 1;
}
/**
* Creates the default Tor config file
*/
public final void createDefaultConfig() {
SimpleFile sfTorrc = new SimpleFile(getConfigFilePath());
sfTorrc.openBufferedWrite();
sfTorrc.writeFile(getTorrcOptionsAsString(), 0);
switch (loglev) {
case LOG_DEBUG:
sfTorrc.writeFile("log debug stdout", 1);
break;
case LOG_INFO:
sfTorrc.writeFile("log info stdout", 1);
break;
case LOG_NOTICE:
sfTorrc.writeFile("log notice stdout", 1);
break;
}
sfTorrc.writeFile(EMPTYSTRING, 1);
sfTorrc.closeFile();
}
/**
* Delete the configuration file
*/
public final void deleteConfigFile() {
SimpleFile.delete(getConfigFilePath());
}
/**
* Creates a data folder for the Tor client to put its cache data
*/
public final void createDataFolder() {
String folder = getDataFolder();
if (folder != null) {
setTorrcOption("datadirectory", invCommas + getDataFolder() + invCommas);
SimpleFile.createFolder(getDataFolder());
}
}
/**
* Get the datafolder being used by tor client
*
* @return Path to datafolder
*/
public final String getDataFolder() {
if (strConfigFolder == null) {
return null;
}
return strConfigFolder + String.valueOf(intListenPort);
}
/**
* Get the age of the file cache in minutes
*
* @return age of cache in minutes
*/
public float getCacheAge() {
String path = getDataFolder() + SimpleFile.getSeparator()
+ "cached-consensus";
if (SimpleFile.exists(path)) {
return SimpleFile.getAgeOfFile(path, SimpleFile.PERIOD_MINUTES);
} else {
return -1;
}
}
/**
* Delete Tor cache data
*/
public final void deleteCacheData() {
SimpleFile.secureWipe(getDataFolder() + SimpleFile.getSeparator() + "cached-consensus");
SimpleFile.secureWipe(getDataFolder() + SimpleFile.getSeparator() + "cached-certs");
SimpleFile.secureWipe(getDataFolder() + SimpleFile.getSeparator() + "cached-descriptors");
SimpleFile.secureWipe(getDataFolder() + SimpleFile.getSeparator() + "cached-descriptors.new");
SimpleFile.secureWipe(getDataFolder() + SimpleFile.getSeparator() + "lock");
SimpleFile.secureWipe(getDataFolder() + SimpleFile.getSeparator() + "state");
}
/**
* This populates the the current folder whose name is derived from the
* listening port with data from the given source folder derived by the
* given port number. This effectively allows each Tor client spawned to
* have its Tor cache data copied from the first Tor client launched instead
* of having to go to the net and fetch it and thus start up is a lot
* faster. I was actually mildly suprised that this actually works.
*
* @param port
*/
public final void setCachedDataFolder(int port) {
if (port < 0) {
strCachedDataFolder = null;
return;
}
strCachedDataFolder = strConfigFolder + String.valueOf(port);
}
/**
* Get the currently set cached data folder
*
* @return path to cached data folder as String
*/
public final String getCachedDataFolder() {
return strCachedDataFolder;
}
/**
* Set the text area that will receive Stdout output
*
* @param jta
*/
public void setStdoutTextArea(JTextArea jta) {
jtxtstdout = jta;
}
/**
* Set the maximum no of lines to display in the Stdout output
*
* @param lines
*/
public void setMaxHistory(int lines) {
maxlines = lines;
}
/**
* Clear the Stdout text area
*/
public void clearStdout() {
if (jtxtstdout != null) {
jtxtstdout.setText("");
}
nolines = 0;
}
/**
* Append text to the StdOut text area
*
* @param text
*/
private void appendStdout(String text) {
if (jtxtstdout == null) {
return;
}
jtxtstdout.append(text + "\n");
if (++nolines > maxlines) {
try {
int end = jtxtstdout.getLineEndOffset(0);
jtxtstdout.replaceRange("", 0, end);
} catch (BadLocationException ex) {
}
}
jtxtstdout.setCaretPosition(jtxtstdout.getText().length());
}
/**
* Get Tor version as float
*
* @return Tor version as String
*/
public final float getVersion() {
if (version == 9999) {
BufferedReader br;
String strVer = "";
Process proc;
try {
proc = Runtime.getRuntime().exec(strClientLocation + " --version");
br = new BufferedReader(new InputStreamReader(proc.getInputStream()), 256);
String line;
while (true) {
line = br.readLine();
if (line == null) {
break;
}
strVer = line;
}
br.close();
proc.destroy();
proc.waitFor();
} catch (IOException | InterruptedException ex) {
Logger.getLogger(TorProcess.class.getName()).log(Level.SEVERE, null, ex);
}
int idx = strVer.indexOf("ion");
if (idx > -1) {
strVer = strVer.substring(idx + 4).replace(".", "");
idx = strVer.indexOf(' ');
if (idx > -1) {
strVer = strVer.substring(0, idx);
}
try {
version = Float.parseFloat("0." + strVer) * 10;
} catch (Exception ex) {
Logger.getGlobal().logp(Level.SEVERE, this.getClass().getName(), "getVersion() Port=" + intListenPort, "", ex);
}
}
}
return version;
}
}
selektor-3.13.73/src/client/QuickAddDialog.java 0000644 0001750 0001750 00000021050 13302030722 020543 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import lib.Localisation;
/**
*
* @author Alistair Neil,
*/
public final class QuickAddDialog extends javax.swing.JDialog {
private static final Localisation LOCAL = new Localisation("resources/MessagesBundle");
public static final int CANCEL = 0;
public static final int APPLY = 1;
public static final int RESET = 2;
/**
* Creates a quick add patterns dialog
*
* @param parent parent frame
* @param modal modality
*/
public QuickAddDialog(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
/**
* Set text that appears on the Apply button
*
* @param text
*/
public void setApplyText(String text) {
jButtonApply.setText(text);
}
/**
* Set the test that appears in both fields
*
* @param desc
* @param pattern
*/
public void setFields(String desc, String pattern) {
jTextDescription.setText(desc);
jTextPattern.setText(pattern);
}
/**
* Get contents of description field
*
* @return String text
*/
public String getDescription() {
return jTextDescription.getText();
}
/**
* Get contents of the pattern field
*
* @return String text
*/
public String getPattern() {
return jTextPattern.getText();
}
/**
* @return the return status of this dialog - one of RET_OK or RET_CANCEL
*/
public int getReturnStatus() {
return returnStatus;
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
// //GEN-BEGIN:initComponents
private void initComponents() {
jPanelPreferences = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jTextDescription = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jTextPattern = new javax.swing.JTextField();
jButtonCancel = new javax.swing.JButton();
jButtonApply = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle(LOCAL.getString("dlg_quickadd_title")); // NOI18N
setIconImage(null);
setResizable(false);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
closeDialog(evt);
}
});
jPanelPreferences.setFont(jPanelPreferences.getFont().deriveFont(jPanelPreferences.getFont().getStyle() | java.awt.Font.BOLD));
jLabel1.setText(LOCAL.getString("label_quickadd_desc")); // NOI18N
jLabel2.setText(LOCAL.getString("label_quickadd_pattern")); // NOI18N
jButtonCancel.setText(LOCAL.getString("button_cancel")); // NOI18N
jButtonCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonCancelActionPerformed(evt);
}
});
jButtonApply.setText(LOCAL.getString("button_addnew")); // NOI18N
jButtonApply.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonApplyActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanelPreferencesLayout = new javax.swing.GroupLayout(jPanelPreferences);
jPanelPreferences.setLayout(jPanelPreferencesLayout);
jPanelPreferencesLayout.setHorizontalGroup(
jPanelPreferencesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelPreferencesLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanelPreferencesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jTextDescription, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
.addComponent(jLabel2)
.addComponent(jTextPattern, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelPreferencesLayout.createSequentialGroup()
.addComponent(jButtonCancel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButtonApply)))
.addContainerGap())
);
jPanelPreferencesLayout.setVerticalGroup(
jPanelPreferencesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelPreferencesLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addGap(0, 0, 0)
.addComponent(jTextDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2)
.addGap(0, 0, 0)
.addComponent(jTextPattern, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanelPreferencesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonApply)
.addComponent(jButtonCancel))
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanelPreferences, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanelPreferences, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
);
pack();
}// //GEN-END:initComponents
private void jButtonApplyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonApplyActionPerformed
doClose(APPLY);
}//GEN-LAST:event_jButtonApplyActionPerformed
private void jButtonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelActionPerformed
doClose(CANCEL);
}//GEN-LAST:event_jButtonCancelActionPerformed
/**
* Closes the dialog
*/
private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
doClose(CANCEL);
}//GEN-LAST:event_closeDialog
private void doClose(int retStatus) {
returnStatus = retStatus;
setVisible(false);
dispose();
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButtonApply;
private javax.swing.JButton jButtonCancel;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanelPreferences;
private javax.swing.JTextField jTextDescription;
private javax.swing.JTextField jTextPattern;
// End of variables declaration//GEN-END:variables
private int returnStatus = CANCEL;
}
selektor-3.13.73/src/client/NodeItem.java 0000644 0001750 0001750 00000021065 13302030722 017450 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import java.text.DecimalFormat;
/**
*
* @author Alistair Neil
*/
public class NodeItem extends Object implements Cloneable {
public static final int TYPE_EXIT = 1;
public static final int TYPE_GUARD = 2;
public static final int TESTSTATUS_UNKNOWN = 0;
public static final int TESTSTATUS_PASSED = 1;
public static final int TESTSTATUS_FAILED = 2;
private int type;
private boolean exitFavourite;
private boolean guardEnabled;
private boolean httpSupported;
private String stable;
private String countrycode;
private String countryname;
private String nickname;
private String finger;
private String ipaddress;
private String testingmess;
private String circuithops;
private int teststatus;
private float bandwidth;
private int streams;
private long latency;
private long testlatency;
public NodeItem() {
this.type = 0;
this.exitFavourite = false;
this.guardEnabled = false;
this.httpSupported = false;
this.countrycode = null;
this.latency = 9999;
this.testlatency = this.latency;
this.bandwidth = 0;
this.streams = 0;
this.countrycode = "";
this.countryname = "";
this.stable = "";
this.testingmess = "";
this.ipaddress = "";
this.finger = "";
this.nickname = "";
this.teststatus = TESTSTATUS_UNKNOWN;
}
/**
* Set Node type
*
* @param mask
*/
public final void setType(int mask) {
this.type |= mask;
}
/**
* Clear node type
*/
public final void clearType() {
this.type = 0;
}
public boolean isNonUnique() {
return (nickname.contains("Default")
|| nickname.contains("default")
|| nickname.contains("Unnamed"));
}
/**
* Is exit node
*
* @return true if an exit node
*/
public final boolean isExit() {
return (type & TYPE_EXIT) != 0;
}
public boolean isHttpSupported() {
return httpSupported;
}
public void setHttpSupported(boolean supported) {
httpSupported = supported;
}
/**
* Is Guard node
*
* @return true if guard node
*/
public final boolean isGuard() {
return (type & TYPE_GUARD) != 0;
}
/**
* Set circuit hops
*
* @param hops
*/
public final void setCircuitHops(String hops) {
circuithops = hops;
}
/**
* Get circuit hops
*
* @return Circuit hops as String
*/
public final String getCircuitHops() {
return circuithops;
}
/**
* Set Nodeitem testing status message
*
* @param text
*/
public final void setTestingMessage(String text) {
this.testingmess = text;
}
/**
* Set testing status flag
*
* @param status
*/
public final void setTestStatus(int status) {
teststatus = status;
}
/**
* Get testing status flag
*
* @return test status
*/
public final int getTestStatus() {
return teststatus;
}
/**
* Get Node item status
*
* @return Nodeitem testing status message as string
*/
public final String getTestingMessage() {
return testingmess;
}
/**
* Set Nodeitem latency value in ms
*
* @param latency
*/
public final void setLatency(long latency) {
this.latency = latency;
}
/**
* Get Nodeitem latency in ms
*
* @return Latency value in ms
*/
public final long getLatency() {
return latency;
}
/**
* Set Nodeitem test latency value in ms
*
* @param latency
*/
public final void setTestLatency(long latency) {
this.testlatency = latency;
}
/**
* Get Nodeitem test latency in ms
*
* @return Latency value in ms
*/
public final long getTestLatency() {
return testlatency;
}
/**
* Set exit enabled status of Nodeitem
*
* @param enabled
*/
public final void setFavouriteEnabled(boolean enabled) {
this.exitFavourite = enabled;
}
/**
* Get exit enabled status of Nodeitem
*
* @return true if enabled
*/
public final boolean isFavourite() {
return exitFavourite;
}
/**
* Set guard enabled status of Nodeitem
*
* @param enabled
*/
public final void setGuardEnabled(boolean enabled) {
this.guardEnabled = enabled;
}
/**
* Get guard enabled status of Nodeitem
*
* @return true if enabled
*/
public final boolean isGuardEnabled() {
return guardEnabled;
}
/**
* Set Nodeitem stability yes/no/unknown
*
* @param stability
*/
public final void setStable(String stability) {
this.stable = stability;
}
/**
* Get Nodeitem stability
*
* @return Stability
*/
public final String getStability() {
return stable;
}
/**
* Set Nodeitem with its two letter country code abbreviation
*
* @param abrv
*/
public final void setCountryCode(String abrv) {
countrycode = abrv;
}
/**
* Get nodeitem two letter country code abbreviation
*
* @return Country code as string
*/
public final String getCountryCode() {
return countrycode;
}
/**
* Set Nodeitem with its full country name
*
* @param name
*/
public final void setCountryName(String name) {
countryname = name;
}
/**
* Get nodeitem full country name
*
* @return Country name as string
*/
public final String getCountryName() {
return countryname;
}
/**
* Set nodeitem name
*
* @param name
*/
public final void setNickName(String name) {
nickname = name;
}
/**
* Get nodeitem unique name
*
* @return Node name as string
*/
public final String getNickName() {
return nickname;
}
/**
* Set node item bandwidth
*
* @param bw
*/
public final void setBandwidth(float bw) {
bandwidth = bw;
}
/**
* Get nodeitem bandwith
*
* @return Bandwidth as long, in kb/s
*/
public final float getBandwidth() {
Float result;
try {
DecimalFormat df = new DecimalFormat("#0.##");
result = Float.parseFloat(df.format(bandwidth).replace(",", "."));
} catch (Exception ex) {
result = (float) 0;
}
return result;
}
/**
* Set nodeitem number of streams
*
* @param streams
*/
public final void setStreams(int streams) {
this.streams = streams;
}
/**
* Get nodeitems active streams
*
* @return Number of active streams as int
*/
public final int getStreams() {
return streams;
}
/**
* Set nodeitem fingerprint
*
* @param fp
*/
public final void setFingerprint(String fp) {
finger = fp;
}
/**
* Get nodeitems fingerprint
*
* @return Tor node fingerprint as string
*/
public final String getFingerprint() {
return finger;
}
/**
* Set nodeitem ip address
*
* @param ip
*/
public final void setIPAddress(String ip) {
ipaddress = ip;
}
/**
* Get nodeitem ip address
*
* @return IP address as a string
*/
public final String getIPAddress() {
return ipaddress;
}
@Override
public NodeItem clone() {
try {
return (NodeItem) super.clone();
} catch (CloneNotSupportedException ex) {
return null;
}
}
}
selektor-3.13.73/src/client/QuickAddDialog.form 0000644 0001750 0001750 00000016726 13302030722 020603 0 ustar bannor bannor
selektor-3.13.73/src/client/PrefsDialog.form 0000644 0001750 0001750 00000124544 13302030722 020173 0 ustar bannor bannor
selektor-3.13.73/src/client/SelekTOR.java 0000644 0001750 0001750 00000450170 13302030722 017377 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import java.awt.Color;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.IOException;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JFileChooser;
import javax.swing.JPopupMenu;
import javax.swing.JProgressBar;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import javax.swing.event.TableModelEvent;
import javax.swing.table.TableRowSorter;
import lib.AboutDialog;
import lib.DesktopNotify;
import lib.ExtensionFileFilter;
import lib.GTKFixes;
import lib.InfoDialog;
import lib.TextResourceDialog;
import lib.Localisation;
import lib.NetFunctions;
import lib.OSFunction;
import lib.SimpleFile;
import lib.SimpleProps;
import lib.SwingTrayIcon;
import lib.TrayPopupMenu;
import lib.Utilities;
/**
*
* @author Alistair Neil
*/
public class SelekTOR extends javax.swing.JFrame {
private static final Localisation LOCAL = new Localisation("resources/MessagesBundle");
private static final String EMPTYSTR = "";
private static final String PREFSVER = "1.01";
private static final String APPNAME = "SelekTOR";
private static final String APPVER = "3.13.73";
private static final String APPSERIES = "3xx";
private static final String WEBDOMAIN = "www.dazzleships.net";
private static final String FILEDOMAIN = "http://dazzle.000webhostapp.com";
private static final String HOMEPAGE = "http://" + WEBDOMAIN;
private static final String HOMEPAGE_SSL = "https://" + WEBDOMAIN;
private static final String CONTACT = HOMEPAGE_SSL + "/?page_id=247";
private static final String APPUPDATE = FILEDOMAIN + "/anapps/linux/selektor/";
private static final String TESTURL = "http://google.com";
private static final String TORPROJECT = "https://torproject.org/";
private static final String TORCHECK = "https://check.torproject.org/";
private static final String ATLAS = "https://atlas.torproject.org/";
private static final String PATREON = "https://www.patreon.com/SelekTOR";
private static final String DOCSPATH = "/usr/share/doc/selektor/";
private static final String EXITFAVOURITES = "favourites.txt";
private static final String GUARDWHITELIST = "guardwhitelist.txt";
private static final String GEOIPZIP = "geoip.zip";
private static final String GEOIPSHA = "geoip.sha";
private static final String ICONFILE = "selektor.png";
private static final int TESTING_DISABLED = 0;
private static final int TESTING_ACTIVE = -1;
private static final long MAXTHRESHOLD = 5000;
private String clientLocation;
private String settingsPath;
private String cachePath;
private String defaultGeoipPath;
private String geoipPath;
private String geoip6Path;
private String iconPath = EMPTYSTR;
private TorController tcMain;
private NodeList nodeList;
private PacFactory pacFactory;
private String strExitISOCode = "GB";
private String strRequestedExit = EMPTYSTR;
private NodeItem niActiveGuard;
private NodeItem niActiveMiddle;
private NodeItem niActiveExit;
private int intRowSelected = -1;
private ExitNodeTableModel entm;
private SimpleProps sp;
private final ArrayList alTestThreads = new ArrayList<>();
private int intActiveNodeTests = 0;
private int intBestNodeIndex = 0;
private String[] strArrBestNodes;
private long lngThreshold = MAXTHRESHOLD;
private int intThresholdExceeded = 0;
private NetFunctions nf;
private boolean boolNetEnabled = true;
private String strSecret;
private String strHash;
private final ArrayList alTestQueue = new ArrayList<>();
private Timer tmr;
private int intBeginTesting;
private int intLatencyCheck;
private int intAutoSelectCheck;
private long lngHibernateTimeStamp;
private volatile boolean boolFirstRun;
private ArrayList alArgs;
private TorMonFrame tmf;
private long startupDelay;
private DesktopNotify dn;
private SwingTrayIcon sti;
private String desktopname = EMPTYSTR;
private String compositor = EMPTYSTR;
private boolean updateCheckDisabled;
/**
* Initialises SelekTOR UI Frame
*
* @param args
*/
public SelekTOR(String[] args) {
boolFirstRun = true;
// Initialises UI theme to system default
Utilities.loadUIStyle("System");
// Check for multiple instances of this app
if (OSFunction.isMultipleInstance(APPNAME)) {
openInstanceDialog();
cleanupExit();
return;
}
// Initialise some essentialvariables
// I know this looks a bit odd but trust me this allows us to install and run from anywhere
String runPath = OSFunction.getUsersCurrentFolder() + OSFunction.getFileSeparator();
if (runPath.startsWith("/usr/share")) {
runPath = "/usr/share/";
}
iconPath = runPath + "icons" + OSFunction.getFileSeparator();
settingsPath = OSFunction.getAppSettingsPath(APPNAME, APPSERIES);
cachePath = settingsPath + "cache" + OSFunction.getFileSeparator();
// Initialise property settings
initProperties();
// Initialise pac factory
initPacFactory();
// Get the desktop
desktopname = OSFunction.getActiveDesktop();
compositor = OSFunction.getCompositor();
// Process any supplied cli arguments
if (processCLIArgs(args)) {
cleanupExit();
return;
}
// Ensure any old proxy settings are cleaned up
pacCleanup();
// Verify Tor client is installed
if (OSFunction.isWindows()) {
clientLocation = OSFunction.findFile("tor.exe", "Tor/");
} else {
clientLocation = OSFunction.findFile("tor", "/usr/sbin/", "/usr/bin/");
}
if (clientLocation == null) {
Logger.getGlobal().log(Level.SEVERE, "Tor client not found.");
openTorClientDialog();
cleanupExit();
return;
}
// Verify if geoip data is installed
defaultGeoipPath = "/usr/share/tor/";
geoipPath = OSFunction.findFile("geoip", settingsPath, defaultGeoipPath);
geoip6Path = OSFunction.findFile("geoip6", settingsPath, defaultGeoipPath);
if (geoipPath == null || geoip6Path == null) {
Logger.getGlobal().log(Level.SEVERE, "Geoip not found.");
openTorClientDialog();
cleanupExit();
return;
}
// Verify if gsettings is installed
if (OSFunction.getGsettingsPath() == null) {
Logger.getGlobal().log(Level.SEVERE, "Gsettings not found.");
openGsettingsDialog();
cleanupExit();
return;
}
// Netbeans components init
initComponents();
Utilities.preloadFileChooser();
updateProgramStatus(LOCAL.getString("progstatus_initial"));
// Process any startup delay
try {
Thread.sleep(startupDelay);
} catch (InterruptedException ex) {
}
startupDelay = -1;
// Backup proxy preferences
pacFactory.backupProxyPrefs();
pacFactory.setProxyAutoConfigURL(null);
// Initialise node table
initNodeTables();
// Initialise tor main and test threads
initTorMain();
// Do a Tor version check
float torversion = tcMain.getVersion();
Logger.getGlobal().logp(Level.INFO, this.getClass().getName(), "", "Tor version = " + torversion);
if (torversion < 0.2420) {
openToOldDialog();
cleanupExit();
return;
}
// Create testing threads
initTestThreads(sp.getInt("PREF_TOR_TESTHREADS"));
// Final Initialisation of other components which need to be done last
initFinalComponents();
// System tray
initSystemTray();
// Main program timer
initTimer();
// Do tor main start
applyMainTorSettings();
tcMain.setStartupDelay(1000);
tcMain.start();
initGUIVisibility();
Logger.getGlobal().log(Level.INFO, "Environment = {0}", System.getenv().toString());
Logger.getGlobal().log(Level.INFO, "Active desktop = {0}", desktopname);
Logger.getGlobal().log(Level.INFO, "Compositor = {0}", compositor);
if (Logger.getGlobal().isLoggable(Level.FINE)) {
for (String s : OSFunction.getCachedProcesses()) {
Logger.getGlobal().log(Level.FINE, "Process = {0}", s);
}
}
}
/**
* Initialise properties
*/
private void initProperties() {
// Initialise application title
setTitle(APPNAME);
// Application icon
setIconImage(new javax.swing.ImageIcon(iconPath + ICONFILE).getImage());
// Initial logging settings
Logger.getGlobal().setLevel(Level.SEVERE);
addLoggingFile(settingsPath + "status.log", false);
// Init protperties
sp = new SimpleProps(settingsPath + APPNAME + ".xml", APPNAME + " Settings");
// Set up our defaults
sp.setDefaultModeEnabled(true);
sp.setString("PREF_ISOCOUNTRY", "GB");
sp.setInt("PREF_LISTENPORT", 9054);
sp.setInt("PREF_TOR_TESTHREADS", 2);
sp.setInt("PREF_TORLOGLEV", 2);
sp.setInt("PREF_PROXY_MODE", 2);
sp.setLong("PREF_GEODATE", 0);
sp.setBool("PREF_GEOCHECK", true);
sp.setBool("PREF_AUTOSTART", false);
sp.setBool("PREF_NOSYSTRAY", false);
sp.setBool("PREF_HIDETOTRAY", false);
sp.setBool("PREF_MINONCLOSE", false);
sp.setBool("PREF_HIDE_MIN", false);
sp.setBool("PREF_UPDATECHECK", true);
sp.setBool("PREF_SAFESOCKS", true);
sp.setBool("PREF_TESTSOCKS", false);
sp.setBool("PREF_AVOIDDISK", true);
sp.setBool("PREF_SAFELOG", true);
sp.setBool("PREF_CACHEDELETE", false);
sp.setBool("PREF_DISABLE_NOTIFY", false);
sp.setString("PREF_HTTP_PROXY", EMPTYSTR);
sp.setString("PREF_DONOT_PROXY", "localhost,127.0.0.1");
sp.setString("PREF_TORBRIDGE", EMPTYSTR);
sp.setString("PREF_TORARGS", EMPTYSTR);
sp.setDefaultModeEnabled(false);
sp.resetToDefaults();
sp.load();
// This will reset the preferences file to its default if we dont get a preferences version match
if (!sp.getString("prefsver").contentEquals(PREFSVER)) {
sp.resetToDefaults();
sp.setString("prefsver", PREFSVER);
sp.delete();
sp.save();
}
// Dont allow listen ports below 9054, prevents any conflicts with the Tor default service.
// Which can be used along side SelekTOR
if (sp.getInt("PREF_LISTENPORT") < 9054) {
sp.setInt("PREF_LISTENPORT", 9054);
sp.save();
}
strExitISOCode = sp.getString("PREF_ISOCOUNTRY");
}
/**
* Initialise logging facilities
*
* @param logpath
* @param append
*/
private void addLoggingFile(String logpath, boolean append) {
try {
if (logpath != null) {
FileHandler fh = new FileHandler(logpath, 10000000, 1, append);
fh.setFormatter(new SimpleFormatter());
Logger.getGlobal().addHandler(fh);
}
} catch (SecurityException | IOException ex) {
}
}
/**
* Processes any supplied arguments post UI component build
*
* @param args Startup arguments
*/
private boolean processCLIArgs(String... args) {
alArgs = new ArrayList<>();
alArgs.addAll(Arrays.asList(args));
for (String s : args) {
if (s.contentEquals("--start-delay")) {
alArgs.remove(s);
if (alArgs.size() > 0) {
String strDelay = alArgs.get(0);
try {
startupDelay = Long.valueOf(strDelay) * 1000;
alArgs.remove(0);
} catch (NumberFormatException ex) {
}
}
}
if (s.contentEquals("--debug-all")) {
alArgs.remove(s);
if (!alArgs.isEmpty()) {
addLoggingFile(alArgs.get(0), false);
alArgs.remove(0);
}
Logger.getGlobal().setLevel(Level.ALL);
}
if (s.contentEquals("--debug-warn")) {
alArgs.remove(s);
if (!alArgs.isEmpty()) {
addLoggingFile(alArgs.get(0), false);
alArgs.remove(0);
}
Logger.getGlobal().setLevel(Level.WARNING);
}
if (s.contentEquals("--debug-info")) {
alArgs.remove(s);
if (!alArgs.isEmpty()) {
addLoggingFile(alArgs.get(0), false);
}
Logger.getGlobal().setLevel(Level.INFO);
}
if (s.contentEquals("--debug-fine")) {
alArgs.remove(s);
if (!alArgs.isEmpty()) {
addLoggingFile(alArgs.get(0), false);
alArgs.remove(0);
}
Logger.getGlobal().setLevel(Level.FINE);
}
if (s.contentEquals("--debug-finer")) {
alArgs.remove(s);
if (!alArgs.isEmpty()) {
addLoggingFile(alArgs.get(0), false);
alArgs.remove(0);
}
Logger.getGlobal().setLevel(Level.FINER);
}
if (s.contentEquals("--debug-finest")) {
alArgs.remove(s);
if (!alArgs.isEmpty()) {
addLoggingFile(alArgs.get(0), false);
alArgs.remove(0);
}
Logger.getGlobal().setLevel(Level.FINEST);
}
if (s.contentEquals("--reset-defaults")) {
alArgs.remove(s);
sp.resetToDefaults();
sp.save();
sp.load();
return true;
}
if (s.contentEquals("--clear-cache")) {
alArgs.remove(s);
SimpleFile.deleteFolder(cachePath);
}
if (s.contentEquals("--help")) {
alArgs.remove(s);
outputHelp();
// Disable proxy restore on exit
pacFactory = null;
return true;
}
if (s.contentEquals("--cleanup")) {
alArgs.remove(s);
if (!sp.getBool("PREF_AUTOSTART")) {
return true;
}
}
if (s.contentEquals("--default-proxy-quiet")) {
alArgs.remove(s);
pacFactory.setProxyAutoConfigURL(null);
pacFactory.deleteProxyPrefs();
// Disable proxy restore on exit
pacFactory = null;
return true;
}
if (s.contentEquals("--restore-proxy-quiet")) {
alArgs.remove(s);
return true;
}
if (s.contentEquals("--update-disable")) {
alArgs.remove(s);
updateCheckDisabled = true;
}
if (s.contentEquals("--restore-proxy")) {
alArgs.remove(s);
InfoDialog id = createInfoDialog();
id.createWarn(LOCAL.getString("dlg_restoreproxy_title"),
LOCAL.getString("dlg_restoreproxy_body"));
id.pack();
id.setVisible(true);
if (id.getReturnStatus() == InfoDialog.OK) {
return true;
}
// Disable proxy restore on exit
pacFactory = null;
return true;
}
if (s.contentEquals("--default-proxy")) {
alArgs.remove(s);
InfoDialog id = createInfoDialog();
id.createWarn(LOCAL.getString("dlg_resetproxy_title"),
LOCAL.getString("dlg_resetproxy_body"));
id.pack();
id.setVisible(true);
if (id.getReturnStatus() == InfoDialog.OK) {
pacFactory.setProxyAutoConfigURL(null);
pacFactory.deleteProxyPrefs();
}
// Disable proxy restore on exit
pacFactory = null;
return true;
}
if (s.contentEquals("--ignore-desktop")) {
alArgs.remove(s);
desktopname = EMPTYSTR;
}
}
if (alArgs.size() > 0) {
outputHelp();
// Disable proxy restore on exit
pacFactory = null;
return true;
}
return false;
}
/**
* Output on standard out command line help info
*/
private void outputHelp() {
System.out.println(APPNAME + " " + APPVER + " valid command line arguments.");
System.out.println();
System.out.println("--help : This help information");
System.out.println("--debug-all [filename] : All debug output.");
System.out.println("--debug-warn [filename] : Warnings level debug output.");
System.out.println("--debug-info [filename] : Information level debug output.");
System.out.println("--debug-fine [filename] : Fine level debug output.");
System.out.println("--debug-finer [filename] : Finer level debug output.");
System.out.println("--debug-finest [filename] : Finest level debug output.");
System.out.println("--reset-defaults : Return user settings to their safe defaults.");
System.out.println("--clear-cache : Clears the Tor cache on startup.");
System.out.println("--ignore-desktop : Ignore desktop detection information.");
System.out.println("--start-delay : Delay startup in seconds, eg. --start-delay 5");
System.out.println("--cleanup : Cleans up after a bad shutdown which may have left system proxy in an unknown state.");
System.out.println("--default-proxy-quiet : Set system proxy back to its defaults quietly, without GUI dialog.");
System.out.println("--restore-proxy-quiet : Attempt to restore proxy to its last known settings using a previously saved backup, "
+ "without GUI dialog.");
System.out.println("--default-proxy : Set system proxy back to its defaults accepts verification input via a GUI dialog..");
System.out.println("--restore-proxy : Attempt to restore proxy to its last known settings using a previously saved backup, "
+ "with input verification via a GUI dialog.");
System.out.println("--update-disable : Disables the version update checking at startup and removes "
+ "the option from preferences.");
System.out.println();
}
/**
* Sets the enabled status of various GUI objects
*
* @param enabled
*/
private void setComponentsEnabled(boolean enabled) {
jButtonExitNodeDetails.setEnabled(enabled);
jButtonMiddleNodeDetails.setEnabled(enabled);
jButtonGuardNodeDetails.setEnabled(enabled);
jButtonSetGuards.setEnabled(enabled);
jMenuItemPatternEdit.setEnabled(enabled);
jMenuItemAddPattern.setEnabled(enabled);
jTableExitNodes.setEnabled(enabled);
jComboCountry.setEnabled(enabled);
jMenuItemTorCheck.setEnabled(enabled);
jCheckProxyDisable.setEnabled(enabled);
jCheckProxyByPattern.setEnabled(enabled);
jCheckProxyAll.setEnabled(enabled);
jCheckTrayProxyDisable.setEnabled(enabled);
jCheckTrayProxyByPattern.setEnabled(enabled);
jCheckTrayProxyAll.setEnabled(enabled);
jButtonClearFavs.setEnabled(enabled);
if (!enabled) {
jMenuItemGeoip.setEnabled(enabled);
}
}
/**
* Final initialisation of objects that need to be done near the end of
* startup
*
*/
private void initFinalComponents() {
// Apply fixes for linux gtk issues in java
GTKFixes.fixMenubarHeight(jMenuBar, jMenuItemGUI);
GTKFixes.fixMenuSelectionColor(jMenuMenu, jMenuProxy, jMenuHelp);
GTKFixes.fixJMenuPopupBorder(jMenuMenu, jMenuProxy, jMenuHelp);
GTKFixes.fixMenuItemFgColor(jCheckProxyDisable, jCheckProxyByPattern, jCheckProxyAll);
GTKFixes.fixMenuItemFgColor(jCheckTrayProxyDisable, jCheckTrayProxyByPattern, jCheckTrayProxyAll);
// Disable certain components until first node is activated
setComponentsEnabled(false);
// Add proxy buttons to proxy button groups
buttonGroupProxy.add(jCheckProxyDisable);
buttonGroupProxy.add(jCheckProxyByPattern);
buttonGroupProxy.add(jCheckProxyAll);
buttonGroupProxyTray.add(jCheckTrayProxyDisable);
buttonGroupProxyTray.add(jCheckTrayProxyByPattern);
buttonGroupProxyTray.add(jCheckTrayProxyAll);
// Update initial proxy selection
switch (sp.getInt("PREF_PROXY_MODE")) {
case 0:
jCheckProxyDisable.setSelected(true);
break;
case 1:
jCheckProxyByPattern.setSelected(true);
break;
case 2:
jCheckProxyAll.setSelected(true);
break;
}
// Make debug log menu item visible if required
jMenuItemDebugLog.setVisible(Logger.getGlobal().getLevel() != Level.SEVERE);
}
/**
* Initialise our internal 1 second timer tick
*
*/
private void initTimer() {
tmr = new Timer(1000, new java.awt.event.ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
// Do a hibernate check, check to see if computer has been asleep for more than 60 secs
if ((System.currentTimeMillis() - lngHibernateTimeStamp) > 60000) {
Logger.getGlobal().logp(Level.INFO, SelekTOR.class.getName(),
"initTimer()", "Hibernate Recovery");
lngHibernateTimeStamp = System.currentTimeMillis();
setComponentsEnabled(false);
stopAllTorThreads();
boolFirstRun = true;
tcMain.start();
}
lngHibernateTimeStamp = System.currentTimeMillis();
if (!boolNetEnabled) {
return;
}
// Do Latency checking
if (intLatencyCheck > 0) {
intLatencyCheck--;
if (intLatencyCheck == 0) {
intLatencyCheck = 5;
getFreshNodeInfo();
// Tor latency check, only when node active
if (niActiveExit != null) {
// Do latency check
tcMain.doLatencyCheck(4950);
}
}
}
// Activate a node selection check
if (intAutoSelectCheck > 0) {
intAutoSelectCheck--;
if (intAutoSelectCheck == 0) {
autoSelectNode();
}
}
// Activate a testing cycle
if (intBeginTesting > 0) {
intBeginTesting--;
if (intBeginTesting == 0) {
runTestingCycle();
}
}
} catch (Exception ex) {
Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "initTimer() actionPerformed", EMPTYSTR, ex);
}
}
});
lngHibernateTimeStamp = System.currentTimeMillis();
tmr.setInitialDelay(0);
tmr.setRepeats(true);
tmr.start();
}
/**
* Initialise our pacfactory object
*
*/
private void initPacFactory() {
pacFactory = new PacFactory();
pacFactory.setTempFolder(cachePath);
pacFactory.setBackupFolder(settingsPath + "backup");
pacFactory.setPatternsFolder(settingsPath + "patterns");
pacFactory.setPACFolder(settingsPath);
pacFactory.setDefaultProxy(sp.getString("PREF_HTTP_PROXY"));
pacFactory.setDoNotProxy(sp.getString("PREF_DONOT_PROXY"));
}
/**
* Open the preferences dialog
*/
private void openPreferencesDialog() {
// open dialog
PrefsDialog pd;
String disableditems = EMPTYSTR;
if (!sti.isSupported()) {
sp.setBool("PREF_NOSYSTRAY", true);
disableditems += "jCheckDisableTray";
}
if (updateCheckDisabled) {
disableditems += ",jCheckAppUpdate";
}
pd = new PrefsDialog(this, sp, disableditems);
pd.setTitle(LOCAL.getString("wintitle_prefs").replace("$appname", APPNAME));
pd.pack();
pd.setLocationRelativeTo(this);
pd.setVisible(true);
// Check for changes
String changed = sp.getChangedProperties();
if (pd.getReturnStatus() == PrefsDialog.APPLY) {
sp.save();
}
if (changed.contains("PREF_HTTP_PROXY")) {
pacFactory.setDefaultProxy(sp.getString("PREF_HTTP_PROXY"));
rebuildPatternPac();
}
if (changed.contains("PREF_NOSYSTRAY")) {
if (sp.getBool("PREF_NOSYSTRAY")) {
sti.unload();
} else {
sti.load();
}
}
if (changed.contains("PREF_DISABLE_NOTIFY")) {
dn.setEnabled(!sp.getBool("PREF_DISABLE_NOTIFY"));
if (dn.isEnabled() && !dn.isSupported()) {
openLibnotifyDialog();
}
}
if (!boolNetEnabled) {
return;
}
// Check to see if bridges entry was changed
if (changed.contains("TORBRIDGE")) {
// Update status message
updateProgramStatus(LOCAL.getString("progstatus_applychanges"));
// Validate bridge entry
if (!tcMain.validateBridges(sp.getString("PREF_TORBRIDGE"))) {
// Validation failed
sp.setString("PREF_TORBRIDGE", EMPTYSTR);
sp.save();
// Apply default bridge settings by doing hard Tor restart
stopAllTorThreads();
applyMainTorSettings();
tcMain.start();
// Indicate validation failure to user
openBridgeErrorDialog();
} else {
// Apply default bridge settings by doing hard Tor restart
stopAllTorThreads();
applyMainTorSettings();
tcMain.start();
}
return;
}
// Check for any parameters that have changed that require full restart
if (changed.contains("LISTENPORT") || changed.contains("SAFE")
|| changed.contains("AVOID")
|| changed.contains("LOGLEV") || changed.contains("TORARGS")
|| changed.contains("TESTSOCKS")) {
// Update status message
updateProgramStatus(LOCAL.getString("progstatus_applychanges"));
// Apply default bridge settings by doing hard Tor restart
stopAllTorThreads();
applyMainTorSettings();
tcMain.start();
}
}
private void applyMainTorSettings() {
// Check to see if bridges are active
String bridge = sp.getString("PREF_TORBRIDGE");
if (!tcMain.validateBridges(bridge)) {
bridge = EMPTYSTR;
sp.setString("PREF_TORBRIDGE", bridge);
sp.save();
}
// Update entry node label on UI
if (bridge.isEmpty()) {
jLabelGuard.setText(LOCAL.getString("label_guardnode"));
} else {
jLabelGuard.setText(LOCAL.getString("label_bridgenode"));
}
tcMain.setBridges(bridge);
tcMain.setTestingURL(TESTURL);
tcMain.setListenPort(sp.getInt("PREF_LISTENPORT"));
tcMain.setEntryNodes(nodeList.getGuardFavouritesAsCSV());
tcMain.setBoolTorOption("SafeSocks", sp.getBool("PREF_SAFESOCKS"));
tcMain.setBoolTorOption("TestSocks", sp.getBool("PREF_TESTSOCKS"));
tcMain.setBoolTorOption("AvoidDiskWrites", sp.getBool("PREF_AVOIDDISK"));
tcMain.setBoolTorOption("SafeLogging", sp.getBool("PREF_SAFELOG"));
tcMain.setExternalArgs(sp.getString("PREF_TORARGS"));
tcMain.setLogLevel(sp.getInt("PREF_TORLOGLEV"));
tcMain.setGeoIP4(geoipPath);
tcMain.setGeoIP6(geoip6Path);
tmf.setLaunchString("# Via commandline\n"
+ tcMain.getCLIOptionsAsString() + "\n\n"
+ "# Via torrc configuration file\n"
+ tcMain.getTorrcOptionsAsString()
);
}
/**
* Abort actions on all tor client threads
*/
private void abortAllTorThreads() {
if (niActiveExit != null) {
niActiveExit.setCircuitHops(null);
}
if (tcMain != null) {
tcMain.abortActions();
}
abortTesting();
}
/**
* Bring all tor threads to a stop
*/
private void stopAllTorThreads() {
abortTesting();
stopTestClients();
if (nodeList != null) {
nodeList.terminate();
}
if (tcMain != null) {
tcMain.stop();
tcMain.clearStdout();
tcMain.setStartupDelay(2000);
}
}
/**
* Do nodelist refresh
*/
private void regenNodelist() {
Thread t = new Thread(new java.lang.Runnable() {
@Override
public void run() {
if (boolFirstRun) {
updateProgramStatus(LOCAL.getString("progstatus_generate"));
nodeList.refreshNodelist(tcMain);
// App update check
checkForAppUpdates();
}
switch (nodeList.getCurrentStatus()) {
case NodeList.NODELIST_BUILT:
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
if (boolFirstRun) {
dn.setNotificationBody(LOCAL.getString("traymenu_proxymode" + (sp.getInt("PREF_PROXY_MODE") + 1)));
applyProxyChanges(sp.getInt("PREF_PROXY_MODE"));
}
// Update countries combo box
String[] countries = nodeList.getValidatedCountries();
DefaultComboBoxModel dcbm = new DefaultComboBoxModel<>(countries);
jComboCountry.setModel(dcbm);
jComboCountry.setSelectedIndex(-1);
String strSelection = strExitISOCode + "," + LOCAL.getDisplayCountry(strExitISOCode);
// Check selection exists
if (dcbm.getIndexOf(strSelection) < 0) {
// Does not exist so default to the first country entry
jComboCountry.setSelectedIndex(0);
} else {
jComboCountry.setSelectedItem(strSelection);
}
// Check to make shure we have enough guard nodes
int activeguards = nodeList.saveGuardWhitelist();
if (activeguards < 3 && activeguards > 0) {
openNotEnoughGuardsDialog();
}
}
});
break;
case NodeList.NODELIST_FAILED:
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
Logger.getGlobal().logp(Level.WARNING, SelekTOR.class
.getName(), "fetchRemoteData()", "Nodelist Failed");
openFatalErrorDialog(LOCAL.getString("dlg_nodelistfail_body"));
cleanupExit();
}
});
break;
}
}
});
t.start();
}
/**
* Check remoteversion to determine if their is a newer application
* available
*
*/
private void checkForAppUpdates() {
// App update
if (!sp.getBool("PREF_UPDATECHECK") || updateCheckDisabled) {
Logger.getGlobal().log(Level.WARNING, "Update check is disabled.");
return;
}
TorCircuit tc = tcMain.getLatestCircuit();
if (tc != null) {
String finger = tc.getExit(TorCircuit.FINGER);
NodeItem ni = nodeList.getNode(finger);
if (ni != null) {
Logger.getGlobal().log(Level.INFO, "Active Exit is {0}({1}) in {2}",
new Object[]{ni.getNickName(), finger, ni.getCountryName()});
}
}
String url = APPUPDATE + "version.html";
Socket s = tcMain.createTorSocketToURL(url, false);
nf.setSocketTimeout(5000);
String version = nf.getURLContentAsString(url, s);
if (version == null) {
Logger.getGlobal().log(Level.WARNING, "Failed to retrieve version info.");
return;
}
Logger.getGlobal().log(Level.INFO, "Sucessfully retrieved version info.");
final String remoteversion = version.trim();
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
if (Utilities.isNewerVersion(APPVER, remoteversion)) {
InfoDialog id = createInfoDialog();
id.createInfo(LOCAL.getString("dlg_update_title"),
LOCAL.getString("dlg_update_body").replace("$version", remoteversion));
id.setAutoClose(30000);
id.pack();
id.setVisible(true);
}
}
});
}
/**
* Check to see if we need to update geoip
*
*/
private void updateGeoipCheck() {
jMenuItemGeoip.setEnabled(true);
if (!sp.getBool("PREF_GEOCHECK")) {
return;
}
long lngDate = sp.getLong("PREF_GEODATE");
if (System.currentTimeMillis() > lngDate) {
updateGeoip();
}
}
/**
* Pops up the GEOIP update dialog
*/
private void updateGeoip() {
InfoDialog id = new InfoDialog(this) {
private final InfoDialog id = this;
@Override
public void progressTask(int retstatus, final JProgressBar jpb) {
Thread t = new Thread(new java.lang.Runnable() {
@Override
public void run() {
String url = APPUPDATE + GEOIPSHA;
String destfile = OSFunction.getTempFolder(EMPTYSTR) + APPNAME
+ "_" + GEOIPZIP;
try {
setAckEnabled(false);
jpb.setString(LOCAL.getString("dload_status_contact"));
Socket s;
// Grab checksum file from dazzleships
if (isCheckBoxSelected()) {
if (niActiveExit == null) {
// Indicate download failure
Logger.getGlobal().log(Level.INFO, "Invalid exit node");
throw new IOException();
}
if (niActiveExit.getLatency() > 4000) {
// Indicate download failure
Logger.getGlobal().log(Level.INFO, "Poor exit node");
throw new IOException();
}
s = tcMain.createTorSocketToURL(url, false);
} else {
s = new Socket(FILEDOMAIN, 80);
}
nf.setSocketTimeout(5000);
nf.setProgressBar(jpb);
jpb.setStringPainted(true);
if (!id.isVisible()) {
throw new IOException();
}
Logger.getGlobal().log(Level.INFO, "Starting geoip.sha download");
String chksum = nf.getURLContentAsString(url, s);
if (chksum == null || chksum.isEmpty()) {
// Indicate download failure
Logger.getGlobal().log(Level.INFO, "geoip.sha download failed");
throw new IOException();
}
// Grab geodata zip file from dazzleships
if (!id.isVisible()) {
throw new IOException();
}
Logger.getGlobal().log(Level.INFO, "Starting geoip.zip download");
url = APPUPDATE + GEOIPZIP;
if (isCheckBoxSelected()) {
s = tcMain.createTorSocketToURL(url, false);
} else {
s = new Socket(FILEDOMAIN, 80);
}
final SimpleFile sf = new SimpleFile(destfile);
// Delete old/previous file
if (sf.exists()) {
sf.delete();
}
// Ensure zip file downloaded
nf.saveURLContentToFile(destfile, url, s, true);
if (!sf.exists()) {
// Indicate download failure
Logger.getGlobal().log(Level.INFO, "geoip.zip download failed");
throw new IOException();
}
// Do checksum verification
String fchk = Utilities.getSha1Sum(destfile);
if (!fchk.contentEquals(chksum.trim())) {
// Delete corrupt zip file
sf.delete();
// Indicate download failure
Logger.getGlobal().log(Level.INFO, "geoip.zip checksum does not match");
throw new IOException();
}
if (!id.isVisible()) {
throw new IOException();
}
if (sf.extractZipTo(settingsPath)) {
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
// Set new check time
updateGeoipCheckDate();
// Update geoip paths
geoipPath = OSFunction.findFile("geoip", settingsPath, defaultGeoipPath);
geoip6Path = OSFunction.findFile("geoip6", settingsPath, defaultGeoipPath);
// Restart Tor client, to take advantage of new geoip
jComboCountry.setEnabled(false);
setComponentsEnabled(false);
boolFirstRun = true;
stopAllTorThreads();
applyMainTorSettings();
tcMain.start();
setVisible(false);
dispose();
}
});
}
} catch (final Exception ex) {
// Exits here in case of download fail
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
Logger.getGlobal().log(Level.WARNING, ex.getMessage());
jpb.setString(LOCAL.getString("dload_status_failed"));
setAckEnabled(true);
}
});
}
}
});
if (retstatus == InfoDialog.OK) {
t.start();
} else {
updateGeoipCheckDate();
setVisible(false);
dispose();
}
}
};
id.setTitle(APPNAME);
id.setCancelButtonText(LOCAL.getString("button_cancel"));
id.setContinueButtonText(LOCAL.getString("button_continue"));
id.setCloseButtonText(LOCAL.getString("button_close"));
id.setCheckBoxText(LOCAL.getString("chkbox_viator"));
id.setCheckBoxVisible(true);
id.setCheckBoxEnabled(true);
id.pack();
id.createProgress(LOCAL.getString("dlg_geo_title"),
LOCAL.getString("dlg_geo_body"));
id.pack();
id.setVisible(true);
}
private void updateGeoipCheckDate() {
// Set new check time
sp.setLong("PREF_GEODATE", System.currentTimeMillis() + ((long) 60000 * 60 * 24 * 90));
sp.save();
}
/**
* System tray initialisation
*/
private void initSystemTray() {
// Initialise tray utility
sti = new SwingTrayIcon(this.getGraphicsConfiguration(), "resources/trayicon.png");
if (desktopname.contentEquals("gnome3")
|| desktopname.contentEquals("enlightenment")
|| desktopname.contentEquals("kde5")) {
sti.disable();
}
// Initialise desktop notification
dn = new DesktopNotify(sti, iconPath + ICONFILE);
dn.setNotificationTitle(APPNAME);
dn.setEnabled(!sp.getBool("PREF_DISABLE_NOTIFY"));
if (dn.isEnabled() && !dn.isSupported()) {
openLibnotifyDialog();
}
// If trayIcon valid add mouse listener
TrayPopupMenu tpm = new TrayPopupMenu();
GTKFixes.fixTrayMenuPopupBorder(tpm);
tpm.add(jCheckTrayProxyDisable);
tpm.add(jCheckTrayProxyByPattern);
tpm.add(jCheckTrayProxyAll);
tpm.add(new JPopupMenu.Separator());
tpm.add(jMenuItemGUI);
tpm.add(jMenuItemQuitx);
sti.addMouseListener(new javax.swing.event.MouseInputListener() {
@Override
public void mouseClicked(MouseEvent e) {
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) {
toggleGUIVisibility();
}
}
@Override
public void mouseEntered(MouseEvent e) {
}
@Override
public void mouseExited(MouseEvent e) {
}
@Override
public void mouseDragged(MouseEvent e) {
}
@Override
public void mouseMoved(MouseEvent e) {
}
});
sti.setTrayPopupMenu(tpm);
if (!sp.getBool("PREF_NOSYSTRAY")) {
sti.load();
}
}
private InfoDialog createInfoDialog() {
InfoDialog id = new InfoDialog(this);
id.setTitle(APPNAME);
id.setCancelButtonText(LOCAL.getString("button_cancel"));
id.setContinueButtonText(LOCAL.getString("button_continue"));
id.setCloseButtonText(LOCAL.getString("button_close"));
return id;
}
private void openInstanceDialog() {
InfoDialog id = createInfoDialog();
id.createError(LOCAL.getString("dlg_instancefail_title"),
LOCAL.getString("dlg_instancefail_body").replace("$appname", APPNAME));
id.pack();
id.setVisible(true);
}
private void openNotEnoughGuardsDialog() {
InfoDialog id = createInfoDialog();
id.createWarn(LOCAL.getString("dlg_guardwarn_title"),
LOCAL.getString("dlg_notenoughguards_body").replace("$appname", APPNAME));
id.setCancelVisible(false);
id.setContinueButtonText(LOCAL.getString("button_setguards"));
id.pack();
id.setVisible(true);
if (id.getReturnStatus() == InfoDialog.OK) {
openGuardsSettingDialog();
}
}
private void openGsettingsDialog() {
InfoDialog id = createInfoDialog();
id.createError(LOCAL.getString("dlg_gsetting_title"),
LOCAL.getString("dlg_gsetting_body").replace("$appname", APPNAME));
id.pack();
id.setVisible(true);
}
private void openTorClientDialog() {
InfoDialog id = createInfoDialog();
id.createError(LOCAL.getString("dlg_torclient_title"),
LOCAL.getString("dlg_torclient_body").replace("$appname", APPNAME));
id.pack();
id.setVisible(true);
}
private void openLibnotifyDialog() {
InfoDialog id = createInfoDialog();
id.createError(LOCAL.getString("dlg_libnotify_title"),
LOCAL.getString("dlg_libnotify_body").replace("$appname", APPNAME));
id.setModal(false);
id.setAutoClose(10000);
id.pack();
id.setVisible(true);
}
private void openBridgeErrorDialog() {
InfoDialog id = createInfoDialog();
id.createError(LOCAL.getString("dlg_bridgerr_title"),
LOCAL.getString("dlg_bridgerr_body").replace("$appname", APPNAME));
id.pack();
id.setVisible(true);
}
/**
* Node table and node list initialisation
*/
private void initNodeTables() {
// Create our node list storage object
nodeList = new NodeList(settingsPath, EXITFAVOURITES, GUARDWHITELIST);
entm = new ExitNodeTableModel();
entm.setColumnName(LOCAL.getString("exittable_col1"), 0);
entm.setColumnName(LOCAL.getString("exittable_col2"), 1);
entm.setColumnName(LOCAL.getString("exittable_col3"), 2);
entm.setColumnName(LOCAL.getString("exittable_col4"), 3);
entm.setColumnName(LOCAL.getString("exittable_col5"), 4);
entm.addTableModelListener(new javax.swing.event.TableModelListener() {
@Override
public void tableChanged(TableModelEvent e) {
if (e.getType() == TableModelEvent.UPDATE) {
if (e.getColumn() == 4) {
nodeList.saveExitFavourites();
// Force favourites recalc
intThresholdExceeded = 255;
// Do node auto selection in 5 secs
intAutoSelectCheck = 5;
}
}
}
});
nodeList.setExitNodeTableModel(entm);
jTableExitNodes.setModel(entm);
// Adjust table column widths
adjustExitTableColumns();
}
private void clearFavourites() {
for (int i = 0; i < entm.getRowCount(); i++) {
entm.setValueAt(false, i, 4);
}
}
/**
* Main tor process initialisation
*/
private void initTorMain() {
intBeginTesting = TESTING_DISABLED;
nf = new NetFunctions();
tmf = new TorMonFrame();
tmf.setTitle(LOCAL.getString("wintitle_tormonitor"));
tmf.setIconImage(new javax.swing.ImageIcon(iconPath + ICONFILE).getImage());
// Initialise the Tor main client event handler
tcMain = new TorController(clientLocation, cachePath) {
private int intNodeFailCount;
@Override
public void controllerEventFired(int event, Object data) {
Logger.getGlobal().logp(Level.INFO, SelekTOR.class.getName(),
"controllerEventFired() on Port=" + getListenPort(), getEventMessage(event) + ", Data=" + data);
switch (event) {
case TOR_BRIDGE:
nodeList.addBridge((String) data);
break;
case TOR_NOROUTE:
if (boolNetEnabled) {
boolNetEnabled = false;
boolFirstRun = true;
updateProgramStatus(LOCAL.getString("progstatus_nonet"));
dn.setNotificationBody(LOCAL.getString("progstatus_nonet"));
dn.raiseNotification();
setComponentsEnabled(false);
}
break;
case TOR_DIRINFO_STALE:
// Deliberate fallthrough here
case TOR_NOEXITS:
// Ensure client is fully running as multiple TOR_NOEXITS can
// be generated at startup especially if folks are torrenting via Tor
if (getStatus() < STATUS_IDLE) {
break;
}
updateProgramStatus(LOCAL.getString("circuit_status_none"));
intNodeFailCount = 0;
resetBestNode();
strRequestedExit = getBestNode();
if (strRequestedExit == null) {
strRequestedExit = EMPTYSTR;
}
stop();
setSilentBootEnabled(true);
setStartupDelay(2000);
start(TOR_RESTARTED);
break;
case TOR_CLOCK_ERROR:
// Deliberate fallthrough here
case TOR_BOOT_FATAL:
openFatalErrorDialog((String) data);
cleanupExit();
break;
case TOR_BOOT_TIMEOUT:
stop();
setStartupDelay(2000);
start(TOR_BOOTED);
break;
case TOR_MESSAGE:
updateProgramStatus((String) data);
break;
case TOR_BOOTED:
boolNetEnabled = true;
regenNodelist();
break;
case TOR_RESTARTED:
boolNetEnabled = true;
activateNode(strRequestedExit);
break;
case EVENT_CIRCUIT_FAILED:
// Deliberate fallthrough here
case EVENT_CIRCUITS_FAILED:
switch (++intNodeFailCount) {
case 1:
// Retry
updateProgramStatus(LOCAL.getString("progstatus_nodefailretry"));
intThresholdExceeded = 254;
intAutoSelectCheck = 2;
break;
case 2:
// Get the next best node
updateProgramStatus(LOCAL.getString("progstatus_nodefail"));
intThresholdExceeded = 4;
intAutoSelectCheck = 2;
break;
case 3:
// Get the next best node and trigger test cycle
updateProgramStatus(LOCAL.getString("progstatus_nodefail"));
intNodeFailCount = 0;
intThresholdExceeded = 4;
intAutoSelectCheck = 2;
if (intBeginTesting > 2) {
intBeginTesting = 2;
}
break;
}
break;
case EVENT_CIRCUITS_BUILT:
if (!strRequestedExit.isEmpty()) {
NodeItem ni = nodeList.getNode(strRequestedExit);
if (ni == null) {
activateNode(strRequestedExit = EMPTYSTR);
break;
}
if (ni.getCircuitHops() != null) {
tcMain.activateCircuit(ni.getCircuitHops());
break;
}
}
case EVENT_CIRCUIT_BUILT:
intNodeFailCount = 0;
intThresholdExceeded = 0;
intLatencyCheck = 1;
// Trigger node testing
if (intBeginTesting == TESTING_DISABLED) {
intBeginTesting = 2;
}
if (boolFirstRun) {
boolFirstRun = false;
// Update geoip check
updateGeoipCheck();
}
break;
case EVENT_LATENCY_DONE:
if (niActiveExit != null) {
niActiveExit.setStreams(getActiveStreams().size());
niActiveExit.setLatency(getLatency());
updateGUINodeInfo(niActiveGuard, niActiveMiddle, niActiveExit);
// Check for threshold override
if (intThresholdExceeded >= 100) {
break;
}
if (niActiveExit.getLatency() > lngThreshold) {
intThresholdExceeded++;
if (niActiveExit.getLatency() > MAXTHRESHOLD) {
// If we have 3 (15 sec) of outright latency failures then trigger test cycle
if (intThresholdExceeded > 2) {
intAutoSelectCheck = 2;
if (intBeginTesting > 2) {
intBeginTesting = 2;
}
}
break;
}
// If we have only have one favourite then effectively
// ignore latency
if (nodeList.getNumberOfFavs() == 1) {
intThresholdExceeded = 0;
break;
}
if (niActiveExit.getStreams() > 0) {
// If we have active streams then do new selection after 1 minute
// of threshold excesses
if (intThresholdExceeded > 11) {
intAutoSelectCheck = 2;
}
} else {
// If we have no active streams then do new selection after 15 secs
// of threshold excesses
if (intThresholdExceeded > 2) {
intAutoSelectCheck = 2;
}
}
break;
}
intThresholdExceeded = 0;
}
break;
}
}
};
// Tor main initial startup conditions
tcMain.setTorrcOption("ClientOnly", "1");
tcMain.setTorrcOption("StrictNodes", "1");
tcMain.setTorrcOption("UseMicrodescriptors", "0");
tcMain.setTorrcOption("UseEntryGuards", "1");
tcMain.setTorrcOption("NumEntryGuards", "3");
tcMain.setTorrcOption("ExitNodes", "{FI}");
tcMain.setStdoutTextArea(tmf.getStdoutTextArea());
tcMain.setListenPort(sp.getInt("PREF_LISTENPORT"));
tcMain.setOwnershipID(OSFunction.getOurProcessID());
strSecret = Utilities.generateSecretKey(16);
strHash = Utilities.getTorHashPassword(strSecret);
tcMain.setControlPassword(strSecret, strHash);
}
/**
* Test thread initialisation
*
* @param nothreads
*/
private void initTestThreads(int nothreads) {
TorController tcTest;
// Main testing procedure here, event driven this just handles process declaration
// Initialise our tor testing thread prior to booting it
while (alTestThreads.size() < nothreads) {
tcTest = new TorController(clientLocation, cachePath) {
private NodeItem ni;
@Override
public void controllerEventFired(int event, Object data) {
Logger.getGlobal().logp(Level.INFO, SelekTOR.class.getName(),
"controllerEventFired() on Port=" + getListenPort(), getEventMessage(event) + ", Data=" + data);
switch (event) {
case TOR_NOROUTE:
if (boolNetEnabled) {
abortTesting();
stopTestClients();
updateGUINodeInfo(niActiveGuard = null, niActiveMiddle = null, niActiveExit = null);
tcMain.stop();
tcMain.setSilentBootEnabled(true);
tcMain.setStartupDelay(2000);
tcMain.start(TOR_BOOTED);
}
break;
case TOR_BOOT_TIMEOUT:
case TOR_BOOT_FATAL:
ni = null;
stop();
setSilentBootEnabled(true);
setStartupDelay(2000);
start(TOR_BOOTED);
break;
case TOR_RESTARTED:
// Deliberate fallthrough here
case TOR_BOOTED:
// Deliberate fallthrough here
ni = null;
case EVENT_TESTING_DONE:
if (ni != null) {
if (intActiveNodeTests > 0) {
intActiveNodeTests--;
}
Logger.getGlobal().logp(Level.INFO, SelekTOR.class.getName(),
"controllerEventFired() on Port=" + getListenPort(), "Completed Testing of " + ni.getNickName());
if (getBestLatency() < LATENCY_FAIL) {
ni.setTestStatus(NodeItem.TESTSTATUS_PASSED);
// Store best circuit using its latency as a key
entm.setTestFieldValues(ni.getFingerprint(),
getBestLatency(),
LOCAL.getString("circuit_status_passed"),
getBestHops());
} else if ((Integer) data > 0) {
ni.setTestStatus(NodeItem.TESTSTATUS_FAILED);
// If we have circuits that failed testing
entm.setTestFieldValues(ni.getFingerprint(),
LATENCY_FAIL,
LOCAL.getString("circuit_status_failed"), null);
} else {
// If we have no circuits
ni.setTestStatus(NodeItem.TESTSTATUS_FAILED);
entm.setTestFieldValues(ni.getFingerprint(),
LATENCY_FAIL,
LOCAL.getString("circuit_status_none"), null);
stop();
setSilentBootEnabled(true);
setStartupDelay(2000);
start(TOR_RESTARTED);
break;
}
}
ni = null;
// Ensure test thread is ready
if (getStatus() != STATUS_IDLE) {
break;
}
// No more nodes to test
if (alTestQueue.isEmpty()) {
// Check to see that all testing threads have completed
if (intActiveNodeTests <= 0) {
stopTestClients();
// Re-Enable testing menu button
jMenuTesting.setEnabled(true);
// intActiveNodeTests will be -1 if testing was aborted
if (intActiveNodeTests == 0) {
// Start next test in 10 minutes
intBeginTesting = 600;
// Force change on next Autoselection check
intThresholdExceeded = 255;
// Force Autoselection check in 1 second
intAutoSelectCheck = 1;
}
return;
}
return;
}
// Fetch node item from queue
while (!alTestQueue.isEmpty()) {
String finger = alTestQueue.get(0);
alTestQueue.remove(0);
ni = nodeList.getNode(finger);
if (ni != null) {
intActiveNodeTests++;
entm.setValueAt(LOCAL.getString("circuit_status_creating_3hop"),
ni.getFingerprint(), 3);
Logger.getGlobal().logp(Level.INFO, SelekTOR.class.getName(),
"controllerEventFired() on Port=" + getListenPort(), "Begun testing node " + ni.getNickName());
testNode(ni.getFingerprint());
} else {
Logger.getGlobal().logp(Level.INFO, SelekTOR.class.getName(),
"controllerEventFired() on Port=" + getListenPort(), finger + " node not found in nodelist ");
entm.setValueAt(LOCAL.getString("circuit_status_failed"),
finger, 3);
}
break;
}
break;
case EVENT_CIRCUIT_BUILT:
if (ni != null) {
entm.setValueAt(LOCAL.getString("circuit_status_testing"), ni.getFingerprint(), 3);
}
break;
case EVENT_ABORTED:
if (intActiveNodeTests > 0) {
intActiveNodeTests--;
}
if (ni != null) {
entm.setValueAt(LOCAL.getString("circuit_status_aborted"),
ni.getFingerprint(), 3);
ni.setTestStatus(NodeItem.TESTSTATUS_UNKNOWN);
ni = null;
}
break;
case TOR_DIRINFO_STALE:
case TOR_NOEXITS:
if (intActiveNodeTests > 0) {
intActiveNodeTests--;
}
if (ni != null) {
entm.setTestFieldValues(ni.getFingerprint(),
LATENCY_FAIL,
LOCAL.getString("circuit_status_noroute"), null);
ni.setTestStatus(NodeItem.TESTSTATUS_FAILED);
ni = null;
stop();
setSilentBootEnabled(true);
setStartupDelay(2000);
start(TOR_RESTARTED);
}
break;
}
}
};
tcTest.setTorrcOption("ClientOnly", "1");
tcTest.setTorrcOption("StrictNodes", "1");
tcTest.setTorrcOption("UseMicrodescriptors", "0");
tcTest.setTorrcOption("UseEntryGuards", "1");
tcTest.setTorrcOption("NumEntryGuards", "3");
tcTest.setOwnershipID(tcMain.getOwnershipID());
tcTest.setControlPassword(strSecret, strHash);
tcTest.setCLIOption("quiet", EMPTYSTR);
// Add this this tor process thread to our thread queue
alTestThreads.add(tcTest);
}
strSecret = strHash = null;
}
/**
* Auto select next best node based on latency
*
*/
private void autoSelectNode() {
String finger;
switch (intThresholdExceeded) {
case 255:
intThresholdExceeded = 0;
// Recaculate best nodes
calcBestNodes();
resetBestNode();
finger = getBestNode();
break;
case 254:
// this will re-apply previously selected node
finger = strRequestedExit;
strRequestedExit = EMPTYSTR;
break;
default:
// Indicate node has failed testing
NodeItem ni = null;
if (niActiveExit != null && nodeList.getNumberOfFavs() != 1) {
ni = nodeList.getNode(niActiveExit.getFingerprint());
if (ni != null) {
ni.setTestStatus(NodeItem.TESTSTATUS_FAILED);
}
}
// Get next best node
finger = getBestNode();
break;
}
intThresholdExceeded = 0;
// Check to see if finger is valid
if (finger != null && !finger.isEmpty()) {
if (!finger.contentEquals(strRequestedExit)) {
strRequestedExit = finger;
updateProgramStatus(LOCAL.getString("progstatus_autoswitch")
+ " " + activateNode(strRequestedExit) + ".");
}
} else {
updateProgramStatus(LOCAL.getString("progstatus_nodefailtorchoose"));
strRequestedExit = EMPTYSTR;
activateNode(strRequestedExit);
}
}
/**
* Set latency threshold value and update its corresponding label
*
* @param threshold
*/
private void setThreshold(long threshold) {
lngThreshold = threshold;
jTableExitNodes.setToolTipText(LOCAL.getString("ttip_threshold")
+ ": " + lngThreshold + " ms");
}
/**
* Calculate best nodes based on latency and also generate the latency
* threshold value
*/
private void calcBestNodes() {
long l;
long summation = 0;
long mean = TorController.LATENCY_FAIL;
int i = 0;
ArrayList alBestNodes = new ArrayList<>();
ArrayList alBestFavs = new ArrayList<>();
TableRowSorter trs = new TableRowSorter<>(entm);
trs.toggleSortOrder(2);
for (int idx = 0; idx < entm.getRowCount(); idx++) {
NodeItem ni = entm.getNodeItemAt(trs.convertRowIndexToModel(idx));
if (ni.getTestStatus() == NodeItem.TESTSTATUS_FAILED) {
continue;
}
if (ni.isFavourite()) {
alBestFavs.add(ni.getFingerprint());
}
// Calculate our new weighted threshold value
l = ni.getTestLatency();
if (l >= mean) {
continue;
}
summation += l;
mean = (summation / (i + 1)) * 3;
i++;
alBestNodes.add(ni.getFingerprint());
}
// New threshold result, prevent divide by zero
if (i == 0) {
setThreshold(MAXTHRESHOLD);
} else {
setThreshold((summation / i) + 100);
}
if (alBestFavs.isEmpty()) {
while (alBestNodes.size() > 5) {
alBestNodes.remove(alBestNodes.remove(alBestNodes.size() - 1));
}
strArrBestNodes = alBestNodes.toArray(new String[alBestNodes.size()]);
} else {
strArrBestNodes = alBestFavs.toArray(new String[alBestFavs.size()]);
}
}
private void resetTestFields() {
for (int i = 0; i < entm.getRowCount(); i++) {
entm.setValueAt(TorController.LATENCY_FAIL, i, 2);
entm.setValueAt(LOCAL.getString("textfield_unknown"), i, 3);
entm.setValueAt(null, i, 6);
}
}
/**
* Begin the test cycle
*/
private void runTestingCycle() {
// Setting intBeginTesting to -1 prevents re-triggering of testing cycle until it has completed
intBeginTesting = TESTING_ACTIVE;
// Update table status column to show unknown and reset the latency column to 9999
intActiveNodeTests = 0;
jMenuTesting.setEnabled(false);
jTableExitNodes.getRowSorter().setSortKeys(null);
resetTestFields();
// Add all nodes to the individual test thread queues
alTestQueue.addAll(nodeList.getExitNodes(true, false));
// Some more inititalisation of test process threads
long delay = 0;
int listenport = tcMain.getListenPort();
for (TorController tc : alTestThreads) {
listenport += 2;
tc.setListenPort(listenport);
tc.setCachedDataFolder(tcMain.getListenPort());
tc.setBridges(sp.getString("PREF_TORBRIDGE"));
tc.setEntryNodes(tcMain.getEntryGuardsAsCSV());
tc.setTestingURL(TESTURL);
tc.setBoolTorOption("SafeSocks", sp.getBool("PREF_SAFESOCKS"));
tc.setBoolTorOption("TestSocks", sp.getBool("PREF_TESTSOCKS"));
tc.setBoolTorOption("AvoidDiskWrites", sp.getBool("PREF_AVOIDDISK"));
tc.setBoolTorOption("SafeLogging", sp.getBool("PREF_SAFELOG"));
tc.setGeoIP4(geoipPath);
tc.setGeoIP6(geoip6Path);
tc.setExternalArgs(sp.getString("PREF_TORARGS"));
tc.setLogLevel(sp.getInt("PREF_TORLOGLEV"));
tc.setSilentBootEnabled(true);
tc.setStartupDelay(delay);
delay += 5000;
tc.start();
}
}
/**
* Cleanly abort any node testing
*/
private void abortTesting() {
intBeginTesting = TESTING_DISABLED;
for (TorController tcTest : alTestThreads) {
tcTest.abortActions();
}
intActiveNodeTests = -1;
alTestQueue.clear();
jMenuTesting.setEnabled(true);
}
/**
* Terminate all test threads cleanly, this is permanent and would require a
* call to initTestThreads prior to starting them again
*/
private void stopTestClients() {
for (TorController tc : alTestThreads) {
tc.stop();
}
}
/**
* Gets the node with the best circuit hops
*
* @return String with the best circuit hops or empty string if we don't
* have any or null if we have run out of good nodes
*/
private String getBestNode() {
// Check for no table or empty table
if (strArrBestNodes == null || strArrBestNodes.length == 0) {
intBestNodeIndex = 0;
return EMPTYSTR;
}
// Check for end of table
if (intBestNodeIndex > (strArrBestNodes.length - 1)) {
intBestNodeIndex = 0;
if (intBeginTesting > 2) {
intBeginTesting = 2;
}
return null;
}
return strArrBestNodes[intBestNodeIndex++];
}
/**
* Reset to the best node
*/
private void resetBestNode() {
intBestNodeIndex = 0;
}
/**
* Update program status message
*
* @param message
*/
private synchronized void updateProgramStatus(String message) {
if (message != null) {
jLabStatus.setText(message);
Logger.getGlobal().log(Level.INFO, "updateProgramStatus {0}", message);
}
}
private void getFreshNodeInfo() {
TorCircuit tc = tcMain.getLatestCircuit();
if (tc == null) {
return;
}
// Get active guard node item
String finger = tc.getGuard(TorCircuit.FINGER);
niActiveGuard = nodeList.getNode(finger).clone();
// Get exitnode info
finger = tc.getExit(TorCircuit.FINGER);
niActiveExit = (NodeItem) nodeList.getNode(finger).clone();
niActiveExit.setCircuitHops(tc.getHops());
niActiveExit.setLatency(TorController.LATENCY_FAIL);
// Get active middle node item
finger = tc.getMiddleMan(TorCircuit.FINGER);
niActiveMiddle = nodeList.getNode(finger).clone();
}
/**
* Convenience method to refresh all the GUI labels related to Node
* information
*
* @param niexit Requires the active node item to be provided
*/
private void updateGUINodeInfo(NodeItem niguard, NodeItem nimiddle, NodeItem niexit) {
if (nimiddle == null) {
jLabelMiddleStable.setText(LOCAL.getString("textfield_unknown"));
jLabelMiddleBw.setText(LOCAL.getString("textfield_unknown"));
jLabelMiddleNick.setText(LOCAL.getString("textfield_unknown"));
jLabelMiddleIP.setText(LOCAL.getString("textfield_unknown"));
jLabelMiddleCountry.setText(LOCAL.getString("textfield_unknown"));
jButtonMiddleNodeDetails.setEnabled(false);
} else {
jLabelMiddleNick.setText(nimiddle.getNickName());
jLabelMiddleIP.setText(nimiddle.getIPAddress());
jLabelMiddleCountry.setText(nimiddle.getCountryName());
jLabelMiddleBw.setText(String.valueOf(nimiddle.getBandwidth()) + " MB\\s");
jLabelMiddleStable.setText(nimiddle.getStability());
jButtonMiddleNodeDetails.setEnabled(true);
}
if (niexit == null) {
intLatencyCheck = 0;
intAutoSelectCheck = 0;
jLabelExitNick.setText(LOCAL.getString("textfield_unknown"));
jLabelExitIP.setText(LOCAL.getString("textfield_unknown"));
jLabelExitCountry.setText(LOCAL.getString("textfield_unknown"));
jLabelExitBw.setText(LOCAL.getString("textfield_unknown"));
jLabelExitStable.setText(LOCAL.getString("textfield_unknown"));
jLabelTorLatency.setText(LOCAL.getString("textfield_unknown"));
jLabelStreams.setText(LOCAL.getString("textfield_unknown"));
jLabelGuardStable.setText(LOCAL.getString("textfield_unknown"));
jLabelGuardBw.setText(LOCAL.getString("textfield_unknown"));
jLabelGuardNick.setText(LOCAL.getString("textfield_unknown"));
jLabelGuardIP.setText(LOCAL.getString("textfield_unknown"));
jLabelGuardCountry.setText(LOCAL.getString("textfield_unknown"));
jButtonExitNodeDetails.setEnabled(false);
jButtonGuardNodeDetails.setEnabled(false);
jMenuItemTorCheck.setEnabled(false);
} else {
jLabelExitNick.setText(niexit.getNickName());
jLabelExitIP.setText(niexit.getIPAddress());
jLabelExitCountry.setText(niexit.getCountryName());
jLabelExitBw.setText(String.valueOf(niexit.getBandwidth()) + " MB\\s");
jLabelExitStable.setText(niexit.getStability());
jButtonExitNodeDetails.setEnabled(true);
jLabelGuardNick.setText(niguard.getNickName());
jLabelGuardIP.setText(niguard.getIPAddress());
jLabelGuardCountry.setText(niguard.getCountryName());
jLabelGuardBw.setText(String.valueOf(niguard.getBandwidth()) + " MB\\s");
jLabelGuardStable.setText(niguard.getStability());
jMenuItemTorCheck.setEnabled(true);
jButtonGuardNodeDetails.setEnabled(true);
if (niexit.getLatency() > 5000) {
jLabelTorLatency.setText("> 5000 ms");
} else {
jLabelTorLatency.setText(String.valueOf(niexit.getLatency()) + " ms");
}
jLabelStreams.setText(String.valueOf(niexit.getStreams()));
updateProgramStatus(LOCAL.getString("progstatus_nodeactive3hop").replace("$nodename", niActiveExit.getNickName()));
dn.raiseNotification();
}
String text = LOCAL.getString("label_country") + " : " + sp.getString("PREF_ISOCOUNTRY");
text += "\n" + LOCAL.getString("traymenu_proxymode" + (sp.getInt("PREF_PROXY_MODE") + 1));
text += "\n" + LOCAL.getString("traytool_guardnode") + " : " + jLabelGuardNick.getText();
text += "\n" + LOCAL.getString("traytool_exitnode") + " : " + jLabelExitNick.getText();
text += "\n" + LOCAL.getString("label_torlatency") + " : " + jLabelTorLatency.getText();
text += "\n" + LOCAL.getString("label_streams") + " : " + jLabelStreams.getText();
sti.setInfoTip(text);
}
/**
* Convenience method to update the exit node table
*
*/
private void updateExitNodeTable() {
try {
strArrBestNodes = null;
intRowSelected = -1;
// Set in an empty model while we do the update of its model to avoid event collision issues
jTableExitNodes.setModel(new ExitNodeTableModel());
nodeList.refreshExitTableModel(strExitISOCode);
jTableExitNodes.setModel(entm);
resetTestFields();
calcBestNodes();
} catch (Exception ex) {
Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "updateExitNodeTable()", EMPTYSTR, ex);
}
updateGUINodeInfo(null, null, null);
setComponentsEnabled(true);
}
/**
* Adjust exit table column widths
*/
private void adjustExitTableColumns() {
// Adjust table column widths
String col3 = LOCAL.getString("circuit_status_creating_2hop");
if (col3.length() > 6) {
col3 = col3.substring(0, col3.length() - 2);
} else {
col3 = "XXXXXXXXXXXXXXXXXX";
}
Utilities.adjustTableColumnWidth(jTableExitNodes,
"XXXXXXXXXXXXXXXXXX",
jTableExitNodes.getColumnName(1) + "X",
jTableExitNodes.getColumnName(2) + "X",
col3,
jTableExitNodes.getColumnName(4) + "X");
}
/**
* Returns the selected fingerprint
*
* @param row
* @return Fingerprint as String
*/
private String getSelectedFinger(int row) {
return (String) entm.getValueAt(row, 5);
}
/**
* Tests first to see if node is in the exitnode list
*
* @param finger
* @return true if specified node is in the exit node table
*/
private boolean isValidExit(String finger) {
return nodeList.getExitNodes(true, false).contains(finger);
}
/**
* Activates specified node with fingerprint finger, also returns the node
* name
*
* @param finger
* @return Node name
*/
private String activateNode(String fingerprint) {
String result = EMPTYSTR;
updateGUINodeInfo(niActiveGuard = null, niActiveMiddle = null, niActiveExit = null);
if (boolFirstRun) {
tcMain.closeCircuitsExcept("", true);
}
if (fingerprint.isEmpty()) {
// Get a list of exit nodes based on auto node selection mode
ArrayList alFingers = nodeList.getExitNodes(false, true);
if (alFingers.isEmpty()) {
// Get a list of all exit nodes
alFingers = nodeList.getExitNodes(true, true);
}
// Randomly select from given list of nodes
Random rand = new Random();
int idx = rand.nextInt(alFingers.size());
fingerprint = alFingers.get(idx);
tcMain.activateNodes(fingerprint, 1);
} else if (!fingerprint.startsWith("$")) {
tcMain.activateNodes(fingerprint, 1);
} else {
NodeItem ni = nodeList.getNode(fingerprint);
tcMain.activateNodes(fingerprint, 1);
if (ni != null) {
ni.setTestStatus(NodeItem.TESTSTATUS_PASSED);
result = ni.getNickName();
} else {
result = fingerprint;
}
}
return result;
}
/**
* Called when the country is changed via the combo box change event
*
*/
private void countryChanged() {
// Some essential resets of variables
niActiveExit = null;
// Get selected country
String iso = (String) jComboCountry.getSelectedItem();
iso = iso.substring(0, 2);
if (!strExitISOCode.contentEquals(iso)) {
// Save new country to properties file
sp.setString("PREF_ISOCOUNTRY", strExitISOCode = iso);
sp.save();
}
rebuildPatternPac();
updateExitNodeTable();
adjustExitTableColumns();
updateProgramStatus(LOCAL.getString("progstatus_waitfortor"));
activateNode(strRequestedExit = EMPTYSTR);
}
/**
* Cleans up pac files and proxies
*/
private void pacCleanup() {
if (pacFactory != null) {
pacFactory.restoreProxyPrefs(false);
pacFactory.deleteProxyPrefs();
pacFactory.deleteAllPAC();
}
}
/**
* The main application exit routine also does cleanup before exiting
*
*/
public final void cleanupExit() {
try {
setVisible(false);
// Need to ensure various processes are cleanly terminated before we can exit
if (tmr != null) {
tmr.stop();
}
if (sti != null) {
sti.dispose();
}
if (nodeList != null) {
nodeList.terminate();
}
if (tmf != null) {
tmf.dispose();
}
// Terminate all tor threads
if (tcMain != null) {
tcMain.stop();
}
stopTestClients();
pacCleanup();
if (sp.getBool("PREF_CACHEDELETE")) {
SimpleFile.secureWipeFolder(cachePath);
}
} catch (Exception ex) {
}
Logger.getGlobal().log(Level.INFO, "Cleanup completed, shutting down");
dispose();
System.exit(0);
}
/**
* Change visibilty of gUI
*
*/
private void initGUIVisibility() {
// Bring up gui
pack();
setLocationRelativeTo(this);
Utilities.registerWindow();
if (sp.getBool("PREF_HIDETOTRAY")) {
if (sp.getBool("PREF_HIDE_MIN") && sti.isLoaded()) {
setVisible(false);
} else {
setVisible(true);
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
repaint();
setExtendedState(Frame.ICONIFIED);
}
});
}
} else {
setVisible(true);
}
}
/**
* Toggle GUI visibility
*/
private void toggleGUIVisibility() {
if (OSFunction.isLinux()) {
requestFocus();
}
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
if (!isVisible()) {
setVisible(true);
setExtendedState(Frame.NORMAL);
return;
}
if ((getExtendedState() & Frame.ICONIFIED) != 0) {
setExtendedState(Frame.NORMAL);
toFront();
} else {
if (OSFunction.isLinux()) {
switch (desktopname) {
case "kde4":
if (compositor.contentEquals("kwin")) {
if (getFocusOwner() == null) {
setVisible(false);
setVisible(true);
return;
}
}
break;
case "mate":
if (compositor.contentEquals("compiz")) {
if (getFocusOwner() == null) {
setExtendedState(Frame.NORMAL);
toFront();
return;
}
} else if (getFocusOwner() == null) {
setVisible(false);
setVisible(true);
return;
}
break;
default:
if (getFocusOwner() == null) {
setExtendedState(Frame.NORMAL);
toFront();
return;
}
break;
}
}
if (sp.getBool("PREF_HIDE_MIN") && sti.isLoaded()) {
setVisible(false);
} else {
setExtendedState(Frame.ICONIFIED);
}
}
}
});
}
/**
* Open the about dialog
*/
private void openAboutDialog() {
AboutDialog ad = new AboutDialog(this, true);
ad.setButtonCloseText(LOCAL.getString("button_close"));
ad.setButtonVisitText(LOCAL.getString("button_visitus"));
ad.setButtonContactText(LOCAL.getString("button_contactus"));
ad.setTitle(LOCAL.getString("wintitle_about").replace("$appname", APPNAME));
ad.setContactURL(CONTACT);
ad.setHomeURL(HOMEPAGE_SSL);
ad.setAppLogo(new javax.swing.ImageIcon(iconPath + ICONFILE));
String desc = LOCAL.getString("appdesc").replace("$appname", APPNAME);
desc = desc.replace("$appver", APPVER) + "\n\nCopyright 2009-2017\nAlistair Neil";
ad.setAppDescription(desc);
ad.setLocationRelativeTo(this);
ad.pack();
ad.setVisible(true);
}
/**
* Open the licensing dialog
*/
private void openLicenseDialog() {
TextResourceDialog trd = new TextResourceDialog(this, true);
trd.setTitle(LOCAL.getString("dlg_license_title"));
trd.setURLButtonText(LOCAL.getString("button_translations"));
trd.setButtonURL(LOCAL.getString("gpltransurl"));
trd.setCloseButtonText(LOCAL.getString("button_close"));
trd.setTitle(LOCAL.getString("dlg_license_title").replace("$appname", APPNAME));
trd.setText(Utilities.getTextFromResource("/resources/license.txt"));
trd.setLocationRelativeTo(this);
trd.setVisible(true);
}
/**
* Open the licensing dialog
*/
private void openCreditsDialog() {
TextResourceDialog trd = new TextResourceDialog(this, true);
trd.setTitle(LOCAL.getString("dlg_credits_title"));
trd.setButtonURL(PATREON);
trd.setURLButtonText(LOCAL.getString("button_patreon"));
trd.setCloseButtonText(LOCAL.getString("button_close"));
trd.setTitle(LOCAL.getString("dlg_credits_title").replace("$appname", APPNAME));
trd.setText(LOCAL.getString("dlg_credits_body") + "\n\n"
+ Utilities.getTextFromResource("/resources/credits.txt"));
trd.setLocationRelativeTo(this);
trd.setVisible(true);
}
/**
* Open the user pattern export file chooser
*/
private void openPatternExport() {
File[] files = pacFactory.getPatternsFiles();
if (files.length == 0) {
InfoDialog id = createInfoDialog();
id.createWarn(LOCAL.getString("dlg_exportuser_title"),
LOCAL.getString("dlg_exportuser_body"));
id.setContinueButtonText(LOCAL.getString("button_close"));
id.setCancelVisible(false);
id.pack();
id.setVisible(true);
return;
}
// Lets choose our zip filename or overwrite an existing zip file
JFileChooser jfc = new JFileChooser();
jfc.setDialogTitle(LOCAL.getString("dlg_saveuser_title"));
if (jfc.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) {
return;
}
pacFactory.exportUserPatterns(jfc.getSelectedFile().getAbsolutePath(), files);
}
/**
* Open the pattern import file chooser
*/
private void openPatternImport() {
JFileChooser jfc = new JFileChooser();
ExtensionFileFilter filter = new ExtensionFileFilter(LOCAL.getString("fileext_pattern"), new String[]{"zip"});
jfc.setFileFilter(filter);
jfc.setDialogTitle(LOCAL.getString("dlg_import_title"));
if (jfc.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) {
return;
}
InfoDialog id = createInfoDialog();
if (pacFactory.importPatterns(jfc.getSelectedFile().getAbsolutePath())) {
rebuildPatternPac();
id.createWarn(LOCAL.getString("dlg_import_success_title"),
LOCAL.getString("dlg_import_success_body"));
id.setCancelVisible(false);
id.pack();
id.setVisible(true);
} else {
id.createWarn(LOCAL.getString("dlg_import_fail_title"),
LOCAL.getString("dlg_import_fail_body"));
id.setCancelVisible(false);
id.pack();
id.setVisible(true);
}
}
/**
* Open the pattern editor
*/
private void openPatternEditorDialog() {
PatternsEditor pe = new PatternsEditor(this, true, pacFactory);
pe.populateCountryComboBox(nodeList.getValidatedCountries());
pe.setSelectedCountry((String) jComboCountry.getSelectedItem());
pe.setTitle(LOCAL.getString("wintitle_patternedit").replace("$appname", APPNAME));
pe.pack();
pe.setLocationRelativeTo(this);
pe.setVisible(true);
sp.setString("PREF_DONOT_PROXY", pacFactory.getDoNotProxy());
if (sp.getChangedProperties().contains("PREF_DONOT_PROXY")) {
sp.save();
}
if (pe.getReturnStatus() == PatternsEditor.APPLY) {
rebuildPatternPac();
}
}
/**
* Open Quick Add pattern dialog
*/
private void openQuickAddDialog() {
QuickAddDialog qad = new QuickAddDialog(this, true);
qad.pack();
qad.setLocationRelativeTo(this);
qad.setVisible(true);
if (qad.getReturnStatus() == QuickAddDialog.APPLY && strExitISOCode != null) {
pacFactory.addToPatternFile(strExitISOCode, qad.getDescription(), qad.getPattern());
rebuildPatternPac();
}
}
/**
* Open Tor client to old dialog
*/
private void openToOldDialog() {
openFatalErrorDialog(LOCAL.getString("dlg_toold_body"));
}
/**
* Open the fatal error dialog
*
* @param errmessage
*/
private void openFatalErrorDialog(String errmessage) {
String text = "\n\n" + LOCAL.getString("dlg_error_body").replace("$appname", APPNAME);
InfoDialog id = createInfoDialog();
id.setSize(500, 450);
id.createInfo(LOCAL.getString("dlg_error_title"), errmessage + text);
id.setModal(true);
id.pack();
id.setLocationRelativeTo(this);
id.pack();
id.setVisible(true);
}
/**
* Open the guards node setting dialog
*/
private void openGuardsSettingDialog() {
GuardNodeDialog gnd = new GuardNodeDialog(this, true);
gnd.setNodeList(nodeList);
gnd.pack();
gnd.setLocationRelativeTo(this);
gnd.setVisible(true);
if (gnd.getReturnStatus() == GuardNodeDialog.APPLY) {
if (sp.getString("PREF_TORBRIDGE").isEmpty()) {
updateProgramStatus(LOCAL.getString("progstatus_applychanges"));
abortAllTorThreads();
applyMainTorSettings();
tcMain.start();
}
}
}
/**
* Open the standard out dialog
*/
private void openTorMonitor() {
tmf.setLocationRelativeTo(this);
tmf.setVisible(true);
}
/**
* Called when proxy mode is changed by the user
*
* @param mode Proxy mode
*/
private void proxyModeChanged(int mode) {
sp.setInt("PREF_PROXY_MODE", mode);
sp.save();
dn.setNotificationBody(LOCAL.getString("traymenu_proxymode" + (sp.getInt("PREF_PROXY_MODE") + 1)));
applyProxyChanges(mode);
}
/**
* Apply any proxy changes based on current proxy mode
*
* @param mode Proxy mode
*/
private void applyProxyChanges(int mode) {
if (tcMain == null) {
return;
}
switch (mode) {
case PacFactory.PROXY_DISABLED:
pacFactory.restoreProxyPrefs(true);
pacFactory.deleteAllPAC();
break;
case PacFactory.PROXY_PATTERN:
pacFactory.createPacFile(strExitISOCode, tcMain.getListenPort());
break;
case PacFactory.PROXY_ALL:
pacFactory.createPacFile("proxyall", tcMain.getListenPort());
break;
}
}
/**
* Rebuilds pattern pacfile but only if we are in pattern mode
*/
private void rebuildPatternPac() {
if (sp.getInt("PREF_PROXY_MODE") == PacFactory.PROXY_PATTERN) {
applyProxyChanges(sp.getInt("PREF_PROXY_MODE"));
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
// //GEN-BEGIN:initComponents
private void initComponents() {
popupTable = new javax.swing.JPopupMenu();
jMenuNodeDetails = new javax.swing.JMenuItem();
jMenuWhois = new javax.swing.JMenuItem();
jMenuTesting = new javax.swing.JMenuItem();
jMenuItemGUI = new javax.swing.JMenuItem();
jMenuItemQuitx = new javax.swing.JMenuItem();
buttonGroupProxy = new javax.swing.ButtonGroup();
buttonGroupProxyTray = new javax.swing.ButtonGroup();
jCheckTrayProxyDisable = new javax.swing.JCheckBoxMenuItem();
jCheckTrayProxyByPattern = new javax.swing.JCheckBoxMenuItem();
jCheckTrayProxyAll = new javax.swing.JCheckBoxMenuItem();
jPanelMain = new javax.swing.JPanel();
jLabelCountry = new javax.swing.JLabel();
jComboCountry = new javax.swing.JComboBox<>();
jScrollPaneExitNodes = new javax.swing.JScrollPane();
jTableExitNodes = new javax.swing.JTable();
jPanelNodeInfo = new javax.swing.JPanel();
jLabel5 = new javax.swing.JLabel();
jLabelGuardBw = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabelGuardStable = new javax.swing.JLabel();
jLabelGuard = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabelGuardNick = new javax.swing.JLabel();
jLabelGuardIP = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabelGuardCountry = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabelExitNick = new javax.swing.JLabel();
jLabelExitIP = new javax.swing.JLabel();
jLabelMiddle = new javax.swing.JLabel();
jLabelExit = new javax.swing.JLabel();
jLabelMiddleNick = new javax.swing.JLabel();
jLabelMiddleIP = new javax.swing.JLabel();
jLabelMiddleCountry = new javax.swing.JLabel();
jButtonExitNodeDetails = new javax.swing.JButton();
jButtonGuardNodeDetails = new javax.swing.JButton();
jButtonMiddleNodeDetails = new javax.swing.JButton();
jLabelMiddleBw = new javax.swing.JLabel();
jLabelExitBw = new javax.swing.JLabel();
jLabelMiddleStable = new javax.swing.JLabel();
jLabelExitStable = new javax.swing.JLabel();
jLabelExitCountry = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabelTorLatency = new javax.swing.JLabel();
jLabelStreams = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jButtonSetGuards = new javax.swing.JButton();
jLabStatus = new javax.swing.JLabel();
jButtonClearFavs = new javax.swing.JButton();
jMenuBar = new javax.swing.JMenuBar();
jMenuMenu = new javax.swing.JMenu();
jMenuItemPrefs = new javax.swing.JMenuItem();
jMenuItemAddPattern = new javax.swing.JMenuItem();
jMenuItemPatternEdit = new javax.swing.JMenuItem();
jMenuItemStdout = new javax.swing.JMenuItem();
jMenuItemExport = new javax.swing.JMenuItem();
jMenuItemImport = new javax.swing.JMenuItem();
jMenuItemGeoip = new javax.swing.JMenuItem();
jMenuItemQuit = new javax.swing.JMenuItem();
jMenuProxy = new javax.swing.JMenu();
jCheckProxyDisable = new javax.swing.JCheckBoxMenuItem();
jCheckProxyByPattern = new javax.swing.JCheckBoxMenuItem();
jCheckProxyAll = new javax.swing.JCheckBoxMenuItem();
jMenuHelp = new javax.swing.JMenu();
jMenuItemDebugLog = new javax.swing.JMenuItem();
jMenuItemHelp = new javax.swing.JMenuItem();
jMenuItemTorMan = new javax.swing.JMenuItem();
jMenuItemTorCheck = new javax.swing.JMenuItem();
jMenuItemAbout = new javax.swing.JMenuItem();
jMenuItemLicense = new javax.swing.JMenuItem();
popupTable.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {
public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
popupTablePopupMenuWillBecomeVisible(evt);
}
public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
}
public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
}
});
jMenuNodeDetails.setText(LOCAL.getString("table_popup_details")); // NOI18N
jMenuNodeDetails.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuNodeDetailsActionPerformed(evt);
}
});
popupTable.add(jMenuNodeDetails);
jMenuWhois.setText(LOCAL.getString("table_popup_whois")); // NOI18N
jMenuWhois.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuWhoisActionPerformed(evt);
}
});
popupTable.add(jMenuWhois);
jMenuTesting.setText(LOCAL.getString("table_popup_begintest")); // NOI18N
jMenuTesting.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuTestingActionPerformed(evt);
}
});
popupTable.add(jMenuTesting);
jMenuItemGUI.setBackground(new Color(jMenuBar.getBackground().getRGB()));
jMenuItemGUI.setForeground(new Color(jMenuBar.getForeground().getRGB()));
jMenuItemGUI.setText(LOCAL.getString("traymenu_showgui")); // NOI18N
jMenuItemGUI.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemGUIActionPerformed(evt);
}
});
jMenuItemQuitx.setText(LOCAL.getString("menu_quit")); // NOI18N
jMenuItemQuitx.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemQuitxActionPerformed(evt);
}
});
jCheckTrayProxyDisable.setText(LOCAL.getString("combo_proxymode1")); // NOI18N
jCheckTrayProxyDisable.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
jCheckTrayProxyDisableItemStateChanged(evt);
}
});
jCheckTrayProxyByPattern.setText(LOCAL.getString("combo_proxymode2")); // NOI18N
jCheckTrayProxyByPattern.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
jCheckTrayProxyByPatternItemStateChanged(evt);
}
});
jCheckTrayProxyAll.setText(LOCAL.getString("combo_proxymode3")); // NOI18N
jCheckTrayProxyAll.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
jCheckTrayProxyAllItemStateChanged(evt);
}
});
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
setResizable(false);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
}
});
jPanelMain.setFont(jPanelMain.getFont().deriveFont(jPanelMain.getFont().getStyle() | java.awt.Font.BOLD, jPanelMain.getFont().getSize()+1));
jLabelCountry.setFont(jLabelCountry.getFont().deriveFont(jLabelCountry.getFont().getStyle() | java.awt.Font.BOLD));
jLabelCountry.setText(LOCAL.getString("label_activecountry")); // NOI18N
jComboCountry.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
jComboCountryItemStateChanged(evt);
}
});
jTableExitNodes.setAutoCreateRowSorter(true);
jTableExitNodes.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{},
{},
{},
{}
},
new String [] {
}
));
jTableExitNodes.setToolTipText(LOCAL.getString("ttip_threshold") +" : "+ LOCAL.getString("textfield_unknown")
);
jTableExitNodes.setComponentPopupMenu(popupTable);
jTableExitNodes.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
jTableExitNodes.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTableExitNodesMouseClicked(evt);
}
});
jScrollPaneExitNodes.setViewportView(jTableExitNodes);
jPanelNodeInfo.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LOCAL.getString("panel_info"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, jPanelMain.getFont())); // NOI18N
jPanelNodeInfo.setFont(jPanelNodeInfo.getFont().deriveFont(jPanelNodeInfo.getFont().getStyle() | java.awt.Font.BOLD));
jLabel5.setFont(jLabel5.getFont().deriveFont(jLabel5.getFont().getStyle() | java.awt.Font.BOLD));
jLabel5.setText(LOCAL.getString("label_bandwidth")); // NOI18N
jLabelGuardBw.setText(LOCAL.getString("textfield_unknown")); // NOI18N
jLabelGuardBw.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabel10.setFont(jLabel10.getFont().deriveFont(jLabel10.getFont().getStyle() | java.awt.Font.BOLD));
jLabel10.setText(LOCAL.getString("label_stable")); // NOI18N
jLabelGuardStable.setText(LOCAL.getString("textfield_unknown")); // NOI18N
jLabelGuardStable.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabelGuard.setFont(jLabelGuard.getFont().deriveFont(jLabelGuard.getFont().getStyle() | java.awt.Font.BOLD));
jLabelGuard.setText(LOCAL.getString("label_guard")); // NOI18N
jLabel8.setFont(jLabel8.getFont().deriveFont(jLabel8.getFont().getStyle() | java.awt.Font.BOLD));
jLabel8.setText(LOCAL.getString("label_ip")); // NOI18N
jLabelGuardNick.setText(LOCAL.getString("textfield_unknown")); // NOI18N
jLabelGuardNick.setBorder(javax.swing.BorderFactory.createEtchedBorder());
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("resources/MessagesBundle"); // NOI18N
jLabelGuardIP.setText(bundle.getString("textfield_unknown")); // NOI18N
jLabelGuardIP.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabel9.setFont(jLabel9.getFont().deriveFont(jLabel9.getFont().getStyle() | java.awt.Font.BOLD));
jLabel9.setText(LOCAL.getString("label_country")); // NOI18N
jLabelGuardCountry.setText(bundle.getString("textfield_unknown")); // NOI18N
jLabelGuardCountry.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabel12.setFont(jLabel12.getFont().deriveFont(jLabel12.getFont().getStyle() | java.awt.Font.BOLD));
jLabel12.setText(LOCAL.getString("label_nickname")); // NOI18N
jLabelExitNick.setText(LOCAL.getString("textfield_unknown")); // NOI18N
jLabelExitNick.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabelExitIP.setText(bundle.getString("textfield_unknown")); // NOI18N
jLabelExitIP.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabelMiddle.setFont(jLabelMiddle.getFont().deriveFont(jLabelMiddle.getFont().getStyle() | java.awt.Font.BOLD));
jLabelMiddle.setText(LOCAL.getString("label_middle")); // NOI18N
jLabelExit.setFont(jLabelExit.getFont().deriveFont(jLabelExit.getFont().getStyle() | java.awt.Font.BOLD));
jLabelExit.setText(LOCAL.getString("label_exit")); // NOI18N
jLabelMiddleNick.setText(bundle.getString("textfield_unknown")); // NOI18N
jLabelMiddleNick.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabelMiddleIP.setText(bundle.getString("textfield_unknown")); // NOI18N
jLabelMiddleIP.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabelMiddleCountry.setText(bundle.getString("textfield_unknown")); // NOI18N
jLabelMiddleCountry.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jButtonExitNodeDetails.setText(LOCAL.getString("button_details")); // NOI18N
jButtonExitNodeDetails.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonExitNodeDetailsActionPerformed(evt);
}
});
jButtonGuardNodeDetails.setText(LOCAL.getString("button_details")); // NOI18N
jButtonGuardNodeDetails.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonGuardNodeDetailsActionPerformed(evt);
}
});
jButtonMiddleNodeDetails.setText(LOCAL.getString("button_details")); // NOI18N
jButtonMiddleNodeDetails.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonMiddleNodeDetailsActionPerformed(evt);
}
});
jLabelMiddleBw.setText(LOCAL.getString("textfield_unknown")); // NOI18N
jLabelMiddleBw.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabelExitBw.setText(LOCAL.getString("textfield_unknown")); // NOI18N
jLabelExitBw.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabelMiddleStable.setText(LOCAL.getString("textfield_unknown")); // NOI18N
jLabelMiddleStable.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabelExitStable.setText(LOCAL.getString("textfield_unknown")); // NOI18N
jLabelExitStable.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabelExitCountry.setText(bundle.getString("textfield_unknown")); // NOI18N
jLabelExitCountry.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabel4.setFont(jLabel4.getFont().deriveFont(jLabel4.getFont().getStyle() | java.awt.Font.BOLD));
jLabel4.setText(LOCAL.getString("label_torlatency")); // NOI18N
jLabelTorLatency.setText(LOCAL.getString("textfield_unknown")); // NOI18N
jLabelTorLatency.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabelStreams.setText(LOCAL.getString("textfield_unknown")); // NOI18N
jLabelStreams.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jLabel6.setFont(jLabel6.getFont().deriveFont(jLabel6.getFont().getStyle() | java.awt.Font.BOLD));
jLabel6.setText(LOCAL.getString("label_streams")); // NOI18N
javax.swing.GroupLayout jPanelNodeInfoLayout = new javax.swing.GroupLayout(jPanelNodeInfo);
jPanelNodeInfo.setLayout(jPanelNodeInfoLayout);
jPanelNodeInfoLayout.setHorizontalGroup(
jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelNodeInfoLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel10)
.addComponent(jLabel9)
.addComponent(jLabel8)
.addComponent(jLabel12)
.addComponent(jLabel5))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanelNodeInfoLayout.createSequentialGroup()
.addComponent(jLabelGuard)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButtonGuardNodeDetails))
.addComponent(jLabelGuardIP, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
.addComponent(jLabelGuardCountry, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
.addComponent(jLabelGuardBw, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
.addComponent(jLabelGuardStable, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
.addComponent(jLabelGuardNick, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanelNodeInfoLayout.createSequentialGroup()
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabelTorLatency, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanelNodeInfoLayout.createSequentialGroup()
.addComponent(jLabelMiddle)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButtonMiddleNodeDetails))
.addComponent(jLabelMiddleIP, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
.addComponent(jLabelMiddleCountry, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
.addComponent(jLabelMiddleBw, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
.addComponent(jLabelMiddleStable, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
.addComponent(jLabelMiddleNick, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabelExitStable, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
.addComponent(jLabelExitBw, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
.addComponent(jLabelExitCountry, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
.addComponent(jLabelExitIP, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanelNodeInfoLayout.createSequentialGroup()
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabelStreams, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanelNodeInfoLayout.createSequentialGroup()
.addComponent(jLabelExit)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButtonExitNodeDetails))
.addComponent(jLabelExitNick, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE))
.addContainerGap())
);
jPanelNodeInfoLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel10, jLabel12, jLabel5, jLabel8, jLabel9});
jPanelNodeInfoLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabelExitBw, jLabelExitCountry, jLabelExitIP, jLabelExitNick, jLabelExitStable, jLabelMiddleBw, jLabelMiddleCountry, jLabelMiddleIP, jLabelMiddleStable});
jPanelNodeInfoLayout.setVerticalGroup(
jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelNodeInfoLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(jLabelGuard)
.addComponent(jButtonGuardNodeDetails)
.addComponent(jLabelMiddle)
.addComponent(jButtonMiddleNodeDetails)
.addComponent(jLabelExit)
.addComponent(jButtonExitNodeDetails))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelNodeInfoLayout.createSequentialGroup()
.addComponent(jLabelExitNick)
.addGap(0, 0, 0)
.addComponent(jLabelExitIP)
.addGap(0, 0, 0)
.addComponent(jLabelExitCountry)
.addGap(0, 0, 0)
.addComponent(jLabelExitBw)
.addGap(0, 0, 0)
.addComponent(jLabelExitStable))
.addGroup(jPanelNodeInfoLayout.createSequentialGroup()
.addComponent(jLabelMiddleNick)
.addGap(0, 0, 0)
.addComponent(jLabelMiddleIP)
.addGap(0, 0, 0)
.addComponent(jLabelMiddleCountry)
.addGap(0, 0, 0)
.addComponent(jLabelMiddleBw)
.addGap(0, 0, 0)
.addComponent(jLabelMiddleStable))
.addGroup(jPanelNodeInfoLayout.createSequentialGroup()
.addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelGuardNick)
.addComponent(jLabel12))
.addGap(0, 0, 0)
.addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelGuardIP)
.addComponent(jLabel8))
.addGap(0, 0, 0)
.addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel9)
.addComponent(jLabelGuardCountry))
.addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(jLabelGuardBw))
.addGap(0, 0, 0)
.addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabelGuardStable)
.addComponent(jLabel10))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabelStreams, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabelTorLatency, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING))
.addContainerGap())
);
jPanelNodeInfoLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabelExitBw, jLabelExitCountry, jLabelExitIP, jLabelExitNick, jLabelExitStable, jLabelGuardBw, jLabelGuardCountry, jLabelGuardIP, jLabelGuardNick, jLabelGuardStable, jLabelMiddleBw, jLabelMiddleCountry, jLabelMiddleIP, jLabelMiddleNick, jLabelMiddleStable});
jButtonSetGuards.setText(LOCAL.getString("button_setguards")); // NOI18N
jButtonSetGuards.setToolTipText(LOCAL.getString("button_setguards")); // NOI18N
jButtonSetGuards.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonSetGuardsActionPerformed(evt);
}
});
jLabStatus.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabStatus.setText(LOCAL.getString("textfield_unknown")); // NOI18N
jButtonClearFavs.setText(LOCAL.getString("button_clearfavs")); // NOI18N
jButtonClearFavs.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonClearFavsActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanelMainLayout = new javax.swing.GroupLayout(jPanelMain);
jPanelMain.setLayout(jPanelMainLayout);
jPanelMainLayout.setHorizontalGroup(
jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelMainLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPaneExitNodes)
.addComponent(jPanelNodeInfo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanelMainLayout.createSequentialGroup()
.addGroup(jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelMainLayout.createSequentialGroup()
.addComponent(jComboCountry, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButtonSetGuards)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButtonClearFavs))
.addComponent(jLabelCountry))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
jPanelMainLayout.setVerticalGroup(
jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelMainLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabelCountry)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jComboCountry, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButtonSetGuards)
.addComponent(jButtonClearFavs))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPaneExitNodes, javax.swing.GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanelNodeInfo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabStatus)
.addContainerGap())
);
jMenuMenu.setMnemonic(LOCAL.getString("menu_menu").charAt(0));
jMenuMenu.setText(LOCAL.getString("menu_menu")); // NOI18N
jMenuItemPrefs.setMnemonic('P');
jMenuItemPrefs.setText(LOCAL.getString("menu_prefs")); // NOI18N
jMenuItemPrefs.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemPrefsActionPerformed(evt);
}
});
jMenuMenu.add(jMenuItemPrefs);
jMenuItemAddPattern.setText(LOCAL.getString("menu_quickadd")); // NOI18N
jMenuItemAddPattern.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemAddPatternActionPerformed(evt);
}
});
jMenuMenu.add(jMenuItemAddPattern);
jMenuItemPatternEdit.setText(LOCAL.getString("menu_patternedit")); // NOI18N
jMenuItemPatternEdit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemPatternEditActionPerformed(evt);
}
});
jMenuMenu.add(jMenuItemPatternEdit);
jMenuItemStdout.setText(LOCAL.getString("menu_tormonitor")); // NOI18N
jMenuItemStdout.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemStdoutActionPerformed(evt);
}
});
jMenuMenu.add(jMenuItemStdout);
jMenuItemExport.setText(LOCAL.getString("menu_export")); // NOI18N
jMenuItemExport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemExportActionPerformed(evt);
}
});
jMenuMenu.add(jMenuItemExport);
jMenuItemImport.setText(LOCAL.getString("menu_import")); // NOI18N
jMenuItemImport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemImportActionPerformed(evt);
}
});
jMenuMenu.add(jMenuItemImport);
jMenuItemGeoip.setText(LOCAL.getString("menu_geoip")); // NOI18N
jMenuItemGeoip.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemGeoipActionPerformed(evt);
}
});
jMenuMenu.add(jMenuItemGeoip);
jMenuItemQuit.setMnemonic('Q');
jMenuItemQuit.setText(LOCAL.getString("menu_quit")); // NOI18N
jMenuItemQuit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemQuitActionPerformed(evt);
}
});
jMenuMenu.add(jMenuItemQuit);
jMenuBar.add(jMenuMenu);
jMenuProxy.setMnemonic(LOCAL.getString("menu_proxy").charAt(0));
jMenuProxy.setText(LOCAL.getString("menu_proxy")); // NOI18N
jCheckProxyDisable.setText(LOCAL.getString("combo_proxymode1")); // NOI18N
jCheckProxyDisable.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
jCheckProxyDisableItemStateChanged(evt);
}
});
jMenuProxy.add(jCheckProxyDisable);
jCheckProxyByPattern.setText(LOCAL.getString("combo_proxymode2")); // NOI18N
jCheckProxyByPattern.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
jCheckProxyByPatternItemStateChanged(evt);
}
});
jMenuProxy.add(jCheckProxyByPattern);
jCheckProxyAll.setText(LOCAL.getString("combo_proxymode3")); // NOI18N
jCheckProxyAll.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
jCheckProxyAllItemStateChanged(evt);
}
});
jMenuProxy.add(jCheckProxyAll);
jMenuBar.add(jMenuProxy);
jMenuHelp.setMnemonic(LOCAL.getString("menu_help").charAt(0));
jMenuHelp.setText(LOCAL.getString("menu_help")); // NOI18N
jMenuItemDebugLog.setVisible(false);
jMenuItemDebugLog.setText(LOCAL.getString("menu_debuglog")); // NOI18N
jMenuItemDebugLog.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemDebugLogActionPerformed(evt);
}
});
jMenuHelp.add(jMenuItemDebugLog);
jMenuItemHelp.setMnemonic('C');
jMenuItemHelp.setText(LOCAL.getString("menu_helpcontents")); // NOI18N
jMenuItemHelp.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemHelpActionPerformed(evt);
}
});
jMenuHelp.add(jMenuItemHelp);
jMenuItemTorMan.setText(LOCAL.getString("menu_tormanual")); // NOI18N
jMenuItemTorMan.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemTorManActionPerformed(evt);
}
});
jMenuHelp.add(jMenuItemTorMan);
jMenuItemTorCheck.setMnemonic('T');
jMenuItemTorCheck.setText(LOCAL.getString("menu_torcheck")); // NOI18N
jMenuItemTorCheck.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemTorCheckActionPerformed(evt);
}
});
jMenuHelp.add(jMenuItemTorCheck);
jMenuItemAbout.setMnemonic('A');
jMenuItemAbout.setText(LOCAL.getString("menu_about")); // NOI18N
jMenuItemAbout.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemAboutActionPerformed(evt);
}
});
jMenuHelp.add(jMenuItemAbout);
jMenuItemLicense.setText(LOCAL.getString("menu_license")); // NOI18N
jMenuItemLicense.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemLicenseActionPerformed(evt);
}
});
jMenuHelp.add(jMenuItemLicense);
jMenuBar.add(jMenuHelp);
setJMenuBar(jMenuBar);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanelMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanelMain, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// //GEN-END:initComponents
private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
if (sp.getBool("PREF_MINONCLOSE")) {
// Used to provide clean shut down when a WM_CLOSE and Taskkill are called
// posted externally
if (!isVisible() && OSFunction.isWindows()) {
cleanupExit();
return;
}
if (sp.getBool("PREF_HIDE_MIN") && sti.isLoaded()) {
setVisible(false);
} else {
setExtendedState(Frame.ICONIFIED);
}
} else {
cleanupExit();
}
}//GEN-LAST:event_formWindowClosing
private void jComboCountryItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboCountryItemStateChanged
switch (evt.getStateChange()) {
case ItemEvent.DESELECTED:
abortTesting();
break;
case ItemEvent.SELECTED:
countryChanged();
break;
}
}//GEN-LAST:event_jComboCountryItemStateChanged
private void jMenuItemPrefsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemPrefsActionPerformed
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
openPreferencesDialog();
}
});
}//GEN-LAST:event_jMenuItemPrefsActionPerformed
private void jMenuItemAddPatternActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAddPatternActionPerformed
openQuickAddDialog();
}//GEN-LAST:event_jMenuItemAddPatternActionPerformed
private void jMenuItemPatternEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemPatternEditActionPerformed
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
openPatternEditorDialog();
}
});
}//GEN-LAST:event_jMenuItemPatternEditActionPerformed
private void jMenuItemImportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemImportActionPerformed
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
openPatternImport();
}
});
}//GEN-LAST:event_jMenuItemImportActionPerformed
private void jMenuItemQuitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemQuitActionPerformed
cleanupExit();
}//GEN-LAST:event_jMenuItemQuitActionPerformed
private void jMenuItemDebugLogActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemDebugLogActionPerformed
Utilities.editFile(settingsPath + "status.log");
}//GEN-LAST:event_jMenuItemDebugLogActionPerformed
private void jMenuItemHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemHelpActionPerformed
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
Utilities.openFileExternally(DOCSPATH + "help-" + OSFunction.getLangCode() + ".html");
}
});
}//GEN-LAST:event_jMenuItemHelpActionPerformed
private void jMenuItemTorCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemTorCheckActionPerformed
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
String link = TORCHECK + "?lang="
+ LOCAL.toWebLanguageTag();
Utilities.openFileExternally(link);
}
});
}//GEN-LAST:event_jMenuItemTorCheckActionPerformed
private void jMenuItemAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAboutActionPerformed
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
openAboutDialog();
}
});
}//GEN-LAST:event_jMenuItemAboutActionPerformed
private void jMenuItemLicenseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemLicenseActionPerformed
openLicenseDialog();
}//GEN-LAST:event_jMenuItemLicenseActionPerformed
private void jMenuWhoisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuWhoisActionPerformed
String finger = (String) entm.getValueAt(intRowSelected, 5);
NodeItem ni = nodeList.getNode(finger);
if (ni != null) {
Utilities.openFileExternally("https://www.networksolutions.com/whois/results.jsp?ip=" + ni.getIPAddress());
}
}//GEN-LAST:event_jMenuWhoisActionPerformed
private void jMenuTestingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuTestingActionPerformed
abortTesting();
intBeginTesting = 4;
}//GEN-LAST:event_jMenuTestingActionPerformed
private void popupTablePopupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_popupTablePopupMenuWillBecomeVisible
jMenuWhois.setEnabled(intRowSelected > -1);
jMenuNodeDetails.setEnabled(intRowSelected > -1);
}//GEN-LAST:event_popupTablePopupMenuWillBecomeVisible
private void jMenuNodeDetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuNodeDetailsActionPerformed
String finger = (String) entm.getValueAt(intRowSelected, 5);
finger = finger.replace("$", EMPTYSTR);
Utilities.openFileExternally(ATLAS + "#details/" + finger);
}//GEN-LAST:event_jMenuNodeDetailsActionPerformed
private void jButtonExitNodeDetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonExitNodeDetailsActionPerformed
String finger = niActiveExit.getFingerprint();
finger = finger.replace("$", EMPTYSTR);
Utilities.openFileExternally(ATLAS + "#details/" + finger);
}//GEN-LAST:event_jButtonExitNodeDetailsActionPerformed
private void jMenuItemStdoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemStdoutActionPerformed
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
openTorMonitor();
}
});
}//GEN-LAST:event_jMenuItemStdoutActionPerformed
private void jMenuItemTorManActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemTorManActionPerformed
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
Utilities.openFileExternally(TORPROJECT + "docs/tor-manual.html");
}
});
}//GEN-LAST:event_jMenuItemTorManActionPerformed
private void jButtonGuardNodeDetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGuardNodeDetailsActionPerformed
String finger = niActiveGuard.getFingerprint();
finger = finger.replace("$", EMPTYSTR);
Utilities.openFileExternally(ATLAS + "#details/" + finger);
}//GEN-LAST:event_jButtonGuardNodeDetailsActionPerformed
private void jButtonSetGuardsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSetGuardsActionPerformed
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
openGuardsSettingDialog();
}
});
}//GEN-LAST:event_jButtonSetGuardsActionPerformed
private void jMenuItemGUIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGUIActionPerformed
toggleGUIVisibility();
}//GEN-LAST:event_jMenuItemGUIActionPerformed
private void jMenuItemQuitxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemQuitxActionPerformed
cleanupExit();
}//GEN-LAST:event_jMenuItemQuitxActionPerformed
private void jButtonMiddleNodeDetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonMiddleNodeDetailsActionPerformed
String finger = niActiveMiddle.getFingerprint();
finger = finger.replace("$", EMPTYSTR);
Utilities.openFileExternally(ATLAS + "#details/" + finger);
}//GEN-LAST:event_jButtonMiddleNodeDetailsActionPerformed
private void jMenuItemExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemExportActionPerformed
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
openPatternExport();
}
});
}//GEN-LAST:event_jMenuItemExportActionPerformed
private void jCheckProxyDisableItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckProxyDisableItemStateChanged
if (evt.getStateChange() == ItemEvent.SELECTED) {
jCheckTrayProxyDisable.setSelected(true);
if (jCheckProxyDisable.isEnabled()) {
proxyModeChanged(PacFactory.PROXY_DISABLED);
}
}
}//GEN-LAST:event_jCheckProxyDisableItemStateChanged
private void jCheckProxyByPatternItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckProxyByPatternItemStateChanged
if (evt.getStateChange() == ItemEvent.SELECTED) {
jCheckTrayProxyByPattern.setSelected(true);
if (jCheckProxyByPattern.isEnabled()) {
proxyModeChanged(PacFactory.PROXY_PATTERN);
}
}
}//GEN-LAST:event_jCheckProxyByPatternItemStateChanged
private void jCheckProxyAllItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckProxyAllItemStateChanged
if (evt.getStateChange() == ItemEvent.SELECTED) {
jCheckTrayProxyAll.setSelected(true);
if (jCheckProxyAll.isEnabled()) {
proxyModeChanged(PacFactory.PROXY_ALL);
}
}
}//GEN-LAST:event_jCheckProxyAllItemStateChanged
private void jCheckTrayProxyDisableItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckTrayProxyDisableItemStateChanged
if (evt.getStateChange() == ItemEvent.SELECTED) {
jCheckProxyDisable.setSelected(true);
}
}//GEN-LAST:event_jCheckTrayProxyDisableItemStateChanged
private void jCheckTrayProxyByPatternItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckTrayProxyByPatternItemStateChanged
if (evt.getStateChange() == ItemEvent.SELECTED) {
jCheckProxyByPattern.setSelected(true);
}
}//GEN-LAST:event_jCheckTrayProxyByPatternItemStateChanged
private void jCheckTrayProxyAllItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckTrayProxyAllItemStateChanged
if (evt.getStateChange() == ItemEvent.SELECTED) {
jCheckProxyAll.setSelected(true);
}
}//GEN-LAST:event_jCheckTrayProxyAllItemStateChanged
private void jMenuItemGeoipActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGeoipActionPerformed
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
updateGeoip();
}
});
}//GEN-LAST:event_jMenuItemGeoipActionPerformed
private void jButtonClearFavsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonClearFavsActionPerformed
clearFavourites();
}//GEN-LAST:event_jButtonClearFavsActionPerformed
private void jTableExitNodesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableExitNodesMouseClicked
if (evt.getButton() != MouseEvent.BUTTON1) {
return;
}
try {
// Get row selection
intRowSelected = jTableExitNodes.getSelectedRow();
if (intRowSelected > -1) {
intRowSelected = jTableExitNodes.convertRowIndexToModel(intRowSelected);
}
} catch (Exception ex) {
}
}//GEN-LAST:event_jTableExitNodesMouseClicked
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup buttonGroupProxy;
private javax.swing.ButtonGroup buttonGroupProxyTray;
private javax.swing.JButton jButtonClearFavs;
private javax.swing.JButton jButtonExitNodeDetails;
private javax.swing.JButton jButtonGuardNodeDetails;
private javax.swing.JButton jButtonMiddleNodeDetails;
private javax.swing.JButton jButtonSetGuards;
private javax.swing.JCheckBoxMenuItem jCheckProxyAll;
private javax.swing.JCheckBoxMenuItem jCheckProxyByPattern;
private javax.swing.JCheckBoxMenuItem jCheckProxyDisable;
private javax.swing.JCheckBoxMenuItem jCheckTrayProxyAll;
private javax.swing.JCheckBoxMenuItem jCheckTrayProxyByPattern;
private javax.swing.JCheckBoxMenuItem jCheckTrayProxyDisable;
private javax.swing.JComboBox jComboCountry;
private javax.swing.JLabel jLabStatus;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JLabel jLabelCountry;
private javax.swing.JLabel jLabelExit;
private javax.swing.JLabel jLabelExitBw;
private javax.swing.JLabel jLabelExitCountry;
private javax.swing.JLabel jLabelExitIP;
private javax.swing.JLabel jLabelExitNick;
private javax.swing.JLabel jLabelExitStable;
private javax.swing.JLabel jLabelGuard;
private javax.swing.JLabel jLabelGuardBw;
private javax.swing.JLabel jLabelGuardCountry;
private javax.swing.JLabel jLabelGuardIP;
private javax.swing.JLabel jLabelGuardNick;
private javax.swing.JLabel jLabelGuardStable;
private javax.swing.JLabel jLabelMiddle;
private javax.swing.JLabel jLabelMiddleBw;
private javax.swing.JLabel jLabelMiddleCountry;
private javax.swing.JLabel jLabelMiddleIP;
private javax.swing.JLabel jLabelMiddleNick;
private javax.swing.JLabel jLabelMiddleStable;
private javax.swing.JLabel jLabelStreams;
private javax.swing.JLabel jLabelTorLatency;
private javax.swing.JMenuBar jMenuBar;
private javax.swing.JMenu jMenuHelp;
private javax.swing.JMenuItem jMenuItemAbout;
private javax.swing.JMenuItem jMenuItemAddPattern;
private javax.swing.JMenuItem jMenuItemDebugLog;
private javax.swing.JMenuItem jMenuItemExport;
private javax.swing.JMenuItem jMenuItemGUI;
private javax.swing.JMenuItem jMenuItemGeoip;
private javax.swing.JMenuItem jMenuItemHelp;
private javax.swing.JMenuItem jMenuItemImport;
private javax.swing.JMenuItem jMenuItemLicense;
private javax.swing.JMenuItem jMenuItemPatternEdit;
private javax.swing.JMenuItem jMenuItemPrefs;
private javax.swing.JMenuItem jMenuItemQuit;
private javax.swing.JMenuItem jMenuItemQuitx;
private javax.swing.JMenuItem jMenuItemStdout;
private javax.swing.JMenuItem jMenuItemTorCheck;
private javax.swing.JMenuItem jMenuItemTorMan;
private javax.swing.JMenu jMenuMenu;
private javax.swing.JMenuItem jMenuNodeDetails;
private javax.swing.JMenu jMenuProxy;
private javax.swing.JMenuItem jMenuTesting;
private javax.swing.JMenuItem jMenuWhois;
private javax.swing.JPanel jPanelMain;
private javax.swing.JPanel jPanelNodeInfo;
private javax.swing.JScrollPane jScrollPaneExitNodes;
private javax.swing.JTable jTableExitNodes;
private javax.swing.JPopupMenu popupTable;
// End of variables declaration//GEN-END:variables
}
selektor-3.13.73/src/client/GuardNodeTableModel.java 0000644 0001750 0001750 00000011663 13302030722 021550 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.swing.table.DefaultTableModel;
/**
*
* @author Alistair Neil
*/
public class GuardNodeTableModel extends DefaultTableModel {
private final List salFinger = Collections.synchronizedList(new ArrayList());
private final String[] columnNames = {"GuardNode", "Country", "BW (MB\\s)", "Trusted"};
private NodeItem ni;
private int enabledcount;
public GuardNodeTableModel() {
}
public int getEnabledCount() {
return enabledcount;
}
/**
* Clear the table model of all data
*/
public void clear() {
getDataVector().clear();
salFinger.clear();
enabledcount = 0;
}
/**
* Get the number of columns
*
* @return columns as integer
*/
@Override
public int getColumnCount() {
return columnNames.length;
}
/**
* Test if the cell is editable
*
* @param row Cell row
* @param col Cell column
* @return True if editable
*/
@Override
public boolean isCellEditable(int row, int col) {
return col == 3;
}
/**
* Set value with given fingerprint at given column
*
* @param value Value
* @param finger Fingerprint
* @param col Column
*/
public void setValueAt(Object value, String finger, int col) {
setValueAt(value, salFinger.indexOf(finger), col);
}
/**
* Set cell value at row,col
*
* @param value
* @param row
* @param col
*/
@Override
public void setValueAt(Object value, int row, int col) {
try {
ni = (NodeItem) super.getValueAt(row, 0);
if (col == 3) {
ni.setGuardEnabled((Boolean) value);
if (ni.isGuardEnabled()) {
enabledcount++;
} else {
if (enabledcount > 0) {
enabledcount--;
}
}
fireTableCellUpdated(row, col);
}
} catch (Exception ex) {
}
}
/**
* Get cell value as object at row,col
*
* @param row
* @param col
* @return value as object
*/
@Override
public Object getValueAt(int row, int col) {
ni = (NodeItem) super.getValueAt(row, 0);
Object obj = null;
switch (col) {
case 0:
obj = ni.getNickName();
break;
case 1:
obj = ni.getCountryName();
break;
case 2:
obj = ni.getBandwidth();
break;
case 3:
obj = ni.isGuardEnabled();
break;
case 4:
obj = ni.getFingerprint();
break;
}
return obj;
}
/**
* Add rowdata with given data object array
*
* @param rowData
*/
@Override
public void addRow(Object[] rowData) {
super.addRow(rowData);
ni = (NodeItem) rowData[0];
if (ni.isGuardEnabled()) {
enabledcount++;
}
salFinger.add(ni.getFingerprint());
}
/**
* Get column name at given index
*
* @param index
* @return name as string
*/
@Override
public String getColumnName(int index) {
return columnNames[index];
}
/**
* Set the column name at the specified index
*
* @param name
* @param index
*/
public void setColumnName(String name, int index) {
if (index < columnNames.length) {
columnNames[index] = name;
}
}
/**
* Get column class at given index
*
* @param index
* @return Class
*/
@Override
public Class getColumnClass(int index) {
Class cl;
switch (index) {
case 2:
cl = Float.class;
break;
case 3:
cl = Boolean.class;
break;
default:
cl = String.class;
break;
}
return cl;
}
}
selektor-3.13.73/src/client/TorCircuit.java 0000644 0001750 0001750 00000012452 13302030722 020033 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import java.util.regex.Pattern;
/**
*
* @author Alistair Neil
*/
public final class TorCircuit {
public static final int FINGER = 0;
public static final int NICKNAME = 1;
private String[] dataCirc;
private String[] dataHops;
private String circuitinfo;
/**
* Constructor
*/
public TorCircuit() {
}
/**
* Constructor, Create circuit object with given circuit
*
* @param circuit
*/
public TorCircuit(String circuit) {
setCircuit(circuit);
}
/**
* Set circuit to supplied circuit
*
* @param circuit
*/
public void setCircuit(String circuit) {
circuitinfo = circuit;
Pattern pattern = Pattern.compile(" ");
dataCirc = pattern.split(circuit);
setHops(dataCirc[2]);
}
/**
* Get circuit
*
* @return circuit as string
*/
public String getCircuit() {
return circuitinfo;
}
/**
* Set hops
*
* @param hops
*/
public void setHops(String hops) {
Pattern pattern = Pattern.compile(",");
dataHops = pattern.split(hops);
}
/**
* Get current circuit ID
*
* @return ID as string
*/
public String getID() {
return dataCirc[0];
}
/**
* Get current circuit status
*
* @return status as string
*/
public String getStatus() {
return dataCirc[1];
}
/**
* Get current circuits build flags
*
* @return build flags as string
*/
public String getBuildFlags() {
return dataCirc[3].substring(12);
}
/**
* Get current circuits purpose
*
* @return purpose as string
*/
public String getPurpose() {
return dataCirc[4].substring(8);
}
/**
* Get current circuits timestamp
*
* @return timestamp as string
*/
public String getTimestamp() {
return dataCirc[5].substring(13);
}
/**
* Get circuit hops
*
* @return circuit hops as string
*/
public String getHops() {
return dataCirc[2];
}
/**
* Get current circuits guard or entry node
*
* @return guard node as string
*/
public String getGuardHop() {
String result = null;
try {
result = dataHops[0];
} catch (Exception ex) {
}
return result;
}
/**
* Get current circuits middle node if any, returns exit node for a two hop
* circuit
*
* @return middleman node as string
*/
public String getMiddleHop() {
String result = null;
try {
if (dataHops.length < 3) {
result = "";
} else {
result = dataHops[1];
}
} catch (Exception ex) {
}
return result;
}
/**
* Get current circuits exit node
*
* @return exit node as string
*/
public String getExitHop() {
String result = null;
try {
result = dataHops[dataHops.length - 1];
} catch (Exception ex) {
}
return result;
}
/**
* Get Guardnode finger or nick
*
* @param type 0 = finger, 1 = nick
* @return fingerprint as string
*/
public String getGuard(int type) {
return getFromNodeHop(getGuardHop(), type);
}
/**
* Get Middleman
*
* @param type 0 = finger, 1 = nick
* @return fingerprint as string
*/
public String getMiddleMan(int type) {
return getFromNodeHop(getMiddleHop(), type);
}
/**
* Get Exitnode
*
* @param type 0 = finger, 1 = nick
* @return fingerprint as string
*/
public String getExit(int type) {
return getFromNodeHop(getExitHop(), type);
}
/**
* Get fingerprint of given node Nodeinfo is in the format of
* fingerprint~name or fingerprint=name
*
* @param nodeinfo
* @param type 0 = finger, 1 = nickname
* @return fingerprint as string
*/
public static String getFromNodeHop(String nodeinfo, int type) {
Pattern pattern;
try {
if (nodeinfo.contains("~")) {
pattern = Pattern.compile("~");
} else {
pattern = Pattern.compile("=");
}
String[] result = pattern.split(nodeinfo);
if (result.length > 0) {
return result[type];
}
} catch (Exception ex) {
}
return null;
}
}
selektor-3.13.73/src/client/TorMonFrame.form 0000644 0001750 0001750 00000022776 13302030722 020171 0 ustar bannor bannor
selektor-3.13.73/src/client/SelekTOR.form 0000644 0001750 0001750 00000203720 13302030722 017416 0 ustar bannor bannor
selektor-3.13.73/src/client/NodeList.java 0000644 0001750 0001750 00000060475 13302030722 017475 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.regex.Pattern;
import lib.Localisation;
import lib.SimpleFile;
/**
*
* @author Alistair Neil
*/
public class NodeList {
public static final int NODELIST_IDLE = 0;
public static final int NODELIST_BUILDING = 1;
public static final int NODELIST_BUILT = 2;
public static final int NODELIST_FAILED = 3;
public static final int NODELIST_TERMINATED = 4;
private static final String EMPTYSTRING = "";
private static final Localisation LOCAL = new Localisation("resources/MessagesBundle");
private ExitNodeTableModel entm;
private GuardNodeTableModel gntm;
private int intStatus = NODELIST_IDLE;
private HashMap hmNode;
private final HashMap hmBridges;
private final ArrayList alCountries;
private TorController tc;
private final String exitFavouritesFile;
private final String guardFavouritesFile;
private final String filepath;
private volatile boolean boolAbortActions;
private final Pattern pattspace = Pattern.compile(" ");
private int nooffavs;
public NodeList(String filepath, String exitfavourites, String guardfavouritesfile) {
this.hmNode = new HashMap<>();
this.hmBridges = new HashMap<>();
this.filepath = filepath;
this.alCountries = new ArrayList<>();
this.exitFavouritesFile = exitfavourites;
this.guardFavouritesFile = guardfavouritesfile;
}
/**
* Get node item from its fingerprint
*
* @param key or fingerprint
* @return NodeItem
*/
public final NodeItem getNode(String key) {
String temp;
NodeItem ni = hmNode.get(key);
if (ni == null) {
// No bridge found so must be a new node not currently in nodelist
ArrayList alRouterInfo = getRouterDesc(key);
if (alRouterInfo != null) {
alRouterInfo.addAll(getRouterStatus(key));
ni = new NodeItem();
temp = filterRouterInfo(alRouterInfo, "router ");
if (temp == null) {
return null;
}
String[] data = pattspace.split(temp);
ni.setFingerprint(key);
ni.setNickName(data[0]);
ni.setIPAddress(data[1]);
String isocode = tc.getCountryFromIP(ni.getIPAddress());
if (isocode == null || isocode.contentEquals("??")) {
isocode = "U1";
}
ni.setCountryCode(isocode);
ni.setCountryName(LOCAL.getDisplayCountry(isocode));
temp = filterRouterInfo(alRouterInfo, "bandwidth ");
data = pattspace.split(temp);
ni.setBandwidth(getLowestBandwidth(data));
temp = filterRouterInfo(alRouterInfo, "s ");
if (temp == null) {
// We probably have a bridge
ni.setType(NodeItem.TYPE_GUARD);
ni.setStable(LOCAL.getString("text_yes"));
return ni;
}
if (temp.contains("Guard")) {
ni.setType(NodeItem.TYPE_GUARD);
}
if (temp.contains("Stable")) {
ni.setStable(LOCAL.getString("text_yes"));
} else {
ni.setStable(LOCAL.getString("text_no"));
}
if (temp.contains("Exit") && !temp.contains("BadExit")) {
ni.setType(NodeItem.TYPE_EXIT);
temp = filterRouterInfo(alRouterInfo, "p ");
if (temp.startsWith("accept")) {
temp = temp.replace("accept ", "");
if (!containsPort(temp, 80) && !containsPort(temp, 443)) {
return ni;
}
} else {
temp = temp.replace("reject ", "");
if (containsPort(temp, 80) || containsPort(temp, 443)) {
return ni;
}
}
ni.setHttpSupported(true);
}
}
}
return ni;
}
public ArrayList getRouterDesc(String finger) {
ArrayList alResult = tc.getInfo("desc/id/" + finger);
if (alResult == null) {
return null;
}
alResult.remove("250 OK");
if (alResult.isEmpty()) {
return null;
}
return alResult;
}
public ArrayList getRouterStatus(String finger) {
ArrayList alResult = tc.getInfo("ns/id/" + finger);
if (alResult == null) {
return null;
}
alResult.remove("250 OK");
if (alResult.isEmpty()) {
return null;
}
return alResult;
}
public String filterRouterInfo(ArrayList alInfo, String field) {
for (String s : alInfo) {
if (s.startsWith(field)) {
return s.replace(field, "");
}
}
return null;
}
/**
* Get the process status
*
* @return status
*/
public final int getCurrentStatus() {
return intStatus;
}
/**
* Generate the nodelist
*
* @param tc
*/
public final void refreshNodelist(TorController tc) {
boolAbortActions = false;
intStatus = NODELIST_BUILDING;
this.tc = tc;
boolean boolSuccess = populateNodeMap();
if (boolSuccess) {
boolSuccess = fetchFingerData();
}
if (boolSuccess) {
intStatus = NODELIST_BUILT;
} else if (boolAbortActions) {
intStatus = NODELIST_TERMINATED;
} else {
intStatus = NODELIST_FAILED;
}
}
/**
* Update internal node mappings
*
*/
private boolean populateNodeMap() {
String strFlags;
String data[];
String temp;
String strNick;
String strIP;
String strCountryName;
String strCountryCode;
String strPerms;
String strDirPort;
String strOrPort;
NodeItem ni;
SimpleFile sfConsensus = new SimpleFile(tc.getDataFolder() + SimpleFile.getSeparator() + "cached-consensus");
hmNode.clear();
alCountries.clear();
sfConsensus.openBufferedRead();
while (!boolAbortActions) {
temp = sfConsensus.readLine();
// Test for end of node info file
if (temp.startsWith("directory-footer")) {
break;
}
// Test for node info line
if (temp.startsWith("r ")) {
data = pattspace.split(temp);
strNick = data[1];
strIP = data[6];
strOrPort = data[7];
strDirPort = data[8];
// Read flags line
while (true) {
strFlags = sfConsensus.readLine();
if (strFlags.startsWith("s ")) {
break;
}
}
// Ignore certain types of node
if (!strFlags.contains("Running")
|| !strFlags.contains("Valid")) {
continue;
}
// Read port permissions line
while (true) {
strPerms = sfConsensus.readLine();
if (strPerms.startsWith("p ")) {
break;
}
}
// Check if Tor is fully active
if (tc.getStatus() < TorController.STATUS_IDLE) {
boolAbortActions = false;
alCountries.clear();
break;
}
// Get country code from ip address
strCountryCode = tc.getCountryFromIP(strIP);
if (strCountryCode == null || strCountryCode.contains("??")) {
strCountryCode = "U1";
}
// If we get GEOIP errors then abort
if (strCountryCode.startsWith("551 GEOIP")) {
alCountries.clear();
break;
}
// Get country name
strCountryName = LOCAL.getDisplayCountry(strCountryCode);
ni = new NodeItem();
// Update our node item fields now that we have validated our node
ni.setCountryCode(strCountryCode);
ni.setCountryName(strCountryName);
ni.setNickName(strNick);
ni.setIPAddress(strIP);
// Get stableflag
if (strFlags.contains("Stable")) {
ni.setStable(LOCAL.getString("text_yes"));
} else {
ni.setStable(LOCAL.getString("text_no"));
}
hmNode.put(strOrPort + strDirPort + ":" + strIP, ni);
// Check if a guard node
if (strFlags.contains("Guard")) {
ni.setType(NodeItem.TYPE_GUARD);
}
// Check if an exit node also exclude nodes flagged as bad exits
if (strFlags.contains("Exit") && !strFlags.contains("BadExit")) {
ni.setType(NodeItem.TYPE_EXIT);
// Simple test on port permissions, we will only allow node
// if it accepts connections on port 80 and 443 for web browsing
if (strPerms.startsWith("p accept")) {
strPerms = strPerms.replace("p accept ", "");
if (!containsPort(strPerms, 80)) {
continue;
}
if (!containsPort(strPerms, 443)) {
continue;
}
} else {
strPerms = strPerms.replace("p reject ", "");
if (containsPort(strPerms, 80)) {
continue;
}
if (containsPort(strPerms, 443)) {
continue;
}
}
ni.setHttpSupported(true);
// Ensure we only add exit country info in once to validated countries list
if (!alCountries.contains(strCountryCode + "," + strCountryName)) {
alCountries.add(strCountryCode + "," + strCountryName);
}
}
}
}
sfConsensus.closeFile();
// Sort our country validation list
if (alCountries.isEmpty()) {
return false;
} else {
Collections.sort(alCountries, Collator.getInstance());
}
return !boolAbortActions;
}
/**
* Update internal finger mappings
*
*/
private boolean fetchFingerData() {
int idx;
String line;
String data[];
String ipaddress;
String finger;
String strOrPort;
String strDirPort;
String key;
boolean result;
String guardwhitelist = getGuardFavouritesAsCSV();
NodeItem ni;
HashMap hmNodeReplacement = new HashMap<>();
SimpleFile sfDescriptors = new SimpleFile(tc.getDataFolder() + SimpleFile.getSeparator() + "cached-descriptors");
SimpleFile sfDescriptorsNew = new SimpleFile(tc.getDataFolder() + SimpleFile.getSeparator() + "cached-descriptors.new");
if (!sfDescriptorsNew.exists() || sfDescriptorsNew.getFile().length() == 0) {
sfDescriptorsNew = null;
}
sfDescriptors.openBufferedRead();
try {
while (!boolAbortActions) {
line = sfDescriptors.readLine();
// If line is null we have then processed the main descriptors file
if (line == null) {
// Check if their is a descriptors new file
if (sfDescriptorsNew == null) {
break;
} else {
sfDescriptors.closeFile();
sfDescriptors = sfDescriptorsNew;
sfDescriptors.openBufferedRead();
sfDescriptorsNew = null;
continue;
}
}
if (line.startsWith("router ")) {
data = pattspace.split(line);
ipaddress = data[2];
strOrPort = data[3];
strDirPort = data[5];
key = strOrPort + strDirPort + ":";
if (!hmNode.containsKey(key + ipaddress)) {
continue;
}
// Get fingerprint
while (true) {
line = sfDescriptors.readLine();
idx = line.indexOf("fingerprint");
if (idx > -1) {
line = line.substring(idx + 12);
break;
}
}
finger = "$" + line.replace(" ", EMPTYSTRING);
// Get bandwidth
while (true) {
line = sfDescriptors.readLine();
idx = line.indexOf("bandwidth");
if (idx > -1) {
line = line.substring(idx + 10);
break;
}
}
data = pattspace.split(line);
ni = hmNode.get(key + ipaddress);
ni.setFingerprint(finger);
ni.setGuardEnabled(guardwhitelist.contains(finger));
ni.setBandwidth(getLowestBandwidth(data));
hmNodeReplacement.put(finger, ni);
}
}
result = !boolAbortActions;
} catch (Exception ex) {
result = false;
}
sfDescriptors.closeFile();
// Replace our original ipaddress keyed nodemap with our fingerprint keyed nodemap
hmNode = hmNodeReplacement;
return result;
}
/**
* Return the lowest bandwidth
*
* @param data
* @return bandwidth as float
*/
private float getLowestBandwidth(String[] data) {
float bw = 1000000;
float tmp;
for (String s : data) {
tmp = Float.parseFloat(s) / 1000000;
if (tmp < bw) {
bw = tmp;
}
}
return bw;
}
/**
* Add newly learned bridge to nodelist
*
* @param bridgedata
*/
public void addBridge(String bridgedata) {
Pattern pat = Pattern.compile(" ");
bridgedata = bridgedata.substring(bridgedata.indexOf('$'));
String[] data = pat.split(bridgedata);
int index = data[0].indexOf('~');
if (index < 0) {
index = data[0].indexOf('=');
}
NodeItem ni = new NodeItem();
ni.setFingerprint(data[0].substring(0, index));
ni.setIPAddress(data[2]);
ni.setNickName(data[0].substring(index + 1));
hmBridges.put(ni.getFingerprint(), ni);
}
/**
* Clear any learned bridges
*/
public void clearBridges() {
hmBridges.clear();
}
/**
* Test to check supplied data contains the specified port
*
* @param data
* @param port
* @return True if data contains specified port
*/
private boolean containsPort(String data, int port) {
String strRanges[];
String[] strPorts;
int rangemin;
int rangemax;
Pattern pattcomma = Pattern.compile(",");
Pattern pattminus = Pattern.compile("-");
strRanges = pattcomma.split(data);
for (String s : strRanges) {
// Test to see if its a range of ports
if (s.contains("-")) {
strPorts = pattminus.split(s);
rangemin = Integer.parseInt(strPorts[0]);
rangemax = Integer.parseInt(strPorts[1]);
if (port >= rangemin && port <= rangemax) {
return true;
}
} else {
// We have a single port
rangemin = Integer.parseInt(s);
if (port == rangemin) {
return true;
}
}
}
return false;
}
/**
* Gets validated countries, a valid country is any country with active exit
* nodes
*
* @return String array of countries
*/
public final String[] getValidatedCountries() {
return alCountries.toArray(new String[alCountries.size()]);
}
/**
* Gets validated country codes, a valid country is any country with active
* exit nodes
*
* @return String array of country abbreviations
*/
public final String[] getValidatedCountryCodes() {
String[] result = new String[alCountries.size()];
int idx = 0;
for (String s : alCountries) {
result[idx++] = s.substring(0, 2);
}
return result;
}
/**
* Set the guard node view table model
*
* @param gntm
*/
public final void setGuardNodeTableModel(GuardNodeTableModel gntm) {
this.gntm = gntm;
}
/**
* Set the exit node view table model
*
* @param entm
*/
public final void setExitNodeTableModel(ExitNodeTableModel entm) {
this.entm = entm;
}
/**
* Get a list of exitnodes, if all is false then it returns only favourited
* nodes, if omitfailednodes is true then don't include nodes that failed
* testing
*
* @param all
* @param omitfailednodes
* @return ArrayList of exit nodes
*/
public final ArrayList getExitNodes(boolean all, boolean omitfailednodes) {
ArrayList al = new ArrayList<>();
for (int i = 0; i < entm.getRowCount(); i++) {
int teststatus = (Integer) entm.getValueAt(i, 7);
if (omitfailednodes && teststatus == NodeItem.TESTSTATUS_FAILED) {
continue;
}
boolean fave = (Boolean) entm.getValueAt(i, 4) | all;
if (fave) {
al.add((String) entm.getValueAt(i, 5));
}
}
return al;
}
/**
* Get a string of comma separated exitnodes, if all is false then it
* returns only favourited nodes, if omitfailednodes is true then don't
* include nodes that failed testing
*
* @param all
* @param omitfailednodes
* @return String of exitnodes in csv format
*/
public final String getExitNodesAsString(boolean all, boolean omitfailednodes) {
String result = getExitNodes(all, omitfailednodes).toString();
result = result.replace("[", "").replace(" ", "").replace("]", "");
return result;
}
/**
* Get a list of all guard nodes guard nodes
*
* @return ArrayList of guard nodes
*/
public final ArrayList getGuardNodes() {
ArrayList al = new ArrayList<>();
if (gntm == null) {
return al;
}
for (int i = 0; i < gntm.getRowCount(); i++) {
al.add((String) gntm.getValueAt(i, 3));
}
return al;
}
/**
* Get guard favourites
*
* @return CSV string of guard entry fingerprints
*/
public final String getGuardFavouritesAsCSV() {
StringBuilder sbResult = new StringBuilder();
String line;
String sep = "";
if (guardFavouritesFile == null) {
return sbResult.toString();
}
SimpleFile sf = new SimpleFile(filepath + guardFavouritesFile);
if (!sf.exists()) {
return sbResult.toString();
}
sf.openBufferedRead();
while ((line = sf.readLine()) != null) {
sbResult.append(sep);
sbResult.append(line);
if (sep.isEmpty()) {
sep = ",";
}
}
sf.closeFile();
return sbResult.toString();
}
/**
* Update the guard node table model
*/
public final void refreshGuardTableModel() {
if (gntm == null) {
return;
}
NodeItem ni;
gntm.clear();
// Populate model
for (String s : hmNode.keySet()) {
ni = hmNode.get(s);
if (ni.isGuard()) {
Object[] rowData = new Object[]{ni};
gntm.addRow(rowData);
}
}
}
/**
* Update the table model based on supplied country
*
*
* @param isocountry in the format "GB,Great Britain"
*/
public final void refreshExitTableModel(String isocountry) {
if (entm == null) {
return;
}
NodeItem ni;
entm.clear();
String abbrv = isocountry;
String favourites = "";
if (exitFavouritesFile != null) {
SimpleFile sf = new SimpleFile(filepath + exitFavouritesFile);
if (sf.exists()) {
sf.openBufferedRead();
favourites = sf.readEntireFile().trim();
sf.closeFile();
}
}
// Populate model
nooffavs = 0;
for (String s : hmNode.keySet()) {
ni = hmNode.get(s);
if (ni.isExit() && ni.isHttpSupported() && ni.getCountryCode().contentEquals(abbrv)) {
ni.setLatency(9999);
ni.setTestingMessage(LOCAL.getString("textfield_unknown"));
// Whitelisting here
ni.setFavouriteEnabled(favourites.contains(ni.getIPAddress()));
if (ni.isFavourite()) {
nooffavs++;
}
Object[] rowData = new Object[]{ni};
entm.addRow(rowData);
}
}
}
/**
* Get the number of active favourites
*
* @return number of favs as int
*/
public int getNumberOfFavs() {
return nooffavs;
}
/**
* Ensures any threaded actions will terminate themselves
*/
public final void terminate() {
boolAbortActions = true;
}
/**
* Save exit node whitelist
*/
public void saveExitFavourites() {
if (exitFavouritesFile == null) {
return;
}
SimpleFile sf = new SimpleFile(filepath + exitFavouritesFile);
sf.openBufferedWrite();
NodeItem ni;
nooffavs = 0;
for (String s : hmNode.keySet()) {
ni = hmNode.get(s);
if (ni.isExit() && ni.isFavourite()) {
nooffavs++;
sf.writeFile(ni.getIPAddress(), 1);
}
}
sf.closeFile();
}
/**
* Save exit node blacklist
*
* @return number of active guards
*/
public int saveGuardWhitelist() {
int activeguards = 0;
if (guardFavouritesFile == null) {
return activeguards;
}
SimpleFile sf = new SimpleFile(filepath + guardFavouritesFile);
sf.openBufferedWrite();
NodeItem ni;
for (String s : hmNode.keySet()) {
ni = hmNode.get(s);
if (ni.isGuard() && ni.isGuardEnabled()) {
sf.writeFile(ni.getFingerprint(), 1);
activeguards++;
}
}
sf.closeFile();
return activeguards;
}
}
selektor-3.13.73/src/client/PacFactory.java 0000644 0001750 0001750 00000053616 13302030722 020006 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import java.io.File;
import java.util.ArrayList;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import lib.OSFunction;
import lib.SimpleFile;
/**
*
* @author Alistair Neil
*/
public class PacFactory {
public static final String FILEUSER = "user";
private static final String FILEEXT = ".txt";
public static final int PROXY_DISABLED = 0;
public static final int PROXY_PATTERN = 1;
public static final int PROXY_ALL = 2;
private static final String PACFILE_EXT = ".pac";
private static final String PATTERNFIRSTLINE = "### Pattern File, Do not remove or modify this line ###";
private String strKDEProxyPrefsBackup;
private String strGnome3ProxyPrefsBackup;
private String strPACPath;
private String strBackupFolder;
private String strPatternsFolder;
private String strTempFolder;
private String strDefaultProxy = "";
private String strDoNotProxy = "";
private String strActiveCountry;
private String strActivePacName = "";
private final Random randgen;
public PacFactory() {
randgen = new Random(System.currentTimeMillis());
}
/**
* Get the active country code
*
* @return Active country
*/
public String getActiveCountry() {
return strActiveCountry;
}
/**
* Create and/or activate a pacfile for a specific country
*
* @param isocountry
* @param port
*/
public void createPacFile(String isocountry, int port) {
// Generate a pseudo random pac name
String pacname = createRandomName() + PACFILE_EXT;
savePACFile(pacname, getPacRules(isocountry, String.valueOf(port)));
setProxyAutoConfigURL("file://" + strPACPath.replace("\\", "/") + pacname);
strActiveCountry = isocountry;
if (!strActivePacName.isEmpty()) {
this.deletePAC(strActivePacName);
}
strActivePacName = pacname;
}
/**
* Get pac rules for a specific country Can also be used for getting direct
* rule and proxy all rules, by setting countrycode to "direct" or
* "proxyall"
*
* @param countrycode
* @param port
* @return An arraylist of rules
*/
private ArrayList getPacRules(String country, String port) {
ArrayList result = new ArrayList<>();
// If country code is null then generate proxy all traffic rules
if (country.contentEquals("proxyall")) {
addSocksRule(result, "127.0.0.1", port);
return result;
}
if (country.contentEquals("direct")) {
addDirectMatchingRule(result, null);
return result;
}
Pattern pat = Pattern.compile(",");
String[] split;
// Create our pattern rules storage list
ArrayList patternrules = new ArrayList<>();
// Add in do not proxy rules
if (!strDoNotProxy.isEmpty()) {
split = pat.split(strDoNotProxy);
for (String s : split) {
if (!s.isEmpty()) {
addDirectMatchingRule(result, "*" + s + "*");
}
}
}
// Get default patterns
loadPatternsList(country, patternrules);
for (String s : patternrules) {
split = pat.split(s);
if (split.length < 3) {
break;
}
if (split[2].contentEquals("true")) {
if (split[1].contentEquals("*")) {
addSocksRule(result, "127.0.0.1", port);
return result;
} else {
addSocksMatchingRule(result, split[1], "127.0.0.1", port);
}
}
}
if (strDefaultProxy.isEmpty()) {
addDirectMatchingRule(result, null);
} else {
addProxyRule(result, strDefaultProxy);
}
return result;
}
/**
*
* @param rules
* @param proxy
*/
public void addProxyRule(ArrayList rules, String proxy) {
rules.add("\treturn \"PROXY " + proxy + "\";");
}
/**
* Add a socks rule to a supplied list
*
* @param rules
* @param host
* @param port
*/
public void addSocksRule(ArrayList rules, String host, String port) {
String rule = "\treturn \"SOCKS5 " + host + ":" + port + "\";";
rules.add(rule);
}
/**
*
* @param rules
* @param pattern
*/
public void addDirectMatchingRule(ArrayList rules, String pattern) {
String rule;
if (pattern == null) {
rule = "\treturn \"DIRECT\";";
} else {
rule = "\tif (shExpMatch(url, \"" + pattern + "\"))\n"
+ "\t{\n"
+ "\t\treturn \"DIRECT\";\n"
+ "\t}";
}
rules.add(rule);
}
/**
* Add socks pattern mayching rule to a supllied list
*
* @param rules
* @param pattern
* @param host
* @param port
*/
public void addSocksMatchingRule(ArrayList rules, String pattern, String host, String port) {
String rule = "\tif (shExpMatch(url, \"" + pattern + "\"))\n"
+ "\t{\n"
+ "\t\treturn \"SOCKS5 " + host + ":" + port + "\";\n"
+ "\t}";
rules.add(rule);
}
/**
* Load a patterns list from a file
*
* @param country
* @param list
*/
public void loadPatternsList(String country, ArrayList list) {
String line;
int idxs, idxe;
SimpleFile sfPatternFile = new SimpleFile(strPatternsFolder + country.substring(0, 2) + "_" + FILEUSER + FILEEXT);
if (sfPatternFile.exists()) {
sfPatternFile.openBufferedRead();
while ((line = sfPatternFile.readLine()) != null) {
idxs = line.indexOf('<');
idxe = line.indexOf('>');
if (idxs == 0 && idxe == (line.length() - 1)) {
list.add(line.substring(idxs + 1, idxe) + "," + FILEUSER);
}
}
sfPatternFile.closeFile();
}
}
/**
* Delete patterns file for a given country and type, where type is either
* "def" or "user"
*
* @param country
* @param type
*/
public void deletePatternsFile(String country, String type) {
SimpleFile sfPatternFile = new SimpleFile(strPatternsFolder + country.substring(0, 2) + "_" + type + FILEEXT);
sfPatternFile.delete();
}
/**
* Save a patterns list by filename
*
* @param country
* @param list
* @param type
*/
public void savePatternsList(String country, String type, ArrayList list) {
SimpleFile sfPatternFile = new SimpleFile(strPatternsFolder + country.substring(0, 2) + "_" + type + FILEEXT);
sfPatternFile.openBufferedWrite();
sfPatternFile.writeFile(PATTERNFIRSTLINE, 1);
for (String s : list) {
sfPatternFile.writeFile("<" + s + ">", 1);
}
sfPatternFile.closeFile();
}
/**
* Create folder in which pattern files will be stored
*
* @param folder
*/
public final void setPatternsFolder(String folder) {
strPatternsFolder = folder + SimpleFile.getSeparator();
SimpleFile.createFolder(strPatternsFolder);
}
/**
* Set folder where pac files will be generated
*
* @param folder
*/
public final void setPACFolder(String folder) {
strPACPath = folder;
SimpleFile.createFolder(folder);
}
/**
* Set folder where system proxy settings will be backed up
*
* @param folder
*/
public final void setBackupFolder(String folder) {
strBackupFolder = folder + SimpleFile.getSeparator();
SimpleFile.createFolder(strBackupFolder);
if (OSFunction.getGsettingsPath() != null) {
strGnome3ProxyPrefsBackup = strBackupFolder + "gnome3_proxy.txt";
} else {
strGnome3ProxyPrefsBackup = null;
}
if (OSFunction.getKDEProxyPath() != null) {
strKDEProxyPrefsBackup = strBackupFolder + "kde_proxy.txt";
} else {
strKDEProxyPrefsBackup = null;
}
}
/**
* Set the temp folder for file extractions
*
* @param path
*/
public final void setTempFolder(String path) {
strTempFolder = path;
}
/**
* Generic backup of proxy settings
*
*/
public void backupProxyPrefs() {
backupGnomeProxyPrefs();
backupKDEProxyPrefs();
}
/**
* Gnome backup of proxy settings
*
*/
private void backupGnomeProxyPrefs() {
if (strBackupFolder == null) {
return;
}
SimpleFile sfProxyPrefs;
try {
if (strGnome3ProxyPrefsBackup != null) {
sfProxyPrefs = new SimpleFile(strGnome3ProxyPrefsBackup);
if (!sfProxyPrefs.exists()) {
sfProxyPrefs.openBufferedWrite();
sfProxyPrefs.writeFile(OSFunction.getGnome3Pref("org.gnome.system.proxy", "mode"), 1);
sfProxyPrefs.writeFile(OSFunction.getGnome3Pref("org.gnome.system.proxy", "autoconfig-url"), 1);
sfProxyPrefs.closeFile();
}
}
} catch (Exception ex) {
Logger.getGlobal().logp(Level.SEVERE, this.getClass().getName(), "backupGnomeProxyPrefs()", "", ex);
}
}
/**
* KDE backup of proxy settings
*
*/
private void backupKDEProxyPrefs() {
if (strBackupFolder == null) {
return;
}
SimpleFile sfProxyPrefs;
try {
if (strKDEProxyPrefsBackup != null) {
sfProxyPrefs = new SimpleFile(strKDEProxyPrefsBackup);
if (!sfProxyPrefs.exists()) {
sfProxyPrefs.openBufferedWrite();
sfProxyPrefs.writeFile(OSFunction.getKDEPref("Proxy Settings", "Proxy Config Script", ""), 1);
sfProxyPrefs.writeFile(OSFunction.getKDEPref("Proxy Settings", "ProxyType", "0"), 1);
sfProxyPrefs.closeFile();
}
}
} catch (Exception ex) {
Logger.getGlobal().logp(Level.SEVERE, this.getClass().getName(), "backupKDEProxyPrefs()", "", ex);
}
}
/**
* Generic restore of proxy settings, for ease of use
*
*/
public void restoreProxyPrefs(boolean resetonfail) {
restoreGnomeProxyPrefs(resetonfail);
restoreKDEProxyPrefs(resetonfail);
}
/**
* Gnome specific restore of proxy settings
*
*/
private void restoreGnomeProxyPrefs(boolean resetonfail) {
SimpleFile sfProxyPrefs;
try {
// Restore gnome3 proxy prefs
if (strGnome3ProxyPrefsBackup != null) {
sfProxyPrefs = new SimpleFile(strGnome3ProxyPrefsBackup);
if (sfProxyPrefs.exists()) {
sfProxyPrefs.openBufferedRead();
String mode = sfProxyPrefs.readLine();
String url = sfProxyPrefs.readLine();
sfProxyPrefs.closeFile();
if (url != null && mode != null && !mode.isEmpty()) {
// Restore original settings from file
OSFunction.setGnome3Pref("org.gnome.system.proxy", "mode", mode);
OSFunction.setGnome3Pref("org.gnome.system.proxy", "autoconfig-url", url);
}
} else {
if (resetonfail) {
setGnomeProxyAutoConfigURL(null);
}
}
}
} catch (Exception ex) {
Logger.getGlobal().logp(Level.SEVERE, this.getClass().getName(), "restoreGnomeProxyPrefs()", "", ex);
}
}
/**
* KDE specific restore of proxy settings
*
*/
private void restoreKDEProxyPrefs(boolean resetonfail) {
SimpleFile sfProxyPrefs;
try {
// Restore kde proxy prefs
if (strKDEProxyPrefsBackup != null) {
sfProxyPrefs = new SimpleFile(strKDEProxyPrefsBackup);
if (sfProxyPrefs.exists()) {
sfProxyPrefs.openBufferedRead();
String url = sfProxyPrefs.readLine();
String type = sfProxyPrefs.readLine();
sfProxyPrefs.closeFile();
if (url != null && type != null) {
if (!SimpleFile.exists(url)) {
url = "";
}
OSFunction.setKDEPref("Proxy Settings", "Proxy Config Script", url);
OSFunction.setKDEPref("Proxy Settings", "ProxyType", type);
}
} else {
if (resetonfail) {
setKDEProxyAutoConfigURL(null);
}
}
}
} catch (Exception ex) {
Logger.getGlobal().logp(Level.SEVERE, this.getClass().getName(), "restoreKDEProxyPrefs()", "", ex);
}
}
/**
* Generic proxy prefs delete, for ease of use
*/
public void deleteProxyPrefs() {
deleteGnomeProxyPrefs();
deleteKDEProxyPrefs();
}
/**
* Generic delete of backed up gnome proxy settings
*
* @return boolean True if successful
*/
private boolean deleteGnomeProxyPrefs() {
if (strBackupFolder == null) {
return false;
}
boolean result = true;
// Delete Gnome3 prefs
if (strGnome3ProxyPrefsBackup != null) {
result = SimpleFile.delete(strGnome3ProxyPrefsBackup);
}
return result;
}
/**
* Generic delete of backed up KDE proxy settings
*
* @return boolean True if successful
*/
private boolean deleteKDEProxyPrefs() {
if (strBackupFolder == null) {
return false;
}
boolean result = true;
// Delete Kde prefs
if (strKDEProxyPrefsBackup != null) {
result = SimpleFile.delete(strKDEProxyPrefsBackup);
}
return result;
}
/**
* Generic set proxy config
*
* @param url
*/
public void setProxyAutoConfigURL(String url) {
setGnomeProxyAutoConfigURL(url);
setKDEProxyAutoConfigURL(url);
}
/**
* Set Gnome proxy config
*
* @param url
*/
private void setGnomeProxyAutoConfigURL(String url) {
if (strGnome3ProxyPrefsBackup != null) {
if (url == null) {
OSFunction.resetGnome3Pref("org.gnome.system.proxy", "mode");
OSFunction.resetGnome3Pref("org.gnome.system.proxy", "autoconfig-url");
} else {
OSFunction.setGnome3Pref("org.gnome.system.proxy", "mode", "auto");
OSFunction.setGnome3Pref("org.gnome.system.proxy", "autoconfig-url", url);
}
}
}
/**
* Set KDE proxy config
*
* @param url
*/
private void setKDEProxyAutoConfigURL(String url) {
if (strKDEProxyPrefsBackup != null) {
if (url == null) {
OSFunction.setKDEPref("Proxy Settings", "Proxy Config Script", "");
OSFunction.setKDEPref("Proxy Settings", "ProxyType", 0);
} else {
OSFunction.setKDEPref("Proxy Settings", "Proxy Config Script", url);
OSFunction.setKDEPref("Proxy Settings", "ProxyType", 2);
}
}
}
/**
* Save pac file using given filename
*
* @param filename
* @param ruleslist
*/
private void savePACFile(String filename, ArrayList ruleslist) {
SimpleFile sfPacFile = new SimpleFile(strPACPath + filename);
sfPacFile.openBufferedWrite();
sfPacFile.writeFile("//" + filename, 1);
String temp = "function FindProxyForURL(url, host) {";
sfPacFile.writeFile(temp, 1);
for (String s : ruleslist) {
sfPacFile.writeFile(s, 1);
}
sfPacFile.writeFile("}", 1);
sfPacFile.closeFile();
}
/**
* Delete specified pac file
*
* @param filename
* @return boolean true if action successful
*/
public boolean deletePAC(String filename) {
return SimpleFile.delete(strPACPath + filename);
}
/**
* Delete all pac files
*/
public void deleteAllPAC() {
SimpleFile sf = new SimpleFile(strPACPath);
sf.setFileFilter(PACFILE_EXT);
sf.deleteFileList(sf.getFileList());
}
/**
* Get a pseudo random numerical name
*
* @return String
*/
private String createRandomName() {
// Create new filename with a random number to modify filename from
// previous one to force auto reload of pac settings in browser
int pacNumber = randgen.nextInt();
if (pacNumber < 0) {
pacNumber = 0 - pacNumber;
}
return String.valueOf(pacNumber);
}
/**
* Set default proxy url
*
* @param proxyurl
*/
public void setDefaultProxy(String proxyurl) {
strDefaultProxy = proxyurl;
}
/**
* Set do not proxy
*
* @param hostcsv
*/
public void setDoNotProxy(String hostcsv) {
strDoNotProxy = hostcsv;
}
/**
* Get value of comma separated host or ip list
*
* @return String value
*/
public String getDoNotProxy() {
return strDoNotProxy;
}
/**
* Adds pattern to an existing pattern file
*
* @param country
* @param description
* @param pattern
*/
public void addToPatternFile(String country, String description, String pattern) {
if (strPatternsFolder == null || pattern.isEmpty()) {
return;
}
SimpleFile sfPatternFile = new SimpleFile(strPatternsFolder + SimpleFile.getSeparator() + country.substring(0, 2) + "_" + FILEUSER + FILEEXT);
sfPatternFile.openBufferedAppend();
sfPatternFile.writeFile("<" + description + "," + pattern + ",true>", 1);
sfPatternFile.closeFile();
}
/**
* Get an array of user pattern files
*
* @return array of files
*/
public File[] getPatternsFiles() {
SimpleFile sf = new SimpleFile(strPatternsFolder);
sf.setFileFilter(FILEUSER + FILEEXT);
return sf.getFileList();
}
/**
* Export user patterns
*
* @param filename
* @param files
*/
public void exportUserPatterns(String filename, File[] files) {
// Append .zip extension if we need to
if (!filename.endsWith(".zip")) {
filename += ".zip";
}
// Add user pattern files to zip
SimpleFile sf = new SimpleFile(filename);
sf.openZipStream(9);
sf.addFilesToZip(files);
sf.closeZipStream();
}
/**
* Import patterns
*
* @param filename
* @return true if succesful
*/
public boolean importPatterns(String filename) {
// Import patterns
boolean success = false;
SimpleFile sf = new SimpleFile(filename);
String destpath;
// Check existence
if (sf.exists()) {
// Get temporary path to extraction folder
if (strTempFolder == null) {
destpath = OSFunction.getTempFolder(null)
+ getClass().getName();
} else {
destpath = strTempFolder + getClass().getName();
}
// Create temp extraction folder
SimpleFile.createFolder(destpath);
// Extract files to temp folder
success = sf.extractZipTo(destpath);
if (success) {
// Get list of files
sf.setFileName(destpath);
sf.setFileFilter(".txt");
File[] files = sf.getFileList();
// Verify each file before copying them over
String firstLine;
try {
if (files.length == 0) {
throw new Exception();
}
for (File f : files) {
// Verify valid pattern file by checking first line of file
sf.setFile(f);
sf.openBufferedRead();
firstLine = sf.readLine();
sf.closeFile();
if (firstLine != null) {
if (firstLine.toLowerCase().contains("pattern file")) {
SimpleFile.copyFromTo(f.getAbsolutePath(), strPatternsFolder + f.getName());
} else {
success = false;
break;
}
}
}
} catch (Exception ex) {
success = false;
}
}
// Delete temporary files
SimpleFile.deleteFolder(destpath);
}
return success;
}
}
selektor-3.13.73/src/client/PatternsEditor.form 0000644 0001750 0001750 00000027462 13302030722 020744 0 ustar bannor bannor
selektor-3.13.73/src/client/ExitNodeTableModel.java 0000644 0001750 0001750 00000014461 13302030722 021416 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.swing.table.DefaultTableModel;
/**
*
* @author Alistair Neil
*/
public class ExitNodeTableModel extends DefaultTableModel {
private final List salFinger = Collections.synchronizedList(new ArrayList());
private final String[] columnNames = new String[5];
private NodeItem ni;
public ExitNodeTableModel() {
}
/**
* Clear the table model of all data
*/
public void clear() {
getDataVector().clear();
salFinger.clear();
}
/**
* Get the number of columns
*
* @return columns as integer
*/
@Override
public int getColumnCount() {
return columnNames.length;
}
/**
* Test if the cell is editable
*
* @param row Cell row
* @param col Cell column
* @return True if editable
*/
@Override
public boolean isCellEditable(int row, int col) {
return col == 4;
}
/**
* Set value with given fingerprint at given column
*
* @param value Value
* @param finger Fingerprint
* @param col Column
*/
public void setValueAt(Object value, String finger, int col) {
setValueAt(value, salFinger.indexOf(finger), col);
}
/**
* Convenience method to set the testing field cell values for a specific
* fingerprint, the hops field is hidden and does npt show up in table
*
* @param finger Fingerprint
* @param latency Latency value
* @param status Status value
* @param hops Hops value
*/
public synchronized void setTestFieldValues(String finger, long latency, String status, String hops) {
int row = salFinger.indexOf(finger);
if (row > -1) {
ni = (NodeItem) super.getValueAt(row, 0);
ni.setTestLatency(latency);
ni.setTestingMessage(status);
ni.setCircuitHops(hops);
fireTableRowsUpdated(row, row);
}
}
/**
* Get row nodeitem
*
* @param row
* @return a nodeitem
*/
public NodeItem getNodeItemAt(int row) {
return (NodeItem) super.getValueAt(row, 0);
}
/**
* Set cell value at row,col
*
* @param value
* @param row
* @param col
*/
@Override
public void setValueAt(Object value, int row, int col) {
try {
ni = (NodeItem) super.getValueAt(row, 0);
switch (col) {
case 1:
ni.setBandwidth((Float) value);
break;
case 2:
ni.setTestLatency((Long) value);
break;
case 3:
ni.setTestingMessage((String) value);
break;
case 4:
ni.setFavouriteEnabled((Boolean) value);
break;
case 5:
salFinger.set(row, (String) value);
ni.setFingerprint((String) value);
return;
case 6:
ni.setCircuitHops((String) value);
return;
}
fireTableCellUpdated(row, col);
} catch (Exception ex) {
}
}
/**
* Get cell value as object at row,col
*
* @param row
* @param col
* @return value as object
*/
@Override
public Object getValueAt(int row, int col) {
ni = (NodeItem) super.getValueAt(row, 0);
Object obj = null;
switch (col) {
case 0:
obj = ni.getNickName();
break;
case 1:
obj = ni.getBandwidth();
break;
case 2:
obj = ni.getTestLatency();
break;
case 3:
obj = ni.getTestingMessage();
break;
case 4:
obj = ni.isFavourite();
break;
case 5:
obj = ni.getFingerprint();
break;
case 6:
obj = ni.getCircuitHops();
break;
case 7:
obj = ni.getTestStatus();
break;
}
return obj;
}
/**
* Add rowdata with given data object array
*
* @param rowData
*/
@Override
public void addRow(Object[] rowData) {
super.addRow(rowData);
salFinger.add(((NodeItem) rowData[0]).getFingerprint());
}
/**
* Get column name at given index
*
* @param index
* @return name as string
*/
@Override
public String getColumnName(int index) {
return columnNames[index];
}
/**
* Set the column name at the specified index
*
* @param name
* @param index
*/
public void setColumnName(String name, int index) {
if (index < columnNames.length) {
columnNames[index] = name;
}
}
/**
* Get column class at given index
*
* @param index
* @return Class
*/
@Override
public Class getColumnClass(int index) {
Class cl;
switch (index) {
case 1:
cl = Float.class;
break;
case 2:
cl = Long.class;
break;
case 4:
cl = Boolean.class;
break;
default:
cl = String.class;
break;
}
return cl;
}
}
selektor-3.13.73/src/client/GuardNodeDialog.form 0000644 0001750 0001750 00000023646 13302030722 020765 0 ustar bannor bannor
selektor-3.13.73/src/client/TorController.java 0000644 0001750 0001750 00000110427 13302030722 020555 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import lib.SimpleFile;
/**
*
* @author Alistair Neil
*/
public class TorController extends TorProcess {
// Event constants, which supplement the ones provide by TorProcess
public static final int EVENT_CIRCUITS_BUILT = 15;
public static final int EVENT_CIRCUITS_FAILED = 16;
public static final int EVENT_CIRCUIT_BUILT = 17;
public static final int EVENT_CIRCUIT_FAILED = 18;
public static final int EVENT_LATENCY_DONE = 19;
public static final int EVENT_TESTING_DONE = 20;
public static final int EVENT_CIRCUIT_CHANGED = 21;
public static final int EVENT_ABORTED = 22;
private static final String LOCALHOST = "127.0.0.1";
private static final String[] EVENTMESSAGES = new String[]{
"EVENT_CIRCUITS_BUILT", "EVENT_CIRCUITS_FAILED", "EVENT_CIRCUIT_BUILT",
"EVENT_CIRCUIT_FAILED", "EVENT_LATENCY_DONE", "EVENT_TESTING_DONE",
"EVENT_CIRCUIT_CHANGED", "EVENT_ABORTED"
};
// Status constants
public static final int STATUS_DEAD = 0;
public static final int STATUS_BOOTING = 1;
public static final int STATUS_IDLE = 2;
public static final int STATUS_CIRCUIT_CREATION = 3;
public static final int STATUS_LATENCY_CHECKING = 4;
// Other constants
public static final long LATENCY_FAIL = 9999;
public static final int STREAM_IP = 5;
public static final int NODE_GUARD = 0;
public static final int NODE_MIDDLE = 1;
public static final int NODE_EXIT = 2;
private static final int DEFBUILDTIME = 20;
private volatile Socket sockControl;
private volatile BufferedReader brSocket;
private volatile PrintWriter pwSocket;
private String strLatencyURL;
private final ConcurrentHashMap chmUseableCircuits;
private ArrayList alActiveStreams;
private int intStatus = STATUS_DEAD;
private volatile Socket sockProxy;
private long lngLatency;
private String strBestHops;
private long lngBestLatency;
private String entrynodes = "";
private Thread tActive;
private boolean haveEntryNode;
/**
* Constructor
*
* @param clientpath Path to Tor client
* @param configfolder Location of configuration file torrc
*/
public TorController(String clientpath, String configfolder) {
super(clientpath, configfolder);
this.chmUseableCircuits = new ConcurrentHashMap<>();
this.alActiveStreams = new ArrayList<>();
}
/**
* Tor process event
*
* @param event
* @param data
*/
@Override
public final void torProcessEventFired(int event, String data) {
Logger.getGlobal().logp(Level.FINE, TorProcess.class.getName(),
"torProcessEventFired() on Port=" + getListenPort(), getEventMessage(event) + ", Data=" + data);
switch (event) {
case TOR_BRIDGE:
haveEntryNode = true;
break;
case TOR_STOPPED:
setStatus(STATUS_DEAD);
break;
case TOR_BOOTED:
case TOR_RESTARTED:
openControlSocket();
// Authenticate our control
authenticateTor(getSecret());
takeOwnership();
waitForBridgeNodes(20);
setStatus(STATUS_IDLE);
break;
}
controllerEventFired(event, data);
}
@Override
public String getEventMessage(int event) {
if (event < EVENT_CIRCUITS_BUILT) {
return super.getEventMessage(event);
} else {
return EVENTMESSAGES[event - EVENT_CIRCUITS_BUILT];
}
}
/**
* Handle for controllerEventFired should be overridden by parent class
*
* @param event
* @param data
*/
public void controllerEventFired(int event, Object data) {
}
/**
* Set status flag
*
* @param status
*/
public synchronized void setStatus(int status) {
intStatus = status;
}
/**
* Get current status
*
* @return status integer constant, see defined status constants
*/
public synchronized int getStatus() {
return intStatus;
}
/**
* Convenience test for idle status
*
* @return true if idle
*/
public boolean isIdle() {
return (getStatus() <= STATUS_IDLE);
}
/**
* Stop the tor controller process completely
*
*/
public final void stop() {
haveEntryNode = false;
abortActions();
Logger.getGlobal().logp(Level.INFO, TorController.class.getName(),
"stop() on Port=" + getListenPort(), "Stop requested");
sendCommand("QUIT");
closeControlSocket();
stopProcess();
setStatus(STATUS_DEAD);
}
/**
* Start tor controller process and issue the TOR_BOOTED event
*
*/
public final void start() {
createDefaultConfig();
start(TOR_BOOTED);
}
/**
* Start tor controller process and issue the given event
*
* @param bootevent
*/
public final void start(int bootevent) {
if (getStatus() == STATUS_DEAD) {
setInitialBootEvent(bootevent);
setStatus(STATUS_BOOTING);
startProcess();
return;
}
if (getStatus() > STATUS_BOOTING) {
setStatus(STATUS_IDLE);
controllerEventFired(bootevent, null);
}
}
/**
* Abort all current actions
*/
public final void abortActions() {
if (getStatus() < STATUS_IDLE) {
return;
}
setStatus(STATUS_IDLE);
// Abort latency checking
abortLatencyCheck();
// Interrupt sleep thread if active
Thread t = getActiveThread();
if (t != null) {
t.interrupt();
}
}
/**
* Abort latency checking
*/
public final void abortLatencyCheck() {
// Kill off latency checking proxy socket
if (sockProxy != null) {
try {
sockProxy.close();
} catch (IOException ex) {
}
}
sockProxy = null;
}
/**
* Save configuration file
*/
public void saveConf() {
SimpleFile sf = new SimpleFile(getConfigFilePath());
sf.delete();
sendCommand("SAVECONF");
}
/**
* Load configuration file
*/
public void loadConf() {
SimpleFile sf = new SimpleFile(getConfigFilePath());
sf.openBufferedRead();
String text = sf.readEntireFile();
sf.closeFile();
sendCommand("+loadconf\r\n" + text + "\r\n.");
}
/**
* Attempts to return the Country associated with an ip address
*
* @param ip
* @return Country or null if not found
*/
public String getCountryFromIP(String ip) {
// Get country from ip address
String cmd = "ip-to-country/" + ip;
ArrayList infoList = getInfo(cmd);
try {
if (infoList != null) {
return infoList.get(0).toUpperCase();
}
} catch (Exception ex) {
}
return null;
}
/**
* Set the url used for latency checking
*
* @param url
*/
public void setTestingURL(String url) {
strLatencyURL = url;
}
/**
* Take ownership of the Tor client process so that it shuts down if the
* process is destroyed, particular useful for linux desktops that dont
* issue proper terminations.
*/
private void takeOwnership() {
sendCommand("TAKEOWNERSHIP");
sendCommand("RESETCONF __OwningControllerProcess");
}
/**
* Authenticate a password protected tor control socket
*
* @param password
*/
private void authenticateTor(String password) {
if (password == null) {
sendCommand("AUTHENTICATE");
} else {
sendCommand("AUTHENTICATE " + "\"" + password + "\"");
}
}
/**
* Enable/Disable predictive circuit building
*
* @param enabled
*/
public void enablePredictiveCircuits(boolean enabled) {
if (enabled) {
setConf("__DisablePredictedCircuits=0");
} else {
setConf("__DisablePredictedCircuits=1");
}
}
/**
* Get tor status information for a given property. See TOR control-spec
* documentation for valid properties
*
* @param property
* @return Arraylist containg the result of the command
*/
public final ArrayList getInfo(String property) {
return sendCommand("GETINFO " + property);
}
/**
* Close a circuit with ID
*
* @param id
*/
public final void closeCircuit(String id) {
sendCommand("CLOSECIRCUIT " + id);
}
/**
* Set a tor configuration property
*
* @param property
* @return Arraylist containg the result of the command
*/
public final ArrayList setConf(String property) {
return sendCommand("SETCONF " + property);
}
/**
* reset a tor configuration property
*
* @param property
* @return Arraylist containing the result of the command
*/
public final ArrayList resetConf(String property) {
return sendCommand("RESETCONF " + property);
}
/**
* Send signal to tor
*
* @param cmd
* @return Arraylist containing the result of the command
*/
public final ArrayList signal(String cmd) {
return sendCommand("SIGNAL " + cmd);
}
/**
* Get entry guards chosen by tor client
*
* @return entry guards as comma separated fingerprints
*/
public String getEntryGuardsAsCSV() {
ArrayList al = getInfo("entry-guards");
StringBuilder sbResult = new StringBuilder();
if (!al.contains("250 OK")) {
return sbResult.toString();
}
// Remove 250 OK entry
al.remove("250 OK");
String sep = "";
for (String s : al) {
if (s.contains("~")) {
sbResult.append(sep);
sbResult.append(s.substring(0, s.indexOf('~')));
if (sep.isEmpty()) {
sep = ",";
}
}
}
return sbResult.toString();
}
/**
* Triggers a socks latency check, EVENT_LATENCY_CHECK is fired on
* completion
*
* @param timeout
*/
public final void doLatencyCheck(final int timeout) {
Thread t = new Thread(new java.lang.Runnable() {
long latency;
@Override
public void run() {
latency = getTorLatency(timeout);
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
lngLatency = latency;
controllerEventFired(EVENT_LATENCY_DONE, null);
}
});
}
});
if (getStatus() < STATUS_IDLE) {
return;
}
alActiveStreams = getInfo("stream-status");
alActiveStreams.remove("250 OK");
t.start();
}
/**
* Get current latency
*
* @return latency in ms as long
*/
public final long getLatency() {
return lngLatency;
}
/**
* Returns measured latency for the active circuit without creating a
* stream, this blocks so be careful
*
* @param timeout
* @return latency
*/
public long getTorLatency(int timeout) {
long lngResult = LATENCY_FAIL;
DataInputStream dis = null;
try {
sockProxy = createTorSocketToURL(strLatencyURL, true);
if (sockProxy != null) {
sockProxy.setSoTimeout(timeout);
dis = new DataInputStream(sockProxy.getInputStream());
long lngStart = System.currentTimeMillis();
dis.skipBytes(1);
lngResult = System.currentTimeMillis() - lngStart;
}
} catch (IOException ex) {
Logger.getGlobal().logp(Level.INFO, TorController.class.getName(),
"getTorLatency Exception " + getListenPort(), ex.getMessage());
}
try {
if (!sockProxy.isClosed()) {
sockProxy.close();
}
sockProxy = null;
} catch (Exception ex) {
}
try {
if (dis != null) {
dis.close();
}
} catch (Exception ex) {
}
return lngResult;
}
/**
* Close open circuits except circuit specified by id
*
* @param id
* @param filtered
*/
public void closeCircuitsExcept(String id, boolean filtered) {
Logger.getGlobal().logp(Level.FINEST, TorController.class.getName(),
"closeCircuitsExcept() Port=" + getListenPort(), "");
Set keys = getBuiltCircuits(filtered).keySet();
Iterator i = keys.iterator();
String hopid;
while (i.hasNext()) {
hopid = (String) i.next();
if (!hopid.contentEquals(id)) {
closeCircuit(hopid);
}
}
}
private String getCircuitIdFromStream(String stream) {
String data[];
Pattern pat = Pattern.compile(" ");
data = pat.split(stream);
return data[2];
}
/**
* Get list of active streams
*
* @return active streams as a list
*/
public final ArrayList getActiveStreams() {
return alActiveStreams;
}
/**
* Set the csv list of exit node fingers to be used by tor, a single exit
* node may also be specified, this does not block
*
* @param fingers
* @param nocircs
*/
public final void activateNodes(final String fingers, final int nocircs) {
Thread t = new Thread(new java.lang.Runnable() {
@Override
public void run() {
activateNodesBlocking(fingers, nocircs);
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
if (isIdle()) {
controllerEventFired(EVENT_ABORTED, null);
return;
}
setStatus(STATUS_IDLE);
if (chmUseableCircuits.isEmpty()) {
controllerEventFired(EVENT_CIRCUITS_FAILED, 0);
} else {
controllerEventFired(EVENT_CIRCUITS_BUILT, chmUseableCircuits.size());
}
}
});
}
});
if (getStatus() < STATUS_IDLE) {
return;
}
abortActions();
setStatus(STATUS_CIRCUIT_CREATION);
t.start();
}
/**
* Activate given circuit, does not block
*
* @param hops
*/
public final void activateCircuit(final String hops) {
Thread t = new Thread(new java.lang.Runnable() {
@Override
public void run() {
activateCircuitBlocking(hops);
SwingUtilities.invokeLater(new java.lang.Runnable() {
@Override
public void run() {
if (isIdle()) {
controllerEventFired(EVENT_ABORTED, null);
return;
}
setStatus(STATUS_IDLE);
if (chmUseableCircuits.isEmpty()) {
controllerEventFired(EVENT_CIRCUIT_FAILED, null);
} else {
controllerEventFired(EVENT_CIRCUIT_BUILT, null);
}
}
});
}
});
if (getStatus() < STATUS_IDLE) {
return;
}
setStatus(STATUS_CIRCUIT_CREATION);
t.start();
}
/**
* Set entry nodes
*
* @param fingers
*/
public void setEntryNodes(String fingers) {
entrynodes = "";
if (fingers == null || !getBridges().isEmpty()) {
return;
}
entrynodes = fingers;
}
/**
* Get configured entry nodes
*
* @return entry nodes in CSV format
*/
public String getEntryNodes() {
return entrynodes;
}
/**
* Set the csv list of exit node fingers to be used by tor, a single exit
* node may also be specified, this blocks
*
* @param fingers
* @param nocircs
*/
public void activateNodesBlocking(String fingers, int nocircs) {
chmUseableCircuits.clear();
enablePredictiveCircuits(true);
setConf("EntryNodes=" + entrynodes);
setConf("ExitNodes=" + fingers);
if (fingers.isEmpty() || fingers.contains("{")) {
fingers = null;
}
waitForCircuits(DEFBUILDTIME, nocircs, fingers);
enablePredictiveCircuits(false);
}
/**
* Activate given circuit, blocks
*
* @param hops
*/
private void activateCircuitBlocking(String hops) {
chmUseableCircuits.clear();
sendCommand("EXTENDCIRCUIT 0 " + hops + " PURPOSE=GENERAL");
waitForCircuit(DEFBUILDTIME, hops);
}
/**
* Wait so many seconds for valid bridges to appear if bridges are set
*
* @param secs
*/
private void waitForBridgeNodes(int secs) {
long timeout = System.currentTimeMillis() + (secs * 1000);
while (!haveValidEntryNode()) {
try {
Thread.sleep(250);
if (System.currentTimeMillis() > timeout) {
break;
}
} catch (InterruptedException ex) {
break;
}
}
}
public boolean haveValidEntryNode() {
if (getBridges().isEmpty()) {
return true;
}
return haveEntryNode;
}
private void waitForCircuits(long secs, int nocircs, String reqFinger) {
long timeout = System.currentTimeMillis() + (secs * nocircs * 1000);
setActiveThread(Thread.currentThread());
while (chmUseableCircuits.size() < nocircs) {
try {
Thread.sleep(250);
} catch (InterruptedException ex) {
break;
}
if (System.currentTimeMillis() > timeout) {
Logger.getGlobal().logp(Level.INFO, TorController.class
.getName(),
"waitForCircuits() on Port=" + getListenPort(), "Timed Out");
break;
}
if (isIdle()) {
Logger.getGlobal().logp(Level.INFO, TorController.class
.getName(),
"waitForCircuits() on Port=" + getListenPort(), "Aborting");
chmUseableCircuits.clear();
break;
}
TorCircuit tc = getLatestCircuit();
if (tc != null) {
// If we have a node request then ensure that the circuit contains the requested node fingerprint
if (reqFinger != null && !reqFinger.contains(tc.getExit(TorCircuit.FINGER))) {
continue;
}
// If we have custom guards, then ensure circuit contains guard
if (entrynodes.isEmpty()) {
chmUseableCircuits.put(tc.getID(), tc);
} else if (entrynodes.contains(tc.getGuard(TorCircuit.FINGER))) {
chmUseableCircuits.put(tc.getID(), tc);
}
}
}
}
private void waitForCircuit(long secs, String reqHops) {
long timeout = System.currentTimeMillis() + (secs * 1000);
setActiveThread(Thread.currentThread());
while (chmUseableCircuits.size() < 1) {
try {
Thread.sleep(250);
} catch (InterruptedException ex) {
break;
}
if (System.currentTimeMillis() > timeout) {
Logger.getGlobal().logp(Level.INFO, TorController.class
.getName(),
"waitForCircuit() on Port=" + getListenPort(), "Timed Out");
break;
}
if (isIdle()) {
Logger.getGlobal().logp(Level.INFO, TorController.class
.getName(),
"waitForCircuit() on Port=" + getListenPort(), "Aborting");
chmUseableCircuits.clear();
break;
}
TorCircuit tcActive = getLatestCircuit();
if (tcActive != null) {
String hops = tcActive.getHops();
if (hops.contains(reqHops)) {
chmUseableCircuits.put(tcActive.getID(), tcActive);
}
}
}
}
private synchronized void setActiveThread(Thread t) {
tActive = t;
}
private synchronized Thread getActiveThread() {
return tActive;
}
/**
* Test specified node, non blocking
*
* @param finger
*/
public void testNode(final String finger) {
SwingWorker sw = new SwingWorker() {
private long bestLatency = LATENCY_FAIL;
private String bestHops = null;
@Override
protected Void doInBackground() {
closeCircuitsExcept("", true);
activateNodesBlocking(finger, 1);
if (isIdle()) {
return null;
}
if (chmUseableCircuits.size() > 0) {
String id = chmUseableCircuits.keys().nextElement();
TorCircuit tc = chmUseableCircuits.get(id);
closeCircuitsExcept("", true);
activateCircuitBlocking(tc.getHops());
publish(EVENT_CIRCUIT_BUILT);
long latency = getTorLatency(5000);
if (latency < bestLatency) {
bestLatency = latency;
bestHops = tc.getHops();
}
}
return null;
}
@Override
protected void process(List chunks) {
for (Integer i : chunks) {
controllerEventFired(i, chmUseableCircuits.size());
}
}
@Override
protected void done() {
if (isIdle()) {
lngBestLatency = LATENCY_FAIL;
strBestHops = null;
controllerEventFired(EVENT_ABORTED, null);
} else {
setStatus(STATUS_IDLE);
lngBestLatency = bestLatency;
strBestHops = bestHops;
controllerEventFired(EVENT_TESTING_DONE, chmUseableCircuits.size());
}
}
};
setStatus(STATUS_CIRCUIT_CREATION);
strBestHops = null;
lngBestLatency = LATENCY_FAIL;
sw.execute();
}
/**
* Get best latency
*
* @return best latency value in ms as long
*/
public final long getBestLatency() {
return lngBestLatency;
}
/**
* Get best hops
*
* @return hops info as string
*/
public final String getBestHops() {
return strBestHops;
}
/**
* Get built circuits
*
* @param filtered Filter out unwanted circuits
* @return HashMap of built circuits keyed to their circuit id
*/
public final HashMap getBuiltCircuits(boolean filtered) {
HashMap hm = new HashMap<>();
ArrayList circuits = getInfo("circuit-status");
circuits.remove("250 OK");
for (String circuit : circuits) {
if (circuit.contains("BUILT")) {
if (filtered) {
if (circuit.contains("ONEHOP_TUNNEL")) {
continue;
}
if (circuit.contains("IS_INTERNAL")) {
continue;
}
if (!circuit.contains("PURPOSE=GENERAL")) {
continue;
}
}
TorCircuit tc = new TorCircuit(circuit);
hm.put(tc.getID(), tc);
// Debug purposes
// if (getListenPort() == 9054) {
// System.out.println("Circuit=" + circuit);
// }
}
}
return hm;
}
/**
* Verify we have comms on the control socket
*
* @return true if its good
*/
public final boolean verifyControlComms() {
ArrayList circuits = getInfo("circuit-status");
return !circuits.isEmpty();
}
/**
* Get the latest circuit
*
* @return circuit
*/
public final TorCircuit getLatestCircuit() {
HashMap hm = getBuiltCircuits(true);
Iterator i = getBuiltCircuits(true).keySet().iterator();
String strId;
TorCircuit tcRecent = null;
int hid = 0;
int id;
while (i.hasNext()) {
strId = (String) i.next();
id = Integer.parseInt(strId);
if (id > hid) {
hid = id;
tcRecent = hm.get(strId);
}
}
return tcRecent;
}
private void openControlSocket() {
try {
sockControl = new Socket(LOCALHOST, getControlPort());
sockControl.setKeepAlive(true);
sockControl.setSoTimeout(2000);
pwSocket = new PrintWriter(sockControl.getOutputStream());
brSocket = new BufferedReader(new InputStreamReader(sockControl.getInputStream()), 1024);
} catch (IOException ex) {
Logger.getGlobal().throwing(TorController.class
.getName(),
"openControlSocket() on Port=" + getListenPort(), ex);
}
}
private void closeControlSocket() {
try {
if (sockControl != null) {
sockControl.setKeepAlive(false);
sockControl.close();
sockControl = null;
pwSocket.close();
brSocket.close();
pwSocket = null;
brSocket = null;
}
} catch (IOException ex) {
Logger.getGlobal().throwing(TorController.class
.getName(),
"closeControlSocket() on Port=" + getListenPort(), ex);
}
}
/**
* Send a command to tor client
*
* @param command
* @return Arraylist containing the result of the command
*/
public final synchronized ArrayList sendCommand(String command) {
ArrayList result = new ArrayList<>();
if (sockControl == null) {
Logger.getGlobal().logp(Level.WARNING, TorController.class
.getName(),
"sendCommand() Port=" + getListenPort(), "Cmd=" + command
+ ", Non-existent socket");
return result;
}
if (sockControl.isClosed()) {
Logger.getGlobal().logp(Level.WARNING, TorController.class
.getName(),
"sendCommand() Port=" + getListenPort(), "Cmd=" + command
+ ", Socket is closed.");
return result;
}
flushReadBuffer();
// Write out the command
if (pwSocket.checkError()) {
Logger.getGlobal().logp(Level.FINEST, TorController.class
.getName(),
"sendCommand() Port=" + getListenPort(), "Cmd=" + command
+ ", Write Socket Error");
return result;
}
pwSocket.write(command + "\r\n");
pwSocket.flush();
// Dont wait for command response if quitting
if (command.contentEquals("QUIT")) {
return result;
}
result = getCommandResponse();
if (!result.isEmpty()) {
Logger.getGlobal().logp(Level.FINEST, TorController.class
.getName(),
"sendCommand() Port=" + getListenPort(), "Cmd=" + command
+ ", Response=" + result.toString());
} else {
Logger.getGlobal().logp(Level.WARNING, TorController.class
.getName(),
"sendCommand() Port=" + getListenPort(), "Cmd=" + command
+ ", Response=Timed out");
}
return result;
}
private ArrayList getCommandResponse() {
boolean boolMultiReply = false;
String response;
ArrayList result = new ArrayList<>();
try {
while (true) {
response = brSocket.readLine();
if (response == null) {
break;
}
// Check to see if we are in the middle of a multi line reply
if (boolMultiReply) {
// A multiline extended reply is part terminated by a fullstop
if (response.startsWith(".")) {
boolMultiReply = false;
} else {
result.add(response);
}
continue;
}
// Check for the start of a multi line reply
if (response.startsWith("250+")) {
boolMultiReply = true;
response = response.substring(response.indexOf('=') + 1).trim();
if (!response.isEmpty()) {
result.add(response);
}
continue;
}
// Check for single line reply
if (response.startsWith("250-")) {
response = response.substring(response.indexOf('=') + 1).trim();
if (!response.isEmpty()) {
result.add(response);
}
continue;
}
result.add(response);
if (response.startsWith("250 ") || response.startsWith("251 ")
|| response.startsWith("4") || response.startsWith("5")) {
break;
}
}
} catch (IOException ex) {
result.clear();
}
return result;
}
private void flushReadBuffer() {
try {
while (brSocket.ready()) {
brSocket.readLine();
}
} catch (IOException ex) {
}
}
/**
* Create a socks4a socket to this URL on this tor connection, if nowww is
* true then remove www. from domain
*
* @param url
* @param nowww
* @return socket
*/
public Socket createTorSocketToURL(String url, boolean nowww) {
try {
URI uri = new URI(url);
String host = uri.getHost().toLowerCase();
if (nowww) {
host = host.replace("www.", "");
}
String protocol = uri.getScheme();
int port = uri.getPort();
if (port == -1) {
switch (protocol) {
default:
port = 80;
break;
case "https":
port = 443;
break;
}
}
return createSocks4aSocket(LOCALHOST, getListenPort(), host, port);
} catch (URISyntaxException ex) {
Logger.getLogger(TorController.class
.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
/**
* Create a Socks4a socket Taken from Wikipedia SOCKS4a is a simple
* extension to SOCKS4 protocol that allows a client that cannot resolve the
* destination host's domain name to specify it.
*
* The client should set the first three bytes of DSTIP to NULL and the last
* byte to a non-zero value. (This corresponds to IP address 0.0.0.x, with x
* nonzero, an inadmissible destination address and thus should never occur
* if the client can resolve the domain name.) Following the NULL byte
* terminating USERID, the client must send the destination domain name and
* terminate it with another NULL byte. This is used for both "connect" and
* "bind" requests.
*
* Client to SOCKS server: field 1: SOCKS version number, 1 byte, must be
* 0x04 for this version field 2: command code, 1 byte: 0x01 = establish a
* TCP/IP stream connection 0x02 = establish a TCP/IP port binding field 3:
* network byte order port number, 2 bytes field 4: deliberate invalid IP
* address, 4 bytes, first three must be 0x00 and the last one must not be
* 0x00 field 5: the user ID string, variable length, terminated with a null
* (0x00) field 6: the domain name of the host we want to contact, variable
* length, terminated with a null (0x00)
*
*
* Server to SOCKS client: field 1: null byte field 2: status, 1 byte: 0x5a
* = request granted 0x5b = request rejected or failed 0x5c = request failed
* because client is not running identd (or not reachable from the server)
* 0x5d = request failed because client's identd could not confirm the user
* ID string in the request field 3: network byte order port number, 2 bytes
* field 4: network byte order IP address, 4 bytes
*
* A server using protocol SOCKS4A must check the DSTIP in the request
* packet. If it represents address 0.0.0.x with nonzero x, the server must
* read in the domain name that the client sends in the packet. The server
* should resolve the domain name and make connection to the destination
* host if it can.
*
* @param socksaddr Socks ip address
* @param socksport Socks port
* @param remotehost Remote host
* @param remoteport Remote port
* @return Socket
*/
public Socket createSocks4aSocket(String socksaddr, int socksport, String remotehost, int remoteport) {
try {
Socket s = new Socket(socksaddr, socksport);
DataOutputStream dos = new DataOutputStream(s.getOutputStream());
dos.writeByte(0x04); // Version 4 Socks
dos.writeByte(0x01); // Connect command code
dos.writeShort(remoteport); // Remote Port number
dos.writeInt(0x01); // IP address of 0.0.0.1 means use Socks 4a
dos.writeByte(0x00); // Null terminator
dos.writeBytes(remotehost); // Remote host IP address
dos.writeByte(0x00); // Null terminator
return s;
} catch (IOException ex) {
Logger.getGlobal().logp(Level.FINE, this.getClass().getName(), "createSocks4aSocket", "", ex);
}
return null;
}
}
selektor-3.13.73/src/client/GuardNodeDialog.java 0000644 0001750 0001750 00000030715 13302030722 020736 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import java.awt.event.MouseEvent;
import javax.swing.event.TableModelEvent;
import lib.GTKFixes;
import lib.Localisation;
import lib.Utilities;
/**
*
* @author Alistair Neil
*/
public class GuardNodeDialog extends javax.swing.JDialog {
public static final int CANCEL = 0;
public static final int APPLY = 1;
public static final int RESET = 2;
private static final String ATLAS = "https://atlas.torproject.org/";
private static final Localisation LOCAL = new Localisation("resources/MessagesBundle");
private int intRowSelected = -1;
private int returnStatus = CANCEL;
private final GuardNodeTableModel gntm;
private NodeList nl;
/**
* Creates new form GuardNodeDialog
*
* @param parent
* @param modal
*/
public GuardNodeDialog(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
GTKFixes.fixTextAreaColor(jTextArea1);
jTableGuards.setComponentPopupMenu(popupTable);
gntm = new GuardNodeTableModel();
gntm.setColumnName(LOCAL.getString("guardtable_col1"), 0);
gntm.setColumnName(LOCAL.getString("guardtable_col2"), 1);
gntm.setColumnName(LOCAL.getString("guardtable_col3"), 2);
gntm.setColumnName(LOCAL.getString("guardtable_col4"), 3);
gntm.addTableModelListener(new javax.swing.event.TableModelListener() {
@Override
public void tableChanged(TableModelEvent e) {
if (gntm.getEnabledCount() >= 3 || gntm.getEnabledCount() == 0) {
jButtonApply.setEnabled(true);
} else {
jButtonApply.setEnabled(false);
}
}
});
jTableGuards.setModel(gntm);
adjustGuardTableColumns();
}
/**
* Set the nodelist
*
* @param nl
*/
public void setNodeList(NodeList nl) {
this.nl = nl;
this.nl.setGuardNodeTableModel(gntm);
this.nl.refreshGuardTableModel();
adjustGuardTableColumns();
}
/**
* Adjust guard table column widths
*/
private void adjustGuardTableColumns() {
// Adjust table column widths
Utilities.adjustTableColumnWidth(jTableGuards,
"XXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX");
}
private void clearSelections() {
for (int row = 0; row < jTableGuards.getRowCount(); row++) {
jTableGuards.setValueAt(false, row, 3);
}
}
private void doClose(int retStatus) {
returnStatus = retStatus;
setVisible(false);
dispose();
}
/**
* @return the return status of this dialog - one of RET_OK or RET_CANCEL
*/
public int getReturnStatus() {
return returnStatus;
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// //GEN-BEGIN:initComponents
private void initComponents() {
popupTable = new javax.swing.JPopupMenu();
jMenuNodeDetails = new javax.swing.JMenuItem();
jMenuWhois = new javax.swing.JMenuItem();
jScrollPane1 = new javax.swing.JScrollPane();
jTableGuards = new javax.swing.JTable();
jButtonClear = new javax.swing.JButton();
jButtonApply = new javax.swing.JButton();
jButtonClose = new javax.swing.JButton();
jTextArea1 = new javax.swing.JTextArea();
popupTable.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {
public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
popupTablePopupMenuWillBecomeVisible(evt);
}
public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
}
public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
}
});
jMenuNodeDetails.setText(LOCAL.getString("table_popup_details")); // NOI18N
jMenuNodeDetails.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuNodeDetailsActionPerformed(evt);
}
});
popupTable.add(jMenuNodeDetails);
jMenuWhois.setText(LOCAL.getString("table_popup_whois")); // NOI18N
jMenuWhois.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuWhoisActionPerformed(evt);
}
});
popupTable.add(jMenuWhois);
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle(LOCAL.getString("wintitle_guardnodes")); // NOI18N
setResizable(false);
jTableGuards.setAutoCreateRowSorter(true);
jTableGuards.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
jTableGuards.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTableGuardsMouseClicked(evt);
}
});
jScrollPane1.setViewportView(jTableGuards);
jButtonClear.setText(LOCAL.getString("button_clearguards")); // NOI18N
jButtonClear.setToolTipText(LOCAL.getString("ttip_clearguards")); // NOI18N
jButtonClear.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonClearActionPerformed(evt);
}
});
jButtonApply.setText(LOCAL.getString("button_apply")); // NOI18N
jButtonApply.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonApplyActionPerformed(evt);
}
});
jButtonClose.setText(LOCAL.getString("button_close")); // NOI18N
jButtonClose.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonCloseActionPerformed(evt);
}
});
jTextArea1.setEditable(false);
jTextArea1.setColumns(40);
jTextArea1.setFont(new javax.swing.JLabel().getFont());
jTextArea1.setLineWrap(true);
jTextArea1.setRows(2);
jTextArea1.setText(LOCAL.getString("label_guard_minimum")); // NOI18N
jTextArea1.setWrapStyleWord(true);
jTextArea1.setDisabledTextColor(jTextArea1.getForeground());
jTextArea1.setEnabled(false);
jTextArea1.setMinimumSize(new java.awt.Dimension(0, 0));
jTextArea1.setOpaque(false);
jTextArea1.setRequestFocusEnabled(false);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jButtonClear)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButtonClose)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButtonApply))
.addComponent(jTextArea1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane1))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTextArea1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 367, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonClear)
.addComponent(jButtonApply)
.addComponent(jButtonClose))
.addContainerGap())
);
pack();
}// //GEN-END:initComponents
private void jButtonCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCloseActionPerformed
doClose(CANCEL);
}//GEN-LAST:event_jButtonCloseActionPerformed
private void jButtonApplyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonApplyActionPerformed
nl.saveGuardWhitelist();
doClose(APPLY);
}//GEN-LAST:event_jButtonApplyActionPerformed
private void jButtonClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonClearActionPerformed
clearSelections();
}//GEN-LAST:event_jButtonClearActionPerformed
private void jMenuNodeDetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuNodeDetailsActionPerformed
String finger = (String) gntm.getValueAt(intRowSelected, 4);
finger = finger.replace("$", "");
Utilities.openFileExternally(ATLAS + "#details/" + finger);
}//GEN-LAST:event_jMenuNodeDetailsActionPerformed
private void jMenuWhoisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuWhoisActionPerformed
String finger = (String) gntm.getValueAt(intRowSelected, 4);
NodeItem ni = nl.getNode(finger);
if (ni != null) {
Utilities.openFileExternally("https://www.networksolutions.com/whois/results.jsp?ip=" + ni.getIPAddress());
}
}//GEN-LAST:event_jMenuWhoisActionPerformed
private void popupTablePopupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_popupTablePopupMenuWillBecomeVisible
jMenuWhois.setEnabled(intRowSelected > -1);
jMenuNodeDetails.setEnabled(intRowSelected > -1);
}//GEN-LAST:event_popupTablePopupMenuWillBecomeVisible
private void jTableGuardsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableGuardsMouseClicked
if (evt.getButton() != MouseEvent.BUTTON1) {
return;
}
intRowSelected = jTableGuards.getSelectedRow();
if (intRowSelected > 0) {
intRowSelected = jTableGuards.convertRowIndexToModel(intRowSelected);
}
}//GEN-LAST:event_jTableGuardsMouseClicked
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButtonApply;
private javax.swing.JButton jButtonClear;
private javax.swing.JButton jButtonClose;
private javax.swing.JMenuItem jMenuNodeDetails;
private javax.swing.JMenuItem jMenuWhois;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTableGuards;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JPopupMenu popupTable;
// End of variables declaration//GEN-END:variables
}
selektor-3.13.73/src/client/PatternsEditor.java 0000644 0001750 0001750 00000054610 13302030722 020715 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import lib.InfoDialog;
import java.awt.Component;
import java.awt.FontMetrics;
import java.awt.Frame;
import java.awt.event.ItemEvent;
import java.util.ArrayList;
import java.util.regex.Pattern;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import lib.Localisation;
/**
*
* @author Alistair Neil,
*/
public final class PatternsEditor extends javax.swing.JDialog {
public static final int CANCEL = 0;
public static final int APPLY = 1;
private final PACTableModel pactm = new PACTableModel();
private PacFactory pacFactory = null;
private String strChange = null;
private Frame parent = null;
private String strSelectedCountry = null;
private static final Localisation LOCAL = new Localisation("resources/MessagesBundle");
/**
* Creates a PatternsEditor dialog
*
* @param parent Parent frame
* @param modal Modality
* @param pacfactory PacFactory being edited
*/
public PatternsEditor(java.awt.Frame parent, boolean modal, PacFactory pacfactory) {
super(parent, modal);
this.parent = parent;
pacFactory = pacfactory;
initComponents();
pactm.setColumnName(LOCAL.getString("patterntable_col1"), 0);
pactm.setColumnName(LOCAL.getString("patterntable_col2"), 1);
pactm.setColumnName(LOCAL.getString("patterntable_col3"), 2);
jTablePatterns.setModel(pactm);
jTablePatterns.setDefaultRenderer(String.class, new CustomTableCellRenderer());
// Adjust our column widths
adjustTableColumnWidth(0, "AAAAAAAAAA");
adjustTableColumnWidth(1, "AAAAAAAAAAAAAAAAAAAAAAAA");
adjustTableColumnWidth(2, "AAA");
jTablePatterns.setRowHeight(jLabel1.getHeight() + 1);
jTablePatterns.setShowGrid(true);
jTextDoNotProxy.setText(pacFactory.getDoNotProxy());
}
/**
* Populate the country combobox with a list of countries
*
* @param countries String[] of countries
*/
public void populateCountryComboBox(String[] countries) {
jComboCountry.setModel(new DefaultComboBoxModel<>(countries));
jComboCountry.setSelectedIndex(-1);
}
/**
* Set the selected country
*
* @param country
*/
public void setSelectedCountry(String country) {
jComboCountry.setSelectedItem(country);
}
/**
* Populate the patterns table
*
* @param patterns an ArrayList of pattern rules
*/
private void populatePatternsTable(ArrayList patterns) {
// Clear all entries from table
while (pactm.getRowCount() > 0) {
pactm.removeRow(0);
}
// If patterns null just return;
if (patterns == null) {
strChange = pactm.toString() + jTextDoNotProxy.getText();
return;
}
// Populate table
Pattern pat = Pattern.compile(",");
String[] split;
Object[] obj = new Object[3];
for (String s : patterns) {
split = pat.split(s);
if (split.length < 4) {
continue;
}
obj[0] = split[0];
obj[1] = split[1];
try {
obj[2] = Boolean.valueOf(split[2]);
} catch (Exception ex) {
obj[2] = true;
}
pactm.addRow(obj, (split[3]).contains("user"));
}
strChange = pactm.toString() + jTextDoNotProxy.getText();
}
/**
* Test to see if patterns table has changed
*
* @return boolean True if changed
*/
private boolean isPatternsTableChanged() {
if (strChange == null) {
return false;
}
String temp = pactm.toString() + jTextDoNotProxy.getText();
return (!temp.contentEquals(strChange));
}
/**
* Save patterns and rebuild active country pac if required
*/
private void savePatterns() {
String s;
Boolean b;
ArrayList listUser = new ArrayList<>();
int rowCount = pactm.getRowCount();
if (rowCount > 0) {
for (int i = 0; i < rowCount; i++) {
s = pactm.getValueAt(i, 0) + "," + pactm.getValueAt(i, 1);
b = (Boolean) pactm.getValueAt(i, 2);
if (b) {
s += ",true";
} else {
s += ",false";
}
listUser.add(s);
}
}
if (listUser.isEmpty()) {
pacFactory.deletePatternsFile(strSelectedCountry, PacFactory.FILEUSER);
} else {
pacFactory.savePatternsList(strSelectedCountry, PacFactory.FILEUSER, listUser);
}
pacFactory.setDoNotProxy(jTextDoNotProxy.getText());
strChange = pactm.toString() + jTextDoNotProxy.getText();
}
/**
* This is a check to see if any pattern save are required before exiting
* the pattern editor
*/
private int saveOnExitCheck() {
int result = CANCEL;
if (jButtonSave.isEnabled()) {
jComboCountry.hidePopup();
InfoDialog id = new InfoDialog(parent);
id.createWarn(LOCAL.getString("dlg_patterneditsave_title"),
LOCAL.getString("dlg_patterneditsave_body"));
id.setVisible(true);
strChange = null;
if (id.getReturnStatus() == InfoDialog.OK) {
savePatterns();
result = APPLY;
}
jButtonSave.setEnabled(isPatternsTableChanged());
}
return result;
}
/**
* Will adjust table column widths based on fontmetrics
*
* @param col Column to be adjusted
* @param text Text string to adjust for
*/
private void adjustTableColumnWidth(int col, String text) {
FontMetrics ourFontMetrics = getFontMetrics(jTablePatterns.getTableHeader().getFont());
jTablePatterns.getColumn(jTablePatterns.getColumnName(col)).setPreferredWidth(ourFontMetrics.stringWidth(text));
}
/**
* @return the return status of this dialog - one of RET_OK or RET_CANCEL
*/
public int getReturnStatus() {
return returnStatus;
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
// //GEN-BEGIN:initComponents
private void initComponents() {
jButtonSave = new javax.swing.JButton();
jButtonCancel = new javax.swing.JButton();
jComboCountry = new javax.swing.JComboBox<>();
jButtonDeletePattern = new javax.swing.JButton();
jButtonAddPattern = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTablePatterns = new javax.swing.JTable();
jLabel17 = new javax.swing.JLabel();
jTextDoNotProxy = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Proxy Pattern Editor");
setIconImage(null);
setResizable(false);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
closeDialog(evt);
}
});
jButtonSave.setText(LOCAL.getString("button_save")); // NOI18N
jButtonSave.setEnabled(false);
jButtonSave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonSaveActionPerformed(evt);
}
});
jButtonCancel.setText(LOCAL.getString("button_close")); // NOI18N
jButtonCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonCancelActionPerformed(evt);
}
});
jComboCountry.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
jComboCountry.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
jComboCountryItemStateChanged(evt);
}
});
jButtonDeletePattern.setText(LOCAL.getString("button_delete")); // NOI18N
jButtonDeletePattern.setEnabled(false);
jButtonDeletePattern.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonDeletePatternActionPerformed(evt);
}
});
jButtonAddPattern.setText(LOCAL.getString("button_addnew")); // NOI18N
jButtonAddPattern.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonAddPatternActionPerformed(evt);
}
});
jLabel1.setText(LOCAL.getString("label_editcountry")); // NOI18N
jTablePatterns.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
}
));
jTablePatterns.setToolTipText(LOCAL.getString("ttip_patterntable")); // NOI18N
jTablePatterns.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN);
jTablePatterns.setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTablePatterns.getTableHeader().setResizingAllowed(false);
jTablePatterns.getTableHeader().setReorderingAllowed(false);
jTablePatterns.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseReleased(java.awt.event.MouseEvent evt) {
jTablePatternsMouseReleased(evt);
}
});
jTablePatterns.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
jTablePatternsKeyReleased(evt);
}
});
jScrollPane1.setViewportView(jTablePatterns);
jLabel17.setText(LOCAL.getString("label_donotproxy")); // NOI18N
jTextDoNotProxy.setToolTipText(LOCAL.getString("ttip_donotproxy")); // NOI18N
jTextDoNotProxy.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
jTextDoNotProxyFocusLost(evt);
}
});
jTextDoNotProxy.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
jTextDoNotProxyKeyReleased(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1)
.addGroup(layout.createSequentialGroup()
.addComponent(jComboCountry, javax.swing.GroupLayout.PREFERRED_SIZE, 264, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addComponent(jButtonDeletePattern)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButtonAddPattern)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButtonCancel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButtonSave))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel17)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextDoNotProxy)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jComboCountry, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextDoNotProxy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel17))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonDeletePattern)
.addComponent(jButtonCancel)
.addComponent(jButtonSave)
.addComponent(jButtonAddPattern))
.addContainerGap())
);
pack();
}// //GEN-END:initComponents
private void jButtonSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSaveActionPerformed
savePatterns();
jButtonSave.setEnabled(isPatternsTableChanged());
doClose(APPLY);
}//GEN-LAST:event_jButtonSaveActionPerformed
private void jButtonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelActionPerformed
doClose(saveOnExitCheck());
}//GEN-LAST:event_jButtonCancelActionPerformed
/**
* Closes the dialog
*/
private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
doClose(CANCEL);
}//GEN-LAST:event_closeDialog
private void jComboCountryItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboCountryItemStateChanged
if (evt.getStateChange() != ItemEvent.SELECTED) {
return;
}
saveOnExitCheck();
// Check for no entries
if (jComboCountry.getItemCount() == 0) {
jTablePatterns.setEnabled(false);
jButtonDeletePattern.setEnabled(false);
jButtonAddPattern.setEnabled(false);
jButtonSave.setEnabled(false);
populatePatternsTable(null);
return;
}
// We reach here if we have selected a valid country
jTablePatterns.setEnabled(true);
jButtonAddPattern.setEnabled(true);
strSelectedCountry = (String) jComboCountry.getSelectedItem();
ArrayList patterns = new ArrayList<>();
pacFactory.loadPatternsList(strSelectedCountry, patterns);
populatePatternsTable(patterns);
}//GEN-LAST:event_jComboCountryItemStateChanged
private void jTablePatternsMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTablePatternsMouseReleased
jButtonDeletePattern.setEnabled(jTablePatterns.isCellEditable(jTablePatterns.getSelectedRow(), 0));
jButtonSave.setEnabled(isPatternsTableChanged());
}//GEN-LAST:event_jTablePatternsMouseReleased
private void jButtonDeletePatternActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDeletePatternActionPerformed
int[] i;
while (true) {
i = jTablePatterns.getSelectedRows();
if (i.length == 0) {
break;
}
pactm.removeRow(i[0]);
}
jButtonDeletePattern.setEnabled(false);
jButtonSave.setEnabled(isPatternsTableChanged());
}//GEN-LAST:event_jButtonDeletePatternActionPerformed
private void jTablePatternsKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTablePatternsKeyReleased
jButtonSave.setEnabled(isPatternsTableChanged());
}//GEN-LAST:event_jTablePatternsKeyReleased
private void jButtonAddPatternActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddPatternActionPerformed
QuickAddDialog qad = new QuickAddDialog(parent, true);
qad.setTitle("Add new pattern");
qad.setLocationRelativeTo(this);
qad.setVisible(true);
if (qad.getReturnStatus() == QuickAddDialog.CANCEL) {
return;
}
if (!qad.getPattern().isEmpty()) {
pactm.addRow(new Object[]{qad.getDescription(), qad.getPattern(), Boolean.TRUE}, true);
}
jButtonSave.setEnabled(isPatternsTableChanged());
}//GEN-LAST:event_jButtonAddPatternActionPerformed
private void jTextDoNotProxyKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextDoNotProxyKeyReleased
jButtonSave.setEnabled(isPatternsTableChanged());
}//GEN-LAST:event_jTextDoNotProxyKeyReleased
private void jTextDoNotProxyFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextDoNotProxyFocusLost
jButtonSave.setEnabled(isPatternsTableChanged());
}//GEN-LAST:event_jTextDoNotProxyFocusLost
private void doClose(int retStatus) {
returnStatus = retStatus;
setVisible(false);
dispose();
}
/**
* CustomTableCellRenderer
*/
public class CustomTableCellRenderer extends DefaultTableCellRenderer {
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
Component c = super.getTableCellRendererComponent(table, value,
isSelected, hasFocus, row, column);
// Only for specific cell
if (table.isRowSelected(row)) {
return c;
}
if (column < 2) {
if (table.getModel().isCellEditable(row, column)) {
c.setBackground(javax.swing.UIManager.getDefaults().getColor("Table.background"));
} else {
c.setBackground(javax.swing.UIManager.getDefaults().getColor("control"));
}
}
return c;
}
}
/**
* PACTableModel class
*/
public class PACTableModel extends DefaultTableModel {
@SuppressWarnings("rawtypes")
private final String[] columnNames = {"Description", "Pattern", "Enabled"};
private final Class[] types = new Class[]{
java.lang.String.class, java.lang.String.class, java.lang.Boolean.class
};
private final ArrayList rowedit = new ArrayList<>();
public void addRow(Object[] obj, boolean editable) {
addRow(obj);
rowedit.add(editable);
}
/**
* Constructor
*/
public PACTableModel() {
}
/**
* Get column count as integer
*
* @return columns as integer
*/
@Override
public int getColumnCount() {
return types.length;
}
/**
* Get column class
*
* @param columnIndex
* @return object Class
*/
@Override
@SuppressWarnings("rawtypes")
public Class getColumnClass(int columnIndex) {
return types[columnIndex];
}
/**
* Test if cell at given row, col is editable
*
* @param row
* @param column
* @return True if editable
*/
@Override
public boolean isCellEditable(int row, int column) {
if (column == 2) {
return true;
} else {
return rowedit.get(row);
}
}
/**
* Get column name at given index
*
* @param index
* @return name as string
*/
@Override
public String getColumnName(int index) {
return columnNames[index];
}
/**
* Set the column name at the specified index
*
* @param name
* @param index
*/
public void setColumnName(String name, int index) {
if (index < columnNames.length) {
columnNames[index] = name;
}
}
/**
* Returns all data as a single string
*
* @return string
*/
@Override
public String toString() {
return getDataVector().toString();
}
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButtonAddPattern;
private javax.swing.JButton jButtonCancel;
private javax.swing.JButton jButtonDeletePattern;
private javax.swing.JButton jButtonSave;
private javax.swing.JComboBox jComboCountry;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel17;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTablePatterns;
private javax.swing.JTextField jTextDoNotProxy;
// End of variables declaration//GEN-END:variables
private int returnStatus = CANCEL;
}
selektor-3.13.73/src/client/PrefsDialog.java 0000644 0001750 0001750 00000076460 13302030722 020154 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import javax.swing.DefaultComboBoxModel;
import lib.Localisation;
import lib.SimpleProps;
import lib.Utilities;
/**
*
* @author Alistair Neil,
*/
public final class PrefsDialog extends javax.swing.JDialog {
public static final int CANCEL = 0;
public static final int APPLY = 1;
public static final int RESET = 2;
private static final Localisation LOCAL = new Localisation("resources/MessagesBundle");
private final SimpleProps sp;
private final String disabledprefs;
/**
* Creates a preferences editor dialog
*
* @param parent Parent Frame
* @param sp
* @param disabledprefs
*/
public PrefsDialog(java.awt.Frame parent, SimpleProps sp, String disabledprefs) {
super(parent, true);
this.sp = sp;
this.disabledprefs = disabledprefs;
initComponents();
loadBasicPrefs(false);
loadAdvancedPrefs(false);
}
/**
* @return the return status of this dialog - one of RET_OK or RET_CANCEL
*/
public int getReturnStatus() {
return returnStatus;
}
public void loadBasicPrefs(boolean usedefault) {
sp.setDefaultModeEnabled(usedefault);
jCheckAutostart.setSelected(sp.getBool("PREF_AUTOSTART"));
jCheckDisableTray.setSelected(sp.getBool("PREF_NOSYSTRAY"));
jCheckHideMin.setEnabled(!jCheckDisableTray.isSelected());
jCheckHideTray.setSelected(sp.getBool("PREF_HIDETOTRAY"));
jCheckAppUpdate.setSelected(sp.getBool("PREF_UPDATECHECK"));
jCheckMinOnClose.setSelected(sp.getBool("PREF_MINONCLOSE"));
jCheckCacheDelete.setSelected(sp.getBool("PREF_CACHEDELETE"));
jCheckDisableNotify.setSelected(sp.getBool("PREF_DISABLE_NOTIFY"));
jCheckHideMin.setSelected(sp.getBool("PREF_HIDE_MIN"));
jCheckGeoUpdate.setSelected(sp.getBool("PREF_GEOCHECK"));
if (disabledprefs.contains("jCheckDisableTray")) {
jCheckDisableTray.setEnabled(false);
jCheckHideMin.setEnabled(false);
}
jCheckAppUpdate.setVisible(!disabledprefs.contains("jCheckAppUpdate"));
sp.setDefaultModeEnabled(false);
updatePortRanges(sp.getInt("PREF_TOR_TESTHREADS"));
}
/**
* Load the preferences
*
* @param usedefault
*/
public void loadAdvancedPrefs(boolean usedefault) {
sp.setDefaultModeEnabled(usedefault);
jTextHTTPProxy.setText(sp.getString("PREF_HTTP_PROXY"));
jSpinnerMainPort.setValue(sp.getInt("PREF_LISTENPORT"));
jTextTorBridge.setText(sp.getString("PREF_TORBRIDGE"));
jTextTorArgs.setText(sp.getString("PREF_TORARGS"));
jComboLogLev.setSelectedIndex(sp.getInt("PREF_TORLOGLEV"));
jCheckSafeSocks.setSelected(sp.getBool("PREF_SAFESOCKS"));
jCheckTestSocks.setSelected(sp.getBool("PREF_TESTSOCKS"));
jCheckAvoidDisk.setSelected(sp.getBool("PREF_AVOIDDISK"));
jCheckSafeLog.setSelected(sp.getBool("PREF_SAFELOG"));
sp.setDefaultModeEnabled(false);
}
/**
* Save preferences
*/
public void savePreferences() {
sp.setInt("PREF_LISTENPORT", (Integer) jSpinnerMainPort.getValue());
sp.setInt("PREF_TORLOGLEV", jComboLogLev.getSelectedIndex());
sp.setBool("PREF_AUTOSTART", jCheckAutostart.isSelected());
sp.setBool("PREF_NOSYSTRAY", jCheckDisableTray.isSelected());
sp.setBool("PREF_HIDETOTRAY", jCheckHideTray.isSelected());
sp.setBool("PREF_UPDATECHECK", jCheckAppUpdate.isSelected());
sp.setBool("PREF_MINONCLOSE", jCheckMinOnClose.isSelected());
sp.setBool("PREF_SAFESOCKS", jCheckSafeSocks.isSelected());
sp.setBool("PREF_TESTSOCKS", jCheckTestSocks.isSelected());
sp.setBool("PREF_AVOIDDISK", jCheckAvoidDisk.isSelected());
sp.setBool("PREF_SAFELOG", jCheckSafeLog.isSelected());
sp.setBool("PREF_CACHEDELETE", jCheckCacheDelete.isSelected());
sp.setBool("PREF_DISABLE_NOTIFY", jCheckDisableNotify.isSelected());
sp.setBool("PREF_HIDE_MIN", jCheckHideMin.isSelected());
sp.setBool("PREF_GEOCHECK", jCheckGeoUpdate.isSelected());
sp.setString("PREF_HTTP_PROXY", jTextHTTPProxy.getText());
sp.setString("PREF_TORBRIDGE", jTextTorBridge.getText());
sp.setString("PREF_TORARGS", jTextTorArgs.getText());
}
/**
* Update displayed port ranges to reflect any port changes
*/
private void updatePortRanges(int threads) {
int intBasePort = sp.getInt("PREF_LISTENPORT");
String strRanges = LOCAL.getString("label_portranges");
strRanges = strRanges.replace("$portmin", String.valueOf(intBasePort));
strRanges = strRanges.replace("$portmax", String.valueOf(intBasePort + (threads * 2) + 1));
jLabelPortRanges.setText(strRanges);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
// //GEN-BEGIN:initComponents
private void initComponents() {
jTabPrefs = new javax.swing.JTabbedPane();
jPanelBasicPrefs = new javax.swing.JPanel();
jPanelGeneralPrefs = new javax.swing.JPanel();
jCheckHideTray = new javax.swing.JCheckBox();
jCheckAppUpdate = new javax.swing.JCheckBox();
jCheckAutostart = new javax.swing.JCheckBox();
jCheckDisableTray = new javax.swing.JCheckBox();
jCheckMinOnClose = new javax.swing.JCheckBox();
jCheckCacheDelete = new javax.swing.JCheckBox();
jCheckDisableNotify = new javax.swing.JCheckBox();
jCheckHideMin = new javax.swing.JCheckBox();
jCheckGeoUpdate = new javax.swing.JCheckBox();
jPanelAdvancedPrefs = new javax.swing.JPanel();
jPanelTorPrefs = new javax.swing.JPanel();
jLabel6 = new javax.swing.JLabel();
jSpinnerMainPort = new javax.swing.JSpinner();
jLabelPortRanges = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jTextTorBridge = new javax.swing.JTextField();
jButtonGetBridges = new javax.swing.JButton();
jCheckSafeSocks = new javax.swing.JCheckBox();
jLabel12 = new javax.swing.JLabel();
jCheckTestSocks = new javax.swing.JCheckBox();
jLabel13 = new javax.swing.JLabel();
jTextTorArgs = new javax.swing.JTextField();
jLabel14 = new javax.swing.JLabel();
jCheckAvoidDisk = new javax.swing.JCheckBox();
jLabel15 = new javax.swing.JLabel();
jComboLogLev = new javax.swing.JComboBox<>();
jCheckSafeLog = new javax.swing.JCheckBox();
jPanel1 = new javax.swing.JPanel();
jLabel16 = new javax.swing.JLabel();
jTextHTTPProxy = new javax.swing.JTextField();
jButtonCancel = new javax.swing.JButton();
jButtonApply = new javax.swing.JButton();
jButtonDefaults = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setIconImage(null);
setResizable(false);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
closeDialog(evt);
}
});
jTabPrefs.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
jTabPrefsStateChanged(evt);
}
});
jPanelBasicPrefs.setFont(jPanelBasicPrefs.getFont().deriveFont(jPanelBasicPrefs.getFont().getStyle() | java.awt.Font.BOLD));
jPanelGeneralPrefs.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LOCAL.getString("panel_general"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, jPanelBasicPrefs.getFont(), jPanelBasicPrefs.getForeground())); // NOI18N
jCheckHideTray.setText(LOCAL.getString("chkbox_hidetotray")); // NOI18N
jCheckHideTray.setToolTipText(LOCAL.getString("ttip_hidetotray")); // NOI18N
jCheckAppUpdate.setSelected(true);
jCheckAppUpdate.setText(LOCAL.getString("chkbox_checkforupdates")); // NOI18N
jCheckAppUpdate.setToolTipText(LOCAL.getString("ttip_checkforupdates")); // NOI18N
jCheckAutostart.setText(LOCAL.getString("chkbox_autostart")); // NOI18N
jCheckAutostart.setToolTipText(LOCAL.getString("ttip_autostart")); // NOI18N
jCheckDisableTray.setText(LOCAL.getString("chkbox_disabletray")); // NOI18N
jCheckDisableTray.setToolTipText(LOCAL.getString("ttip_disabletray")); // NOI18N
jCheckDisableTray.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
jCheckDisableTrayItemStateChanged(evt);
}
});
jCheckMinOnClose.setText(LOCAL.getString("chkbox_minonclose")); // NOI18N
jCheckMinOnClose.setToolTipText(LOCAL.getString("ttip_minonclose")); // NOI18N
jCheckCacheDelete.setText(LOCAL.getString("chkbox_securedelete")); // NOI18N
jCheckCacheDelete.setToolTipText(LOCAL.getString("ttip_securedelete")); // NOI18N
jCheckDisableNotify.setText(LOCAL.getString("chkbox_disablenotify")); // NOI18N
jCheckDisableNotify.setToolTipText(LOCAL.getString("ttip_disablenotify")); // NOI18N
jCheckHideMin.setText(LOCAL.getString("chkbox_hidemin")); // NOI18N
jCheckHideMin.setToolTipText(LOCAL.getString("ttip_hidemin")); // NOI18N
jCheckGeoUpdate.setSelected(true);
jCheckGeoUpdate.setText(LOCAL.getString("chkbox_geocheck")); // NOI18N
jCheckGeoUpdate.setToolTipText(LOCAL.getString("ttip_geocheck")); // NOI18N
javax.swing.GroupLayout jPanelGeneralPrefsLayout = new javax.swing.GroupLayout(jPanelGeneralPrefs);
jPanelGeneralPrefs.setLayout(jPanelGeneralPrefsLayout);
jPanelGeneralPrefsLayout.setHorizontalGroup(
jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelGeneralPrefsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jCheckAutostart)
.addComponent(jCheckHideTray)
.addComponent(jCheckCacheDelete)
.addComponent(jCheckHideMin)
.addComponent(jCheckDisableNotify))
.addGap(18, 18, 18)
.addGroup(jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jCheckAppUpdate)
.addComponent(jCheckGeoUpdate)
.addComponent(jCheckDisableTray)
.addComponent(jCheckMinOnClose))
.addContainerGap(39, Short.MAX_VALUE))
);
jPanelGeneralPrefsLayout.setVerticalGroup(
jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelGeneralPrefsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jCheckAutostart)
.addComponent(jCheckGeoUpdate))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jCheckHideTray)
.addComponent(jCheckDisableTray))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jCheckHideMin)
.addComponent(jCheckMinOnClose))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jCheckCacheDelete)
.addComponent(jCheckAppUpdate))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jCheckDisableNotify)
.addContainerGap(132, Short.MAX_VALUE))
);
javax.swing.GroupLayout jPanelBasicPrefsLayout = new javax.swing.GroupLayout(jPanelBasicPrefs);
jPanelBasicPrefs.setLayout(jPanelBasicPrefsLayout);
jPanelBasicPrefsLayout.setHorizontalGroup(
jPanelBasicPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelBasicPrefsLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanelGeneralPrefs, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jPanelBasicPrefsLayout.setVerticalGroup(
jPanelBasicPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelBasicPrefsLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanelGeneralPrefs, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jTabPrefs.addTab(LOCAL.getString("tab_basic"), jPanelBasicPrefs); // NOI18N
jPanelTorPrefs.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LOCAL.getString("panel_torclientset"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, jPanelBasicPrefs.getFont(), jPanelBasicPrefs.getForeground())); // NOI18N
jLabel6.setText(LOCAL.getString("label_listenport")); // NOI18N
jSpinnerMainPort.setModel(new javax.swing.SpinnerNumberModel(9054, 9054, 9999, 1));
jSpinnerMainPort.setToolTipText(LOCAL.getString("ttip_listenport")); // NOI18N
jLabelPortRanges.setText("Currently active port ranges, 9052 to 9063");
jLabel11.setText(LOCAL.getString("label_bridgeaddress")); // NOI18N
jTextTorBridge.setToolTipText(LOCAL.getString("ttip_bridgeaddress")); // NOI18N
jButtonGetBridges.setText(LOCAL.getString("button_getbridges")); // NOI18N
jButtonGetBridges.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonGetBridgesActionPerformed(evt);
}
});
jCheckSafeSocks.setText(LOCAL.getString("chkbox_safesocks")); // NOI18N
jCheckSafeSocks.setToolTipText(LOCAL.getString("ttip_safesocks")); // NOI18N
jLabel12.setText(LOCAL.getString("label_torlogging")); // NOI18N
jCheckTestSocks.setText(LOCAL.getString("chkbox_testsocks")); // NOI18N
jCheckTestSocks.setToolTipText(LOCAL.getString("ttip_testsocks")); // NOI18N
jLabel13.setText(LOCAL.getString("label_torargs")); // NOI18N
jTextTorArgs.setToolTipText(LOCAL.getString("ttip_extraargs")); // NOI18N
jLabel14.setText(LOCAL.getString("label_torsocks")); // NOI18N
jCheckAvoidDisk.setText(LOCAL.getString("chkbox_diskavoid")); // NOI18N
jCheckAvoidDisk.setToolTipText(LOCAL.getString("ttip_avoiddisk")); // NOI18N
jLabel15.setText(LOCAL.getString("label_diskoptions")); // NOI18N
jComboLogLev.setModel(new DefaultComboBoxModel<>(new String[] {LOCAL.getString("combo_loglev1"),LOCAL.getString("combo_loglev2"),LOCAL.getString("combo_loglev3")}));
jComboLogLev.setToolTipText(LOCAL.getString("ttip_combo_loglevel")); // NOI18N
jCheckSafeLog.setText(LOCAL.getString("chkbox_safelog")); // NOI18N
jCheckSafeLog.setToolTipText(LOCAL.getString("ttip_safelogging")); // NOI18N
javax.swing.GroupLayout jPanelTorPrefsLayout = new javax.swing.GroupLayout(jPanelTorPrefs);
jPanelTorPrefs.setLayout(jPanelTorPrefsLayout);
jPanelTorPrefsLayout.setHorizontalGroup(
jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelTorPrefsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel14)
.addComponent(jLabel15)
.addComponent(jLabel12)
.addComponent(jLabel13)
.addComponent(jLabel11)
.addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanelTorPrefsLayout.createSequentialGroup()
.addComponent(jCheckSafeSocks)
.addGap(18, 18, 18)
.addComponent(jCheckTestSocks))
.addComponent(jCheckAvoidDisk)
.addGroup(jPanelTorPrefsLayout.createSequentialGroup()
.addComponent(jComboLogLev, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jCheckSafeLog))
.addGroup(jPanelTorPrefsLayout.createSequentialGroup()
.addComponent(jTextTorBridge, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButtonGetBridges))
.addGroup(jPanelTorPrefsLayout.createSequentialGroup()
.addComponent(jSpinnerMainPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabelPortRanges))
.addComponent(jTextTorArgs))
.addContainerGap())
);
jPanelTorPrefsLayout.setVerticalGroup(
jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelTorPrefsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(jLabelPortRanges)
.addComponent(jSpinnerMainPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel11)
.addComponent(jTextTorBridge, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButtonGetBridges))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel14)
.addComponent(jCheckSafeSocks)
.addComponent(jCheckTestSocks))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel12)
.addComponent(jComboLogLev, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jCheckSafeLog))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel15)
.addComponent(jCheckAvoidDisk))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel13)
.addComponent(jTextTorArgs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LOCAL.getString("panel_network"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, jPanelBasicPrefs.getFont(), jPanelBasicPrefs.getForeground())); // NOI18N
jLabel16.setText(LOCAL.getString("label_defaultproxy")); // NOI18N
jTextHTTPProxy.setToolTipText(LOCAL.getString("ttip_defaultproxy")); // NOI18N
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel16)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextHTTPProxy)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel16)
.addComponent(jTextHTTPProxy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
javax.swing.GroupLayout jPanelAdvancedPrefsLayout = new javax.swing.GroupLayout(jPanelAdvancedPrefs);
jPanelAdvancedPrefs.setLayout(jPanelAdvancedPrefsLayout);
jPanelAdvancedPrefsLayout.setHorizontalGroup(
jPanelAdvancedPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelAdvancedPrefsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanelAdvancedPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanelTorPrefs, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jPanelAdvancedPrefsLayout.setVerticalGroup(
jPanelAdvancedPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelAdvancedPrefsLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanelTorPrefs, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jTabPrefs.addTab(LOCAL.getString("tab_advanced"), jPanelAdvancedPrefs); // NOI18N
jButtonCancel.setText(LOCAL.getString("button_close")); // NOI18N
jButtonCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonCancelActionPerformed(evt);
}
});
jButtonApply.setText(LOCAL.getString("button_apply")); // NOI18N
jButtonApply.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonApplyActionPerformed(evt);
}
});
jButtonDefaults.setText(LOCAL.getString("button_prefdefaults")); // NOI18N
jButtonDefaults.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonDefaultsActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jButtonDefaults)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButtonCancel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButtonApply)
.addContainerGap())
.addComponent(jTabPrefs)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jTabPrefs)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonApply)
.addComponent(jButtonCancel)
.addComponent(jButtonDefaults))
.addContainerGap())
);
pack();
}// //GEN-END:initComponents
private void jButtonApplyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonApplyActionPerformed
savePreferences();
updatePortRanges(sp.getInt("PREF_TOR_TESTHREADS"));
doClose(APPLY);
}//GEN-LAST:event_jButtonApplyActionPerformed
private void jButtonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelActionPerformed
doClose(CANCEL);
}//GEN-LAST:event_jButtonCancelActionPerformed
/**
* Closes the dialog
*/
private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
doClose(CANCEL);
}//GEN-LAST:event_closeDialog
private void jButtonGetBridgesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGetBridgesActionPerformed
Utilities.openFileExternally("https://bridges.torproject.org/bridges?lang="
+ LOCAL.toWebLanguageTag());
}//GEN-LAST:event_jButtonGetBridgesActionPerformed
private void jButtonDefaultsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDefaultsActionPerformed
switch (jTabPrefs.getSelectedIndex()) {
// Basic tab
case 0:
loadBasicPrefs(true);
break;
// Advanced tab
case 1:
loadAdvancedPrefs(true);
break;
}
}//GEN-LAST:event_jButtonDefaultsActionPerformed
private void jTabPrefsStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabPrefsStateChanged
switch (jTabPrefs.getSelectedIndex()) {
case 0:
jButtonDefaults.setToolTipText(LOCAL.getString("ttip_resetbasicprefs"));
break;
case 1:
jButtonDefaults.setToolTipText(LOCAL.getString("ttip_resetadvprefs"));
break;
}
}//GEN-LAST:event_jTabPrefsStateChanged
private void jCheckDisableTrayItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckDisableTrayItemStateChanged
jCheckHideMin.setEnabled(!jCheckDisableTray.isSelected());
}//GEN-LAST:event_jCheckDisableTrayItemStateChanged
private void doClose(int retStatus) {
returnStatus = retStatus;
setVisible(false);
dispose();
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButtonApply;
private javax.swing.JButton jButtonCancel;
private javax.swing.JButton jButtonDefaults;
private javax.swing.JButton jButtonGetBridges;
private javax.swing.JCheckBox jCheckAppUpdate;
private javax.swing.JCheckBox jCheckAutostart;
private javax.swing.JCheckBox jCheckAvoidDisk;
private javax.swing.JCheckBox jCheckCacheDelete;
private javax.swing.JCheckBox jCheckDisableNotify;
private javax.swing.JCheckBox jCheckDisableTray;
private javax.swing.JCheckBox jCheckGeoUpdate;
private javax.swing.JCheckBox jCheckHideMin;
private javax.swing.JCheckBox jCheckHideTray;
private javax.swing.JCheckBox jCheckMinOnClose;
private javax.swing.JCheckBox jCheckSafeLog;
private javax.swing.JCheckBox jCheckSafeSocks;
private javax.swing.JCheckBox jCheckTestSocks;
private javax.swing.JComboBox jComboLogLev;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabelPortRanges;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanelAdvancedPrefs;
private javax.swing.JPanel jPanelBasicPrefs;
private javax.swing.JPanel jPanelGeneralPrefs;
private javax.swing.JPanel jPanelTorPrefs;
private javax.swing.JSpinner jSpinnerMainPort;
private javax.swing.JTabbedPane jTabPrefs;
private javax.swing.JTextField jTextHTTPProxy;
private javax.swing.JTextField jTextTorArgs;
private javax.swing.JTextField jTextTorBridge;
// End of variables declaration//GEN-END:variables
private int returnStatus = CANCEL;
}
selektor-3.13.73/src/client/TorMonFrame.java 0000644 0001750 0001750 00000021211 13302030722 020126 0 ustar bannor bannor /*
* Copyright (C) 2009-2017 Alistair Neil
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package client;
import javax.swing.JTextArea;
import lib.GTKFixes;
import lib.Localisation;
import lib.OSFunction;
/**
*
* @author Alistair Neil
*/
public class TorMonFrame extends javax.swing.JFrame {
private static final Localisation LOCAL = new Localisation("resources/MessagesBundle");
/**
* Creates new form TorMonFrame
*/
public TorMonFrame() {
initComponents();
jTextAreaLaunch.setOpaque(OSFunction.isWindows());
jTextAreaStdOut.setOpaque(OSFunction.isWindows());
GTKFixes.fixTextAreaColor(jTextAreaLaunch);
GTKFixes.fixTextAreaColor(jTextAreaStdOut);
}
/**
* Set launch command text
*
* @param command
*/
public void setLaunchString(String command) {
jTextAreaLaunch.setText(command);
jTextAreaLaunch.setCaretPosition(0);
}
public JTextArea getStdoutTextArea() {
return jTextAreaStdOut;
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// //GEN-BEGIN:initComponents
private void initComponents() {
jPanelMain = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jTextAreaLaunch = new javax.swing.JTextArea();
jPanel2 = new javax.swing.JPanel();
jScrollPaneStdOut = new javax.swing.JScrollPane();
jTextAreaStdOut = new javax.swing.JTextArea();
jButtonClose = new javax.swing.JButton();
setMinimumSize(new java.awt.Dimension(554, 492));
jPanelMain.setFont(jPanelMain.getFont().deriveFont(jPanelMain.getFont().getStyle() | java.awt.Font.BOLD));
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LOCAL.getString("panel_startupargs"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, jPanelMain.getFont())); // NOI18N
jTextAreaLaunch.setEditable(false);
jTextAreaLaunch.setColumns(38);
jTextAreaLaunch.setLineWrap(true);
jTextAreaLaunch.setRows(7);
jScrollPane1.setViewportView(jTextAreaLaunch);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LOCAL.getString("panel_stdout"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, jPanelMain.getFont())); // NOI18N
jTextAreaStdOut.setEditable(false);
jTextAreaStdOut.setColumns(38);
jTextAreaStdOut.setRows(8);
jScrollPaneStdOut.setViewportView(jTextAreaStdOut);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPaneStdOut)
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPaneStdOut)
.addContainerGap())
);
jButtonClose.setText(LOCAL.getString("button_close")); // NOI18N
jButtonClose.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonCloseActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanelMainLayout = new javax.swing.GroupLayout(jPanelMain);
jPanelMain.setLayout(jPanelMainLayout);
jPanelMainLayout.setHorizontalGroup(
jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelMainLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelMainLayout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jButtonClose)))
.addContainerGap())
);
jPanelMainLayout.setVerticalGroup(
jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanelMainLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButtonClose)
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanelMain, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanelMain, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// //GEN-END:initComponents
private void jButtonCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCloseActionPerformed
this.setVisible(false);
}//GEN-LAST:event_jButtonCloseActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButtonClose;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanelMain;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPaneStdOut;
private javax.swing.JTextArea jTextAreaLaunch;
private javax.swing.JTextArea jTextAreaStdOut;
// End of variables declaration//GEN-END:variables
}
selektor-3.13.73/src/resources/ 0000755 0001750 0001750 00000000000 13302030722 015631 5 ustar bannor bannor selektor-3.13.73/src/resources/MessagesBundle_pt_BR.properties 0000644 0001750 0001750 00000040462 13302030722 023744 0 ustar bannor bannor # Portuguese BR, Default language file, provide by Paulo Roberto Alves de Oliveira (aka kretcheu) Licensed by GPL-2+
appdesc=$appname $appver, N\u00f3s de sa\u00edda Tor com simplicidade.
text_yes=Sim
text_no=N\u00e3o
text_mode=N\u00f3
wintitle_prefs = Prefer\u00eancias $appname
wintitle_about = Sobre $appname
wintitle_patternedit = Editor de modelos $appname
wintitle_guardnodes=Sele\u00e7\u00e3o de n\u00f3s guarda
wintitle_tormonitor=Monitor do cliente Tor
textfield_unknown=Desconhecido
progstatus_initial=Iniciando...
progstatus_generate=Gerando lista de n\u00f3s, por favor aguarde.
progstatus_cachedated=Descri\u00e7\u00f5es armazenadas desatualizadas, iremos atualiz\u00e1-las.
progstatus_nonet=Acesso a Internet n\u00e3o dispon\u00edvel.
progstatus_checkrecommended=Verificando os \u00faltimos n\u00f3s recomendados.
progstatus_gotrecommended=Lista de n\u00f3s recomendados recuperados.
progstatus_torfailretry=O Tor falhou ao iniciar, tentando novamente.
progstatus_nodefail=Ativa\u00e7\u00e3o requisitada do n\u00f3 falhou.
progstatus_nodefailretry=Ativa\u00e7\u00e3o requisitada do n\u00f3 falhou, tentaremos novamente, por favor aguarde.
progstatus_nodefailtorchoose=N\u00f3 requisitado fora de alcance, deixaremos o Tor escolher.
progstatus_nodeactive3hop=Circuito de 3 saltos do n\u00f3 de sa\u00edda $nodename est\u00e1 ativo.
progstatus_nodeactive2hop=Cirtuito de 2 saltos do n\u00f3 de sa\u00edda $nodename est\u00e1 ativo.
progstatus_autoswitch=Troca autom\u00e1tica de n\u00f3
progstatus_manswitch=Trocando para n\u00f3 manualmente selecionado.
progstatus_waitfortor=Aguardando ativa\u00e7\u00e3o do n\u00f3 pelo Tor.
progstatus_switchtonode=Trocando para o n\u00f3 $nodename.
progstatus_applychanges=Aplicando novas prefer\u00eancias.
circuit_status_creating_2hop=Criando circuito de 2 saltos.
circuit_status_creating_3hop=Criando circuito de 3 saltos.
circuit_status_testing=Testanto circuito.
circuit_status_aborted=Teste cancelado.
circuit_status_built=Circuito $1 constru\u00eddo.
circuit_status_passed=Circuito passou.
circuit_status_failed=Circuito falhou.
circuit_status_none=Nenhum circuito dispon\u00edvel.
circuit_status_noroute=Todos roteadores fora.
combo_proxymode1=Desabilitado
combo_proxymode2=Proxy por modelo
combo_proxymode3=Proxy para todo tr\u00e1fego
combo_loglev1=Depura\u00e7\u00e3o
combo_loglev2=Informa\u00e7\u00e3o
combo_loglev3=Aviso
traymenu_proxymode1=Modo: Proxy Desabilitado
traymenu_proxymode2=Modo: Proxy por modelo
traymenu_proxymode3=Modo: Proxy para todo tr\u00e1fego
traymenu_showgui=Esconde/Mostra GUI
traytool_guardnode=N\u00f3 guarda
traytool_exitnode=N\u00f3 de sa\u00edda
exittable_col1=N\u00f3 de sa\u00edda
exittable_col2=Largura de Banda (MB\/s)
exittable_col3=Lat\u00eancia (ms)
exittable_col4=Estado
exittable_col5=Favorito
guardtable_col1=N\u00f3 guarda
guardtable_col2=Pa\u00eds
guardtable_col3=Largura de Banda (MB\/s)
guardtable_col4=Confi\u00e1vel
patterntable_col1=Descri\u00e7\u00e3o
patterntable_col2=Modelo
patterntable_col3=Habilitado
menu_menu=Menu
menu_prefs=Prefer\u00eancias
menu_quickadd=Adicione modelo rapidamente
menu_patternedit=Editor de modelo de proxy
menu_export=Exporta\u00e7\u00e3o de modelos
menu_import=Importa\u00e7\u00e3o de modelos
menu_quit=Sair
menu_defaultpatterns=Modelos padr\u00e3o
menu_userpatterns=Modelos de usu\u00e1rio
menu_help=Ajuda
menu_debuglog=Ver log de depura\u00e7\u00e3o
menu_helpcontents=Conte\u00fado de ajuda
menu_torcheck=Verificar roteamento Tor
menu_about=Sobre
menu_license=Licen\u00e7a
menu_tormanual=Manual oficial do Tor
menu_tormonitor=Monitor de cliente Tor
menu_close=Menu fechar
menu_proxy=Modo Proxy
menu_leaktest=Testar vazamento de DNS
menu_credits=Cr\u00e9ditos
label_latency_url=URL de verifica\u00e7\u00e3o de lat\u00eancia do Tor:
label_guardnode=Guarda:
label_bridgenode=Ponte:
label_activecountry=Pa\u00eds de sa\u00edda:
label_proxymode=Modo do proxy:
label_exitnode=N\u00f3 de sa\u00edda:
label_torlatency=Lat\u00eancia
label_fingerprint=Impress\u00e3o digital:
label_bandwidth=Largura de banda
label_streams=Fluxos
label_stable=Est\u00e1vel
label_status=Estado do cliente:
label_listenport=Porta de escuta do Tor:
label_defaultproxy=Proxy HTTP padr\u00e3o:
label_bridgeaddress=Endere\u00e7o de ponte Tor:
label_portranges=Intervalo atual de portas, $portmin at\u00e9 $portmax
label_editcountry=Selecione o pa\u00eds para ver seu modelo
label_quickadd_desc=Descri\u00e7\u00e3o:
label_quickadd_pattern=Modelo:
label_threshold=Limite
label_exitip=IP de sa\u00edda:
label_guardip=IP do n\u00f3 guarda:
label_guardcountry=Pa\u00eds do n\u00f3 guarda:
label_torlogging=N\u00edvel de log:
label_torargs=Par\u00e2metros iniciais:
label_torsocks=Configura\u00e7\u00e3o do Socks:
label_diskoptions=Op\u00e7\u00f5es de disco:
label_guard_minimum=Voc\u00ea pode tanto n\u00e3o ter n\u00f3s guarda selecionados, nesse caso o cliente Tor ir\u00e1 escolher ou ter 3 ou mais n\u00f3s guarda selecionados.
label_nickname=Apelido
label_ip=IP
label_country=Pa\u00eds
label_exit=Sa\u00edda:
label_middle=Meio:
label_donotproxy=Sem proxy:
button_details=Detalhes do atlas
button_whois=WhoIs
button_close=Fechar
button_apply=Aplicar
button_delete=Apagar
button_addnew=Adicionar novo
button_save=Salvar
button_cancel=Cancelar
button_continue=Continuar
button_getbridges=Obter pontes
button_mozillarestart=Reiniciar $browser
button_visitus=Visite-nos
button_contactus=Contacte-nos
button_translations=Tradu\u00e7\u00f5es n\u00e3o oficiais
button_prefdefaults=Restaurar padr\u00f5es
button_setguards=Definir n\u00f3s guarda
button_clearguards=Limpar n\u00f3s guarda selecionados
button_clearfavs=Limpar Favoritos
button_support=Apoie o SelekTOR
button_patreon=Apoie o SelekTOR com Patreon
panel_info=Circuito ativo
panel_general=Configura\u00e7\u00f5es gerais
panel_network=Configura\u00e7\u00f5es de rede
panel_management=Configura\u00e7\u00f5es de gest\u00e3o de n\u00f3s
panel_torclientset=Configura\u00e7\u00f5es do cliente Tor
panel_startupargs=Par\u00e2metros iniciais
panel_stdout=Monitor de sa\u00edda
chkbox_autoselect=Sele\u00e7\u00e3o autom\u00e1tica de n\u00f3s
chkbox_autostart=Iniciar automaticamente o SelekTOR
chkbox_checkforupdates=Verificar por atualiza\u00e7\u00f5es ao iniciar
chkbox_disabletray=Desabilitar \u00edcone da bandeja.
chkbox_autopatterns=Instalar automaticamente os \u00faltimos modelos.
chkbox_mozillawarn=Desabilitar alerta Mozilla
chkbox_recnodesonly=Usar n\u00f3s recomendados no modelo
chkbox_hidetotray=Minimizar ao iniciar
chkbox_minonclose=Minimizar ao inv\u00e9s de sair ao fechar
chkbox_twohop=Usar circuitos de 2 saltos para n\u00f3 de sa\u00edda no modelo
chkbox_safesocks=Socks seguro
chkbox_warnunsafesocks=Avisar se inseguro
chkbox_diskavoid=Evitar escrita no disco
chkbox_testsocks=Testar Socks
chkbox_safelog=Logging seguro
chkbox_guardwarn1=Alertar se um n\u00f3 guarda n\u00e3o especificado for usado
chkbox_securedelete=Apagar dados armazenados do Tor ao sair
chkbox_guardwarn2=Alertar se menos de 3 n\u00f3s guardas forem selecionados
ttip_autostart=Ir\u00e1 iniciar o SelekTOR automaticamente no boot/login.
ttip_hidetotray=SelekTOR iniciar\u00e1 na bandeja do sistema
ttip_checkforupdates=SelekTOR verificar\u00e1 por nova vers\u00e3o ao iniciar
ttip_autoinstall=Buscar\u00e1 \u00faltimos modelos de Dazzleships.Net.
ttip_disabletray=Desabilitar \u00edcone na bandeja do sistema
ttip_mozillawarn=Desabilitar alerta do navegador Mozilla
ttip_listenport=Cliente Tor escutando na porta.
ttip_defaultproxy=Todo tr\u00e1fego n\u00e3o roteado pelo Tor ir\u00e1 ser redirecionado por esse proxy HTTP.
ttip_donotproxy=Qualquer URL que contenha uma ou mais dessas entradas, separadas por v\u00edrgula, ser\u00e1 conectada diretamente.
ttip_bridgeaddress=Para evitar bloqueio do provedor adicione um endere\u00e7o v\u00e1lido de ponte aqui.
ttip_forcedns=Force pesquisa de DNS via Tor, precisa reiniciar o navegador.
ttip_forcenode=Quando marcado o n\u00f3 \u00e9 ativado independente de atividade atual
ttip_enhanon=Usar\u00e1 3 saltos de n\u00f3s ao inv\u00e9s de 2 saltos.
ttip_recnodesonly=Usuar\u00e1 n\u00f3s recomendados do modelo
ttip_minonclose=A aplica\u00e7\u00e3o ir\u00e1 minimizar ao inv\u00e9s de sair ao fechar a janela principal
ttip_threshold=Limite de lat\u00eancia
ttip_safesocks=Quando habilitado, o Tor ir\u00e1 rejeitar conex\u00f5es que usam varia\u00e7\u00f5es inseguras do protocolo socks.
ttip_warnunsafe=Quando habilitado, o Tor ir\u00e1 avisar sempre que uma requisi\u00e7\u00e3o recebida contiver apenas IP ao inv\u00e9s de um nome de m\u00e1quina.
ttip_testsocks=Quando habilitado, o Tor ir\u00e1 gerar um log de n\u00edvel aviso para cada conex\u00e3o, indicando se foi usado o protocolo socks seguro ou inseguro.
ttip_safelogging=Quando habilitado, o Tor ir\u00e1 limpar o texto potencialmente cr\u00edtico das mensagens de log.
ttip_avoiddisk=Quando habilitado, o Tor tentar\u00e1 escrever no disco com menos frequ\u00eancia.
ttip_extraargs=Especifique par\u00e2metros adicionais, veja o manual do Tor.
ttip_combo_loglevel=N\u00edvel de log do Tor.
ttip_twohop=Usar circuitos de 2 saltos ao inv\u00e9s de 3 saltos, padr\u00e3o do Tor, reduz a lat\u00eancia mas diminui o anonimato.
ttip_resetbasicprefs=Restaurar as prefer\u00eancias b\u00e1sicas para seus padr\u00f5es.
ttip_resetadvprefs=Restaurar as prefer\u00eancias avan\u00e7adas para seus padr\u00f5es.
ttip_securedelete=Quando habilitado, o armazenamento do Tor ser\u00e1 sobrescrito por zeros quanto apagado.
ttip_autonode=Quando habilitado, o SelekTOR tentar\u00e1 escolher o n\u00f3 de melhor performance.
ttip_guardwarn=Quando habilitado, um alerta ser\u00e1 usado para indicar que um n\u00f3 guarda n\u00e3o especificado est\u00e1 ativo.
ttip_clearguards=Limpar n\u00f3s guarda selecionados.
ttip_guardwarn2=Quando habilitado, um alerta ser\u00e1 usado para indicar insufici\u00eancia de n\u00f3s guarda selecionados.
dlg_update_title=Atualiza\u00e7\u00e3o dispon\u00edvel.
dlg_update_body=Vers\u00e3o $version est\u00e1 dispon\u00edvel para download.
dlg_restoreproxy_title=Configura\u00e7\u00e3o original do proxy
dlg_restoreproxy_body=Selecione continue para restaurar as configura\u00e7\u00f5es originais do proxy antes da instala\u00e7\u00e3o do SelekTOR.
dlg_resetproxy_title=Configura\u00e7\u00e3o padr\u00e3o do proxy
dlg_resetproxy_body=Selecione continuar para limpar as configura\u00e7\u00f5es de proxy para o padr\u00e3o do sistema.
dlg_gsetting_title=Gsettings n\u00e3o encontrado
dlg_gsetting_body=$appname n\u00e3o funciona sem o bin\u00e1rio gsettings instalado, em algumas distribui\u00e7\u00f5es pode ser encontrado no pacote libglib2.0-bin.
dlg_torclient_title=Cliente TOR n\u00e3o encontrado
dlg_torclient_body=$appname n\u00e3o funciona sem um cliente Tor instalado, por favor instale os pacotes tor e tor-geoipdb da sua distribui\u00e7\u00e3o.
dlg_mozillarestart_title=Alerta: O navegador $browser est\u00e1 ativo.
dlg_mozillarestart_body=O $appname detectou que o navegador $browser j\u00e1 est\u00e1 em execu\u00e7\u00e3o.\nReiniciar o navegador \u00e9 necess\u00e1rio para habilitar $appname.\n\nSe escolher reiniciar o $browser todas as abas abertas ser\u00e3o restauradas quando o $browser reiniciar, requer que a op\u00e7\u00e3o \"Restaurar janelas e abas anteriores\" seja selecionada no menu prefer\u00eancias no $browser.\n\nVoc\u00ea pode desabilitar o aviso do navegador em prefer\u00eancias de $appname.
dlg_license_title=Licen\u00e7a $appname
dlg_exportuser_title=Exportar modelo de usu\u00e1rio
dlg_exportuser_body=Nenhum modelo de usu\u00e1rio encontrado.\n\nUse o editor de modelos para adicionar seus pr\u00f3rios modelos
dlg_exportdefault_title=Exporte os modelos padr\u00e3o
dlg_exportdefault_body=Nenhum modelo padr\u00e3o encontrado.
dlg_saveuser_title=Salvar o modelo de usu\u00e1rio
dlg_savedefault_title=Salvar os modelos padr\u00e3o
dlg_import_title=Importar um arquivo de modelo
dlg_import_success_title=Modelo importado
dlg_import_success_body=Modelos importados com susesso e agora ativos.
dlg_import_fail_title=Importa\u00e7\u00e3o falhou
dlg_import_fail_body=Falhou ao importar modelos.
dlg_whois_title=Whois $ipaddress
dlg_whois_body=Por favor aguarde enquanto buscando dados Whois...
dlg_whois_fail=Desculpe, n\u00e3o foi poss\u00edvel encontrar informa\u00e7\u00f5es de Whois.
dlg_toold_body=O cliente Tor atualmente instalado \u00e9 antigo, o Tor 0.2.7.6 ou mais novo \u00e9 requerido.\n\nUsu\u00e1rios de GNU/Linux podem acessar a p\u00e1gina \nhttps://www.torproject.org/download/download-unix.html.en\n para obter o cliente Tor mais recente, ou diretamente dos reposit\u00f3rios.
dlg_error_title=Erro de inicia\u00e7\u00e3o
dlg_error_body=Esse erro \u00e9 fatal e $appname ir\u00e1 fechar.
dlg_quickadd_title=Adicionar modelo
dlg_nodelistfail_body=A gera\u00e7\u00e3o da lista de n\u00f3s falhou devido a erros do GEOIP.
dlg_patterneditsave_title=Salvar os modelos atuais
dlg_patterneditsave_body=Modelos atuais foram modificados.\n\nSe voc\u00ea deseja salv\u00e1-los clique em continuar sen\u00e3o clique em cancelar.
dlg_instancefail_title=Falha de inst\u00e2ncia multipla
dlg_instancefail_body=Uma inst\u00e2ncia de $appname j\u00e1 est\u00e1 em execu\u00e7\u00e3o, somente uma inst\u00e2ncia pode ser executada por vez.\n\nFechar a inst\u00e2ncia existente de $appname ou no caso de $appname congelar reinicie o X deslogando e logando novamente.
dlg_guardwarn_title=Alerta de n\u00f3 guarda
dlg_guardwarn_body=Um n\u00f3 guarda que n\u00e3o est\u00e1 na lista de n\u00f3s guarda especificados foi usado.\nProvavelmente porque seus n\u00f3s guarda selecionados n\u00e3o s\u00e3o mais alcan\u00e7\u00e1veis e o cliente Tor escolheu seus pr\u00f3prios n\u00f3s guarda. Talvez queira verificar sua lista de n\u00f3s guarda para ver se ainda est\u00e3o dispon\u00edveis ou selecionar novos.
dlg_notenoughguards_body=N\u00e3o h\u00e1 n\u00f3s guarda suficientes para o Tor operar com seguran\u00e7a e efici\u00eancia.\n\nLimpe todos os n\u00f3s guarda selecionados e deixe o cliente Tor escolher seus pr\u00f3prios n\u00f3s guarda ou escolha 3 n\u00f3s guarda manualmente.
dlg_bridgerr_title=Falha na valida\u00e7\u00e3o do endere\u00e7o da ponte.
dlg_bridgerr_body=A informa\u00e7\u00e3o da ponte fornecida cont\u00e9m erros de valida\u00e7\u00e3o e n\u00e3o est\u00e1 em conformidade com um formato v\u00e1lido host:port endere\u00e7o ipv4.\n\nExemplos do formato de especifica\u00e7\u00e3o de pontes s\u00e3o:\n\nPonte \u00fanica:\n127.0.0.1:8080\n\nPontes m\u00faltiplas:\n127.0.0.1:8080,128.5.6.8:224\n\nAs pontes foram restauradas para os padr\u00f5es.
dlg_credits_title=Cr\u00e9ditos $appname
dlg_credits_body=Para ter seu nome listado aqui e tamb\u00e9m merecer minha gratid\u00e3o por favor apoie o desenvolvimento do SelekTOR na plataforma GNU/Linux atrav\u00e9s do Patreon
table_popup_details=Detalhes
table_popup_begintest=Inicia ciclo de teste
table_popup_whois=WhoIs
tab_basic=B\u00e1sico
tab_advanced=Avan\u00e7ado
isoA1=Proxy an\u00f4nimo
isoA2=Provedor de sat\u00e9lite
isoO1=Outro pa\u00eds
isoU1=Desconhecido
chkbox_disablenotify=Desabilitar notifica\u00e7\u00f5es
ttip_disablenotify=Desabilita notifica\u00e7\u00f5es
dlg_libnotify_title=notify-send n\u00e3o encontrado
dlg_libnotify_body=Notifica\u00e7\u00f5es n\u00e3o funcionam sem o pacote libnotify-bin instalado.\n\nPara previnir que esse alerta apare\u00e7a novamente, instale o pacote requerido ou desabilite as notifica\u00e7\u00f5es em prefer\u00eancias.
ttip_hidemin=Aplica\u00e7\u00e3o ser\u00e1 oculta ao inv\u00e9s de minimizar
chkbox_hidemin=Ocultar ao inv\u00e9s de minimizar
label_autoselect=Modo de auto sele\u00e7\u00e3o:
menu_geoip=Atualizar GEOIP
chkbox_geocheck=Fazer verifica\u00e7\u00e3o trimestral de atualiza\u00e7\u00e3o do GEOIP
ttip_geocheck=SelekTOR ir\u00e1 mostrar o "Di\u00e1logo de atualiza\u00e7\u00e3o GEOIP" se sua base de dados GEOIP estiver desatualizada.
dlg_geo_title=Atualiza\u00e7\u00e3o de dados de geolocaliza\u00e7\u00e3o
dlg_geo_body=Os dados de geolocaliza\u00e7\u00e3o padr\u00e3o vindos do cliente Tor algumas vezes est\u00e3o desatualizados, voc\u00ea pode baixar os dados de geolocaliza\u00e7\u00e3o de Dazzleships.net. Eles s\u00e3o atualizados trimestralmente.\n\nVeja, se escolher n\u00e3o atualizar, alguns n\u00f3s podem estar atribu\u00eddos a pa\u00edses errados.\n\nOs dados nesses arquivos, assim como os do cliente Tor s\u00e3o fornecidos por Maxmind.com.
dload_status_contact=Obtendo dados GEOIP mais recentes
dload_status_failed=Download falhou
chkbox_viator=Download via Tor
ttip_patterntable=Para editar, d\u00ea um duplo click na c\u00e9lula da tabela que deseja modificar.
fileext_pattern=Arquivo zip do modelo selektor-3.13.73/src/resources/credits.txt 0000644 0001750 0001750 00000000031 13302030722 020021 0 ustar bannor bannor Alistair Neil (Developer) selektor-3.13.73/src/resources/license.txt 0000644 0001750 0001750 00000043254 13302030722 020024 0 ustar bannor bannor GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
selektor-3.13.73/src/resources/MessagesBundle_fr_CA.properties 0000644 0001750 0001750 00000044015 13302030722 023706 0 ustar bannor bannor # French CA, Default language file, provided by yahoe001
gpltransurl=https://fsffrance.org/gpl/gpl-fr.fr.html
appdesc=$appname $appver, Les n\u0153uds de sortie de Tor simplifi\u00e9s.
text_yes=Oui
text_no=Non
wintitle_prefs = Pr\u00e9f\u00e9rences de $appname
wintitle_about = \u00c0 propos de $appname
wintitle_patternedit = \u00c9diteur de mod\u00e8les $appname
wintitle_guardnodes=S\u00e9lection des n\u0153uds de garde
wintitle_tormonitor=Moniteur du client Tor
textfield_unknown=Inconnu
progstatus_initial=Initialisation...
progstatus_bridges=Mise en place du changement de ponts.
progstatus_generate=G\u00e9n\u00e9ration d'une nouvelle liste de n\u0153uds, veuillez patienter.
progstatus_cachedated=Les descripteurs en cache sont p\u00e9rim\u00e9s, ils seront renouvel\u00e9s.
progstatus_nonet=L'acc\u00e8s \u00e0 Internet n'est pas disponible.
progstatus_checkrecommended=Recherche des derniers n\u0153uds recommand\u00e9s.
progstatus_torfailretry=\u00c9chec lors du d\u00e9marrage de Tor, nouvel essai.
progstatus_nodefail=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9.
progstatus_nodefailretry=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9. Nouvel essai, veuillez patienter.
progstatus_nodefailtorchoose=Le n\u0153ud demand\u00e9 n'est pas joignable, Tor en choisira un, veuillez patienter.
progstatus_nodeactive3hop=Le circuit \u00e0 3 sauts vers le n\u0153ud de sortie $nodename est actif.
progstatus_nodeactive2hop=Le circuit \u00e0 2 sauts vers le n\u0153ud de sortie $nodename est actif.
progstatus_autoswitch=Auto-commutation vers le n\u0153ud
progstatus_manswitch=Commutation vers le n\u0153ud choisi manuellement
progstatus_waitfortor=Attente d'activation d'un n\u0153ud par Tor.
progstatus_switchtonode=Commutation vers le n\u0153ud $nodename.
progstatus_applychanges=Mise en place des nouvelles pr\u00e9f\u00e9rences.
circuit_status_creating_2hop=Cr\u00e9ation d'un circuit \u00e0 2 sauts.
circuit_status_creating_3hop=Cr\u00e9ation d'un circuit \u00e0 3 sauts.
circuit_status_testing=Test du circuit.
circuit_status_aborted=Test interrompu.
circuit_status_built=$1 circuit(s) construit(s).
circuit_status_passed=Circuit v\u00e9rifi\u00e9.
circuit_status_failed=\u00c9chec de circuit.
circuit_status_none=Aucun circuit n'est disponible.
circuit_status_noroute=Routeurs (tous) hors service.
combo_proxymode1=D\u00e9sactiv\u00e9
combo_proxymode2=Relais par mod\u00e8le
combo_proxymode3=Relayer tout le trafic
combo_loglev1=D\u00e9bogage
combo_loglev2=Infos
combo_loglev3=Avis
traymenu_proxymode1=Mode : pas de relais
traymenu_proxymode2=Mode : relais par mod\u00e8le
traymenu_proxymode3=Mode : relayer tout le trafic
traymenu_showgui=Cacher/Montrer l'IUG
traytool_guardnode=Noeud de garde
traytool_exitnode=Noeud de sortie
exittable_col1=N\u0153ud de sortie
exittable_col2=BP (MB\\s)
exittable_col3=D\u00e9lai (ms)
exittable_col4=\u00c9tat
exittable_col5=Favori
patterntable_col1=Description
patterntable_col2=Mod\u00e8le
patterntable_col3=Activ\u00e9
guardtable_col1=N\u0153ud de garde
guardtable_col2=Pays
guardtable_col3=BP (MB\\s)
guardtable_col4=De confiance
menu_menu=Menu
menu_prefs=Pr\u00e9f\u00e9rences
menu_quickadd=Ajout rapide d'un mod\u00e8le
menu_patternedit=\u00c9diteur de mod\u00e8les de relais
menu_export=Exporter les mod\u00e8les
menu_import=Import les mod\u00e8les
menu_quit=Quitter
menu_defaultpatterns=Mod\u00e8le par d\u00e9faut
menu_userpatterns=Mod\u00e8les de l'utilisateur
menu_help=Aide
menu_debuglog=Voir le journal de d\u00e9bogage
menu_helpcontents=Contenu de l'aide
menu_torcheck=V\u00e9rification de routine de Tor
menu_about=\u00c0 propos de
menu_license=Licence
menu_proxy=Mode de relais
menu_close=Fermer le menu
menu_tormanual=Manuel officiel de Tor
menu_tormonitor=Moniteur du client Tor
menu_leaktest=Test de fuite DNS
menu_credits=Cr\u00e9dits
label_activecountry=Pays actif :
label_proxymode=Mode de relais :
label_exitnode=N\u0153ud de sortie :
label_ip=IP :
label_torlatency=D\u00e9lai
label_fingerprint=Empreinte :
label_bandwidth=Bande passante
label_streams=Flux
label_stable=Stable
label_status=\u00c9tat :
label_listenport=Port d'\u00e9coute de Tor :
label_defaultproxy=Mandataire HTTP par d\u00e9faut :
label_bridgeaddress=Adresse de pont de Tor :
label_portranges=Plages de port pr\u00e9sentement actives, de $portmin \u00e0 $portmax
label_editcountry=Choisir un pays pour voir ses mod\u00e8les
label_quickadd_desc=Description :
label_quickadd_pattern=Mod\u00e8le :
label_threshold=D\u00e9lai seuil
label_middle=Milieu :
label_exit=Sortie :
label_nickname=Pseudonyme
label_ip=IP
label_country=Pays
label_guard_minimum=Vous pouvez soit ne choisir aucun n\u0153ud de garde au cas o\u00f9 le client Tor les choisit, soit choisir trois n\u0153uds de garde ou plus.
label_torlogging=Niveau de journalisation :
label_torargs=Arguments de d\u00e9marrage :
label_torsocks=Param\u00e8tres Socks :
label_diskoptions=Options du disque :
label_guardnode=Garde :
label_bridgenode=Pont :
label_donotproxy=Ne pas relayer :
button_details=D\u00e9tails
button_whois=Qui est
button_close=Fermer
button_apply=Appliquer
button_delete=Supprimer
button_addnew=Ajouter un nouveau
button_save=Enregistrer
button_cancel=Annuler
button_continue=Continuer
button_getbridges=Obtenir des ponts
button_mozillarestart=Red\u00e9marrer $browser
button_visitus=Rendez-nous visite
button_contactus=Contactez-nous
button_translations=Traductions non officielles
button_prefdefaults=R\u00e9initialiser aux leurs valeurs par d\u00e9faut.
button_setguards=D\u00e9finir les n\u0153uds de garde
button_details=D\u00e9tails de l'atlas
button_clearguards=Effacer les n\u0153uds de garde choisis
button_clearfavs=Effacer les favoris
button_support=Soutenir SelekTOR
button_patreon=Soutenir SelekTOR avec Patreon
panel_general=Param\u00e8tres g\u00e9n\u00e9raux
panel_network= Param\u00e8tres r\u00e9seau
panel_management=Param\u00e8tres de gestion des n\u0153uds
panel_info=Circuit actif
panel_torclientset=Param\u00e8tres du client Tor
panel_startupargs=Arguments de d\u00e9marrage
panel_stdout=Moniteur de sortie standard
chkbox_autoselect=Choix automatique du n\u0153ud
chkbox_autostart=D\u00e9marrage automatique de SelekTOR
chkbox_checkforupdates=V\u00e9rifier les mises \u00e0 jour au d\u00e9marrage
chkbox_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification
chkbox_autopatterns=Installer automatiquement les derniers mod\u00e8les.
chkbox_mozillawarn=D\u00e9sactiver l'avertissement de Mozilla
chkbox_recnodesonly=Utiliser les n\u0153uds recommand\u00e9s en mode par mod\u00e8les
chkbox_hidetotray=Minimiser au d\u00e9marrage
chkbox_minonclose=Minimiser plut\u00f4t que de quitter lors de la fermeture
chkbox_safesocks=Socks s\u00e9curitaire
chkbox_twohop=Utiliser des circuits \u00e0 2 sauts vers le n\u0153ud de sortie en mode par mod\u00e8les
chkbox_warnunsafesocks=Avertir si \u00e0 risque
chkbox_diskavoid=\u00c9viter les \u00e9critures sur le disque
chkbox_testsocks=Tester Socks
chkbox_safelog=Journalisation s\u00e9curitaire
chkbox_guardwarn1=Afficher une fen\u00eatre d'avertissement si un n\u0153ud de garde non sp\u00e9cifi\u00e9 est utilis\u00e9
chkbox_guardwarn2=Afficher une fen\u00eatre d'avertissement si moins de trois n\u0153uds de garde sont choisis
chkbox_securedelete=Effacement s\u00e9curis\u00e9 des caches de Tor lors de la fermeture
ttip_autostart=D\u00e9marrage automatique de SelekTOR lors du d\u00e9marrage/de la connexion
ttip_hidetotray=Minimiser au d\u00e9marrage
ttip_checkforupdates=SelekTOR v\u00e9rifiera les mises \u00e0 jour au d\u00e9marage
ttip_autoinstall=Les derniers mod\u00e8les seront r\u00e9cup\u00e9r\u00e9s de Dazzleships.Net
ttip_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification
ttip_mozillawarn=D\u00e9sactiver l'avertissement du navigateur Mozilla
ttip_listenport=Le port d'\u00e9coute du client Tor
ttip_defaultproxy=Tout trafic qui ne sera pas redirig\u00e9 par Tor sera redirig\u00e9 par ce mandataire HTTP
ttip_donotproxy=Toute URL contenant une de ces entr\u00e9es s\u00e9par\u00e9es par des virgules ne sera pas relay\u00e9e. L'on s'y connectera directement.
ttip_bridgeaddress=Pour contourner le blocage du FSI, ajouter une adresse de pont valide ici
ttip_forcedns=Forcer la recherche DNS par Tor, exige le red\u00e9marrage du navigateur
ttip_forcenode=Si coch\u00e9, le n\u0153ud sera activ\u00e9 quelque soit l'activit\u00e9 du n\u0153ud
ttip_recnodesonly=Les n\u0153uds recommand\u00e9s seront utilis\u00e9s en mode par mod\u00e8les
ttip_minonclose=L'application sera minimis\u00e9e au lieu de quitter \u00e0 la fermeture de la fermeture principale
ttip_threshold=D\u00e9lai seuil
ttip_safesocks=Activ\u00e9e, Tor rejettera les connexions logicielles qui utilisent des variantes dangereuses du protocole Socks.
ttip_warnunsafe=Activ\u00e9e, Tor avertira \u00e0 chaque fois qu'une requ\u00eate est re\u00e7ue contenant seulement une adresse IP au lieu d'un nom d'h\u00f4te.
ttip_testsocks=Activ\u00e9e Tor journalisera une entr\u00e9e de journal de niveau avis pour chaque connexion en indiquant si elle utilise un protocole Socks s\u00e9curitaire ou dangereux.
ttip_safelogging=Activ\u00e9e, Tor nettoiera les cha\u00eenes potentiellement sensibles des messages de journalisation.
ttip_avoiddisk=Activ\u00e9e, Tor essaiera d'\u00e9crire moins fr\u00e9quemment sur le disque que nous ne le ferions autrement.
ttip_extraargs= Arguments suppl\u00e9mentaires sp\u00e9cifi\u00e9s par l'utilisateur, voir le Manuel Tor.
ttip_combo_loglevel=Niveau de journalisation de Tor.
ttip_twohop=Utiliser des circuits \u00e0 2 sauts au lieu des 3 par d\u00e9faut de Tor. R\u00e9duit le d\u00e9lai de transit mais affaiblit l'anonymat.
ttip_resetbasicprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences de base \u00e0 leurs valeurs par d\u00e9faut.
ttip_resetadvprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences avanc\u00e9es \u00e0 leurs valeurs par d\u00e9faut.
ttip_guardwarn1=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant qu'un n\u0153ud de garde non sp\u00e9cifi\u00e9 est actif.
ttip_guardwarn2=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant que trop peu de n\u0153uds de garde sont choisis
ttip_clearguards=Effacer les n\u0153uds de garde choisis.
ttip_securedelete=Activ\u00e9, les caches de Tor seront \u00e9cras\u00e9es par des z\u00e9ros, puis supprim\u00e9es
dlg_update_title=Mise \u00e0 jour disponible.
dlg_update_body=$version est maintenant disponible au t\u00e9l\u00e9chargement.
dlg_restoreproxy_title=Param\u00e8tres originaux du mandataire
dlg_restoreproxy_body=Choisir Continuer pour restaurer les param\u00e8tres du mandataire aux valeurs par d\u00e9faut avant l'installation de SelekTOR.
dlg_resetproxy_title=Param\u00e8tres par d\u00e9faut du mandataire
dlg_resetproxy_body=Choisir Continuer pour r\u00e9initialiser les param\u00e8tres du serveur mandataire \u00e0 leurs valeurs syst\u00e8me par d\u00e9faut.
dlg_gsetting_title=Gsettings introuvable
dlg_gsetting_body=$appname ne peux pas fonctionner correctement sans que l'ex\u00e9cutable binary soit install\u00e9. Dans certaines distributions il peut \u00eatre trouv\u00e9 dans le paquet libglib2.0-bin.
dlg_torclient_title=Client TOR introuvable
dlg_torclient_body=$appname ne peux pas fonctionner sans que le client Tor ne soit Install\u00e9. Veuillez installer les paquets tor et tor-geoipdb pour votre distribution.
dlg_mozillarestart_title=Avertissement\u00a0: Le navigateur $browser est actif.
dlg_mozillarestart_body=$appname a d\u00e9tect\u00e9 que le navigateur $browser tourne d\u00e9j\u00e0.\nUn red\u00e9marrage du navigateur est exig\u00e9 pour permettre le fonctionnement de $appname.\n\nSi vous choisissez de red\u00e9marrer $browser, tous les onglets actuellement ouverts seront restaur\u00e9s au red\u00e9marrage de $browser, l'option \u00ab Afficher les dernier onglets et fen\u00eatres utilis\u00e9s \u00bb, doit \u00eatre choisie dans les options de $browser.\n\nVous pouvez d\u00e9sactiver cet avertissement du navigateur dans les Pr\u00e9f\u00e9rences de $appname.
dlg_license_title=Licence de $appname
dlg_exportuser_title=Exporter les mod\u00e8les d'utilisateur
dlg_exportuser_body=Aucun mod\u00e8le cr\u00e9\u00e9 par l'utilisateur n'a \u00e9t\u00e9 trouv\u00e9.\n\nUtilisez l'\u00e9diteur de mode pour ajouter vos propres mod\u00e8les
dlg_exportdefault_title=Exporter les mod\u00e8les par d\u00e9faut
dlg_exportdefault_body=Aucun mod\u00e8le par d\u00e9faut n'a \u00e9t\u00e9 trouv\u00e9.
dlg_saveuser_title=Enregistrer les modes de l'utilisateur
dlg_savedefault_title=Enregistrer les mod\u00e8les par d\u00e9faut
dlg_import_title=Importer le fichier des mod\u00e8les
dlg_import_success_title=Mod\u00e8les import\u00e9s
dlg_import_success_body=Les mod\u00e8les ont \u00e9t\u00e9 import\u00e9s avec succ\u00e8s et sont maintenant actifs.
dlg_import_fail_title=\u00c9chec lors l'importation
dlg_import_fail_body=Les mod\u00e8les n'ont pas \u00e9t\u00e9 import\u00e9s correctement.
dlg_whois_title=Qui est $ipaddress
dlg_whois_body=Veuillez patienter pendant que j'essaie de r\u00e9cup\u00e9rer les donn\u00e9s de WhoIs...
dlg_whois_fail=D\u00e9sol\u00e9, impossible de r\u00e9cup\u00e9rer les informations de Whois.
dlg_toold_body=Le client Tor actuellement install\u00e9 est trop ancien, Tor 0.2.7.6 ou ult\u00e9rieure est exig\u00e9e.\n\nLes utilisateurs de Linux devraient visiter la page suivante \nhttps://www.torproject.org/download/download-unix.html.en\npour obtenir le dernier client Tor.
dlg_error_title=Erreur de d\u00e9marrage
dlg_error_body=Cette erreur est fatale et $appname se fermera.
dlg_quickadd_title=Ajouter un mod\u00e8le
dlg_nodelistfail_body=La g\u00e9n\u00e9ration de la liste des n\u0153uds a \u00e9chou\u00e9 \u00e0 cause d'erreurs de GEOIP.
dlg_patterneditsave_title=Enregistrer les mod\u00e8les actuels
dlg_patterneditsave_body=Les mod\u00e8les actuels ont \u00e9t\u00e9 modifi\u00e9s.\n\nSi vous d\u00e9sirez les enregistrer, cliquez sur Continuer, autrement cliquez sur Annuler.
dlg_instancefail_title=\u00c9chec d\u00fb \u00e0 plusieurs instances
dlg_instancefail_body=Une instance de $appname est d\u00e9j\u00e0 en cours et une seule peut \u00eatre ex\u00e9cut\u00e9e \u00e0 la fois.\n\nQuittez l'instance existante de $appname ou dans le cas d'un plantage de $appname, red\u00e9marrez X en vous d\u00e9connectant et en vous connectant de nouveau.
dlg_guardwarn_title=Avertissement de n\u0153ud de garde
dlg_guardwarn_body=Un n\u0153ud de garde ne se trouvant pas dans votre liste de n\u0153uds de garde sp\u00e9cifi\u00e9e a \u00e9t\u00e9 utilis\u00e9.\nCeci provient probablement du fait que vos n\u0153uds de garde s\u00e9lectionn\u00e9s ne sont plus joignables et par cons\u00e9quent le client Tor a assign\u00e9 son propre n\u0153ud de garde.\n\nVous devriez v\u00e9rifier vos n\u0153uds de garde actuellement d\u00e9finis pour voir s'ils sont toujours disponibles, ou en choisir de nouveaux.
dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus.dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus.
dlg_bridgerr_title=\u00c9chec de validation de l'adresse de pont
dlg_bridgerr_body=Les informations de pont fournies contiennent des erreurs de validation et ne se conforment pas \u00e0 un format d'adresse IPv4 valide h\u00f4te:port\n\nVoici des exemples de format de sp\u00e9cification de ponts :\n\nPont simple : \n127.0.0.1:8080\n\nPonts multiples : \n127.0.0.1:8080,128.5.6.8:224\n\nLes ponts ont \u00e9t\u00e9 r\u00e9initialis\u00e9s \u00e0 leurs valeurs par d\u00e9faut.
dlg_credits_title=Cr\u00e9dits de $appname
dlg_credits_body=Afin que votre nom apparaissent ici et pour aussi m\u00e9riter ma gratitude, veuillez envisager de soutenir le d\u00e9veloppement futur de SelekTOR sous Linux avec Patreon.
table_popup_details=D\u00e9tails
table_popup_whois=Qui est
table_popup_begintest=Commencer le cycle de test
tab_basic=De base
tab_advanced=Avanc\u00e9
isoA1=Mandataire annonyme
isoO1=autre Pays
isoU1=Inconnu
chkbox_disablenotify=D\u00e9sactiver les notifications du bureau
ttip_disablenotify=D\u00e9sactiver les notifications du bureau
dlg_libnotify_title=notify-send est introuvable
dlg_libnotify_body=Les notifications de bureau ne fonctionneront pas sans que le paquet libnotify-bin ne soit install\u00e9.\n\nPour emp\u00eacher que cette fen\u00eatre apparaissent de nouveau installez le paquet exig\u00e9 ou d\u00e9sactivez les notifications de bureau dans les pr\u00e9f\u00e9rences.
ttip_hidemin=L'appli sera cach\u00e9e au lieu d'\u00eatre minimis\u00e9e.
chkbox_hidemin=Cacher au lieu de minimiser
label_autoselect= Mode de s\u00e9lection automatique :
menu_geoip=Mettre GEOIP \u00e0 jour
chkbox_geocheck=V\u00e9rification trimestrielle des mises \u00e0 jour GEOIP
ttip_geocheck=SelekTOR affichera la \u00abfen\u00eatre de mise \u00e0 jour GEOIP \u00bbsi votre base de donn\u00e9es GEOIP est p\u00e9rim\u00e9e.
dlg_geo_title=Mise \u00e0 jour des donn\u00e9es de g\u00e9olocalisation
dlg_geo_body=Les donn\u00e9es de g\u00e9olocalisation fournies par Tor sont parfois p\u00e9rim\u00e9es. Vous pouvez demander \u00e0 SelekTOR de t\u00e9l\u00e9charger ses propres fichiers de donn\u00e9es de g\u00e9olocalisation de Dazzleships.net et de les utiliser. Ils sont mis \u00e0 jour trimestriellement.\n\nVeuillez noter que si vous choisissez de ne pas mettre \u00e0 jour, certains n\u0153uds pourraient \u00eatre assign\u00e9s au mauvais pays.\n\nLes donn\u00e9es des ces fichiers, comme les donn\u00e9es fournies par le client Tor, sont fournies par Maxmind.com.
dload_status_contact=R\u00e9cup\u00e9ration des derni\u00e8res donn\u00e9es GEOIP
dload_status_failed=\u00c9chec de t\u00e9l\u00e9chargement
chkbox_viator=T\u00e9l\u00e9charger par Tor
ttip_patterntable=\u00c9dition en ligne prise en charge, un double-clic gauche lance l'\u00e9dition d'une cellule d'un tableau.
fileext_pattern=Fichiers de mod\u00e8les zipp\u00e9 selektor-3.13.73/src/resources/MessagesBundle_fr_LU.properties 0000644 0001750 0001750 00000044015 13302030722 023743 0 ustar bannor bannor # French CA, Default language file, provided by yahoe001
gpltransurl=https://fsffrance.org/gpl/gpl-fr.fr.html
appdesc=$appname $appver, Les n\u0153uds de sortie de Tor simplifi\u00e9s.
text_yes=Oui
text_no=Non
wintitle_prefs = Pr\u00e9f\u00e9rences de $appname
wintitle_about = \u00c0 propos de $appname
wintitle_patternedit = \u00c9diteur de mod\u00e8les $appname
wintitle_guardnodes=S\u00e9lection des n\u0153uds de garde
wintitle_tormonitor=Moniteur du client Tor
textfield_unknown=Inconnu
progstatus_initial=Initialisation...
progstatus_bridges=Mise en place du changement de ponts.
progstatus_generate=G\u00e9n\u00e9ration d'une nouvelle liste de n\u0153uds, veuillez patienter.
progstatus_cachedated=Les descripteurs en cache sont p\u00e9rim\u00e9s, ils seront renouvel\u00e9s.
progstatus_nonet=L'acc\u00e8s \u00e0 Internet n'est pas disponible.
progstatus_checkrecommended=Recherche des derniers n\u0153uds recommand\u00e9s.
progstatus_torfailretry=\u00c9chec lors du d\u00e9marrage de Tor, nouvel essai.
progstatus_nodefail=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9.
progstatus_nodefailretry=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9. Nouvel essai, veuillez patienter.
progstatus_nodefailtorchoose=Le n\u0153ud demand\u00e9 n'est pas joignable, Tor en choisira un, veuillez patienter.
progstatus_nodeactive3hop=Le circuit \u00e0 3 sauts vers le n\u0153ud de sortie $nodename est actif.
progstatus_nodeactive2hop=Le circuit \u00e0 2 sauts vers le n\u0153ud de sortie $nodename est actif.
progstatus_autoswitch=Auto-commutation vers le n\u0153ud
progstatus_manswitch=Commutation vers le n\u0153ud choisi manuellement
progstatus_waitfortor=Attente d'activation d'un n\u0153ud par Tor.
progstatus_switchtonode=Commutation vers le n\u0153ud $nodename.
progstatus_applychanges=Mise en place des nouvelles pr\u00e9f\u00e9rences.
circuit_status_creating_2hop=Cr\u00e9ation d'un circuit \u00e0 2 sauts.
circuit_status_creating_3hop=Cr\u00e9ation d'un circuit \u00e0 3 sauts.
circuit_status_testing=Test du circuit.
circuit_status_aborted=Test interrompu.
circuit_status_built=$1 circuit(s) construit(s).
circuit_status_passed=Circuit v\u00e9rifi\u00e9.
circuit_status_failed=\u00c9chec de circuit.
circuit_status_none=Aucun circuit n'est disponible.
circuit_status_noroute=Routeurs (tous) hors service.
combo_proxymode1=D\u00e9sactiv\u00e9
combo_proxymode2=Relais par mod\u00e8le
combo_proxymode3=Relayer tout le trafic
combo_loglev1=D\u00e9bogage
combo_loglev2=Infos
combo_loglev3=Avis
traymenu_proxymode1=Mode : pas de relais
traymenu_proxymode2=Mode : relais par mod\u00e8le
traymenu_proxymode3=Mode : relayer tout le trafic
traymenu_showgui=Cacher/Montrer l'IUG
traytool_guardnode=Noeud de garde
traytool_exitnode=Noeud de sortie
exittable_col1=N\u0153ud de sortie
exittable_col2=BP (MB\\s)
exittable_col3=D\u00e9lai (ms)
exittable_col4=\u00c9tat
exittable_col5=Favori
patterntable_col1=Description
patterntable_col2=Mod\u00e8le
patterntable_col3=Activ\u00e9
guardtable_col1=N\u0153ud de garde
guardtable_col2=Pays
guardtable_col3=BP (MB\\s)
guardtable_col4=De confiance
menu_menu=Menu
menu_prefs=Pr\u00e9f\u00e9rences
menu_quickadd=Ajout rapide d'un mod\u00e8le
menu_patternedit=\u00c9diteur de mod\u00e8les de relais
menu_export=Exporter les mod\u00e8les
menu_import=Import les mod\u00e8les
menu_quit=Quitter
menu_defaultpatterns=Mod\u00e8le par d\u00e9faut
menu_userpatterns=Mod\u00e8les de l'utilisateur
menu_help=Aide
menu_debuglog=Voir le journal de d\u00e9bogage
menu_helpcontents=Contenu de l'aide
menu_torcheck=V\u00e9rification de routine de Tor
menu_about=\u00c0 propos de
menu_license=Licence
menu_proxy=Mode de relais
menu_close=Fermer le menu
menu_tormanual=Manuel officiel de Tor
menu_tormonitor=Moniteur du client Tor
menu_leaktest=Test de fuite DNS
menu_credits=Cr\u00e9dits
label_activecountry=Pays actif :
label_proxymode=Mode de relais :
label_exitnode=N\u0153ud de sortie :
label_ip=IP :
label_torlatency=D\u00e9lai
label_fingerprint=Empreinte :
label_bandwidth=Bande passante
label_streams=Flux
label_stable=Stable
label_status=\u00c9tat :
label_listenport=Port d'\u00e9coute de Tor :
label_defaultproxy=Mandataire HTTP par d\u00e9faut :
label_bridgeaddress=Adresse de pont de Tor :
label_portranges=Plages de port pr\u00e9sentement actives, de $portmin \u00e0 $portmax
label_editcountry=Choisir un pays pour voir ses mod\u00e8les
label_quickadd_desc=Description :
label_quickadd_pattern=Mod\u00e8le :
label_threshold=D\u00e9lai seuil
label_middle=Milieu :
label_exit=Sortie :
label_nickname=Pseudonyme
label_ip=IP
label_country=Pays
label_guard_minimum=Vous pouvez soit ne choisir aucun n\u0153ud de garde au cas o\u00f9 le client Tor les choisit, soit choisir trois n\u0153uds de garde ou plus.
label_torlogging=Niveau de journalisation :
label_torargs=Arguments de d\u00e9marrage :
label_torsocks=Param\u00e8tres Socks :
label_diskoptions=Options du disque :
label_guardnode=Garde :
label_bridgenode=Pont :
label_donotproxy=Ne pas relayer :
button_details=D\u00e9tails
button_whois=Qui est
button_close=Fermer
button_apply=Appliquer
button_delete=Supprimer
button_addnew=Ajouter un nouveau
button_save=Enregistrer
button_cancel=Annuler
button_continue=Continuer
button_getbridges=Obtenir des ponts
button_mozillarestart=Red\u00e9marrer $browser
button_visitus=Rendez-nous visite
button_contactus=Contactez-nous
button_translations=Traductions non officielles
button_prefdefaults=R\u00e9initialiser aux leurs valeurs par d\u00e9faut.
button_setguards=D\u00e9finir les n\u0153uds de garde
button_details=D\u00e9tails de l'atlas
button_clearguards=Effacer les n\u0153uds de garde choisis
button_clearfavs=Effacer les favoris
button_support=Soutenir SelekTOR
button_patreon=Soutenir SelekTOR avec Patreon
panel_general=Param\u00e8tres g\u00e9n\u00e9raux
panel_network= Param\u00e8tres r\u00e9seau
panel_management=Param\u00e8tres de gestion des n\u0153uds
panel_info=Circuit actif
panel_torclientset=Param\u00e8tres du client Tor
panel_startupargs=Arguments de d\u00e9marrage
panel_stdout=Moniteur de sortie standard
chkbox_autoselect=Choix automatique du n\u0153ud
chkbox_autostart=D\u00e9marrage automatique de SelekTOR
chkbox_checkforupdates=V\u00e9rifier les mises \u00e0 jour au d\u00e9marrage
chkbox_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification
chkbox_autopatterns=Installer automatiquement les derniers mod\u00e8les.
chkbox_mozillawarn=D\u00e9sactiver l'avertissement de Mozilla
chkbox_recnodesonly=Utiliser les n\u0153uds recommand\u00e9s en mode par mod\u00e8les
chkbox_hidetotray=Minimiser au d\u00e9marrage
chkbox_minonclose=Minimiser plut\u00f4t que de quitter lors de la fermeture
chkbox_safesocks=Socks s\u00e9curitaire
chkbox_twohop=Utiliser des circuits \u00e0 2 sauts vers le n\u0153ud de sortie en mode par mod\u00e8les
chkbox_warnunsafesocks=Avertir si \u00e0 risque
chkbox_diskavoid=\u00c9viter les \u00e9critures sur le disque
chkbox_testsocks=Tester Socks
chkbox_safelog=Journalisation s\u00e9curitaire
chkbox_guardwarn1=Afficher une fen\u00eatre d'avertissement si un n\u0153ud de garde non sp\u00e9cifi\u00e9 est utilis\u00e9
chkbox_guardwarn2=Afficher une fen\u00eatre d'avertissement si moins de trois n\u0153uds de garde sont choisis
chkbox_securedelete=Effacement s\u00e9curis\u00e9 des caches de Tor lors de la fermeture
ttip_autostart=D\u00e9marrage automatique de SelekTOR lors du d\u00e9marrage/de la connexion
ttip_hidetotray=Minimiser au d\u00e9marrage
ttip_checkforupdates=SelekTOR v\u00e9rifiera les mises \u00e0 jour au d\u00e9marage
ttip_autoinstall=Les derniers mod\u00e8les seront r\u00e9cup\u00e9r\u00e9s de Dazzleships.Net
ttip_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification
ttip_mozillawarn=D\u00e9sactiver l'avertissement du navigateur Mozilla
ttip_listenport=Le port d'\u00e9coute du client Tor
ttip_defaultproxy=Tout trafic qui ne sera pas redirig\u00e9 par Tor sera redirig\u00e9 par ce mandataire HTTP
ttip_donotproxy=Toute URL contenant une de ces entr\u00e9es s\u00e9par\u00e9es par des virgules ne sera pas relay\u00e9e. L'on s'y connectera directement.
ttip_bridgeaddress=Pour contourner le blocage du FSI, ajouter une adresse de pont valide ici
ttip_forcedns=Forcer la recherche DNS par Tor, exige le red\u00e9marrage du navigateur
ttip_forcenode=Si coch\u00e9, le n\u0153ud sera activ\u00e9 quelque soit l'activit\u00e9 du n\u0153ud
ttip_recnodesonly=Les n\u0153uds recommand\u00e9s seront utilis\u00e9s en mode par mod\u00e8les
ttip_minonclose=L'application sera minimis\u00e9e au lieu de quitter \u00e0 la fermeture de la fermeture principale
ttip_threshold=D\u00e9lai seuil
ttip_safesocks=Activ\u00e9e, Tor rejettera les connexions logicielles qui utilisent des variantes dangereuses du protocole Socks.
ttip_warnunsafe=Activ\u00e9e, Tor avertira \u00e0 chaque fois qu'une requ\u00eate est re\u00e7ue contenant seulement une adresse IP au lieu d'un nom d'h\u00f4te.
ttip_testsocks=Activ\u00e9e Tor journalisera une entr\u00e9e de journal de niveau avis pour chaque connexion en indiquant si elle utilise un protocole Socks s\u00e9curitaire ou dangereux.
ttip_safelogging=Activ\u00e9e, Tor nettoiera les cha\u00eenes potentiellement sensibles des messages de journalisation.
ttip_avoiddisk=Activ\u00e9e, Tor essaiera d'\u00e9crire moins fr\u00e9quemment sur le disque que nous ne le ferions autrement.
ttip_extraargs= Arguments suppl\u00e9mentaires sp\u00e9cifi\u00e9s par l'utilisateur, voir le Manuel Tor.
ttip_combo_loglevel=Niveau de journalisation de Tor.
ttip_twohop=Utiliser des circuits \u00e0 2 sauts au lieu des 3 par d\u00e9faut de Tor. R\u00e9duit le d\u00e9lai de transit mais affaiblit l'anonymat.
ttip_resetbasicprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences de base \u00e0 leurs valeurs par d\u00e9faut.
ttip_resetadvprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences avanc\u00e9es \u00e0 leurs valeurs par d\u00e9faut.
ttip_guardwarn1=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant qu'un n\u0153ud de garde non sp\u00e9cifi\u00e9 est actif.
ttip_guardwarn2=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant que trop peu de n\u0153uds de garde sont choisis
ttip_clearguards=Effacer les n\u0153uds de garde choisis.
ttip_securedelete=Activ\u00e9, les caches de Tor seront \u00e9cras\u00e9es par des z\u00e9ros, puis supprim\u00e9es
dlg_update_title=Mise \u00e0 jour disponible.
dlg_update_body=$version est maintenant disponible au t\u00e9l\u00e9chargement.
dlg_restoreproxy_title=Param\u00e8tres originaux du mandataire
dlg_restoreproxy_body=Choisir Continuer pour restaurer les param\u00e8tres du mandataire aux valeurs par d\u00e9faut avant l'installation de SelekTOR.
dlg_resetproxy_title=Param\u00e8tres par d\u00e9faut du mandataire
dlg_resetproxy_body=Choisir Continuer pour r\u00e9initialiser les param\u00e8tres du serveur mandataire \u00e0 leurs valeurs syst\u00e8me par d\u00e9faut.
dlg_gsetting_title=Gsettings introuvable
dlg_gsetting_body=$appname ne peux pas fonctionner correctement sans que l'ex\u00e9cutable binary soit install\u00e9. Dans certaines distributions il peut \u00eatre trouv\u00e9 dans le paquet libglib2.0-bin.
dlg_torclient_title=Client TOR introuvable
dlg_torclient_body=$appname ne peux pas fonctionner sans que le client Tor ne soit Install\u00e9. Veuillez installer les paquets tor et tor-geoipdb pour votre distribution.
dlg_mozillarestart_title=Avertissement\u00a0: Le navigateur $browser est actif.
dlg_mozillarestart_body=$appname a d\u00e9tect\u00e9 que le navigateur $browser tourne d\u00e9j\u00e0.\nUn red\u00e9marrage du navigateur est exig\u00e9 pour permettre le fonctionnement de $appname.\n\nSi vous choisissez de red\u00e9marrer $browser, tous les onglets actuellement ouverts seront restaur\u00e9s au red\u00e9marrage de $browser, l'option \u00ab Afficher les dernier onglets et fen\u00eatres utilis\u00e9s \u00bb, doit \u00eatre choisie dans les options de $browser.\n\nVous pouvez d\u00e9sactiver cet avertissement du navigateur dans les Pr\u00e9f\u00e9rences de $appname.
dlg_license_title=Licence de $appname
dlg_exportuser_title=Exporter les mod\u00e8les d'utilisateur
dlg_exportuser_body=Aucun mod\u00e8le cr\u00e9\u00e9 par l'utilisateur n'a \u00e9t\u00e9 trouv\u00e9.\n\nUtilisez l'\u00e9diteur de mode pour ajouter vos propres mod\u00e8les
dlg_exportdefault_title=Exporter les mod\u00e8les par d\u00e9faut
dlg_exportdefault_body=Aucun mod\u00e8le par d\u00e9faut n'a \u00e9t\u00e9 trouv\u00e9.
dlg_saveuser_title=Enregistrer les modes de l'utilisateur
dlg_savedefault_title=Enregistrer les mod\u00e8les par d\u00e9faut
dlg_import_title=Importer le fichier des mod\u00e8les
dlg_import_success_title=Mod\u00e8les import\u00e9s
dlg_import_success_body=Les mod\u00e8les ont \u00e9t\u00e9 import\u00e9s avec succ\u00e8s et sont maintenant actifs.
dlg_import_fail_title=\u00c9chec lors l'importation
dlg_import_fail_body=Les mod\u00e8les n'ont pas \u00e9t\u00e9 import\u00e9s correctement.
dlg_whois_title=Qui est $ipaddress
dlg_whois_body=Veuillez patienter pendant que j'essaie de r\u00e9cup\u00e9rer les donn\u00e9s de WhoIs...
dlg_whois_fail=D\u00e9sol\u00e9, impossible de r\u00e9cup\u00e9rer les informations de Whois.
dlg_toold_body=Le client Tor actuellement install\u00e9 est trop ancien, Tor 0.2.7.6 ou ult\u00e9rieure est exig\u00e9e.\n\nLes utilisateurs de Linux devraient visiter la page suivante \nhttps://www.torproject.org/download/download-unix.html.en\npour obtenir le dernier client Tor.
dlg_error_title=Erreur de d\u00e9marrage
dlg_error_body=Cette erreur est fatale et $appname se fermera.
dlg_quickadd_title=Ajouter un mod\u00e8le
dlg_nodelistfail_body=La g\u00e9n\u00e9ration de la liste des n\u0153uds a \u00e9chou\u00e9 \u00e0 cause d'erreurs de GEOIP.
dlg_patterneditsave_title=Enregistrer les mod\u00e8les actuels
dlg_patterneditsave_body=Les mod\u00e8les actuels ont \u00e9t\u00e9 modifi\u00e9s.\n\nSi vous d\u00e9sirez les enregistrer, cliquez sur Continuer, autrement cliquez sur Annuler.
dlg_instancefail_title=\u00c9chec d\u00fb \u00e0 plusieurs instances
dlg_instancefail_body=Une instance de $appname est d\u00e9j\u00e0 en cours et une seule peut \u00eatre ex\u00e9cut\u00e9e \u00e0 la fois.\n\nQuittez l'instance existante de $appname ou dans le cas d'un plantage de $appname, red\u00e9marrez X en vous d\u00e9connectant et en vous connectant de nouveau.
dlg_guardwarn_title=Avertissement de n\u0153ud de garde
dlg_guardwarn_body=Un n\u0153ud de garde ne se trouvant pas dans votre liste de n\u0153uds de garde sp\u00e9cifi\u00e9e a \u00e9t\u00e9 utilis\u00e9.\nCeci provient probablement du fait que vos n\u0153uds de garde s\u00e9lectionn\u00e9s ne sont plus joignables et par cons\u00e9quent le client Tor a assign\u00e9 son propre n\u0153ud de garde.\n\nVous devriez v\u00e9rifier vos n\u0153uds de garde actuellement d\u00e9finis pour voir s'ils sont toujours disponibles, ou en choisir de nouveaux.
dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus.dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus.
dlg_bridgerr_title=\u00c9chec de validation de l'adresse de pont
dlg_bridgerr_body=Les informations de pont fournies contiennent des erreurs de validation et ne se conforment pas \u00e0 un format d'adresse IPv4 valide h\u00f4te:port\n\nVoici des exemples de format de sp\u00e9cification de ponts :\n\nPont simple : \n127.0.0.1:8080\n\nPonts multiples : \n127.0.0.1:8080,128.5.6.8:224\n\nLes ponts ont \u00e9t\u00e9 r\u00e9initialis\u00e9s \u00e0 leurs valeurs par d\u00e9faut.
dlg_credits_title=Cr\u00e9dits de $appname
dlg_credits_body=Afin que votre nom apparaissent ici et pour aussi m\u00e9riter ma gratitude, veuillez envisager de soutenir le d\u00e9veloppement futur de SelekTOR sous Linux avec Patreon.
table_popup_details=D\u00e9tails
table_popup_whois=Qui est
table_popup_begintest=Commencer le cycle de test
tab_basic=De base
tab_advanced=Avanc\u00e9
isoA1=Mandataire annonyme
isoO1=autre Pays
isoU1=Inconnu
chkbox_disablenotify=D\u00e9sactiver les notifications du bureau
ttip_disablenotify=D\u00e9sactiver les notifications du bureau
dlg_libnotify_title=notify-send est introuvable
dlg_libnotify_body=Les notifications de bureau ne fonctionneront pas sans que le paquet libnotify-bin ne soit install\u00e9.\n\nPour emp\u00eacher que cette fen\u00eatre apparaissent de nouveau installez le paquet exig\u00e9 ou d\u00e9sactivez les notifications de bureau dans les pr\u00e9f\u00e9rences.
ttip_hidemin=L'appli sera cach\u00e9e au lieu d'\u00eatre minimis\u00e9e.
chkbox_hidemin=Cacher au lieu de minimiser
label_autoselect= Mode de s\u00e9lection automatique :
menu_geoip=Mettre GEOIP \u00e0 jour
chkbox_geocheck=V\u00e9rification trimestrielle des mises \u00e0 jour GEOIP
ttip_geocheck=SelekTOR affichera la \u00abfen\u00eatre de mise \u00e0 jour GEOIP \u00bbsi votre base de donn\u00e9es GEOIP est p\u00e9rim\u00e9e.
dlg_geo_title=Mise \u00e0 jour des donn\u00e9es de g\u00e9olocalisation
dlg_geo_body=Les donn\u00e9es de g\u00e9olocalisation fournies par Tor sont parfois p\u00e9rim\u00e9es. Vous pouvez demander \u00e0 SelekTOR de t\u00e9l\u00e9charger ses propres fichiers de donn\u00e9es de g\u00e9olocalisation de Dazzleships.net et de les utiliser. Ils sont mis \u00e0 jour trimestriellement.\n\nVeuillez noter que si vous choisissez de ne pas mettre \u00e0 jour, certains n\u0153uds pourraient \u00eatre assign\u00e9s au mauvais pays.\n\nLes donn\u00e9es des ces fichiers, comme les donn\u00e9es fournies par le client Tor, sont fournies par Maxmind.com.
dload_status_contact=R\u00e9cup\u00e9ration des derni\u00e8res donn\u00e9es GEOIP
dload_status_failed=\u00c9chec de t\u00e9l\u00e9chargement
chkbox_viator=T\u00e9l\u00e9charger par Tor
ttip_patterntable=\u00c9dition en ligne prise en charge, un double-clic gauche lance l'\u00e9dition d'une cellule d'un tableau.
fileext_pattern=Fichiers de mod\u00e8les zipp\u00e9 selektor-3.13.73/src/resources/MessagesBundle_fr_CH.properties 0000644 0001750 0001750 00000044015 13302030722 023715 0 ustar bannor bannor # French CA, Default language file, provided by yahoe001
gpltransurl=https://fsffrance.org/gpl/gpl-fr.fr.html
appdesc=$appname $appver, Les n\u0153uds de sortie de Tor simplifi\u00e9s.
text_yes=Oui
text_no=Non
wintitle_prefs = Pr\u00e9f\u00e9rences de $appname
wintitle_about = \u00c0 propos de $appname
wintitle_patternedit = \u00c9diteur de mod\u00e8les $appname
wintitle_guardnodes=S\u00e9lection des n\u0153uds de garde
wintitle_tormonitor=Moniteur du client Tor
textfield_unknown=Inconnu
progstatus_initial=Initialisation...
progstatus_bridges=Mise en place du changement de ponts.
progstatus_generate=G\u00e9n\u00e9ration d'une nouvelle liste de n\u0153uds, veuillez patienter.
progstatus_cachedated=Les descripteurs en cache sont p\u00e9rim\u00e9s, ils seront renouvel\u00e9s.
progstatus_nonet=L'acc\u00e8s \u00e0 Internet n'est pas disponible.
progstatus_checkrecommended=Recherche des derniers n\u0153uds recommand\u00e9s.
progstatus_torfailretry=\u00c9chec lors du d\u00e9marrage de Tor, nouvel essai.
progstatus_nodefail=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9.
progstatus_nodefailretry=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9. Nouvel essai, veuillez patienter.
progstatus_nodefailtorchoose=Le n\u0153ud demand\u00e9 n'est pas joignable, Tor en choisira un, veuillez patienter.
progstatus_nodeactive3hop=Le circuit \u00e0 3 sauts vers le n\u0153ud de sortie $nodename est actif.
progstatus_nodeactive2hop=Le circuit \u00e0 2 sauts vers le n\u0153ud de sortie $nodename est actif.
progstatus_autoswitch=Auto-commutation vers le n\u0153ud
progstatus_manswitch=Commutation vers le n\u0153ud choisi manuellement
progstatus_waitfortor=Attente d'activation d'un n\u0153ud par Tor.
progstatus_switchtonode=Commutation vers le n\u0153ud $nodename.
progstatus_applychanges=Mise en place des nouvelles pr\u00e9f\u00e9rences.
circuit_status_creating_2hop=Cr\u00e9ation d'un circuit \u00e0 2 sauts.
circuit_status_creating_3hop=Cr\u00e9ation d'un circuit \u00e0 3 sauts.
circuit_status_testing=Test du circuit.
circuit_status_aborted=Test interrompu.
circuit_status_built=$1 circuit(s) construit(s).
circuit_status_passed=Circuit v\u00e9rifi\u00e9.
circuit_status_failed=\u00c9chec de circuit.
circuit_status_none=Aucun circuit n'est disponible.
circuit_status_noroute=Routeurs (tous) hors service.
combo_proxymode1=D\u00e9sactiv\u00e9
combo_proxymode2=Relais par mod\u00e8le
combo_proxymode3=Relayer tout le trafic
combo_loglev1=D\u00e9bogage
combo_loglev2=Infos
combo_loglev3=Avis
traymenu_proxymode1=Mode : pas de relais
traymenu_proxymode2=Mode : relais par mod\u00e8le
traymenu_proxymode3=Mode : relayer tout le trafic
traymenu_showgui=Cacher/Montrer l'IUG
traytool_guardnode=Noeud de garde
traytool_exitnode=Noeud de sortie
exittable_col1=N\u0153ud de sortie
exittable_col2=BP (MB\\s)
exittable_col3=D\u00e9lai (ms)
exittable_col4=\u00c9tat
exittable_col5=Favori
patterntable_col1=Description
patterntable_col2=Mod\u00e8le
patterntable_col3=Activ\u00e9
guardtable_col1=N\u0153ud de garde
guardtable_col2=Pays
guardtable_col3=BP (MB\\s)
guardtable_col4=De confiance
menu_menu=Menu
menu_prefs=Pr\u00e9f\u00e9rences
menu_quickadd=Ajout rapide d'un mod\u00e8le
menu_patternedit=\u00c9diteur de mod\u00e8les de relais
menu_export=Exporter les mod\u00e8les
menu_import=Import les mod\u00e8les
menu_quit=Quitter
menu_defaultpatterns=Mod\u00e8le par d\u00e9faut
menu_userpatterns=Mod\u00e8les de l'utilisateur
menu_help=Aide
menu_debuglog=Voir le journal de d\u00e9bogage
menu_helpcontents=Contenu de l'aide
menu_torcheck=V\u00e9rification de routine de Tor
menu_about=\u00c0 propos de
menu_license=Licence
menu_proxy=Mode de relais
menu_close=Fermer le menu
menu_tormanual=Manuel officiel de Tor
menu_tormonitor=Moniteur du client Tor
menu_leaktest=Test de fuite DNS
menu_credits=Cr\u00e9dits
label_activecountry=Pays actif :
label_proxymode=Mode de relais :
label_exitnode=N\u0153ud de sortie :
label_ip=IP :
label_torlatency=D\u00e9lai
label_fingerprint=Empreinte :
label_bandwidth=Bande passante
label_streams=Flux
label_stable=Stable
label_status=\u00c9tat :
label_listenport=Port d'\u00e9coute de Tor :
label_defaultproxy=Mandataire HTTP par d\u00e9faut :
label_bridgeaddress=Adresse de pont de Tor :
label_portranges=Plages de port pr\u00e9sentement actives, de $portmin \u00e0 $portmax
label_editcountry=Choisir un pays pour voir ses mod\u00e8les
label_quickadd_desc=Description :
label_quickadd_pattern=Mod\u00e8le :
label_threshold=D\u00e9lai seuil
label_middle=Milieu :
label_exit=Sortie :
label_nickname=Pseudonyme
label_ip=IP
label_country=Pays
label_guard_minimum=Vous pouvez soit ne choisir aucun n\u0153ud de garde au cas o\u00f9 le client Tor les choisit, soit choisir trois n\u0153uds de garde ou plus.
label_torlogging=Niveau de journalisation :
label_torargs=Arguments de d\u00e9marrage :
label_torsocks=Param\u00e8tres Socks :
label_diskoptions=Options du disque :
label_guardnode=Garde :
label_bridgenode=Pont :
label_donotproxy=Ne pas relayer :
button_details=D\u00e9tails
button_whois=Qui est
button_close=Fermer
button_apply=Appliquer
button_delete=Supprimer
button_addnew=Ajouter un nouveau
button_save=Enregistrer
button_cancel=Annuler
button_continue=Continuer
button_getbridges=Obtenir des ponts
button_mozillarestart=Red\u00e9marrer $browser
button_visitus=Rendez-nous visite
button_contactus=Contactez-nous
button_translations=Traductions non officielles
button_prefdefaults=R\u00e9initialiser aux leurs valeurs par d\u00e9faut.
button_setguards=D\u00e9finir les n\u0153uds de garde
button_details=D\u00e9tails de l'atlas
button_clearguards=Effacer les n\u0153uds de garde choisis
button_clearfavs=Effacer les favoris
button_support=Soutenir SelekTOR
button_patreon=Soutenir SelekTOR avec Patreon
panel_general=Param\u00e8tres g\u00e9n\u00e9raux
panel_network= Param\u00e8tres r\u00e9seau
panel_management=Param\u00e8tres de gestion des n\u0153uds
panel_info=Circuit actif
panel_torclientset=Param\u00e8tres du client Tor
panel_startupargs=Arguments de d\u00e9marrage
panel_stdout=Moniteur de sortie standard
chkbox_autoselect=Choix automatique du n\u0153ud
chkbox_autostart=D\u00e9marrage automatique de SelekTOR
chkbox_checkforupdates=V\u00e9rifier les mises \u00e0 jour au d\u00e9marrage
chkbox_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification
chkbox_autopatterns=Installer automatiquement les derniers mod\u00e8les.
chkbox_mozillawarn=D\u00e9sactiver l'avertissement de Mozilla
chkbox_recnodesonly=Utiliser les n\u0153uds recommand\u00e9s en mode par mod\u00e8les
chkbox_hidetotray=Minimiser au d\u00e9marrage
chkbox_minonclose=Minimiser plut\u00f4t que de quitter lors de la fermeture
chkbox_safesocks=Socks s\u00e9curitaire
chkbox_twohop=Utiliser des circuits \u00e0 2 sauts vers le n\u0153ud de sortie en mode par mod\u00e8les
chkbox_warnunsafesocks=Avertir si \u00e0 risque
chkbox_diskavoid=\u00c9viter les \u00e9critures sur le disque
chkbox_testsocks=Tester Socks
chkbox_safelog=Journalisation s\u00e9curitaire
chkbox_guardwarn1=Afficher une fen\u00eatre d'avertissement si un n\u0153ud de garde non sp\u00e9cifi\u00e9 est utilis\u00e9
chkbox_guardwarn2=Afficher une fen\u00eatre d'avertissement si moins de trois n\u0153uds de garde sont choisis
chkbox_securedelete=Effacement s\u00e9curis\u00e9 des caches de Tor lors de la fermeture
ttip_autostart=D\u00e9marrage automatique de SelekTOR lors du d\u00e9marrage/de la connexion
ttip_hidetotray=Minimiser au d\u00e9marrage
ttip_checkforupdates=SelekTOR v\u00e9rifiera les mises \u00e0 jour au d\u00e9marage
ttip_autoinstall=Les derniers mod\u00e8les seront r\u00e9cup\u00e9r\u00e9s de Dazzleships.Net
ttip_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification
ttip_mozillawarn=D\u00e9sactiver l'avertissement du navigateur Mozilla
ttip_listenport=Le port d'\u00e9coute du client Tor
ttip_defaultproxy=Tout trafic qui ne sera pas redirig\u00e9 par Tor sera redirig\u00e9 par ce mandataire HTTP
ttip_donotproxy=Toute URL contenant une de ces entr\u00e9es s\u00e9par\u00e9es par des virgules ne sera pas relay\u00e9e. L'on s'y connectera directement.
ttip_bridgeaddress=Pour contourner le blocage du FSI, ajouter une adresse de pont valide ici
ttip_forcedns=Forcer la recherche DNS par Tor, exige le red\u00e9marrage du navigateur
ttip_forcenode=Si coch\u00e9, le n\u0153ud sera activ\u00e9 quelque soit l'activit\u00e9 du n\u0153ud
ttip_recnodesonly=Les n\u0153uds recommand\u00e9s seront utilis\u00e9s en mode par mod\u00e8les
ttip_minonclose=L'application sera minimis\u00e9e au lieu de quitter \u00e0 la fermeture de la fermeture principale
ttip_threshold=D\u00e9lai seuil
ttip_safesocks=Activ\u00e9e, Tor rejettera les connexions logicielles qui utilisent des variantes dangereuses du protocole Socks.
ttip_warnunsafe=Activ\u00e9e, Tor avertira \u00e0 chaque fois qu'une requ\u00eate est re\u00e7ue contenant seulement une adresse IP au lieu d'un nom d'h\u00f4te.
ttip_testsocks=Activ\u00e9e Tor journalisera une entr\u00e9e de journal de niveau avis pour chaque connexion en indiquant si elle utilise un protocole Socks s\u00e9curitaire ou dangereux.
ttip_safelogging=Activ\u00e9e, Tor nettoiera les cha\u00eenes potentiellement sensibles des messages de journalisation.
ttip_avoiddisk=Activ\u00e9e, Tor essaiera d'\u00e9crire moins fr\u00e9quemment sur le disque que nous ne le ferions autrement.
ttip_extraargs= Arguments suppl\u00e9mentaires sp\u00e9cifi\u00e9s par l'utilisateur, voir le Manuel Tor.
ttip_combo_loglevel=Niveau de journalisation de Tor.
ttip_twohop=Utiliser des circuits \u00e0 2 sauts au lieu des 3 par d\u00e9faut de Tor. R\u00e9duit le d\u00e9lai de transit mais affaiblit l'anonymat.
ttip_resetbasicprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences de base \u00e0 leurs valeurs par d\u00e9faut.
ttip_resetadvprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences avanc\u00e9es \u00e0 leurs valeurs par d\u00e9faut.
ttip_guardwarn1=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant qu'un n\u0153ud de garde non sp\u00e9cifi\u00e9 est actif.
ttip_guardwarn2=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant que trop peu de n\u0153uds de garde sont choisis
ttip_clearguards=Effacer les n\u0153uds de garde choisis.
ttip_securedelete=Activ\u00e9, les caches de Tor seront \u00e9cras\u00e9es par des z\u00e9ros, puis supprim\u00e9es
dlg_update_title=Mise \u00e0 jour disponible.
dlg_update_body=$version est maintenant disponible au t\u00e9l\u00e9chargement.
dlg_restoreproxy_title=Param\u00e8tres originaux du mandataire
dlg_restoreproxy_body=Choisir Continuer pour restaurer les param\u00e8tres du mandataire aux valeurs par d\u00e9faut avant l'installation de SelekTOR.
dlg_resetproxy_title=Param\u00e8tres par d\u00e9faut du mandataire
dlg_resetproxy_body=Choisir Continuer pour r\u00e9initialiser les param\u00e8tres du serveur mandataire \u00e0 leurs valeurs syst\u00e8me par d\u00e9faut.
dlg_gsetting_title=Gsettings introuvable
dlg_gsetting_body=$appname ne peux pas fonctionner correctement sans que l'ex\u00e9cutable binary soit install\u00e9. Dans certaines distributions il peut \u00eatre trouv\u00e9 dans le paquet libglib2.0-bin.
dlg_torclient_title=Client TOR introuvable
dlg_torclient_body=$appname ne peux pas fonctionner sans que le client Tor ne soit Install\u00e9. Veuillez installer les paquets tor et tor-geoipdb pour votre distribution.
dlg_mozillarestart_title=Avertissement\u00a0: Le navigateur $browser est actif.
dlg_mozillarestart_body=$appname a d\u00e9tect\u00e9 que le navigateur $browser tourne d\u00e9j\u00e0.\nUn red\u00e9marrage du navigateur est exig\u00e9 pour permettre le fonctionnement de $appname.\n\nSi vous choisissez de red\u00e9marrer $browser, tous les onglets actuellement ouverts seront restaur\u00e9s au red\u00e9marrage de $browser, l'option \u00ab Afficher les dernier onglets et fen\u00eatres utilis\u00e9s \u00bb, doit \u00eatre choisie dans les options de $browser.\n\nVous pouvez d\u00e9sactiver cet avertissement du navigateur dans les Pr\u00e9f\u00e9rences de $appname.
dlg_license_title=Licence de $appname
dlg_exportuser_title=Exporter les mod\u00e8les d'utilisateur
dlg_exportuser_body=Aucun mod\u00e8le cr\u00e9\u00e9 par l'utilisateur n'a \u00e9t\u00e9 trouv\u00e9.\n\nUtilisez l'\u00e9diteur de mode pour ajouter vos propres mod\u00e8les
dlg_exportdefault_title=Exporter les mod\u00e8les par d\u00e9faut
dlg_exportdefault_body=Aucun mod\u00e8le par d\u00e9faut n'a \u00e9t\u00e9 trouv\u00e9.
dlg_saveuser_title=Enregistrer les modes de l'utilisateur
dlg_savedefault_title=Enregistrer les mod\u00e8les par d\u00e9faut
dlg_import_title=Importer le fichier des mod\u00e8les
dlg_import_success_title=Mod\u00e8les import\u00e9s
dlg_import_success_body=Les mod\u00e8les ont \u00e9t\u00e9 import\u00e9s avec succ\u00e8s et sont maintenant actifs.
dlg_import_fail_title=\u00c9chec lors l'importation
dlg_import_fail_body=Les mod\u00e8les n'ont pas \u00e9t\u00e9 import\u00e9s correctement.
dlg_whois_title=Qui est $ipaddress
dlg_whois_body=Veuillez patienter pendant que j'essaie de r\u00e9cup\u00e9rer les donn\u00e9s de WhoIs...
dlg_whois_fail=D\u00e9sol\u00e9, impossible de r\u00e9cup\u00e9rer les informations de Whois.
dlg_toold_body=Le client Tor actuellement install\u00e9 est trop ancien, Tor 0.2.7.6 ou ult\u00e9rieure est exig\u00e9e.\n\nLes utilisateurs de Linux devraient visiter la page suivante \nhttps://www.torproject.org/download/download-unix.html.en\npour obtenir le dernier client Tor.
dlg_error_title=Erreur de d\u00e9marrage
dlg_error_body=Cette erreur est fatale et $appname se fermera.
dlg_quickadd_title=Ajouter un mod\u00e8le
dlg_nodelistfail_body=La g\u00e9n\u00e9ration de la liste des n\u0153uds a \u00e9chou\u00e9 \u00e0 cause d'erreurs de GEOIP.
dlg_patterneditsave_title=Enregistrer les mod\u00e8les actuels
dlg_patterneditsave_body=Les mod\u00e8les actuels ont \u00e9t\u00e9 modifi\u00e9s.\n\nSi vous d\u00e9sirez les enregistrer, cliquez sur Continuer, autrement cliquez sur Annuler.
dlg_instancefail_title=\u00c9chec d\u00fb \u00e0 plusieurs instances
dlg_instancefail_body=Une instance de $appname est d\u00e9j\u00e0 en cours et une seule peut \u00eatre ex\u00e9cut\u00e9e \u00e0 la fois.\n\nQuittez l'instance existante de $appname ou dans le cas d'un plantage de $appname, red\u00e9marrez X en vous d\u00e9connectant et en vous connectant de nouveau.
dlg_guardwarn_title=Avertissement de n\u0153ud de garde
dlg_guardwarn_body=Un n\u0153ud de garde ne se trouvant pas dans votre liste de n\u0153uds de garde sp\u00e9cifi\u00e9e a \u00e9t\u00e9 utilis\u00e9.\nCeci provient probablement du fait que vos n\u0153uds de garde s\u00e9lectionn\u00e9s ne sont plus joignables et par cons\u00e9quent le client Tor a assign\u00e9 son propre n\u0153ud de garde.\n\nVous devriez v\u00e9rifier vos n\u0153uds de garde actuellement d\u00e9finis pour voir s'ils sont toujours disponibles, ou en choisir de nouveaux.
dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus.dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus.
dlg_bridgerr_title=\u00c9chec de validation de l'adresse de pont
dlg_bridgerr_body=Les informations de pont fournies contiennent des erreurs de validation et ne se conforment pas \u00e0 un format d'adresse IPv4 valide h\u00f4te:port\n\nVoici des exemples de format de sp\u00e9cification de ponts :\n\nPont simple : \n127.0.0.1:8080\n\nPonts multiples : \n127.0.0.1:8080,128.5.6.8:224\n\nLes ponts ont \u00e9t\u00e9 r\u00e9initialis\u00e9s \u00e0 leurs valeurs par d\u00e9faut.
dlg_credits_title=Cr\u00e9dits de $appname
dlg_credits_body=Afin que votre nom apparaissent ici et pour aussi m\u00e9riter ma gratitude, veuillez envisager de soutenir le d\u00e9veloppement futur de SelekTOR sous Linux avec Patreon.
table_popup_details=D\u00e9tails
table_popup_whois=Qui est
table_popup_begintest=Commencer le cycle de test
tab_basic=De base
tab_advanced=Avanc\u00e9
isoA1=Mandataire annonyme
isoO1=autre Pays
isoU1=Inconnu
chkbox_disablenotify=D\u00e9sactiver les notifications du bureau
ttip_disablenotify=D\u00e9sactiver les notifications du bureau
dlg_libnotify_title=notify-send est introuvable
dlg_libnotify_body=Les notifications de bureau ne fonctionneront pas sans que le paquet libnotify-bin ne soit install\u00e9.\n\nPour emp\u00eacher que cette fen\u00eatre apparaissent de nouveau installez le paquet exig\u00e9 ou d\u00e9sactivez les notifications de bureau dans les pr\u00e9f\u00e9rences.
ttip_hidemin=L'appli sera cach\u00e9e au lieu d'\u00eatre minimis\u00e9e.
chkbox_hidemin=Cacher au lieu de minimiser
label_autoselect= Mode de s\u00e9lection automatique :
menu_geoip=Mettre GEOIP \u00e0 jour
chkbox_geocheck=V\u00e9rification trimestrielle des mises \u00e0 jour GEOIP
ttip_geocheck=SelekTOR affichera la \u00abfen\u00eatre de mise \u00e0 jour GEOIP \u00bbsi votre base de donn\u00e9es GEOIP est p\u00e9rim\u00e9e.
dlg_geo_title=Mise \u00e0 jour des donn\u00e9es de g\u00e9olocalisation
dlg_geo_body=Les donn\u00e9es de g\u00e9olocalisation fournies par Tor sont parfois p\u00e9rim\u00e9es. Vous pouvez demander \u00e0 SelekTOR de t\u00e9l\u00e9charger ses propres fichiers de donn\u00e9es de g\u00e9olocalisation de Dazzleships.net et de les utiliser. Ils sont mis \u00e0 jour trimestriellement.\n\nVeuillez noter que si vous choisissez de ne pas mettre \u00e0 jour, certains n\u0153uds pourraient \u00eatre assign\u00e9s au mauvais pays.\n\nLes donn\u00e9es des ces fichiers, comme les donn\u00e9es fournies par le client Tor, sont fournies par Maxmind.com.
dload_status_contact=R\u00e9cup\u00e9ration des derni\u00e8res donn\u00e9es GEOIP
dload_status_failed=\u00c9chec de t\u00e9l\u00e9chargement
chkbox_viator=T\u00e9l\u00e9charger par Tor
ttip_patterntable=\u00c9dition en ligne prise en charge, un double-clic gauche lance l'\u00e9dition d'une cellule d'un tableau.
fileext_pattern=Fichiers de mod\u00e8les zipp\u00e9 selektor-3.13.73/src/resources/trayicon.png 0000644 0001750 0001750 00000021720 13302030722 020171 0 ustar bannor bannor PNG
IHDR >a bKGD pHYs tIME--߅c tEXtComment Created with GIMPW IDATxypu? HpHJ6ے(qK8q\7MҴYigڙn3d&tڦIYxqF-ђ%REq}Hb~۽
`[9sٯOf*j#˰]L7G5|HEV8z0+U3eOc( h]\K @!J*#C+ <*QUBԸ~~!KDCHPq}Dk֪rAR!"qaW>Y+R aE1:
~ M_]BV:PayY_u
+J^qA
j"- jf8 P@j Q
5F5 Ԩ P jT@j Q
5Fcj,XTqI-5ʽ Fʿ-US^
ˌb
*ྜIo4,5 ,#͗2ؙNґziIYgKkD}!