📄 main.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: Main.java
package org.gudy.azureus2.ui.swt;
import com.aelitis.azureus.core.AzureusCoreException;
import com.aelitis.azureus.core.AzureusCoreFactory;
import com.aelitis.azureus.launcher.Launcher;
import java.io.File;
import java.io.PrintStream;
import org.gudy.azureus2.core3.config.COConfigurationManager;
import org.gudy.azureus2.core3.logging.*;
import org.gudy.azureus2.ui.swt.mainwindow.Initializer;
// Referenced classes of package org.gudy.azureus2.ui.swt:
// StartServer, StartSocket
public class Main
{
private static final LogIDs LOGID;
public static final String PR_MULTI_INSTANCE = "MULTI_INSTANCE";
StartServer startServer;
public Main(String args[])
{
if (Launcher.checkAndLaunch(org/gudy/azureus2/ui/swt/Main, args))
return;
COConfigurationManager.preInitialise();
String mi_str = System.getProperty("MULTI_INSTANCE");
boolean mi = mi_str != null && mi_str.equalsIgnoreCase("true");
startServer = new StartServer();
boolean debugGUI = Boolean.getBoolean("debug");
if (mi || debugGUI)
{
com.aelitis.azureus.core.AzureusCore core = AzureusCoreFactory.create();
new Initializer(core, startServer, args);
return;
}
try
{
if (processParams(args, startServer))
{
com.aelitis.azureus.core.AzureusCore core = AzureusCoreFactory.create();
startServer.pollForConnections(core);
new Initializer(core, startServer, args);
}
}
catch (AzureusCoreException e)
{
Logger.log(new LogEvent(LOGID, "Start failed", e));
}
return;
}
public static boolean processParams(String args[], StartServer startServer)
{
boolean closedown = false;
boolean another_instance = startServer.getState() != 1;
if (another_instance)
System.setProperty("transitory.startup", "1");
for (int i = 0; i < args.length; i++)
{
String arg = args[i];
if (arg.equalsIgnoreCase("--closedown"))
{
closedown = true;
break;
}
String filename = arg;
if (filename.toUpperCase().startsWith("HTTP:") || filename.toUpperCase().startsWith("HTTPS:") || filename.toUpperCase().startsWith("MAGNET:") || filename.toUpperCase().startsWith("DHT:"))
{
if (!another_instance)
Logger.log(new LogEvent(LOGID, (new StringBuilder()).append("Main::main: args[").append(i).append("] handling as a URI: ").append(filename).toString()));
continue;
}
try
{
File file = new File(filename);
if (!file.exists())
throw new Exception((new StringBuilder()).append("File '").append(file).append("' not found").toString());
args[i] = file.getCanonicalPath();
if (!another_instance && Logger.isEnabled())
Logger.log(new LogEvent(LOGID, (new StringBuilder()).append("Main::main: args[").append(i).append("] exists = ").append((new File(filename)).exists()).toString()));
continue;
}
catch (Throwable e)
{
if (another_instance)
e.printStackTrace();
else
Logger.log(new LogAlert(true, 3, (new StringBuilder()).append("Failed to access torrent file '").append(filename).append("'. Ensure sufficient temporary ").append("file space available (check browser cache usage).").toString()));
}
}
if (another_instance)
{
StartSocket ss = new StartSocket(args);
if (!ss.sendArgs())
{
another_instance = false;
String msg = "There appears to be another program process already listening on socket [127.0.0.1: 6880].\nLoading of torrents via command line parameter will fail until this is fixed.";
System.out.println(msg);
Logger.log(new LogAlert(true, 1, msg));
}
}
if (!another_instance)
return !closedown;
else
return false;
}
public static void main(String args[])
{
if (Launcher.checkAndLaunch(org/gudy/azureus2/ui/swt/Main, args))
return;
if (System.getProperty("ui.temp") == null)
System.setProperty("ui.temp", "az2");
new Main(args);
}
static
{
LOGID = LogIDs.GUI;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -