i4jruntime

16:36:48.822 INFO  jd.cli.Main - Decompiling i4jruntime.jar
package LZMA;

import java.io.IOException;
import java.io.InputStream;

class CRangeDecoder
{
  static final int kNumTopBits = 24;
  static final int kTopValue = 16777216;
  static final int kTopValueMask = -16777216;
  static final int kNumBitModelTotalBits = 11;
  static final int kBitModelTotal = 2048;
  static final int kNumMoveBits = 5;
  InputStream inStream;
  int Range;
  int Code;
  byte[] buffer;
  int buffer_size;
  int buffer_ind;
  static final int kNumPosBitsMax = 4;
  static final int kNumPosStatesMax = 16;
  static final int kLenNumLowBits = 3;
  static final int kLenNumLowSymbols = 8;
  static final int kLenNumMidBits = 3;
  static final int kLenNumMidSymbols = 8;
  static final int kLenNumHighBits = 8;
  static final int kLenNumHighSymbols = 256;
  static final int LenChoice = 0;
  static final int LenChoice2 = 1;
  static final int LenLow = 2;
  static final int LenMid = 130;
  static final int LenHigh = 258;
  static final int kNumLenProbs = 514;
  
  CRangeDecoder(InputStream paramInputStream)
    throws IOException
  {
    buffer = new byte['?'];
    inStream = paramInputStream;
    Code = 0;
    Range = -1;
    for (int i = 0; i < 5; i++) {
      Code = (Code << 8 | Readbyte());
    }
  }
  
  int Readbyte()
    throws IOException
  {
    if (buffer_size == buffer_ind)
    {
      buffer_size = inStream.read(buffer);
      buffer_ind = 0;
      if (buffer_size < 1) {
        throw new LzmaException("LZMA : Data Error");
      }
    }
    return buffer[(buffer_ind++)] & 0xFF;
  }
  
  int DecodeDirectBits(int paramInt)
    throws IOException
  {
    int i = 0;
    for (int j = paramInt; j > 0; j--)
    {
      Range >>>= 1;
      int k = Code - Range >>> 31;
      Code -= (Range & k - 1);
      i = i << 1 | 1 - k;
      if (Range < 16777216)
      {
        Code = (Code << 8 | Readbyte());
        Range <<= 8;
      }
    }
    return i;
  }
  
  int BitDecode(int[] paramArrayOfInt, int paramInt)
    throws IOException
  {
    int i = (Range >>> 11) * paramArrayOfInt[paramInt];
    if ((Code & 0xFFFFFFFF) < (i & 0xFFFFFFFF))
    {
      Range = i;
      paramArrayOfInt[paramInt] += (2048 - paramArrayOfInt[paramInt] >>> 5);
      if ((Range & 0xFF000000) == 0)
      {
        Code = (Code << 8 | Readbyte());
        Range <<= 8;
      }
      return 0;
    }
    Range -= i;
    Code -= i;
    paramArrayOfInt[paramInt] -= (paramArrayOfInt[paramInt] >>> 5);
    if ((Range & 0xFF000000) == 0)
    {
      Code = (Code << 8 | Readbyte());
      Range <<= 8;
    }
    return 1;
  }
  
  int BitTreeDecode(int[] paramArrayOfInt, int paramInt1, int paramInt2)
    throws IOException
  {
    int i = 1;
    for (int j = paramInt2; j > 0; j--) {
      i = i + i + BitDecode(paramArrayOfInt, paramInt1 + i);
    }
    return i - (1 << paramInt2);
  }
  
  int ReverseBitTreeDecode(int[] paramArrayOfInt, int paramInt1, int paramInt2)
    throws IOException
  {
    int i = 1;
    int j = 0;
    for (int k = 0; k < paramInt2; k++)
    {
      int m = BitDecode(paramArrayOfInt, paramInt1 + i);
      i = i + i + m;
      j |= m << k;
    }
    return j;
  }
  
  byte LzmaLiteralDecode(int[] paramArrayOfInt, int paramInt)
    throws IOException
  {
    int i = 1;
    do
    {
      i = i + i | BitDecode(paramArrayOfInt, paramInt + i);
    } while (i < 256);
    return (byte)i;
  }
  
  byte LzmaLiteralDecodeMatch(int[] paramArrayOfInt, int paramInt, byte paramByte)
    throws IOException
  {
    int i = 1;
    do
    {
      int j = paramByte >> 7 & 0x1;
      paramByte = (byte)(paramByte << 1);
      int k = BitDecode(paramArrayOfInt, paramInt + (1 + j << 8) + i);
      i = i << 1 | k;
      if (j != k) {
        while (i < 256) {
          i = i + i | BitDecode(paramArrayOfInt, paramInt + i);
        }
      }
    } while (i < 256);
    return (byte)i;
  }
  
  int LzmaLenDecode(int[] paramArrayOfInt, int paramInt1, int paramInt2)
    throws IOException
  {
    if (BitDecode(paramArrayOfInt, paramInt1 + 0) == 0) {
      return BitTreeDecode(paramArrayOfInt, paramInt1 + 2 + (paramInt2 << 3), 3);
    }
    if (BitDecode(paramArrayOfInt, paramInt1 + 1) == 0) {
      return 8 + BitTreeDecode(paramArrayOfInt, paramInt1 + 130 + (paramInt2 << 3), 3);
    }
    return 16 + BitTreeDecode(paramArrayOfInt, paramInt1 + 258, 8);
  }
}

/* Location:
 * Qualified Name:     LZMA.CRangeDecoder
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package LZMA;

import java.io.IOException;

public class LzmaException
  extends IOException
{
  public LzmaException() {}
  
  public LzmaException(String paramString)
  {
    super(paramString);
  }
}

/* Location:
 * Qualified Name:     LZMA.LzmaException
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package LZMA;

import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;

public class LzmaInputStream
  extends FilterInputStream
{
  boolean isClosed;
  CRangeDecoder RangeDecoder;
  byte[] dictionary;
  int dictionarySize;
  int dictionaryPos;
  int GlobalPos;
  int rep0;
  int rep1;
  int rep2;
  int rep3;
  int lc;
  int lp;
  int pb;
  int State;
  boolean PreviousIsMatch;
  int RemainLen;
  int[] probs;
  byte[] uncompressed_buffer;
  int uncompressed_size;
  int uncompressed_offset;
  long GlobalNowPos;
  long GlobalOutSize;
  static final int LZMA_BASE_SIZE = 1846;
  static final int LZMA_LIT_SIZE = 768;
  static final int kBlockSize = 65536;
  static final int kNumStates = 12;
  static final int kStartPosModelIndex = 4;
  static final int kEndPosModelIndex = 14;
  static final int kNumFullDistances = 128;
  static final int kNumPosSlotBits = 6;
  static final int kNumLenToPosStates = 4;
  static final int kNumAlignBits = 4;
  static final int kAlignTableSize = 16;
  static final int kMatchMinLen = 2;
  static final int IsMatch = 0;
  static final int IsRep = 192;
  static final int IsRepG0 = 204;
  static final int IsRepG1 = 216;
  static final int IsRepG2 = 228;
  static final int IsRep0Long = 240;
  static final int PosSlot = 432;
  static final int SpecPos = 688;
  static final int Align = 802;
  static final int LenCoder = 818;
  static final int RepLenCoder = 1332;
  static final int Literal = 1846;
  
  public LzmaInputStream(InputStream paramInputStream)
    throws IOException
  {
    super(paramInputStream);
    
    isClosed = false;
    
    readHeader();
    
    fill_buffer();
  }
  
  private void LzmaDecode(int paramInt)
    throws IOException
  {
    int j = (1 << pb) - 1;
    int k = (1 << lp) - 1;
    
    uncompressed_size = 0;
    if (RemainLen == -1) {
      return;
    }
    int m;
    while ((RemainLen > 0) && (uncompressed_size < paramInt))
    {
      m = dictionaryPos - rep0;
      if (m < 0) {
        m += dictionarySize;
      }
      uncompressed_buffer[(uncompressed_size++)] = (dictionary[dictionaryPos] = dictionary[m]);
      if (++dictionaryPos == dictionarySize) {
        dictionaryPos = 0;
      }
      RemainLen -= 1;
    }
    int i;
    if (dictionaryPos == 0) {
      i = dictionary[(dictionarySize - 1)];
    } else {
      i = dictionary[(dictionaryPos - 1)];
    }
    while (uncompressed_size < paramInt)
    {
      m = uncompressed_size + GlobalPos & j;
      int n;
      int i1;
      if (RangeDecoder.BitDecode(probs, 0 + (State << 4) + m) == 0)
      {
        n = 1846 + 768 * (((uncompressed_size + GlobalPos & k) << lc) + ((i & 0xFF) >> 8 - lc));
        if (State < 4) {
          State = 0;
        } else if (State < 10) {
          State -= 3;
        } else {
          State -= 6;
        }
        if (PreviousIsMatch)
        {
          i1 = dictionaryPos - rep0;
          if (i1 < 0) {
            i1 += dictionarySize;
          }
          byte b = dictionary[i1];
          
          i = RangeDecoder.LzmaLiteralDecodeMatch(probs, n, b);
          PreviousIsMatch = false;
        }
        else
        {
          i = RangeDecoder.LzmaLiteralDecode(probs, n);
        }
        uncompressed_buffer[(uncompressed_size++)] = i;
        
        dictionary[dictionaryPos] = i;
        if (++dictionaryPos == dictionarySize) {
          dictionaryPos = 0;
        }
      }
      else
      {
        PreviousIsMatch = true;
        if (RangeDecoder.BitDecode(probs, 192 + State) == 1)
        {
          if (RangeDecoder.BitDecode(probs, 204 + State) == 0)
          {
            if (RangeDecoder.BitDecode(probs, 240 + (State << 4) + m) == 0)
            {
              if (uncompressed_size + GlobalPos == 0) {
                throw new LzmaException("LZMA : Data Error");
              }
              State = (State < 7 ? 9 : 11);
              
              n = dictionaryPos - rep0;
              if (n < 0) {
                n += dictionarySize;
              }
              i = dictionary[n];
              dictionary[dictionaryPos] = i;
              if (++dictionaryPos == dictionarySize) {
                dictionaryPos = 0;
              }
              uncompressed_buffer[(uncompressed_size++)] = i;
            }
          }
          else
          {
            if (RangeDecoder.BitDecode(probs, 216 + State) == 0)
            {
              n = rep1;
            }
            else
            {
              if (RangeDecoder.BitDecode(probs, 228 + State) == 0)
              {
                n = rep2;
              }
              else
              {
                n = rep3;
                rep3 = rep2;
              }
              rep2 = rep1;
            }
            rep1 = rep0;
            rep0 = n;
          }
          RemainLen = RangeDecoder.LzmaLenDecode(probs, 1332, m);
          State = (State < 7 ? 8 : 11);
        }
        else
        {
          rep3 = rep2;
          rep2 = rep1;
          rep1 = rep0;
          State = (State < 7 ? 7 : 10);
          RemainLen = RangeDecoder.LzmaLenDecode(probs, 818, m);
          n = RangeDecoder.BitTreeDecode(probs, 432 + ((RemainLen < 4 ? RemainLen : 3) << 6), 6);
          if (n >= 4)
          {
            i1 = (n >> 1) - 1;
            rep0 = ((0x2 | n & 0x1) << i1);
            if (n < 14)
            {
              rep0 += RangeDecoder.ReverseBitTreeDecode(probs, 688 + rep0 - n - 1, i1);
            }
            else
            {
              rep0 += (RangeDecoder.DecodeDirectBits(i1 - 4) << 4);
              
              rep0 += RangeDecoder.ReverseBitTreeDecode(probs, 802, 4);
            }
          }
          else
          {
            rep0 = n;
          }
          rep0 += 1;
        }
        if (rep0 == 0)
        {
          RemainLen = -1;
          break;
        }
        if (rep0 > uncompressed_size + GlobalPos) {
          throw new LzmaException("LZMA : Data Error");
        }
        RemainLen += 2;
        do
        {
          n = dictionaryPos - rep0;
          if (n < 0) {
            n += dictionarySize;
          }
          i = dictionary[n];
          dictionary[dictionaryPos] = i;
          if (++dictionaryPos == dictionarySize) {
            dictionaryPos = 0;
          }
          uncompressed_buffer[(uncompressed_size++)] = i;
          RemainLen -= 1;
        } while ((RemainLen > 0) && (uncompressed_size < paramInt));
      }
    }
    GlobalPos += uncompressed_size;
  }
  
  private void fill_buffer()
    throws IOException
  {
    if (GlobalNowPos < GlobalOutSize)
    {
      uncompressed_offset = 0;
      long l = GlobalOutSize - GlobalNowPos;
      int i;
      if (l > 65536L) {
        i = 65536;
      } else {
        i = (int)l;
      }
      LzmaDecode(i);
      if (uncompressed_size == 0) {
        GlobalOutSize = GlobalNowPos;
      } else {
        GlobalNowPos += uncompressed_size;
      }
    }
  }
  
  private void readHeader()
    throws IOException
  {
    byte[] arrayOfByte = new byte[5];
    if (5 != in.read(arrayOfByte)) {
      throw new LzmaException("LZMA header corrupted : Properties error");
    }
    GlobalOutSize = 0L;
    for (int i = 0; i < 8; i++)
    {
      j = in.read();
      if (j == -1) {
        throw new LzmaException("LZMA header corrupted : Size error");
      }
      GlobalOutSize += (j << i * 8);
    }
    if (GlobalOutSize == -1L) {
      GlobalOutSize = Long.MAX_VALUE;
    }
    i = arrayOfByte[0] & 0xFF;
    if (i >= 225) {
      throw new LzmaException("LZMA header corrupted : Properties error");
    }
    for (pb = 0; i >= 45; i -= 45) {
      pb += 1;
    }
    for (lp = 0; i >= 9; i -= 9) {
      lp += 1;
    }
    lc = i;
    
    int j = 1846 + (768 << lc + lp);
    
    probs = new int[j];
    
    dictionarySize = 0;
    for (int k = 0; k < 4; k++) {
      dictionarySize += ((arrayOfByte[(1 + k)] & 0xFF) << k * 8);
    }
    dictionary = new byte[dictionarySize];
    if (dictionary == null) {
      throw new LzmaException("LZMA : can't allocate");
    }
    k = 1846 + (768 << lc + lp);
    
    RangeDecoder = new CRangeDecoder(in);
    dictionaryPos = 0;
    GlobalPos = 0;
    rep0 = (rep1 = rep2 = rep3 = 1);
    State = 0;
    PreviousIsMatch = false;
    RemainLen = 0;
    dictionary[(dictionarySize - 1)] = 0;
    for (int m = 0; m < k; m++) {
      probs[m] = 1024;
    }
    uncompressed_buffer = new byte[65536];
    uncompressed_size = 0;
    uncompressed_offset = 0;
    
    GlobalNowPos = 0L;
  }
  
  public int read(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
    throws IOException
  {
    if (isClosed) {
      throw new IOException("stream closed");
    }
    if ((paramInt1 | paramInt2 | paramInt1 + paramInt2 | paramArrayOfByte.length - (paramInt1 + paramInt2)) < 0) {
      throw new IndexOutOfBoundsException();
    }
    if (paramInt2 == 0) {
      return 0;
    }
    if (uncompressed_offset == uncompressed_size) {
      fill_buffer();
    }
    if (uncompressed_offset == uncompressed_size) {
      return -1;
    }
    int i = Math.min(paramInt2, uncompressed_size - uncompressed_offset);
    System.arraycopy(uncompressed_buffer, uncompressed_offset, paramArrayOfByte, paramInt1, i);
    uncompressed_offset += i;
    return i;
  }
  
  public void close()
    throws IOException
  {
    isClosed = true;
    super.close();
  }
}

/* Location:
 * Qualified Name:     LZMA.LzmaInputStream
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j;

class Controller$1 {}

/* Location:
 * Qualified Name:     com.exe4j.Controller.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j;

import com.exe4j.runtime.BaseConnectionException;

public class Controller$ConnectionException
  extends Exception
{
  private Controller$ConnectionException(BaseConnectionException paramBaseConnectionException)
  {
    super(paramBaseConnectionException.getMessage());
  }
  
  Controller$ConnectionException(BaseConnectionException paramBaseConnectionException, Controller.1 param1)
  {
    this(paramBaseConnectionException);
  }
}

/* Location:
 * Qualified Name:     com.exe4j.Controller.ConnectionException
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j;

import java.util.EventListener;

public abstract interface Controller$StartupListener
  extends EventListener
{
  public abstract void startupPerformed(String paramString);
}

/* Location:
 * Qualified Name:     com.exe4j.Controller.StartupListener
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j;

class Controller$StartupThread$1
  extends Thread
{
  private final Controller.StartupThread this$0;
  
  Controller$StartupThread$1(Controller.StartupThread paramStartupThread, String paramString) {}
  
  public void run()
  {
    Controller.access$100().startupPerformed(val$parametersFinal);
  }
}

/* Location:
 * Qualified Name:     com.exe4j.Controller.StartupThread.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j;

import com.exe4j.runtime.WinLauncher;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;

class Controller$StartupThread
  extends Thread
{
  private File processCommFile = new File(WinLauncher.PROCESS_COMM_FILE_NAME);
  
  public Controller$StartupThread()
  {
    super("Exe4JStartupThread");
    setDaemon(true);
  }
  
  public void run()
  {
    long l = 0L;
    int i = 0;
    for (;;)
    {
      if ((processCommFile.exists()) && (l != processCommFile.lastModified()))
      {
        l = processCommFile.lastModified();
        try
        {
          String str;
          for (;;)
          {
            try
            {
              BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(processCommFile), "UTF-16LE"));
              str = localBufferedReader.readLine();
              localBufferedReader.close();
            }
            catch (IOException localIOException) {}
          }
          if (Controller.access$100() != null)
          {
            final Object localObject = str;
            new Thread()
            {
              public void run()
              {
                Controller.access$100().startupPerformed(localObject);
              }
            }.start();
            i = 15;
          }
          else if (str != null)
          {
            Controller.access$200().add(str);
          }
          while ((processCommFile.exists()) && (!processCommFile.delete())) {
            try
            {
              sleep(100L);
            }
            catch (InterruptedException localInterruptedException2) {}
          }
        }
        catch (Throwable localThrowable)
        {
          localThrowable.printStackTrace();
        }
      }
      try
      {
        if (i > 0)
        {
          sleep(30L);
          i--;
        }
        else if (Controller.access$100() != null)
        {
          sleep(300L);
        }
        else
        {
          sleep(3000L);
        }
      }
      catch (InterruptedException localInterruptedException1) {}
    }
  }
}

/* Location:
 * Qualified Name:     com.exe4j.Controller.StartupThread
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j;

import com.exe4j.runtime.BaseConnectionException;
import com.exe4j.runtime.ControllerInterface;
import com.exe4j.runtime.Exe4JController;
import com.exe4j.runtime.WinLauncher;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.EventListener;
import java.util.Stack;

public class Controller
{
  private static ControllerInterface controllerBackend;
  private static StartupListener startupListener;
  private static boolean startupThreadStarted = false;
  private static Stack performedStartups = new Stack();
  
  public static void writeMessage(String paramString)
    throws Controller.ConnectionException
  {
    try
    {
      init();
      controllerBackend.writeMessage(paramString);
    }
    catch (BaseConnectionException localBaseConnectionException)
    {
      throw new ConnectionException(localBaseConnectionException, null);
    }
  }
  
  public static void hide()
    throws Controller.ConnectionException
  {
    try
    {
      init();
      controllerBackend.hide();
    }
    catch (BaseConnectionException localBaseConnectionException)
    {
      throw new ConnectionException(localBaseConnectionException, null);
    }
  }
  
  public static void registerStartupListener(StartupListener paramStartupListener)
  {
    startupListener = paramStartupListener;
    if ((!startupThreadStarted) && (WinLauncher.PROCESS_COMM_FILE_NAME != null))
    {
      startupThreadStarted = true;
      new StartupThread().start();
    }
    while (!performedStartups.empty()) {
      paramStartupListener.startupPerformed((String)performedStartups.pop());
    }
  }
  
  private static void init()
    throws BaseConnectionException
  {
    if (controllerBackend == null) {
      controllerBackend = Exe4JController.getInstance();
    }
  }
  
  public static class ConnectionException
    extends Exception
  {
    private ConnectionException(BaseConnectionException paramBaseConnectionException)
    {
      super();
    }
    
    ConnectionException(BaseConnectionException paramBaseConnectionException, Controller.1 param1)
    {
      this(paramBaseConnectionException);
    }
  }
  
  public static abstract interface StartupListener
    extends EventListener
  {
    public abstract void startupPerformed(String paramString);
  }
  
  private static class StartupThread
    extends Thread
  {
    private File processCommFile = new File(WinLauncher.PROCESS_COMM_FILE_NAME);
    
    public StartupThread()
    {
      super();
      setDaemon(true);
    }
    
    public void run()
    {
      long l = 0L;
      int i = 0;
      for (;;)
      {
        if ((processCommFile.exists()) && (l != processCommFile.lastModified()))
        {
          l = processCommFile.lastModified();
          try
          {
            String str;
            for (;;)
            {
              try
              {
                BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(processCommFile), "UTF-16LE"));
                str = localBufferedReader.readLine();
                localBufferedReader.close();
              }
              catch (IOException localIOException) {}
            }
            if (Controller.startupListener != null)
            {
              final Object localObject = str;
              new Thread()
              {
                public void run()
                {
                  Controller.startupListener.startupPerformed(localObject);
                }
              }.start();
              i = 15;
            }
            else if (str != null)
            {
              Controller.performedStartups.add(str);
            }
            while ((processCommFile.exists()) && (!processCommFile.delete())) {
              try
              {
                sleep(100L);
              }
              catch (InterruptedException localInterruptedException2) {}
            }
          }
          catch (Throwable localThrowable)
          {
            localThrowable.printStackTrace();
          }
        }
        try
        {
          if (i > 0)
          {
            sleep(30L);
            i--;
          }
          else if (Controller.startupListener != null)
          {
            sleep(300L);
          }
          else
          {
            sleep(3000L);
          }
        }
        catch (InterruptedException localInterruptedException1) {}
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.exe4j.Controller
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j.runtime;

public class BaseConnectionException
  extends Exception
{
  public BaseConnectionException(String paramString)
  {
    super(paramString);
  }
}

/* Location:
 * Qualified Name:     com.exe4j.runtime.BaseConnectionException
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j.runtime;

public abstract interface ControllerInterface
{
  public abstract void writeMessage(String paramString)
    throws BaseConnectionException;
  
  public abstract void hide()
    throws BaseConnectionException;
}

/* Location:
 * Qualified Name:     com.exe4j.runtime.ControllerInterface
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j.runtime;

public class Exe4JController
  implements ControllerInterface
{
  private static Exe4JController exe4JController;
  private static final int ACTION_NONE = 0;
  private static final int ACTION_HIDE = 1;
  private static final int ACTION_WRITE_MESSAGE = 2;
  private static int currentAction = 0;
  private static String currentMessage = "";
  
  public static Exe4JController getInstance()
    throws BaseConnectionException
  {
    if (exe4JController == null) {
      exe4JController = new Exe4JController();
    }
    return exe4JController;
  }
  
  public void writeMessage(String paramString)
    throws BaseConnectionException
  {
    if (currentAction != 1)
    {
      currentMessage = paramString;
      currentAction = 2;
    }
  }
  
  public void hide()
    throws BaseConnectionException
  {
    currentAction = 1;
  }
  
  public static int getAction()
  {
    int i = currentAction;
    currentAction = 0;
    return i;
  }
  
  public static String getText()
  {
    return currentMessage;
  }
}

/* Location:
 * Qualified Name:     com.exe4j.runtime.Exe4JController
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j.runtime;

import com.exe4j.runtime.util.InternalErrorFrame;
import com.exe4j.runtime.util.LazyFileOutputStream;
import com.exe4j.runtime.util.NullOutputStream;
import com.exe4j.runtime.util.ResourceHelper;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Properties;

public class LauncherEngine
{
  private static Properties properties;
  public static final String DEV_NULL = "/dev/null";
  public static final String PROPNAME_MODULE_NAME = "exe4j.moduleName";
  public static final String PROPNAME_APP_DIR = "install4j.appDir";
  public static final String PROPNAME_EXE_DIR = "install4j.exeDir";
  public static final int EXE4J_MAGIC = -387705899;
  
  public static void launch(String paramString1, String[] paramArrayOfString, String paramString2, String paramString3, boolean paramBoolean1, boolean paramBoolean2, ClassLoader paramClassLoader)
  {
    String str = System.getProperty("exe4j.moduleName");
    if (str != null) {
      try
      {
        System.setProperty("install4j.exeDir", new File(str).getParentFile().getCanonicalPath() + File.separator);
      }
      catch (IOException localIOException) {}
    }
    if ((!WinLauncher.isUsed()) || (WinLauncher.APP_MODE_INSTALL4J)) {
      System.setProperty("install4j.appDir", ResourceHelper.getRuntimeDir().getParentFile().getAbsolutePath() + File.separator);
    }
    try
    {
      try
      {
        doRedirection(paramString2, paramString3);
      }
      catch (Throwable localThrowable1)
      {
        localThrowable1.printStackTrace();
      }
      try
      {
        Class[] arrayOfClass = new Class[1];
        arrayOfClass[0] = new String[0].getClass();
        localObject = new Object[1];
        localObject[0] = paramArrayOfString;
        Class localClass = paramClassLoader.loadClass(paramString1);
        Method localMethod = localClass.getDeclaredMethod("main", arrayOfClass);
        localMethod.setAccessible(true);
        localMethod.invoke(null, (Object[])localObject);
      }
      catch (InvocationTargetException localInvocationTargetException)
      {
        Object localObject = localInvocationTargetException.getCause();
        handleFailure(paramBoolean1, paramBoolean2, localObject != null ? localObject : localInvocationTargetException);
      }
      catch (Throwable localThrowable2)
      {
        handleFailure(paramBoolean1, paramBoolean2, localThrowable2);
      }
    }
    catch (Throwable localThrowable3)
    {
      handleFailure(true, paramBoolean2, localThrowable3);
    }
  }
  
  public static String getProperty(int paramInt)
  {
    return properties.getProperty(String.valueOf(paramInt));
  }
  
  public static boolean getBooleanProperty(int paramInt)
  {
    try
    {
      return Integer.parseInt(getProperty(paramInt)) == 1;
    }
    catch (NumberFormatException localNumberFormatException) {}
    return false;
  }
  
  public static int getIntProperty(int paramInt)
  {
    try
    {
      return Integer.parseInt(getProperty(paramInt));
    }
    catch (NumberFormatException localNumberFormatException) {}
    return 0;
  }
  
  public static void setProperties(Properties paramProperties)
  {
    properties = paramProperties;
  }
  
  private static void handleFailure(boolean paramBoolean1, boolean paramBoolean2, Throwable paramThrowable)
  {
    if (paramThrowable != null) {
      paramThrowable.printStackTrace();
    }
    if (paramBoolean1) {
      if (paramBoolean2) {
        new InternalErrorFrame(paramThrowable).setVisible(true);
      } else {
        System.exit(1);
      }
    }
  }
  
  private static void doRedirection(String paramString1, String paramString2)
    throws FileNotFoundException
  {
    PrintStream localPrintStream1 = null;
    if (paramString2.equals("/dev/null"))
    {
      System.setOut(new PrintStream(new NullOutputStream()));
    }
    else if ((paramString2.length() > 0) && (checkRedirectionFile(paramString2)))
    {
      localPrintStream1 = new PrintStream(new BufferedOutputStream(new LazyFileOutputStream(paramString2)), true);
      System.setOut(localPrintStream1);
    }
    if (paramString1.equals("/dev/null"))
    {
      System.setErr(new PrintStream(new NullOutputStream()));
    }
    else if ((paramString1.length() > 0) && (checkRedirectionFile(paramString1)))
    {
      PrintStream localPrintStream2;
      if (paramString1.equalsIgnoreCase(paramString2)) {
        localPrintStream2 = localPrintStream1;
      } else {
        localPrintStream2 = new PrintStream(new LazyFileOutputStream(paramString1), true);
      }
      System.setErr(localPrintStream2);
    }
  }
  
  private static boolean checkRedirectionFile(String paramString)
    throws FileNotFoundException
  {
    File localFile1 = new File(paramString);
    File localFile2 = localFile1.getParentFile();
    localFile2.mkdirs();
    if (!localFile2.exists()) {
      throw new FileNotFoundException("log file directory '" + localFile2 + "' doesn't exist.");
    }
    if (localFile1.exists()) {
      return localFile1.canWrite();
    }
    return localFile2.canWrite();
  }
}

/* Location:
 * Qualified Name:     com.exe4j.runtime.LauncherEngine
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j.runtime;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

final class WinLauncher$1
  extends Thread
{
  WinLauncher$1(String paramString)
  {
    super(paramString);
  }
  
  public void run()
  {
    try
    {
      InputStream localInputStream = System.in;
      BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(localInputStream, "UTF-8"));
      while (localInputStream.available() < 1) {
        Thread.sleep(200L);
      }
      String str = localBufferedReader.readLine();
      if (Integer.parseInt(str) == 1) {
        WinLauncher.exitMessage();
      }
      System.exit(0);
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      System.exit(1);
    }
  }
}

/* Location:
 * Qualified Name:     com.exe4j.runtime.WinLauncher.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j.runtime;

final class WinLauncher$2
  extends Thread
{
  WinLauncher$2(String paramString1, String paramString2, String paramString3, String paramString4, boolean paramBoolean1, boolean paramBoolean2)
  {
    super(paramString1);
  }
  
  public void run()
  {
    LauncherEngine.launch(val$className, WinLauncher.access$000(), val$stdErrFile, val$stdOutFile, val$failOnMainMethodException, val$guiApplication, ClassLoader.getSystemClassLoader());
  }
}

/* Location:
 * Qualified Name:     com.exe4j.runtime.WinLauncher.2
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j.runtime;

import com.exe4j.runtime.util.WinDel;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

final class WinLauncher$3
  extends Thread
{
  WinLauncher$3(String paramString1, String paramString2)
  {
    super(paramString1);
  }
  
  public void run()
  {
    try
    {
      ArrayList localArrayList1 = new ArrayList();
      ArrayList localArrayList2 = new ArrayList();
      File localFile = new File(val$tempDir);
      WinLauncher.access$100(localArrayList1, localArrayList2, localFile);
      WinDel.prepareDeletion(new File(val$tempDir, "i4jdel.exe"));
      String str = localFile.getName();
      int i = str.lastIndexOf("_dir");
      if (i > 0) {
        str = str.substring(0, i);
      }
      localArrayList2.add(new File(localFile.getParent(), str));
      WinDel.scheduleDeletion(localArrayList2, localArrayList1, false);
    }
    catch (IOException localIOException) {}
  }
}

/* Location:
 * Qualified Name:     com.exe4j.runtime.WinLauncher.3
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j.runtime;

import com.exe4j.Controller;
import com.exe4j.runtime.util.ArgumentStack;
import com.exe4j.runtime.util.WinDel;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import javax.swing.JOptionPane;

public class WinLauncher
{
  public static final String PROCESS_COMM_FILE_NAME = System.getProperty("exe4j.processCommFile");
  static final boolean APP_MODE_INSTALL4J = Boolean.getBoolean("exe4j.isInstall4j");
  private static final boolean IS_SERVICE = Boolean.getBoolean("exe4j.isService");
  private static final String PROPNAME_LAUNCH_NAME = "exe4j.launchName";
  private static final String PROPNAME_TEMP_DIR = "exe4j.tempDir";
  public static final String PROPNAME_UNEXTRACTED_POSITION = "exe4j.unextractedPosition";
  private static String[] originalArgs;
  private static boolean used = false;
  
  public static boolean isService()
  {
    return IS_SERVICE;
  }
  
  public static void main(String[] paramArrayOfString)
  {
    used = true;
    if (PROCESS_COMM_FILE_NAME != null)
    {
      new File(PROCESS_COMM_FILE_NAME).deleteOnExit();
      Controller.registerStartupListener(null);
    }
    if (Boolean.getBoolean("exe4j.jev")) {
      JOptionPane.showMessageDialog(null, "This executable was created with an evaluation version of " + (APP_MODE_INSTALL4J ? "install4j." : "exe4j."), "Evaluation", 1);
    }
    registerCleanup();
    ArgumentStack localArgumentStack = new ArgumentStack(paramArrayOfString);
    final boolean bool1 = localArgumentStack.popBoolean();
    final String str1 = localArgumentStack.popString();
    final String str2 = localArgumentStack.popString();
    final String str3 = localArgumentStack.popString();
    final boolean bool2 = localArgumentStack.popBoolean();
    try
    {
      String str4 = localArgumentStack.popString();
      System.setProperty("exe4j.launchName", str4);
    }
    catch (NoSuchElementException localNoSuchElementException) {}
    originalArgs = localArgumentStack.getStringArray();
    if (IS_SERVICE)
    {
      Thread local1 = new Thread("_shutdown_waiter")
      {
        public void run()
        {
          try
          {
            InputStream localInputStream = System.in;
            BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(localInputStream, "UTF-8"));
            while (localInputStream.available() < 1) {
              Thread.sleep(200L);
            }
            String str = localBufferedReader.readLine();
            if (Integer.parseInt(str) == 1) {
              WinLauncher.exitMessage();
            }
            System.exit(0);
          }
          catch (Exception localException)
          {
            localException.printStackTrace();
            System.exit(1);
          }
        }
      };
      local1.setDaemon(true);
      local1.start();
      new Thread("main")
      {
        public void run()
        {
          LauncherEngine.launch(str1, WinLauncher.originalArgs, str2, str3, bool2, bool1, ClassLoader.getSystemClassLoader());
        }
      }.start();
    }
    else
    {
      LauncherEngine.launch(str1, originalArgs, str2, str3, bool2, bool1, ClassLoader.getSystemClassLoader());
    }
  }
  
  private static void registerCleanup()
  {
    final String str = System.getProperty("exe4j.tempDir");
    Integer localInteger = Integer.getInteger("exe4j.unextractedPosition");
    if ((str != null) && (str.trim().length() > 0) && ((localInteger == null) || (localInteger.intValue() != -1)))
    {
      WinDel.setUsed(true);
      Runtime.getRuntime().addShutdownHook(new Thread("temp_deletion_starter")
      {
        public void run()
        {
          try
          {
            ArrayList localArrayList1 = new ArrayList();
            ArrayList localArrayList2 = new ArrayList();
            File localFile = new File(str);
            WinLauncher.fill(localArrayList1, localArrayList2, localFile);
            WinDel.prepareDeletion(new File(str, "i4jdel.exe"));
            String str = localFile.getName();
            int i = str.lastIndexOf("_dir");
            if (i > 0) {
              str = str.substring(0, i);
            }
            localArrayList2.add(new File(localFile.getParent(), str));
            WinDel.scheduleDeletion(localArrayList2, localArrayList1, false);
          }
          catch (IOException localIOException) {}
        }
      });
    }
  }
  
  public static String[] appendOriginalArgs(String[] paramArrayOfString)
  {
    String[] arrayOfString = new String[paramArrayOfString.length + originalArgs.length];
    System.arraycopy(paramArrayOfString, 0, arrayOfString, 0, paramArrayOfString.length);
    System.arraycopy(originalArgs, 0, arrayOfString, paramArrayOfString.length, originalArgs.length);
    return arrayOfString;
  }
  
  static boolean isUsed()
  {
    return used;
  }
  
  private static void fill(List paramList1, List paramList2, File paramFile)
  {
    File[] arrayOfFile = paramFile.listFiles();
    if (arrayOfFile != null)
    {
      for (int i = 0; i < arrayOfFile.length; i++)
      {
        File localFile = arrayOfFile[i];
        if (localFile.isDirectory()) {
          fill(paramList1, paramList2, localFile);
        } else {
          paramList2.add(localFile);
        }
      }
      paramList1.add(paramFile);
    }
  }
  
  public static void exitMessage()
  {
    System.err.println("*******************************************************************");
    System.err.println("This is an evaluation version of exe4j. The service is terminated");
    System.err.println("after 30 minutes. A licensed version of exe4j will create services");
    System.err.println("without this restriction.");
    System.err.println("*******************************************************************");
  }
}

/* Location:
 * Qualified Name:     com.exe4j.runtime.WinLauncher
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package com.exe4j.runtime.util;

import java.util.LinkedList;

public class ArgumentStack
{
  private LinkedList list = new LinkedList();
  
  public ArgumentStack(String[] paramArrayOfString)
  {
    for (int i = 0; i < paramArrayOfString.length; i++) {
      list.add(paramArrayOfString[i]);
    }
  }
  
  public String popString()
  {
    return (String)list.removeFirst();
  }
  
  public boolean popBoolean()
  {
    return new Boolean(popString()).booleanValue();
  }
  
  public int popInt()
  {
    try
    {
      return Integer.parseInt(popString());
    }
    catch (NumberFormatException localNumberFormatException) {}
    return 0;
  }
  
  public String[] getStringArray()
  {
    int i = list.size();
    String[] arrayOfString = new String[i];
    for (int j = 0; j < i; j++) {
      arrayOfString[j] = popString();
    }
    return arrayOfString;
  }
  
  public int size()
  {
    return list.size();
  }
}

/* Location:
 * Qualified Name:     com.exe4j.runtime.util.ArgumentStack
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package c
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd