Compare commits

...
Author SHA1 Message Date
Erisu 034075d96a release(15.1.0): updated release notes & version 2026-07-18 13:51:10 +09:00
Manuel BeckandGitHub 61ebdcdec9 fix(SystemBarPlugin): remove canEdgeToEdge check for execute method (#1971)
- Setting `StatusBarBackgroundColor` by `config.xml` is allowed and influences the light/dark appeareance of the status bar in edge-to-edge mode. This should also be possible by the Status Bar JS API method `setBackgroundColor``, so a user can dynamically change the light/dark appeareance of the status bar, even if the background color is not applied visually.
2026-07-18 13:38:09 +09:00
80658ea401 chore(deps): bump github/codeql-action/analyze from 4.36.3 to 4.37.0 (#1973)
Bumps [github/codeql-action/analyze](https://github.com/github/codeql-action) from 4.36.3 to 4.37.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/54f647b7e1bb85c95cddabcd46b0c578ec92bc1a...99df26d4f13ea111d4ec1a7dddef6063f76b97e9)

---
updated-dependencies:
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-17 16:03:50 +09:00
89771e64c8 chore(deps): bump github/codeql-action/init from 4.36.3 to 4.37.0 (#1972)
Bumps [github/codeql-action/init](https://github.com/github/codeql-action) from 4.36.3 to 4.37.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/54f647b7e1bb85c95cddabcd46b0c578ec92bc1a...99df26d4f13ea111d4ec1a7dddef6063f76b97e9)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-17 15:58:41 +09:00
065a99d8f9 chore(deps): bump actions/setup-java from 5.4.0 to 5.5.0 (#1974)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5.4.0 to 5.5.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/1bcf9fb12cf4aa7d266a90ae39939e61372fe520...0f481fcb613427c0f801b606911222b5b6f3083a)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 5.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-17 15:52:32 +09:00
Manuel BeckandGitHub cdbeb603bd fix(statusbar.js): remove trailing whitespace in comment for lint (#1970)
- Lint complained about a trainling whitesapce in comment
2026-07-06 16:01:11 +02:00
Manuel BeckandGitHub 50ee09e492 doc(statusbar.js): document visible property and setBackgroundColor method (#1961) 2026-07-06 15:31:19 +02:00
d830222e40 chore(deps): bump github/codeql-action/analyze from 4.36.2 to 4.36.3 (#1969)
Bumps [github/codeql-action/analyze](https://github.com/github/codeql-action) from 4.36.2 to 4.36.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/8aad20d150bbac5944a9f9d289da16a4b0d87c1e...54f647b7e1bb85c95cddabcd46b0c578ec92bc1a)

---
updated-dependencies:
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.36.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-06 15:20:35 +02:00
1e2f0ca6c3 chore(deps): bump github/codeql-action/init from 4.36.2 to 4.36.3 (#1968)
Bumps [github/codeql-action/init](https://github.com/github/codeql-action) from 4.36.2 to 4.36.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/8aad20d150bbac5944a9f9d289da16a4b0d87c1e...54f647b7e1bb85c95cddabcd46b0c578ec92bc1a)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.36.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-06 15:19:46 +02:00
エリスandGitHub 654b03a327 chore(ci): update & clean workflow (#1966)
* chore(workflow): move action version number comment inline with usage
* chore(workflow): update matrix to use macos-26
* chore(workflow): add node-26 to test matrix
* chore: remove .ratignore, ci can use .rat-excludes
* chore(workflow): extract codeql to run once & improved path ignore list
2026-07-01 15:29:46 +09:00
acbc5b48c0 chore(deps): bump codecov/codecov-action from 4.6.0 to 7.0.0 (#1954)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.6.0 to 7.0.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238...fb8b3582c8e4def4969c97caa2f19720cb33a72f)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-30 16:04:55 +09:00
cb52fb8ddd chore(deps): bump actions/setup-java from 5.3.0 to 5.4.0 (#1965)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/ad2b38190b15e4d6bdf0c97fb4fca8412226d287...1bcf9fb12cf4aa7d266a90ae39939e61372fe520)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 5.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-30 16:00:00 +09:00
Manuel BeckandGitHub 7dd7f5042c chore: cleanup PermissionHelper (#1925)
* chore: cleanup PermissionHelper

- AndroidStudio complained about methods not found linked in JavaDoc for the class CordovaInterface: requestPermission(), requestPermissions() and hasPermission(). The parameter types were missing and were added.
- Removing unused imports

* fix: Add missing `@Deprecated` Java annotations
2026-06-30 15:58:16 +09:00
Manuel BeckandGitHub 1d01ea1fc0 doc: improve documentation of onRequestPermissionResult and onRequestPermissionsResult (#1920)
* doc: improve documentation of `onRequestPermissionResult` and `onRequestPermissionsResult`

- Make clear, that these methods are not only called, when the user grants permissions, but also when he denies them or the request was interrupted.
- Add note, how the call chain ist
- Make clear, that `onRequestPermissionResult` is legacy and should not be used anymore
- Add Android Developer documentation link for the new `onRequestPermissionsResult`

* doc: improve documentation

- Forgot to commit everything
2026-06-30 15:49:31 +09:00
エリスandGitHub 929f20542f chore: bump package 15.1.0-dev.0 & update package-lock (#1964) 2026-06-29 22:24:19 +09:00
Darryl PogueandGitHub dd3fd3571e fix(statusbar): Properly handle CSS colours (#1955) 2026-06-23 13:52:12 +09:00
7977149924 chore(deps): bump actions/checkout from 6.0.3 to 7.0.0 (#1959)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.3 to 7.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/df4cb1c069e1874edd31b4311f1884172cec0e10...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-23 13:49:10 +09:00
ebccedf691 chore(deps-dev): bump js-yaml from 4.1.1 to 4.2.0 (#1960)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.1 to 4.2.0.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.1...4.2.0)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.2.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-23 12:34:50 +09:00
e53dc373a4 chore(deps): bump actions/setup-java from 5.2.0 to 5.3.0 (#1958)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/be666c2fcd27ec809703dec50e508c2fdc7f6654...ad2b38190b15e4d6bdf0c97fb4fca8412226d287)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 5.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-22 23:14:25 +09:00
jcesarmobileandGitHub 80491e9a45 refactor: address warnings in SystemWebChromeClient.java (#1951)
* refactor: address warnings in SystemWebChromeClient.java
* remove local appContext variable
2026-06-22 22:09:13 +09:00
d90eeecbba chore(deps-dev): bump tmp from 0.2.6 to 0.2.7 (#1956)
Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.6 to 0.2.7.
- [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/raszi/node-tmp/compare/v0.2.6...v0.2.7)

---
updated-dependencies:
- dependency-name: tmp
  dependency-version: 0.2.7
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-15 10:07:30 -07:00
703ebeae81 chore(deps): bump actions/checkout from 6.0.2 to 6.0.3 (#1952)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-08 16:54:57 +02:00
363a9a772e chore(deps): bump github/codeql-action from 4.36.0 to 4.36.2 (#1953)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.36.0 to 4.36.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/7211b7c8077ea37d8641b6271f6a365a22a5fbfa...8aad20d150bbac5944a9f9d289da16a4b0d87c1e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.36.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-08 16:54:26 +02:00
Gabriel Moré MaiaandGitHub f4ecf9974d fix(SystemBarPlugin): remove sentinel value INVALID_COLOR, use null instead (#1939)
- This change fixes an issue where the color #FFFFFFFF (fully opaque white) is treated as an invalid color when used for the status bar background.
- The problem happens because Color.parseColor("#FFFFFFFF") correctly returns -1, which collides with the current sentinel value used for INVALID_COLOR.
- Fixes #1938
2026-05-30 14:24:25 +02:00
a63c1e18ca chore(deps-dev): bump tmp from 0.2.5 to 0.2.6 (#1945)
Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.5 to 0.2.6.
- [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/raszi/node-tmp/compare/v0.2.5...v0.2.6)

---
updated-dependencies:
- dependency-name: tmp
  dependency-version: 0.2.6
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-28 15:27:23 +02:00
Manuel BeckandGitHub 661fadd083 doc(CordovaPreferences): Improve documentation for using Long.decode instead of Integer.decode (#1943)
- Document why Integer.decode cannot be used for hex values when thy exceed Integer.MAX_VALUE when parsed as positive number and Long.decode has to be used instead
2026-05-28 15:26:52 +02:00
74fbbdce32 chore(deps-dev): bump c8 from 10.1.3 to 11.0.0 (#1941)
Bumps [c8](https://github.com/bcoe/c8) from 10.1.3 to 11.0.0.
- [Release notes](https://github.com/bcoe/c8/releases)
- [Changelog](https://github.com/bcoe/c8/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bcoe/c8/compare/v10.1.3...v11.0.0)

---
updated-dependencies:
- dependency-name: c8
  dependency-version: 11.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-27 13:36:17 +09:00
a1f75a3e95 chore(deps): bump github/codeql-action from 4.35.5 to 4.36.0 (#1944)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.5 to 4.36.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/9e0d7b8d25671d64c341c19c0152d693099fb5ba...7211b7c8077ea37d8641b6271f6a365a22a5fbfa)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-27 11:34:38 +09:00
56e263fece chore: remove redundant Hello World template files (#1926)
* chore: remove redundant Hello World template files

- These files will be copied from the Cordova project to the platform folder already. Also this makes maintaining the hello world template more difficult.
- Added a README file as placeholder to keep the now empty templates/project/assets/www folder, so it breaks nothing, when the folder is not present.

* Update templates/project/assets/www/README

Co-authored-by: エリス <erisu@users.noreply.github.com>
2026-05-26 14:23:34 +09:00
4ce731dac2 chore(deps): bump erisu/apache-rat-action from 2.0.0 to 3.0.0 (#1937)
* chore(deps): bump erisu/apache-rat-action from 2.0.0 to 3.0.0

Bumps [erisu/apache-rat-action](https://github.com/erisu/apache-rat-action) from 2.0.0 to 3.0.0.
- [Release notes](https://github.com/erisu/apache-rat-action/releases)
- [Commits](https://github.com/erisu/apache-rat-action/compare/46fb01ce7d8f76bdcd7ab10e7af46e1ea95ca01c...30c94d10ed21e6f6fd5590dc5c158f58cae7a0dd)

---
updated-dependencies:
- dependency-name: erisu/apache-rat-action
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(workflow): update version info in comment

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: エリス <erisu@users.noreply.github.com>
2026-05-20 01:36:34 +09:00
b91144c0d4 fix: webview loses scrollability and creates empty bottom space (#1924)
Co-authored-by: Gabriel Moré Maia <gabriel.maia@cresol.com.br>
Co-authored-by: Manuel Beck <manuelbeck87@outlook.de>
2026-05-19 16:20:41 +02:00
c636f8bbe4 chore(deps): bump semver from 7.7.4 to 7.8.0 (#1934)
Bumps [semver](https://github.com/npm/node-semver) from 7.7.4 to 7.8.0.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.7.4...v7.8.0)

---
updated-dependencies:
- dependency-name: semver
  dependency-version: 7.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-19 23:12:59 +09:00
90b4b057a4 chore(deps-dev): bump jasmine from 6.1.0 to 6.2.0 (#1932)
Bumps [jasmine](https://github.com/jasmine/jasmine-npm) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/jasmine/jasmine-npm/releases)
- [Changelog](https://github.com/jasmine/jasmine-npm/blob/main/RELEASE.md)
- [Commits](https://github.com/jasmine/jasmine-npm/compare/v6.1.0...v6.2.0)

---
updated-dependencies:
- dependency-name: jasmine
  dependency-version: 6.2.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-19 23:12:39 +09:00
0baa901d6a chore(deps): bump erisu/license-checker-action from 2.0.1 to 2.1.0 (#1930)
* chore(deps): bump erisu/license-checker-action from 2.0.1 to 2.1.0

Bumps [erisu/license-checker-action](https://github.com/erisu/license-checker-action) from 2.0.1 to 2.1.0.
- [Release notes](https://github.com/erisu/license-checker-action/releases)
- [Commits](https://github.com/erisu/license-checker-action/compare/99cffa11264fe545fd0baa6c13bca5a00ae608f2...04511f4c052b5773f11e1c65b42cda88235c62ae)

---
updated-dependencies:
- dependency-name: erisu/license-checker-action
  dependency-version: 2.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(workflow): update version info in comment

---------

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: エリス <erisu@users.noreply.github.com>
2026-05-19 23:10:32 +09:00
21 changed files with 566 additions and 840 deletions
+57 -27
View File
@@ -25,31 +25,79 @@ on:
branches:
- '*'
permissions:
contents: read
security-events: write
jobs:
codeql:
name: CodeQL Analysis
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
fetch-depth: 1
- uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
with:
distribution: 'temurin'
java-version: '17'
# "bin/templates/platform_www/cordova.js" is ignored because it is a generated file.
# It contains mixed content from the npm package "cordova-js" and "./cordova-js-src".
# The report might not be resolvable because of the external package.
# If the report is related to this repository, it would be detected when scanning "./cordova-js-src".
- uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
languages: javascript, java-kotlin
queries: security-and-quality
# When 'build-mode' is set to 'none', CodeQL will create a database without
# requiring a build for Java. If Kotlin files are added in the future, build
# will be required.
build-mode: none
config: |
paths-ignore:
- coverage
- node_modules
- templates/project/assets/www/cordova.js
- test/androidx/app/src/main/assets/www/cordova.js
- framework/build/intermediates
- framework/build/outputs
- framework/build/reports
- framework/build/tmp
- test/androidx/build/intermediates
- test/androidx/build/outputs
- test/androidx/build/reports
- test/androidx/build/tmp
- uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
test:
name: NodeJS ${{ matrix.node-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
os: [ubuntu-latest, windows-latest, macos-15]
node-version: [20.x, 22.x, 24.x, 26.x]
os: [ubuntu-latest, windows-latest, macos-26]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
fetch-depth: 1
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node-version }}
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
- uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
with:
distribution: 'temurin'
java-version: '17'
@@ -60,31 +108,13 @@ jobs:
npm --version
gradle --version
# "bin/templates/platform_www/cordova.js" is ignored because it is a generated file.
# It contains mixed content from the npm package "cordova-js" and "./cordova-js-src".
# The report might not be resolvable because of the external package.
# If the report is related to this repository, it would be detected when scanning "./cordova-js-src".
- uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
with:
languages: javascript, java-kotlin
queries: security-and-quality
config: |
paths-ignore:
- coverage
- node_modules
- templates/project/assets/www/cordova.js
- test/androidx/app/src/main/assets/www/cordova.js
- name: npm install and test
run: |
npm cit
env:
CI: true
- uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
# v4.6.0
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
if: success()
with:
name: ${{ runner.os }} node.js ${{ matrix.node-version }}
+2 -1
View File
@@ -31,10 +31,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
fetch-depth: 1
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
+5 -5
View File
@@ -34,13 +34,13 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checkout project
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
fetch-depth: 1
# Check license headers (v2.0.0)
- uses: erisu/apache-rat-action@46fb01ce7d8f76bdcd7ab10e7af46e1ea95ca01c
# Check license headers
- uses: erisu/apache-rat-action@30c94d10ed21e6f6fd5590dc5c158f58cae7a0dd # v3.0.0
# Setup environment with node
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
@@ -51,8 +51,8 @@ jobs:
- name: npm install packages
run: npm ci
# Check node package licenses (v2.0.1)
- uses: erisu/license-checker-action@99cffa11264fe545fd0baa6c13bca5a00ae608f2
# Check node package licenses
- uses: erisu/license-checker-action@04511f4c052b5773f11e1c65b42cda88235c62ae # v2.1.0
with:
license-config: 'licence_checker.yml'
include-asf-category-a: true
-2
View File
@@ -15,8 +15,6 @@
# specific language governing permissions and limitations
# under the License.
# This file used by ATR
**/*.txt
.git/
coverage/
+64
View File
@@ -21,6 +21,70 @@
## Release Notes for Cordova (Android)
### 15.1.0
**Features:**
* feat: call new method `CordovaPlugin.onRequestPermissionsResult` ([#1855](https://github.com/apache/cordova-android/pull/1855)) [[b66f0f33](https://github.com/apache/cordova-android/commit/b66f0f33)]
* feat: deprecate `PermissionHelper` ([#1857](https://github.com/apache/cordova-android/pull/1857)) [[8c839764](https://github.com/apache/cordova-android/commit/8c839764)]
* feat: remove unused private Method `PermissionHelper.deliverPermissionResult` ([#1858](https://github.com/apache/cordova-android/pull/1858)) [[9c3d8268](https://github.com/apache/cordova-android/commit/9c3d8268)]
**Fixes:**
* fix: webview loses scrollability and creates empty bottom space ([#1924](https://github.com/apache/cordova-android/pull/1924)) [[b91144c0](https://github.com/apache/cordova-android/commit/b91144c0)]
* fix: handle permissions for getUserMedia ([#1895](https://github.com/apache/cordova-android/pull/1895)) [[24502178](https://github.com/apache/cordova-android/commit/24502178)]
* fix: overwritten backbutton not firing on first time by hardware button and never on back gesture ([#1910](https://github.com/apache/cordova-android/pull/1910)) [[0bfbc20b](https://github.com/apache/cordova-android/commit/0bfbc20b)]
* fix(android): use AndroidX `OnBackPressedCallback` instead of `OnBackInvokedCallback` ([#1903](https://github.com/apache/cordova-android/pull/1903)) [[9064bc07](https://github.com/apache/cordova-android/commit/9064bc07)]
* fix(gradle-9): unable to resolve class XmlParser for Groovy 4.x ([#1896](https://github.com/apache/cordova-android/pull/1896)) [[9ae489bd](https://github.com/apache/cordova-android/commit/9ae489bd)]
* fix(statusbar.js): remove trailing whitespace in comment for lint ([#1970](https://github.com/apache/cordova-android/pull/1970)) [[cdbeb603](https://github.com/apache/cordova-android/commit/cdbeb603)]
* fix(statusbar): Properly handle CSS colours ([#1955](https://github.com/apache/cordova-android/pull/1955)) [[dd3fd357](https://github.com/apache/cordova-android/commit/dd3fd357)]
* fix(SystemBarPlugin): remove `canEdgeToEdge` check for `execute` method ([#1971](https://github.com/apache/cordova-android/pull/1971)) [[61ebdcde](https://github.com/apache/cordova-android/commit/61ebdcde)]
* fix(SystemBarPlugin): remove sentinel value `INVALID_COLOR`, use `null` instead ([#1939](https://github.com/apache/cordova-android/pull/1939)) [[f4ecf997](https://github.com/apache/cordova-android/commit/f4ecf997)]
**Others**
* chore: cleanup PermissionHelper ([#1925](https://github.com/apache/cordova-android/pull/1925)) [[7dd7f504](https://github.com/apache/cordova-android/commit/7dd7f504)]
* chore: bump package 15.1.0-dev.0 & update package-lock ([#1964](https://github.com/apache/cordova-android/pull/1964)) [[929f2054](https://github.com/apache/cordova-android/commit/929f2054)]
* chore: remove redundant Hello World template files ([#1926](https://github.com/apache/cordova-android/pull/1926)) [[56e263fe](https://github.com/apache/cordova-android/commit/56e263fe)]
* chore: simplify edge-to-edge preference logic in CordovaActivity and SystemBarPlugin ([#1902](https://github.com/apache/cordova-android/pull/1902)) [[190076ba](https://github.com/apache/cordova-android/commit/190076ba)]
* chore: ignore gradle build artificat `problems-report.html` ([#1912](https://github.com/apache/cordova-android/pull/1912)) [[b1705d83](https://github.com/apache/cordova-android/commit/b1705d83)]
* chore: more license header updates ([#1909](https://github.com/apache/cordova-android/pull/1909)) [[1f70d396](https://github.com/apache/cordova-android/commit/1f70d396)]
* chore: update package-lock ([#1905](https://github.com/apache/cordova-android/pull/1905)) [[af56a003](https://github.com/apache/cordova-android/commit/af56a003)]
* chore(ci): update & clean workflow ([#1966](https://github.com/apache/cordova-android/pull/1966)) [[654b03a3](https://github.com/apache/cordova-android/commit/654b03a3)]
* chore(ci): improve workflows & dependabot ([#1928](https://github.com/apache/cordova-android/pull/1928)) [[08c4fd1e](https://github.com/apache/cordova-android/commit/08c4fd1e)]
* chore(deps-dev): bump js-yaml from 4.1.1 to 4.2.0 ([#1960](https://github.com/apache/cordova-android/pull/1960)) [[ebccedf6](https://github.com/apache/cordova-android/commit/ebccedf6)]
* chore(deps-dev): bump tmp from 0.2.6 to 0.2.7 ([#1956](https://github.com/apache/cordova-android/pull/1956)) [[d90eeecb](https://github.com/apache/cordova-android/commit/d90eeecb)]
* chore(deps-dev): bump tmp from 0.2.5 to 0.2.6 ([#1945](https://github.com/apache/cordova-android/pull/1945)) [[a63c1e18](https://github.com/apache/cordova-android/commit/a63c1e18)]
* chore(deps-dev): bump c8 from 10.1.3 to 11.0.0 ([#1941](https://github.com/apache/cordova-android/pull/1941)) [[74fbbdce](https://github.com/apache/cordova-android/commit/74fbbdce)]
* chore(deps-dev): bump jasmine from 6.1.0 to 6.2.0 ([#1932](https://github.com/apache/cordova-android/pull/1932)) [[90b4b057](https://github.com/apache/cordova-android/commit/90b4b057)]
* chore(deps): bump github/codeql-action/analyze from 4.36.3 to 4.37.0 ([#1973](https://github.com/apache/cordova-android/pull/1973)) [[80658ea4](https://github.com/apache/cordova-android/commit/80658ea4)]
* chore(deps): bump github/codeql-action/init from 4.36.3 to 4.37.0 ([#1972](https://github.com/apache/cordova-android/pull/1972)) [[89771e64](https://github.com/apache/cordova-android/commit/89771e64)]
* chore(deps): bump actions/setup-java from 5.4.0 to 5.5.0 ([#1974](https://github.com/apache/cordova-android/pull/1974)) [[065a99d8](https://github.com/apache/cordova-android/commit/065a99d8)]
* chore(deps): bump github/codeql-action/analyze from 4.36.2 to 4.36.3 ([#1969](https://github.com/apache/cordova-android/pull/1969)) [[d830222e](https://github.com/apache/cordova-android/commit/d830222e)]
* chore(deps): bump github/codeql-action/init from 4.36.2 to 4.36.3 ([#1968](https://github.com/apache/cordova-android/pull/1968)) [[1e2f0ca6](https://github.com/apache/cordova-android/commit/1e2f0ca6)]
* chore(deps): bump codecov/codecov-action from 4.6.0 to 7.0.0 ([#1954](https://github.com/apache/cordova-android/pull/1954)) [[acbc5b48](https://github.com/apache/cordova-android/commit/acbc5b48)]
* chore(deps): bump actions/setup-java from 5.3.0 to 5.4.0 ([#1965](https://github.com/apache/cordova-android/pull/1965)) [[cb52fb8d](https://github.com/apache/cordova-android/commit/cb52fb8d)]
* chore(deps): bump actions/checkout from 6.0.3 to 7.0.0 ([#1959](https://github.com/apache/cordova-android/pull/1959)) [[79771499](https://github.com/apache/cordova-android/commit/79771499)]
* chore(deps): bump actions/setup-java from 5.2.0 to 5.3.0 ([#1958](https://github.com/apache/cordova-android/pull/1958)) [[e53dc373](https://github.com/apache/cordova-android/commit/e53dc373)]
* chore(deps): bump actions/checkout from 6.0.2 to 6.0.3 ([#1952](https://github.com/apache/cordova-android/pull/1952)) [[703ebeae](https://github.com/apache/cordova-android/commit/703ebeae)]
* chore(deps): bump github/codeql-action from 4.36.0 to 4.36.2 ([#1953](https://github.com/apache/cordova-android/pull/1953)) [[363a9a77](https://github.com/apache/cordova-android/commit/363a9a77)]
* chore(deps): bump github/codeql-action from 4.35.5 to 4.36.0 ([#1944](https://github.com/apache/cordova-android/pull/1944)) [[a1f75a3e](https://github.com/apache/cordova-android/commit/a1f75a3e)]
* chore(deps): bump erisu/apache-rat-action from 2.0.0 to 3.0.0 ([#1937](https://github.com/apache/cordova-android/pull/1937)) [[4ce731da](https://github.com/apache/cordova-android/commit/4ce731da)]
* chore(deps): bump semver from 7.7.4 to 7.8.0 ([#1934](https://github.com/apache/cordova-android/pull/1934)) [[c636f8bb](https://github.com/apache/cordova-android/commit/c636f8bb)]
* chore(deps): bump erisu/license-checker-action from 2.0.1 to 2.1.0 ([#1930](https://github.com/apache/cordova-android/pull/1930)) [[0baa901d](https://github.com/apache/cordova-android/commit/0baa901d)]
* chore(deps): bump @xmldom/xmldom from 0.8.12 to 0.8.13 ([#1918](https://github.com/apache/cordova-android/pull/1918)) [[0d6fdd17](https://github.com/apache/cordova-android/commit/0d6fdd17)]
* chore(deps): bump lodash from 4.17.23 to 4.18.1 ([#1914](https://github.com/apache/cordova-android/pull/1914)) [[7b33c5dd](https://github.com/apache/cordova-android/commit/7b33c5dd)]
* chore(deps): bump @xmldom/xmldom from 0.8.11 to 0.8.12 ([#1911](https://github.com/apache/cordova-android/pull/1911)) [[c44a4627](https://github.com/apache/cordova-android/commit/c44a4627)]
* chore(deps): bump picomatch ([#1908](https://github.com/apache/cordova-android/pull/1908)) [[2868f93a](https://github.com/apache/cordova-android/commit/2868f93a)]
* chore(deps): bump minimatch ([#1898](https://github.com/apache/cordova-android/pull/1898)) [[31f3d57c](https://github.com/apache/cordova-android/commit/31f3d57c)]
* chore(gh-action): improve draft-release workflow ([#1906](https://github.com/apache/cordova-android/pull/1906)) [[340eade2](https://github.com/apache/cordova-android/commit/340eade2)]
* chore(INFRA): Set up default protection ruleset for default and release branches ([#1927](https://github.com/apache/cordova-android/pull/1927)) [[f490531d](https://github.com/apache/cordova-android/commit/f490531d)]
* chore(post-release): bump v15.0.1-dev.0 ([#1899](https://github.com/apache/cordova-android/pull/1899)) [[c02d1b03](https://github.com/apache/cordova-android/commit/c02d1b03)]
* doc: improve documentation of `onRequestPermissionResult` and `onRequestPermissionsResult` ([#1920](https://github.com/apache/cordova-android/pull/1920)) [[1d01ea1f](https://github.com/apache/cordova-android/commit/1d01ea1f)]
* doc(CordovaPreferences): Improve documentation for using Long.decode instead of Integer.decode ([#1943](https://github.com/apache/cordova-android/pull/1943)) [[661fadd0](https://github.com/apache/cordova-android/commit/661fadd0)]
* doc(statusbar.js): document `visible` property and `setBackgroundColor` method ([#1961](https://github.com/apache/cordova-android/pull/1961)) [[50ee09e4](https://github.com/apache/cordova-android/commit/50ee09e4)]
* refactor: address warnings in SystemWebChromeClient.java ([#1951](https://github.com/apache/cordova-android/pull/1951)) [[80491e9a](https://github.com/apache/cordova-android/commit/80491e9a)]
### 15.0.0
**Breaking Changes:**
+31 -17
View File
@@ -26,6 +26,11 @@ var statusBar = {};
const statusBarScript = document.createElement('script');
document.head.appendChild(statusBarScript);
/**
* Sets the visibility of the status bar, which will only work if Android EdgeToEdge is disabled.
* If cordova-plugin-statusbar is used, the call will be forwarded to `window.StatusBar.show` or
* `window.StatusBar.hide` of the plugin.
*/
Object.defineProperty(statusBar, 'visible', {
configurable: false,
enumerable: true,
@@ -52,6 +57,14 @@ Object.defineProperty(statusBar, 'visible', {
}
});
/**
* Sets the background color of the visible status bar.
* Supports valid CSS color values, e.g. `rebeccapurple`, `#RRGGBBAA`, `rgb(255 0 153)`.
*
* If cordova-plugin-statusbar is installed, calls are forwarded to the plugin API:
* `window.StatusBar.backgroundColorByHexString`
* See {@link https://s.apache.org/cdv-plugin-statusbar} for cordova-plugin-statusbar details.
*/
Object.defineProperty(statusBar, 'setBackgroundColor', {
configurable: false,
enumerable: false,
@@ -60,28 +73,29 @@ Object.defineProperty(statusBar, 'setBackgroundColor', {
statusBarScript.style.color = value;
var rgbStr = window.getComputedStyle(statusBarScript).getPropertyValue('color');
if (!rgbStr.match(/^rgb/)) { return; }
var rgbVals = rgbStr.match(/\d+/g).map(function (v) { return parseInt(v, 10); });
if (rgbVals.length < 3) {
if (!rgbStr.match(/^rgb/)) {
return;
} else if (rgbVals.length === 3) {
rgbVals = [255].concat(rgbVals);
}
// TODO: Use `padStart(2, '0')` once SDK 24 is dropped.
const padRgb = (val) => {
const hex = val.toString(16);
return hex.length === 1 ? '0' + hex : hex;
};
const a = padRgb(rgbVals[0]);
const r = padRgb(rgbVals[1]);
const g = padRgb(rgbVals[2]);
const b = padRgb(rgbVals[3]);
const hexStr = '#' + a + r + g + b;
var rgbVals = rgbStr.match(/[\d.]+/g).map(function (v, i) { return (i < 3) ? parseInt(v, 10) : parseFloat(v); });
if (rgbVals.length < 3) {
return;
}
if (window.StatusBar) {
// try to let the StatusBar plugin handle it
// TODO: Use `padStart(2, '0')` once SDK 24 is dropped.
const padRgb = (val) => {
const hex = val.toString(16);
return hex.length === 1 ? '0' + hex : hex;
};
const r = padRgb(rgbVals[0]);
const g = padRgb(rgbVals[1]);
const b = padRgb(rgbVals[2]);
const a = padRgb(255 * (rgbVals[3] !== undefined ? rgbVals[3] : 1.0));
const hexStr = '#' + a + r + g + b;
window.StatusBar.backgroundColorByHexString(hexStr);
} else {
exec(null, null, 'SystemBarPlugin', 'setStatusBarBackgroundColor', rgbVals);
@@ -225,13 +225,22 @@ public class CordovaActivity extends AppCompatActivity {
boolean isStatusBarVisible = statusBarView.getVisibility() != View.GONE;
int top = isStatusBarVisible && !canEdgeToEdge && !isFullScreen ? bars.top : 0;
int bottom = !canEdgeToEdge && !isFullScreen ? bars.bottom : 0;
int left = !canEdgeToEdge && !isFullScreen ? bars.left : 0;
int right = !canEdgeToEdge && !isFullScreen ? bars.right : 0;
Insets imeInsets = insets.getInsets(WindowInsetsCompat.Type.ime());
// When in fullscreen mode, we ignore bottom system insets (like the navigation bar)
// to allow the WebView to span the entire screen and avoid being pushed up.
int bottom = isFullScreen ? 0 : canEdgeToEdge ? imeInsets.bottom : Math.max(bars.bottom, imeInsets.bottom);
FrameLayout.LayoutParams webViewParams = (FrameLayout.LayoutParams) webView.getLayoutParams();
webViewParams.setMargins(left, top, right, bottom);
webView.setLayoutParams(webViewParams);
// Only update layout margins if the values have actually changed.
// This prevents redundant layout passes and potential infinite layout loops
if (webViewParams.leftMargin != left || webViewParams.topMargin != top
|| webViewParams.rightMargin != right || webViewParams.bottomMargin != bottom) {
webViewParams.setMargins(left, top, right, bottom);
webView.setLayoutParams(webViewParams);
}
FrameLayout.LayoutParams statusBarParams = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
@@ -416,7 +416,14 @@ public class CordovaPlugin {
}
/**
* Called by the system when the user grants permissions
* Forwarded system call to the plugin when the user grants permissions,
* denies them or the request was interrupted.
* This is a legacy method and should not be used anymore.
* Instead {@link #onRequestPermissionsResult} should be used.
*
* Note: The system calls {@link CordovaActivity#onRequestPermissionsResult(int, String[], int[])},
* which calls {@link CordovaInterfaceImpl#onRequestPermissionsResult(int, String[], int[])},
* and finally this method.
*
* @param requestCode
* @param permissions
@@ -430,11 +437,17 @@ public class CordovaPlugin {
}
/**
* Called by the system when the user grants permissions
* Forwarded system call to the plugin when the user grants permissions,
* denies them or the request was interrupted.
*
* Note: The system calls {@link CordovaActivity#onRequestPermissionsResult(int, String[], int[])},
* which calls {@link CordovaInterfaceImpl#onRequestPermissionsResult(int, String[], int[])},
* and finally this method.
*
* @param requestCode
* @param permissions
* @param grantResults
* @see https://developer.android.com/reference/android/app/Activity#onRequestPermissionsResult(int,%20java.lang.String[],%20int[])
*/
public void onRequestPermissionsResult(int requestCode, String[] permissions,
int[] grantResults) throws JSONException {
@@ -74,7 +74,10 @@ public class CordovaPreferences {
name = name.toLowerCase(Locale.ENGLISH);
String value = prefs.get(name);
if (value != null) {
// Use Integer.decode() can't handle it if the highest bit is set.
// Some 32-bit hex values (for example, 0x80000000) are valid int bit patterns
// but exceed Integer.MAX_VALUE when read as positive numbers. Integer.decode()
// rejects such values with NumberFormatException, so decode as long first and
// cast to int to preserve the intended 32-bit value.
return (int)(long)Long.decode(value);
}
return defaultValue;
@@ -33,7 +33,7 @@ import android.webkit.WebChromeClient.CustomViewCallback;
* are not expected to implement it.
*/
public interface CordovaWebView {
public static final String CORDOVA_VERSION = "15.0.0";
public static final String CORDOVA_VERSION = "15.1.0";
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);
@@ -18,12 +18,6 @@
*/
package org.apache.cordova;
import java.util.Arrays;
import org.json.JSONException;
import android.content.pm.PackageManager;
/**
* This class is permission helper class when compiling against older versions of cordova-android pre 5.0.0
* and provides reflective methods for permission requesting and checking so that plugins
@@ -38,6 +32,7 @@ import android.content.pm.PackageManager;
* @deprecated As of cordova-android 5.0.0, this class is no longer needed and will be removed in a future release.
* You can call directly into {@link CordovaInterface} methods instead with {@link CordovaPlugin#cordova}.
*/
@Deprecated
public class PermissionHelper {
/**
* Requests a "dangerous" permission for the application at runtime. This is a helper method
@@ -48,8 +43,9 @@ public class PermissionHelper {
* @param requestCode A requestCode to be passed to the plugin's onRequestPermissionResult()
* along with the result of the permission request
* @param permission The permission to be requested
* @deprecated As of cordova-android 5.0.0, use {@link CordovaInterface#requestPermission()} instead.
* @deprecated As of cordova-android 5.0.0, use {@link CordovaInterface#requestPermission(CordovaPlugin, int, String)} instead.
*/
@Deprecated
public static void requestPermission(CordovaPlugin plugin, int requestCode, String permission) {
PermissionHelper.requestPermissions(plugin, requestCode, new String[] {permission});
}
@@ -63,8 +59,9 @@ public class PermissionHelper {
* @param requestCode A requestCode to be passed to the plugin's onRequestPermissionResult()
* along with the result of the permissions request
* @param permissions The permissions to be requested
* @deprecated As of cordova-android 5.0.0, use {@link CordovaInterface#requestPermissions()} instead.
* @deprecated As of cordova-android 5.0.0, use {@link CordovaInterface#requestPermissions(CordovaPlugin, int, String[])} instead.
*/
@Deprecated
public static void requestPermissions(CordovaPlugin plugin, int requestCode, String[] permissions) {
plugin.cordova.requestPermissions(plugin, requestCode, permissions);
}
@@ -77,8 +74,9 @@ public class PermissionHelper {
* @param plugin The plugin the permission is being checked against
* @param permission The permission to be checked
* @return True if the permission has already been granted and false otherwise
* @deprecated As of cordova-android 5.0.0, use {@link CordovaInterface#hasPermission()} instead.
* @deprecated As of cordova-android 5.0.0, use {@link CordovaInterface#hasPermission(String)} instead.
*/
@Deprecated
public static boolean hasPermission(CordovaPlugin plugin, String permission) {
return plugin.cordova.hasPermission(permission);
}
@@ -39,15 +39,15 @@ import androidx.core.view.WindowInsetsControllerCompat;
import org.json.JSONArray;
import org.json.JSONException;
import java.util.Objects;
public class SystemBarPlugin extends CordovaPlugin {
static final String PLUGIN_NAME = "SystemBarPlugin";
static final int INVALID_COLOR = -1;
// Internal variables
private Context context;
private Resources resources;
private int overrideStatusBarBackgroundColor = INVALID_COLOR;
private Integer overrideStatusBarBackgroundColor = null;
private boolean canEdgeToEdge = false;
@@ -80,10 +80,6 @@ public class SystemBarPlugin extends CordovaPlugin {
@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
if(canEdgeToEdge) {
return false;
}
if ("setStatusBarVisible".equals(action)) {
boolean visible = args.getBoolean(0);
cordova.getActivity().runOnUiThread(() -> setStatusBarVisible(visible));
@@ -121,20 +117,16 @@ public class SystemBarPlugin extends CordovaPlugin {
* If the supplied ARGB is invalid or fails to parse, it will silently ignore
* the change request.
*
* @param argbVals {A, R, G, B}
* @param argbVals {R, G, B, A}
*/
private void setStatusBarBackgroundColor(JSONArray argbVals) {
try {
int a = argbVals.getInt(0);
int r = argbVals.getInt(1);
int g = argbVals.getInt(2);
int b = argbVals.getInt(3);
String hexColor = String.format("#%02X%02X%02X%02X", a, r, g, b);
int r = argbVals.getInt(0);
int g = argbVals.getInt(1);
int b = argbVals.getInt(2);
int a = Math.round(255 * (float)argbVals.optDouble(3, 1.0));
int parsedColor = parseColorFromString(hexColor);
if (parsedColor == INVALID_COLOR) return;
overrideStatusBarBackgroundColor = parsedColor;
overrideStatusBarBackgroundColor = Color.argb(a, r, g, b);
updateStatusBar(overrideStatusBarBackgroundColor);
} catch (JSONException e) {
// Silently skip
@@ -145,26 +137,26 @@ public class SystemBarPlugin extends CordovaPlugin {
* Attempt to update all system bars (status, navigation and gesture bars) in various points
* of the apps life cycle.
* For example:
* 1. Device configurations between (E.g. between dark and light mode)
* 2. User resumes the app
* 3. App transitions from SplashScreen Theme to App's Theme
* 1. Device configurations between (E.g. between dark and light mode)
* 2. User resumes the app
* 3. App transitions from SplashScreen Theme to App's Theme
*/
private void updateSystemBars() {
// Update Root View Background Color
int rootViewBackgroundColor = getPreferenceBackgroundColor();
if (rootViewBackgroundColor == INVALID_COLOR) {
Integer rootViewBackgroundColor = getPreferenceBackgroundColor();
if (rootViewBackgroundColor == null) {
rootViewBackgroundColor = canEdgeToEdge ? Color.TRANSPARENT : getUiModeColor();
}
updateRootView(rootViewBackgroundColor);
// Update StatusBar Background Color
int statusBarBackgroundColor;
if (overrideStatusBarBackgroundColor != INVALID_COLOR) {
Integer statusBarBackgroundColor;
if (overrideStatusBarBackgroundColor != null) {
statusBarBackgroundColor = overrideStatusBarBackgroundColor;
} else if (preferences.contains("StatusBarBackgroundColor")) {
statusBarBackgroundColor = getPreferenceStatusBarBackgroundColor();
} else if(preferences.contains("BackgroundColor")){
statusBarBackgroundColor = rootViewBackgroundColor;
} else if (preferences.contains("BackgroundColor")) {
statusBarBackgroundColor = rootViewBackgroundColor;
} else {
statusBarBackgroundColor = canEdgeToEdge ? Color.TRANSPARENT : getUiModeColor();
}
@@ -261,34 +253,31 @@ public class SystemBarPlugin extends CordovaPlugin {
}
/**
* Returns the StatusBarBackgroundColor preference value.
* If the value is missing or fails to parse, it will attempt to try to guess the background
* color by extracting from the apps R.color.cdv_background_color or determine from the uiModes.
* If all fails, the color normally used in light mode is returned.
* Returns the StatusBarBackgroundColor preference value or {@link #getUiModeColor()} as fallback.
*
* @return int
* @return Integer
*/
private int getPreferenceStatusBarBackgroundColor() {
private Integer getPreferenceStatusBarBackgroundColor() {
String colorString = preferences.getString("StatusBarBackgroundColor", null);
int parsedColor = parseColorFromString(colorString);
if (parsedColor != INVALID_COLOR) return parsedColor;
return getUiModeColor(); // fallback
return Objects.requireNonNullElse(parseColorFromString(colorString), getUiModeColor());
}
/**
* Returns the BackgroundColor preference value.
* If missing or fails to decode, it will return INVALID_COLOR (-1).
* If the value is missing or fails to decode, null is returned.
*
* @return int
* @return Integer|null
*/
private int getPreferenceBackgroundColor() {
private Integer getPreferenceBackgroundColor() {
if (!preferences.contains("BackgroundColor")) {
return null;
}
try {
return preferences.getInteger("BackgroundColor", INVALID_COLOR);
return preferences.getInteger("BackgroundColor", 0);
} catch (NumberFormatException e) {
LOG.e(PLUGIN_NAME, "Invalid background color argument. Example valid string: '0x00000000'");
return INVALID_COLOR;
return null;
}
}
@@ -354,20 +343,20 @@ public class SystemBarPlugin extends CordovaPlugin {
}
/**
* Parse color string that would be provided by app developers.
* If the color string is empty or unable to parse, it will return INVALID_COLOR (-1).
* Parses a color string provided by app developers.
* If the color string is empty or unable to parse, null is returned.
*
* @param colorPref hex string value, #AARRGGBB or #RRGGBB
* @return int
* @return Integer|null
*/
private int parseColorFromString(final String colorPref) {
if (colorPref.isEmpty()) return INVALID_COLOR;
private Integer parseColorFromString(final String colorPref) {
if (colorPref == null || colorPref.isEmpty()) return null;
try {
return Color.parseColor(colorPref);
} catch (IllegalArgumentException ignore) {
LOG.e(PLUGIN_NAME, "Invalid color hex code. Valid format: #RRGGBB or #AARRGGBB");
return INVALID_COLOR;
return null;
}
}
}
@@ -73,22 +73,16 @@ public class SystemWebChromeClient extends WebChromeClient {
private PermissionListener permissionListener;
private static final int FILECHOOSER_RESULTCODE = 5173;
private static final String LOG_TAG = "SystemWebChromeClient";
private long MAX_QUOTA = 100 * 1024 * 1024;
protected final SystemWebViewEngine parentEngine;
// the video progress view
private View mVideoProgressView;
private CordovaDialogsHelper dialogsHelper;
private Context appContext;
private WebChromeClient.CustomViewCallback mCustomViewCallback;
private View mCustomView;
private final CordovaDialogsHelper dialogsHelper;
public SystemWebChromeClient(SystemWebViewEngine parentEngine) {
this.parentEngine = parentEngine;
appContext = parentEngine.webView.getContext();
dialogsHelper = new CordovaDialogsHelper(appContext);
dialogsHelper = new CordovaDialogsHelper(parentEngine.webView.getContext());
permissionLauncher = parentEngine.cordova.getActivity().registerForActivityResult(new ActivityResultContracts.RequestMultiplePermissions(), isGranted -> {
if (permissionListener != null) {
boolean granted = true;
@@ -105,13 +99,11 @@ public class SystemWebChromeClient extends WebChromeClient {
*/
@Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
dialogsHelper.showAlert(message, (success, value) -> {
if (success) {
result.confirm();
} else {
result.cancel();
}
});
return true;
@@ -122,14 +114,11 @@ public class SystemWebChromeClient extends WebChromeClient {
*/
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
dialogsHelper.showConfirm(message, (success, value) -> {
if (success) {
result.confirm();
} else {
result.cancel();
}
});
return true;
@@ -150,14 +139,11 @@ public class SystemWebChromeClient extends WebChromeClient {
if (handledRet != null) {
result.confirm(handledRet);
} else {
dialogsHelper.showPrompt(message, defaultValue, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm(value);
} else {
result.cancel();
}
dialogsHelper.showPrompt(message, defaultValue, (success, value) -> {
if (success) {
result.confirm(value);
} else {
result.cancel();
}
});
}
@@ -173,6 +159,7 @@ public class SystemWebChromeClient extends WebChromeClient {
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
{
LOG.d(LOG_TAG, "onExceededDatabaseQuota estimatedSize: %d currentQuota: %d totalUsedQuota: %d", estimatedSize, currentQuota, totalUsedQuota);
long MAX_QUOTA = 100 * 1024 * 1024;
quotaUpdater.updateQuota(MAX_QUOTA);
}
@@ -181,8 +168,8 @@ public class SystemWebChromeClient extends WebChromeClient {
*
* <p>This also checks for the Geolocation Plugin and requests permission from the application to use Geolocation.</p>
*
* @param origin
* @param callback
* @param origin The origin of the web content attempting to use the Geolocation API.
* @param callback The callback to use to set the permission state for the origin.
*/
@Override
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
@@ -296,7 +283,7 @@ public class SystemWebChromeClient extends WebChromeClient {
// Handle result
Uri[] result = null;
if (resultCode == Activity.RESULT_OK) {
List<Uri> uris = new ArrayList<Uri>();
List<Uri> uris = new ArrayList<>();
if (intent != null && intent.getData() != null) { // single file
LOG.v(LOG_TAG, "Adding file (single): " + intent.getData());
@@ -317,8 +304,8 @@ public class SystemWebChromeClient extends WebChromeClient {
}
if (!uris.isEmpty()) {
LOG.d(LOG_TAG, "Receive file chooser URL: " + uris.toString());
result = uris.toArray(new Uri[uris.size()]);
LOG.d(LOG_TAG, "Receive file chooser URL: " + uris);
result = uris.toArray(new Uri[0]);
}
}
filePathsCallback.onReceiveValue(result);
@@ -333,14 +320,12 @@ public class SystemWebChromeClient extends WebChromeClient {
private File createTempFile(Context context) throws IOException {
// Create an image file name
File tempFile = File.createTempFile("temp", ".jpg", context.getCacheDir());
return tempFile;
return File.createTempFile("temp", ".jpg", context.getCacheDir());
}
private Uri createUriForFile(Context context, File tempFile) throws IOException {
String appId = context.getPackageName();
Uri uri = FileProvider.getUriForFile(context, appId + ".cdv.core.file.provider", tempFile);
return uri;
return FileProvider.getUriForFile(context, appId + ".cdv.core.file.provider", tempFile);
}
@Override
+299 -457
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "cordova-android",
"version": "15.0.1-dev.0",
"version": "15.1.0",
"description": "cordova-android release",
"types": "./types/index.d.ts",
"main": "lib/Api.js",
@@ -39,7 +39,7 @@
},
"devDependencies": {
"@cordova/eslint-config": "^6.0.1",
"c8": "^10.1.3",
"c8": "^11.0.0",
"cordova-js": "^6.1.0",
"elementtree": "^0.1.7",
"jasmine": "^6.0.0",
@@ -1,3 +1,5 @@
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
@@ -14,14 +16,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->
# This file used by release audit workflow
**/*.txt
.git/
coverage/
framework/build/
node_modules/
test/androidx/app/build/
test/androidx/build/
test/androidx/tools/
Files from the www folder of the Cordova project will be copied here.
-115
View File
@@ -1,115 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
* {
-webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
}
body {
-webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
-webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
background-color:#E4E4E4;
background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
background-image:-webkit-gradient(
linear,
left top,
left bottom,
color-stop(0, #A7A7A7),
color-stop(0.51, #E4E4E4)
);
background-attachment:fixed;
font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
font-size:12px;
height:100%;
margin:0px;
padding:0px;
text-transform:uppercase;
width:100%;
}
/* Portrait layout (default) */
.app {
background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
position:absolute; /* position in the center of the screen */
left:50%;
top:50%;
height:50px; /* text area height */
width:225px; /* text area width */
text-align:center;
padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
/* offset horizontal: half of text area width */
}
/* Landscape layout (with min-width) */
@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
.app {
background-position:left center;
padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
/* offset horizontal: half of image width and text area width */
}
}
h1 {
font-size:24px;
font-weight:normal;
margin:0px;
overflow:visible;
padding:0px;
text-align:center;
}
.event {
border-radius:4px;
-webkit-border-radius:4px;
color:#FFFFFF;
font-size:12px;
margin:0px 30px;
padding:2px 0px;
}
.event.listening {
background-color:#333333;
display:block;
}
.event.received {
background-color:#4B946A;
display:none;
}
@keyframes fade {
from { opacity: 1.0; }
50% { opacity: 0.4; }
to { opacity: 1.0; }
}
@-webkit-keyframes fade {
from { opacity: 1.0; }
50% { opacity: 0.4; }
to { opacity: 1.0; }
}
.blink {
animation:fade 3000ms infinite;
-webkit-animation:fade 3000ms infinite;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

-49
View File
@@ -1,49 +0,0 @@
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<!--
Customize this policy to fit your own app's needs. For more guidance, see:
https://cordova.apache.org/docs/en/latest/
Some notes:
* gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
* Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
-->
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link rel="stylesheet" type="text/css" href="css/index.css">
<title>Hello World</title>
</head>
<body>
<div class="app">
<h1>Apache Cordova</h1>
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
</body>
</html>
-51
View File
@@ -1,51 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
var app = {
// Application Constructor
initialize: function () {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function () {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicitly call 'app.receivedEvent(...);'
onDeviceReady: function () {
app.receivedEvent('deviceready');
},
// Update DOM on a Received Event
receivedEvent: function (id) {
var parentElement = document.getElementById(id);
var listeningElement = parentElement.querySelector('.listening');
var receivedElement = parentElement.querySelector('.received');
listeningElement.setAttribute('style', 'display:none;');
receivedElement.setAttribute('style', 'display:block;');
console.log('Received Event: ' + id);
}
};
app.initialize();