/*
 * Decompiled with CFR 0_110.
 * 
 * Could not load the following classes:
 *  android.app.Activity
 *  android.content.Context
 *  android.content.pm.PackageInfo
 *  android.content.pm.PackageManager
 *  android.net.wifi.WifiInfo
 *  android.net.wifi.WifiManager
 *  android.os.Bundle
 *  android.util.Log
 *  java.io.PrintStream
 *  java.lang.Class
 *  java.lang.Exception
 *  java.lang.Object
 *  java.lang.String
 *  java.lang.System
 *  java.util.ArrayList
 */
package com.xinli.portalclient;

import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.util.Log;
import com.google.code.microlog4android.Logger;
import com.google.code.microlog4android.LoggerFactory;
import com.google.code.microlog4android.config.PropertyConfigurator;
import java.io.PrintStream;
import java.util.ArrayList;

public class BaseActivity
extends Activity {
    public static final String TAG = "BaseActivity";
    protected static ArrayList<Activity> activityList = new ArrayList();
    protected final transient Logger logger;
    WifiManager wifiManager;

    public BaseActivity() {
        this.logger = LoggerFactory.getLogger(this.getClass());
    }

    public static int ntol(int n) {
        return (n & 255) << 24 | (255 & n >> 8) << 16 | (255 & n >> 16) << 8 | 255 & n >> 24;
    }

    public void finish() {
        super.finish();
        if (activityList.contains((Object)this)) {
            activityList.remove((Object)this);
        }
    }

    public int getLocalIpAddress() {
        int n = this.wifiManager.getConnectionInfo().getIpAddress();
        System.out.println("======1111111==========" + n + "str= " + this.intToIp(n));
        return n;
    }

    public String getVersionName() {
        try {
            PackageManager packageManager = this.getPackageManager();
            this.logger.debug("-getVersionName-----2-------" + (Object)packageManager);
            PackageInfo packageInfo = packageManager.getPackageInfo(this.getPackageName(), 0);
            this.logger.debug("-getVersionName------versionName------" + (Object)packageManager);
            String string2 = packageInfo.versionName;
            return string2;
        }
        catch (Exception var1_4) {
            this.logger.debug("-getVersionName-----1-------");
            this.logger.error((Object)var1_4);
            return null;
        }
    }

    public String intToIp(int n) {
        return String.valueOf((int)(n & 255)) + "." + (255 & n >> 8) + "." + (255 & n >> 16) + "." + (255 & n >> 24);
    }

    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.wifiManager = (WifiManager)this.getSystemService("wifi");
        PropertyConfigurator.getConfigurator((Context)this).configure();
        activityList.add((Object)this);
        Log.i((String)"BaseActivity", (String)activityList.toString());
    }

    protected void onDestroy() {
        super.onDestroy();
        activityList.remove((Object)this);
    }
}

