⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ba.java

📁 现在非常流行的手机网游的源码,可以下载来学习学习.
💻 JAVA
字号:
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Vector;
import javax.microedition.io.Connection;
import javax.microedition.io.Connector;
import javax.microedition.io.InputConnection;
import javax.microedition.io.OutputConnection;
import javax.microedition.io.SocketConnection;

public final class ba
  implements Runnable
{
  private SocketConnection jdField_a_of_type_JavaxMicroeditionIoSocketConnection = null;
  private DataInputStream jdField_a_of_type_JavaIoDataInputStream = null;
  private DataOutputStream jdField_a_of_type_JavaIoDataOutputStream = null;
  private ad jdField_a_of_type_Ad = null;
  private Vector jdField_a_of_type_JavaUtilVector = new Vector();
  private g jdField_a_of_type_G = null;
  private Vector b = new Vector();
  public byte a;
  private static ba jdField_a_of_type_Ba = null;
  public boolean a;
  public long a;

  private ba()
  {
    this.jdField_a_of_type_Byte = -1;
    this.jdField_a_of_type_Boolean = true;
  }

  public static ba a()
  {
    if (jdField_a_of_type_Ba == null)
      jdField_a_of_type_Ba = new ba();
    return jdField_a_of_type_Ba;
  }

  private boolean a()
  {
    try
    {
      this.jdField_a_of_type_JavaxMicroeditionIoSocketConnection = ((SocketConnection)Connector.open(be.jdField_k_of_type_JavaLangString, 3, false));
      this.jdField_a_of_type_JavaxMicroeditionIoSocketConnection.setSocketOption(2, 0);
      this.jdField_a_of_type_JavaxMicroeditionIoSocketConnection.setSocketOption(0, 10);
      this.jdField_a_of_type_JavaxMicroeditionIoSocketConnection.setSocketOption(1, 5);
      this.jdField_a_of_type_JavaIoDataInputStream = this.jdField_a_of_type_JavaxMicroeditionIoSocketConnection.openDataInputStream();
      this.jdField_a_of_type_JavaIoDataOutputStream = this.jdField_a_of_type_JavaxMicroeditionIoSocketConnection.openDataOutputStream();
      this.jdField_a_of_type_Ad = new ad(this);
      this.jdField_a_of_type_G = new g(this);
    }
    catch (Exception localException)
    {
      be.f();
      localException.printStackTrace();
      return false;
    }
    return true;
  }

  public final void a()
  {
    try
    {
      if (this.jdField_a_of_type_Ad != null)
      {
        this.jdField_a_of_type_Ad.a();
        this.jdField_a_of_type_Ad = null;
      }
      if (this.jdField_a_of_type_G != null)
      {
        this.jdField_a_of_type_G.a();
        this.jdField_a_of_type_G = null;
      }
      if (this.jdField_a_of_type_JavaxMicroeditionIoSocketConnection != null)
      {
        this.jdField_a_of_type_JavaxMicroeditionIoSocketConnection.close();
        this.jdField_a_of_type_JavaxMicroeditionIoSocketConnection = null;
      }
      this.jdField_a_of_type_JavaxMicroeditionIoSocketConnection = null;
      if (this.jdField_a_of_type_JavaIoDataInputStream != null)
      {
        this.jdField_a_of_type_JavaIoDataInputStream.close();
        this.jdField_a_of_type_JavaIoDataInputStream = null;
      }
      if (this.jdField_a_of_type_JavaIoDataOutputStream != null)
      {
        this.jdField_a_of_type_JavaIoDataOutputStream.close();
        this.jdField_a_of_type_JavaIoDataOutputStream = null;
      }
      this.jdField_a_of_type_Byte = -1;
      return;
    }
    catch (Exception localException)
    {
    }
  }

  public final void run()
  {
    a();
  }

  public final void a(int paramInt)
  {
    if (paramInt == 16777472)
    {
      this.jdField_a_of_type_JavaUtilVector.removeAllElements();
      this.b.removeAllElements();
    }
    byte[] arrayOfByte = null;
    if (be.ag != be.af)
    {
      if (paramInt == 16779264)
      {
        be.ae = be.ad;
        a(arrayOfByte = a(paramInt), true);
        this.jdField_a_of_type_JavaUtilVector.addElement(arrayOfByte);
        be.af = be.ag;
        be.ad = 0;
        if (this.jdField_a_of_type_JavaxMicroeditionIoSocketConnection == null);
        try
        {
          new Thread(this).start();
          return;
        }
        catch (Exception localException1)
        {
          return;
        }
      }
      be.jdField_a_of_type_Ba.a(16779264);
    }
    a(arrayOfByte = a(paramInt), false);
    this.jdField_a_of_type_JavaUtilVector.addElement(arrayOfByte);
    if (this.jdField_a_of_type_JavaxMicroeditionIoSocketConnection == null)
      try
      {
        new Thread(this).start();
        return;
      }
      catch (Exception localException2)
      {
      }
  }

  private boolean b()
  {
    try
    {
      int i;
      if ((i = this.jdField_a_of_type_JavaIoDataInputStream.readShort()) <= 0)
        return true;
      byte[] arrayOfByte = new byte[i - 2];
      int j = 0;
      while (j - arrayOfByte.length != 0)
        j += this.jdField_a_of_type_JavaIoDataInputStream.read(arrayOfByte, j, arrayOfByte.length - j);
      this.b.addElement(arrayOfByte);
    }
    catch (Exception localException)
    {
      if (be.a() != 11)
        be.jdField_a_of_type_Be.m(1);
      localException.printStackTrace();
      return false;
    }
    return true;
  }

  private boolean c()
  {
    try
    {
      be.i = (short)(be.i + 1);
      if (this.jdField_a_of_type_JavaUtilVector.size() != 0)
        while (true)
        {
          byte[] arrayOfByte;
          if (this.jdField_a_of_type_JavaUtilVector.size() == 0)
            break label76;
          if ((arrayOfByte = (byte[])this.jdField_a_of_type_JavaUtilVector.elementAt(0)) != null)
          {
            this.jdField_a_of_type_JavaIoDataOutputStream.write(arrayOfByte);
            be.m = 0;
          }
          this.jdField_a_of_type_JavaUtilVector.removeElementAt(0);
        }
      be.m += 1;
      label76: long l = System.currentTimeMillis();
      if (this.jdField_a_of_type_Boolean)
      {
        this.jdField_a_of_type_Long = l;
        this.jdField_a_of_type_Boolean = false;
      }
      if (l - this.jdField_a_of_type_Long >= 30000L)
      {
        be.jdField_a_of_type_Ba.a(16781056);
        this.jdField_a_of_type_Boolean = true;
      }
      else if (l - this.jdField_a_of_type_Long < 0L)
      {
        this.jdField_a_of_type_Boolean = true;
      }
      this.jdField_a_of_type_JavaIoDataOutputStream.flush();
    }
    catch (Exception localException)
    {
      be.jdField_a_of_type_Be.m(1);
      localException.printStackTrace();
      return false;
    }
    return true;
  }

  public final void b()
  {
    while ((this.b.size() > 0) && (this.b.size() != 0))
    {
      e.a((byte[])this.b.elementAt(0));
      this.b.removeElementAt(0);
    }
  }

  private byte[] a(int paramInt)
  {
    byte[] arrayOfByte;
    c localc;
    Object localObject = null;
    short s = 0;
    if ((arrayOfByte = e.a(paramInt)) != null)
      s = (short)((localObject = arrayOfByte).length + 4 + 4 + 1);
    byte b1 = 0;
    for (int i = 0; i < arrayOfByte.length; ++i)
      b1 = (byte)((b1 + arrayOfByte[i]) % 128);
    b1 = (byte)(b1 ^ 0xFFFFFFFF);
    (localc = new c()).a(s);
    localc.a(8);
    ba tmp91_90 = this;
    tmp91_90.jdField_a_of_type_Byte = (byte)(tmp91_90.jdField_a_of_type_Byte + 1);
    if (this.jdField_a_of_type_Byte > 123)
      this.jdField_a_of_type_Byte = 0;
    localc.a(this.jdField_a_of_type_Byte);
    localc.c(paramInt);
    localc.a(b1);
    if (localObject != null)
      localc.a(localObject);
    return localc.a();
  }

  private static void a(byte[] paramArrayOfByte, boolean paramBoolean)
  {
    Object localObject;
    if ((be.j == null) && (be.jdField_k_of_type_ArrayOfByte == null))
      return;
    int i = 0;
    int j = 0;
    if (paramBoolean)
    {
      if (be.jdField_k_of_type_ArrayOfByte == null)
        return;
      try
      {
        j = be.jdField_k_of_type_ArrayOfByte[be.ae];
        i = be.jdField_k_of_type_ArrayOfByte[(be.ae + 1)];
      }
      catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException1)
      {
        (localObject = localArrayIndexOutOfBoundsException1).printStackTrace();
      }
    }
    else
    {
      try
      {
        j = be.j[be.ad];
        i = be.j[(be.ad + 1)];
      }
      catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException2)
      {
        (localObject = localArrayIndexOutOfBoundsException2).printStackTrace();
      }
      be.ad = (byte)(be.ad + 2);
      if (be.ad >= be.j.length)
        be.ad = 0;
    }
    int k = (localObject = new c(paramArrayOfByte)).a();
    switch (i)
    {
    case 40:
      k = (short)(k + j);
      break;
    case 33:
      k = (short)(k - j);
      break;
    case 51:
      k = (short)(k << j);
      break;
    case 58:
      k = (short)(k >> j);
      break;
    case 42:
      k = (short)(k % j);
      break;
    default:
      System.out.println("未知加密操作!");
    }
    int l = (byte)(k & 0xFF);
    byte[] tmp246_243 = paramArrayOfByte;
    tmp246_243[8] = (byte)(tmp246_243[8] ^ paramArrayOfByte[3]);
    int tmp256_255 = 3;
    byte[] tmp256_254 = paramArrayOfByte;
    tmp256_254[tmp256_255] = (byte)(tmp256_254[tmp256_255] ^ l);
    int tmp265_264 = 5;
    byte[] tmp265_263 = paramArrayOfByte;
    tmp265_263[tmp265_264] = (byte)(tmp265_263[tmp265_264] ^ paramArrayOfByte[3]);
    byte[] tmp276_273 = paramArrayOfByte;
    tmp276_273[7] = (byte)(tmp276_273[7] ^ paramArrayOfByte[3]);
    int tmp286_285 = 4;
    byte[] tmp286_284 = paramArrayOfByte;
    tmp286_284[tmp286_285] = (byte)(tmp286_284[tmp286_285] ^ paramArrayOfByte[7]);
    byte[] tmp298_295 = paramArrayOfByte;
    tmp298_295[6] = (byte)(tmp298_295[6] ^ paramArrayOfByte[5]);
  }

  public static boolean a(ba paramba)
  {
    return paramba.b();
  }

  public static boolean b(ba paramba)
  {
    return paramba.c();
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -