// Path: app/src/main/java/com/leelit/stuer/base_presenter/IPresenter.java
// public interface IPresenter {
//     void doClear();
// 
// }
// 
// Path: app/src/main/java/com/leelit/stuer/constant/NetConstant.java
// public class NetConstant {
// 
//     public static final int NET_ERROR_RECORD_EXISTED = 601;
// 
//     //    public static final String HOST = "http://192.168.191.1:8080/STUer/";
//     public static final String HOST = "http://stuer.applinzi.com/";
// 
//     public static final String IMAGE_HOST = "http://stuer-picture.stor.sinaapp.com/";
// 
// }
// 
// Path: app/src/main/java/com/leelit/stuer/utils/AppInfoUtils.java
// public class AppInfoUtils {
//     public static String getAppName() {
//         return MyApplication.context.getString(R.string.app_name);
//     }
// 
//     public static String getImei() {
//         TelephonyManager tm = ((TelephonyManager) MyApplication.context.getSystemService(Activity.TELEPHONY_SERVICE));
//         String imei = tm.getDeviceId();
//         if (imei != null && !imei.isEmpty()) {
//             return imei;
//         }
//         return "";
//     }
// 
//     /**
//      * 产生唯一订单号
//      * @return
//      */
//     public static String getUniqueCode() {
//         String imei = AppInfoUtils.getImei();
//         Date date = new Date();
//         String unique = imei + date.hashCode();
//         return String.valueOf(unique.hashCode());
//     }
// }


import com.leelit.stuer.base_presenter.IPresenter;
import com.leelit.stuer.constant.NetConstant;
import com.leelit.stuer.utils.AppInfoUtils;
import java.io.IOException;
import okhttp3.ResponseBody;
import rx.Subscriber;
                mView.netError();
            }

            @Override
            public void onNext(ResponseBody responseBody) {
                mView.dismissCheckUpdateProgressDialog();
                String latestVersionAndInfo = "";
                String latestVersion = MyApplication.VERSION;
                String info = "";
                try {
                    latestVersionAndInfo = responseBody.string(); // 得到最新的版本
                    // ..-version-info
                    latestVersion = latestVersionAndInfo.split("-")[1];
                    info = latestVersionAndInfo.split("-")[2];
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (latestVersion.equals(MyApplication.VERSION)) {
                    mView.noNewVersion();
                } else {
                    String newVersionUrl = NetConstant.HOST + AppInfoUtils.getAppName() + "_" + latestVersion + ".apk";
                    mView.doAfterNewVersionExist(newVersionUrl, info);
                }
            }
        };
        mModel.getNewVersion(mSubscriber1);
    }

    @Override
    public void doClear() {
// Path: app/src/main/java/com/leelit/stuer/base_presenter/IPresenter.java
// public interface IPresenter {
//     void doClear();
// 
// }
// 
// Path: app/src/main/java/com/leelit/stuer/constant/NetConstant.java
// public class NetConstant {
// 
//     public static final int NET_ERROR_RECORD_EXISTED = 601;
// 
//     //    public static final String HOST = "http://192.168.191.1:8080/STUer/";
//     public static final String HOST = "http://stuer.applinzi.com/";
// 
//     public static final String IMAGE_HOST = "http://stuer-picture.stor.sinaapp.com/";
// 
// }
// 
// Path: app/src/main/java/com/leelit/stuer/utils/AppInfoUtils.java
// public class AppInfoUtils {
//     public static String getAppName() {
//         return MyApplication.context.getString(R.string.app_name);
//     }
// 
//     public static String getImei() {
//         TelephonyManager tm = ((TelephonyManager) MyApplication.context.getSystemService(Activity.TELEPHONY_SERVICE));
//         String imei = tm.getDeviceId();
//         if (imei != null && !imei.isEmpty()) {
//             return imei;
//         }
//         return "";
//     }
// 
//     /**
//      * 产生唯一订单号
//      * @return
//      */
//     public static String getUniqueCode() {
//         String imei = AppInfoUtils.getImei();
//         Date date = new Date();
//         String unique = imei + date.hashCode();
//         return String.valueOf(unique.hashCode());
//     }
// }


// Path: app/src/main/java/com/leelit/stuer/UpdatePresenter.java
import com.leelit.stuer.base_presenter.IPresenter;
import com.leelit.stuer.constant.NetConstant;
import com.leelit.stuer.utils.AppInfoUtils;
import java.io.IOException;
import okhttp3.ResponseBody;
import rx.Subscriber;

                mView.netError();
            }

            @Override
            public void onNext(ResponseBody responseBody) {
                mView.dismissCheckUpdateProgressDialog();
                String latestVersionAndInfo = "";
                String latestVersion = MyApplication.VERSION;
                String info = "";
                try {
                    latestVersionAndInfo = responseBody.string(); // 得到最新的版本
                    // ..-version-info
                    latestVersion = latestVersionAndInfo.split("-")[1];
                    info = latestVersionAndInfo.split("-")[2];
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (latestVersion.equals(MyApplication.VERSION)) {
                    mView.noNewVersion();
                } else {
                    String newVersionUrl = NetConstant.HOST + AppInfoUtils.getAppName() + "_" + latestVersion + ".apk";
                    mView.doAfterNewVersionExist(newVersionUrl, info);
                }
            }
        };
        mModel.getNewVersion(mSubscriber1);
    }

    @Override
    public void doClear() {
        if (mSubscriber1 != null) {