简体   繁体   English

如何检查cordova/phonegap项目的cordova android版本?

[英]How to check cordova android version of a cordova/phonegap project?

I have received a Security Alert from Google this week that tells me to upgrade my android version of cordova app.本周我收到了来自 Google 的安全警报,告诉我升级我的 android 版本的 cordova 应用程序。 The email from google is as below -来自谷歌的电子邮件如下 -

This is a notification that your --apps ids--, is built on a version of Apache Cordova that contains security vulnerabilities.这是一个通知,表明您的 --apps ids-- 是基于包含安全漏洞的 Apache Cordova 版本构建的。 This includes a high severity cross-application scripting (XAS) vulnerability.这包括一个高严重性的跨应用程序脚本 (XAS) 漏洞。 Under certain circumstances, vulnerable apps could be remotely exploited to steal sensitive information, such as user login credentials.在某些情况下,易受攻击的应用程序可能会被远程利用来窃取敏感信息,例如用户登录凭据。

You should upgrade to Apache Cordova 3.5.1 or higher as soon as possible.您应该尽快升级到 Apache Cordova 3.5.1 或更高版本。 For more information about the vulnerabilities, and for guidance on upgrading Apache Cordova, please see http://cordova.apache.org/announcements/2014/08/04/android-351.html .有关漏洞的更多信息以及升级 Apache Cordova 的指导,请参阅http://cordova.apache.org/announcements/2014/08/04/android-351.html

Please note, applications with vulnerabilities that expose users to risk of compromise may be considered “dangerous products” and subject to removal from Google Play.请注意,具有使用户面临入侵风险的漏洞的应用程序可能被视为“危险产品”,可能会从 Google Play 中删除。

So, I needed to check the current version of my cordova apps.所以,我需要检查我的科尔多瓦应用程序的当前版本。 I can upgrade my cordova installation by using npm update -g cordova on windows cmd.我可以通过在 windows cmd 上使用npm update -g cordova来升级我的 cordova 安装。 The question is how can I check the current platform (android in my case) version of my cordova app?问题是如何检查我的科尔多瓦应用程序的当前平台(在我的情况下是 android)版本?

The current platform version of a cordova app can be checked by the following command可以通过以下命令检查 cordova 应用程序的当前平台版本

cordova platform version android

And can be upgraded using the command并且可以使用命令升级

cordova platform update android

You can replace android by any of your platform choice like "ios" or some else.您可以用任何平台选择(例如“ios”或其他平台)替换 android。

This only applies to android platform.这仅适用于android平台。 I have not checked.我没有检查。 You can try replacing android in the code segments to try for other platforms.您可以尝试将代码段中的android替换为其他平台。

Run

cordova -v 

to see the currently running version.查看当前运行的版本。 Run the npm info command运行 npm info 命令

npm info cordova

for a longer listing that includes the current version along with other available version numbers包含当前版本以及其他可用版本号的更长列表

just type cordova platform ls只需输入cordova platform ls

This will list all the platforms installed along with its version and available for installation plus :)这将列出所有已安装的平台及其版本,并可用于安装:)

Try尝试

cordova platform version科尔多瓦平台版本

It will give you the following output它会给你以下输出

Installed platforms: android 3.5.1, ios 3.5.0
Available platforms: amazon-fireos, blackberry10, browser, firefoxos

Also to know the version of cordodva cli try还要知道cordodva cli的版本试试

cordova -v 

文件platforms/platforms.json列出了所有平台版本。

最新版本的 Cordova 在 www/cordova.js 中有版本号。

要获取有关 cordova 包的所有信息,请使用以下命令:

npm info cordova

After upgrading the Application.升级应用程序后。 I observed different Cordova versions.我观察了不同的 Cordova 版本。

  1. Apache Cordova Cli version which is 6.0.0. Apache Cordova Cli 版本是 6.0.0。
  2. Cordova Android version which is 5.1.0. Cordova Android 版本是 5.1.0。
  3. Cordova IOS version which is 4.1.1. Cordova IOS 版本是 4.1.1。
  4. Docs version is which is 6.0.0, shown on the Cordova Docs website. Docs 版本是 6.0.0,显示在 Cordova Docs 网站上。

Now i am confused, On which version basis, Google Dev Console is giving warning?现在我很困惑,Google Dev Console 在哪个版本的基础上发出警告?

Please migrate your app(s) to Apache Cordova v.4.1.1 or higher as soon as possible and increment the version number of the upgraded APK.请尽快将您的应用迁移到 Apache Cordova v.4.1.1 或更高版本,并增加升级后 APK 的版本号。 Beginning May 9, 2016, Google Play will block publishing of any new apps or updates that use pre-4.1.1 versions of Apache Cordova.从 2016 年 5 月 9 日开始,Google Play 将禁止发布任何使用 Apache Cordova 4.1.1 之前版本的新应用或更新。

The vulnerabilities were addressed in Apache Cordova 4.1.1.这些漏洞已在 Apache Cordova 4.1.1 中得到解决。 If you're using a 3rd party library that bundles Apache Cordova, you'll need to upgrade it to a version that bundles Apache Cordova 4.1.1 or later.如果您使用的是捆绑 Apache Cordova 的第 3 方库,则需要将其升级到捆绑 Apache Cordova 4.1.1 或更高版本的版本。

And before upgrading.并且在升级之前。 Our Application versions were these.我们的应用程序版本是这些。

  1. Apache Cordova Cli version which is 5.4.1. Apache Cordova Cli 版本是 5.4.1。
  2. Cordova Android version which is 4.1.1. Cordova Android 版本是 4.1.1。
  3. Cordova IOS version which is 3.9.1. Cordova IOS 版本是 3.9.1。
  4. Docs version is which is 5.4.1, shown on the Cordova Docs website. Docs 版本是 5.4.1,显示在 Cordova Docs 网站上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM