📄 httpclient.java
字号:
// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov Date: 2006-10-19 15:28:54
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
import java.io.*;
import javax.microedition.io.*;
public class HttpClient extends NetClient
{
public HttpClient(llkCanvas llkcanvas)
{
super(llkcanvas);
j = new byte[1024];
h = new byte[4096];
}
public void run()
{
System.out.println("http_run_1");
try{
HttpConnection httpconnection;
InputStream inputstream;
OutputStream outputstream;
httpconnection = null;
inputstream = null;
outputstream = null;
_fldcase = false;
//_L2:
if(_fldcase){
// break; /* Loop/switch isn't completed */
return;
}
if(!_fldbyte.y() && g <= 0){
// break MISSING_BLOCK_LABEL_693;
return;
}
System.out.println("begin connect");
httpconnection = (HttpConnection)Connector.open("http://10.0.0.172:80/");
System.out.println("begin connect_1");
httpconnection.setRequestProperty("X-Online-Host", "game.pvp.cn:9998");
httpconnection.setRequestMethod("POST");
_fldbyte.d(2);
outputstream = httpconnection.openOutputStream();
synchronized(j)
{
if(g > 0)
{
outputstream.write(j, 0, g);
outputstream.flush();
g = 0;
}
}
inputstream = httpconnection.openInputStream();
_fldgoto = 0;
boolean flag = false;
do
{
if(flag)
break;
int k = _fldnew.length - _fldgoto;
int j1 = inputstream.read(_fldnew, _fldgoto, k);
if(j1 == -1)
break;
_fldgoto += j1;
if(_mthint())
break;
k = llkCanvas.ay(_fldnew, 0);
int l = 0;
do
{
if(_fldgoto - l < k + 4)
break;
int i1 = llkCanvas.ay(_fldnew, l + 2);
if(i1 == 0)
{
l += 4;
_fldbyte.a(i1, a, k);
flag = true;
break;
}
System.arraycopy(_fldnew, l + 4, a, 0, k);
_fldbyte.a(i1, a, k);
l += 4 + k;
if(_fldgoto - l < 4)
break;
k = llkCanvas.ay(_fldnew, l);
} while(true);
_fldgoto -= l;
if(_fldgoto > 0)
{
System.out.println("error");
System.arraycopy(_fldnew, l, _fldnew, 0, _fldgoto);
}
} while(true);
if(inputstream != null)
try
{
inputstream.close();
}
catch(IOException ioexception) { }
if(outputstream != null)
try
{
outputstream.close();
}
catch(IOException ioexception1) { }
if(httpconnection != null)
try
{
httpconnection.close();
}
catch(IOException ioexception2) { }
}
catch(Exception e){
System.out.println("httpclient_e = "+e);
}
// continue; /* Loop/switch isn't completed */
// Object obj;
// obj;
// System.out.println("connection not found");
// _fldbyte.d(0);
// if(_fldbyte.y())
// _fldcase = true;
// if(inputstream != null)
// try
// {
// inputstream.close();
// }
// Misplaced declaration of an exception variable
// catch(Object obj) { }
// if(outputstream != null)
// try
// {
// outputstream.close();
// }
// Misplaced declaration of an exception variable
// catch(Object obj) { }
// if(httpconnection != null)
// try
// {
// httpconnection.close();
// }
// Misplaced declaration of an exception variable
// catch(Object obj) { }
// continue; /* Loop/switch isn't completed */
// obj;
// System.out.println("io exception");
// if(inputstream != null)
// try
// {
// inputstream.close();
// }
// Misplaced declaration of an exception variable
// catch(Object obj) { }
// if(outputstream != null)
// try
// {
// outputstream.close();
// }
// // Misplaced declaration of an exception variable
// catch(Object obj) { }
// if(httpconnection != null)
// try
// {
// httpconnection.close();
// }
// Misplaced declaration of an exception variable
// catch(Object obj) { }
// continue; /* Loop/switch isn't completed */
// obj;
// _fldbyte.d(3);
// if(_fldbyte.y())
// _fldcase = true;
// if(inputstream != null)
// try
// {
// inputstream.close();
// }
// catch(IOException ioexception3) { }
// if(outputstream != null)
// try
// {
// outputstream.close();
// }
// catch(IOException ioexception4) { }
// if(httpconnection != null)
// try
// {
// httpconnection.close();
// }
// catch(IOException ioexception5) { }
// continue; /* Loop/switch isn't completed */
// Exception exception1;
// exception1;
// if(inputstream != null)
// try
// {
// inputstream.close();
// }
// catch(IOException ioexception6) { }
// if(outputstream != null)
// try
// {
// outputstream.close();
// }
// catch(IOException ioexception7) { }
// if(httpconnection != null)
// try
// {
// httpconnection.close();
// }
// catch(IOException ioexception8) { }
// throw exception1;
// try
// {
// Thread.sleep(1000L);
// }
// catch(InterruptedException interruptedexception) { }
// if(true) goto _L2; else goto _L1
//_L1:
// System.out.println("stop");
// return;
}
private boolean a(int k)
{
return k == 81 && g > 0;
}
public void a(int k, byte abyte0[], int l)
{
boolean flag = false;
boolean flag1 = false;
synchronized(j)
{
if(!a(k))
{
j[g] = (byte)(l & 0xff);
g++;
j[g] = (byte)(l >> 8 & 0xff);
g++;
j[g] = (byte)(k & 0xff);
g++;
j[g] = (byte)(k >> 8 & 0xff);
g++;
System.arraycopy(abyte0, 0, j, g, l);
g += l;
}
}
}
private void _mthfor()
{
System.arraycopy(_fldnew, 0, h, 0, _fldgoto);
int i1 = _fldgoto;
_fldgoto = 0;
for(int j1 = 0; j1 < i1 / 2; j1++)
{
int k = h[2 * j1 + 1];
int l = h[2 * j1];
if(k >= 65)
k -= 55;
else
k -= 48;
if(l >= 65)
l -= 55;
else
l -= 48;
_fldnew[_fldgoto] = (byte)(l * 16 + k);
_fldgoto++;
}
}
private boolean _mthint()
{
return _fldnew[0] == 1 && _fldnew[1] == 4 && _fldnew[2] == 106 && _fldnew[3] == 0 && _fldnew[4] == 127 && _fldnew[5] == 108;
}
private byte j[];
private int g;
private byte h[];
private static final String i = "http://10.0.0.172:80/";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -