刘小帅

去重 获取应用版本号
function uniqueArr(arr) { for (let i = 1; i<arr.le...
扫描右侧二维码阅读全文
12
2021/05

去重 获取应用版本号

function uniqueArr(arr) {
    for (let i = 1; i<arr.length;i++) {
        if (arr[i-1] === arr[i]) {
            arr.splice(i-1,1)
            i--
        }
    }
    return arr
}

function getPackageVersion(packageName) {
    importPackage(android.content);
    var pckMan = context.getPackageManager();
    var packageInfo = pckMan.getPackageInfo(packageName, 0);
    return packageInfo.versionName;
};
Last modification:May 18th, 2021 at 04:01 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment