| | |
| | | if (array1 != null) |
| | | for (int j = 0; j < array1.size(); j++) { |
| | | item = array1.optJSONObject(j); |
| | | if (item != null && !StringUtil.isNullOrEmpty(item.optString("version") )) { |
| | | if (item != null && !StringUtil.isNullOrEmpty(item.optString("version"))) { |
| | | return item.optString("version").trim(); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取vivo最新的版本号 |
| | | * |
| | | * @param appId |
| | | * @return |
| | | */ |
| | | public static Integer getVIVOLatestVersionCode(String appId) { |
| | | try { |
| | | String url = String.format("https://hf.appstore.vivo.com.cn/detail/%s?frompage=messageh5&imei=1234567890&av=18&app_version=2100&pictype=webp&h5_websource=h5appstore", appId); |
| | | System.out.println(url); |
| | | String result = HttpUtil.get(url); |
| | | JSONObject root = JSONObject.fromObject(result); |
| | | return root.optInt("version_code"); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |