| | |
| | | private static final String newProgramIndUrl = "http://upgrade.safeluck.com/ftp/aykj4/aks3.json"; |
| | | private static Upgrade instance = null; |
| | | private Context context; |
| | | private int province; |
| | | private int city; |
| | | |
| | | private DownloadManagerUtil downloadManagerUtil = null; |
| | | private InstallUtil installUtil = null; |
| | | private static final String SAVE_FILE_NAME = "aks3.apk"; |
| | |
| | | String result = CheckNewVersion(newProgramIndUrl); |
| | | |
| | | if (result != null) { |
| | | DfuFileInfo dfuFileInfo = parseJson(result, 53, 100); |
| | | DfuFileInfo dfuFileInfo = parseJson(result, province, city); |
| | | if (dfuFileInfo != null && dfuFileInfo.getValid()) { |
| | | if (dfuFileInfo.getAppVerCode() > 0 && dfuFileInfo.getAppUrl() != null) { |
| | | if (installUtil.getVerCode() < dfuFileInfo.getAppVerCode()) { |
| | |
| | | } |
| | | }; |
| | | |
| | | public void CheckUpgrade() { |
| | | public void CheckUpgrade(int province, int city) { |
| | | this.province = province; |
| | | this.city = city; |
| | | handlerCheckNewVersion.removeCallbacks(runnableCheckNewVersion); |
| | | handlerCheckNewVersion.postDelayed(runnableCheckNewVersion, 100); |
| | | } |