admin
2021-02-06 d1f26741bddf6f512d62c0100d42c52be8d37e76
utils/src/main/java/org/yeshi/utils/AppMarketUtil.java
@@ -30,7 +30,7 @@
                    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();
                            }
                        }
@@ -44,4 +44,25 @@
    }
    /**
     * 获取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;
    }
}