lì immagine si riferisce a questo sorgente della class, che di preciso non so cosa compia ma che avevo scelto arbitrariamente per provare a decompilare con quei due programmi ( è un po' lungo percui ho tagliato la parte in cui cascano gli errori... ma mi ha dato solo 8 errori, avvolte con poche stringhe fatte da me per prova me ne ha dati pure di più XD ):
codice:
.....
public void addMessageListener(MessageListener listener)
{
this.listener = listener;
}
public Protocol getProtocol()
{
return protocol;
}
public void go(int x, int y)
{
protocol.go(x, y);
}
protected Object doInBackground()
{
boolean result;
Socket skt;
InputStream in;
OutputStream out;
result = true;
skt = null;
in = null;
out = null;
byte msg[];
setMessage("Connecting...");
skt = new Socket("XXX.YYY.ZZZ.KKK", 843);
in = skt.getInputStream();
System.out.println("Listening...");
out = skt.getOutputStream();
byte msgString[] = "<policy-file-request/>".getBytes();
msg = new byte[msgString.length + 1];
for(int i = 0; i < msgString.length; i++)
{
msg[i] = msgString[i];
}
msg[msgString.length] = 0;
out.write(msg);
System.out.println((new StringBuilder()).append("->").append(new String(msg)).toString());
System.out.println((new StringBuilder()).append("Bytes ready: ").append(in.available()).toString());
for(; in.available() == 0 && !cancelled; Thread.sleep(100L)) { }
msg = new byte[in.available()];
System.out.println((new StringBuilder()).append("Bytes read: ").append(in.read(msg)).toString());
System.out.println((new StringBuilder()).append("<-").append(new String(msg)).toString());
out.close();
in.close();
skt.close();
skt = new Socket("XXX.YYY.ZZZ.KKK", 8084);
in = skt.getInputStream();
setMessage("Listening...");
out = skt.getOutputStream();
msg = null;
_L1:
Vector msgs;
if(cancelled)
{
break MISSING_BLOCK_LABEL_577;
}
msgs = protocol.processInput(msg);
if(protocol.isClosed())
{
return Boolean.valueOf(true);
}
if(msgs == null)
{
GregorianCalendar gc = new GregorianCalendar();
gc.add(13, -30);
if(lastMsg.before(gc.getTime()))
{
lastMsg = new Date();
msgs = Protocol.getAntiTimeoutMsg();
}
}
if(msgs != null)
{
String msgToDisplay = "";
for(Iterator i$ = msgs.iterator(); i$.hasNext();)
{
byte msgo[] = (byte[])i$.next();
out.write(msgo);
msgToDisplay = (new StringBuilder()).append(msgToDisplay).append((new String(msgo)).trim()).toString();
}
listener.messageSent(msgToDisplay);
}
for(; in.available() == 0 && !cancelled; Thread.sleep(100L)) { }
if(in.available() > 0)
{
msg = new byte[in.available()];
in.read(msg);
listener.messageArrived(new String(msg));
}
goto _L1
InterruptedException e;
e;
result = false;
break MISSING_BLOCK_LABEL_577;
e;
e.printStackTrace();
setMessage(e.getMessage());
result = false;
try
{
if(out != null)
{
out.close();
}
if(in != null)
{
in.close();
}
if(skt != null)
{
skt.close();
}
if(result)
{
setMessage("Disconnected");
}
}
// Misplaced declaration of an exception variable
catch(InterruptedException e)
{
e.printStackTrace();
}
return Boolean.valueOf(result);
}
protected void succeeded(Object obj)
{
}
protected void cancelled()
{
super.cancelled();
cancelled = true;
setMessage("Cancelled");
}
protected void interrupted(InterruptedException arg0)
{
super.cancelled();
cancelled = true;
setMessage((new StringBuilder()).append("Interrupted: ").append(arg0.getMessage()).toString());
}
}