Compare commits

...
54 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
エリスandGitHub 08c4fd1ebf chore(ci): improve workflows & dependabot (#1928)
* chore(workflow): draft-release - sync recent changes
* chore(workflow): draft-release - pin actions
* chore(workflow): draft-release - use 'npm ci'
* chore(workflow): draft-release - disable package-manager-cache
* chore(workflow): draft-release - ensure cache is '' for clarity
* chore(workflow): draft-release - update actions/checkout configs
* chore(workflow): pin actions in all workflows
* chore(workflow): update actions/checkout configs
* chore(dependabot): added configs
* chore(workflow): use npm cit
2026-05-19 19:18:26 +09:00
The Apache Software FoundationandGitHub f490531d5a chore(INFRA): Set up default protection ruleset for default and release branches (#1927) 2026-05-19 12:43:08 +09:00
jcesarmobileandGitHub 245021782b fix: handle permissions for getUserMedia (#1895)
* fix: handle permissions for getUserMedia

* remove unused variable

* address comments
2026-04-24 18:53:30 +02:00
0d6fdd178c chore(deps): bump @xmldom/xmldom from 0.8.12 to 0.8.13 (#1918)
Bumps [@xmldom/xmldom](https://github.com/xmldom/xmldom) from 0.8.12 to 0.8.13.
- [Release notes](https://github.com/xmldom/xmldom/releases)
- [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xmldom/xmldom/compare/0.8.12...0.8.13)

---
updated-dependencies:
- dependency-name: "@xmldom/xmldom"
  dependency-version: 0.8.13
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-23 07:06:44 +02:00
Manuel BeckandGitHub b66f0f33b8 Call new method CordovaPlugin.onRequestPermissionsResult (#1855)
- Fixes https://github.com/apache/cordova-android/issues/1388
- `CordovaInterfaceImpl` called the deprecated method `CordovaPlugin.onRequestPermissionResult` but not the new one. Now the one will also be called.
- Renamed `CordovaInterfaceImpl.onRequestPermissionResult` to `CordovaInterfaceImpl.onRequestPermissionsResult` to reflect the new method name
2026-04-20 18:06:08 +02:00
Manuel BeckandGitHub 8c83976486 Deprecate PermissionHelper (#1857)
- The `PermissionHelper` was for cordova-android versions pre 5.0.0. Since cordova-anroid 5.0.0 the relevant permission methods can be called directly on `CordovaInterface`.
2026-04-20 18:04:26 +02:00
Manuel BeckandGitHub 9c3d82680e Remove unused private Method PermissionHelper.deliverPermissionResult (#1858)
- The method deliverPermissionResult is private and nowhere used. Because it's private, it cannot be called from outside and cannot be overwritten and is safe to remove.
2026-04-20 18:03:30 +02:00
seamlink-aalvesandGitHub 190076ba18 chore: simplify edge-to-edge preference logic in CordovaActivity and SystemBarPlugin (#1902)
- Remove the limitation for Android version <15 when preference AndroidEdgeToEdge is true.
- The motivation and context was described here: apache/cordova-discuss#114
- When having cordova android in Edge To Edge the app does not extend to the full height of the device in version bellow Android 15. This change allows the app to behave the same way it was possible to do with the statusbar plugin preference StatusBarOverlaysWebView given that this stopped having any effect in cordova-android 15.
2026-04-20 18:00:47 +02:00
7b33c5dd64 chore(deps): bump lodash from 4.17.23 to 4.18.1 (#1914)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.23 to 4.18.1.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.23...4.18.1)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.18.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-20 17:49:40 +02:00
Manuel BeckandGitHub 0bfbc20b84 fix: overwritten backbutton not firing on first time by hardware button and never on back gesture (#1910)
- When pressing the back button after the app starts nothing happens. When navigating to another page, the back button js event starts to fire.
- On Android versions, which support the back gesture, nothing happens
- This was due to the empty `OnBackPressedCallback.handleOnBackPressed` method, which has to forward its call to `cordova.getActivity().getOnBackPressedDispatcher().onBackPressed()`, but has to disable during this call the `backCallback`.
- Generated-By: GPT-5.4, GitHub Copilot Chat

- warning about back button override on the right 

* chore: resolve methods `registerBackPressedCallback` and `unregisterBackPressedCallback``

- The code moved to inline code
2026-04-20 17:48:48 +02:00
Manuel BeckandGitHub b1705d83c5 chore: ignore gradle build artificat problems-report.html (#1912)
- Ignore globally
2026-04-02 18:51:24 +02:00
c44a4627e3 chore(deps): bump @xmldom/xmldom from 0.8.11 to 0.8.12 (#1911)
Bumps [@xmldom/xmldom](https://github.com/xmldom/xmldom) from 0.8.11 to 0.8.12.
- [Release notes](https://github.com/xmldom/xmldom/releases)
- [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xmldom/xmldom/compare/0.8.11...0.8.12)

---
updated-dependencies:
- dependency-name: "@xmldom/xmldom"
  dependency-version: 0.8.12
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-01 01:04:32 -07:00
エリスandGitHub 1f70d396da chore: more license header updates (#1909)
* chore: update license headers again

- CSS, Gradle, Java, JS, TS: Formatted doc block style to use "/*" instead of "/**"
- HTML: Move license header below DOCTYPE
- Add missing license header
- Cleanup rat ignore

* chore: format cordova-js-src license headers
2026-03-28 12:42:26 +09:00
2868f93aae chore(deps): bump picomatch (#1908)
Bumps  and [picomatch](https://github.com/micromatch/picomatch). These dependencies needed to be updated together.

Updates `picomatch` from 2.3.1 to 2.3.2
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/picomatch/compare/2.3.1...2.3.2)

Updates `picomatch` from 4.0.3 to 4.0.4
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/picomatch/compare/2.3.1...2.3.2)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 2.3.2
  dependency-type: indirect
- dependency-name: picomatch
  dependency-version: 4.0.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-25 14:56:16 -07:00
エリスandGitHub 340eade2de chore(gh-action): improve draft-release workflow (#1906) 2026-03-24 01:51:14 +09:00
エリスandGitHub 9ae489bd37 fix(gradle-9): unable to resolve class XmlParser for Groovy 4.x (#1896) 2026-03-19 09:58:16 +09:00
エリスandGitHub af56a00324 chore: update package-lock (#1905) 2026-03-19 00:54:46 +09:00
9064bc0792 fix(android): use AndroidX OnBackPressedCallback instead of OnBackInvokedCallback (#1903)
- `CoreAndroid.java` referenced `OnBackInvokedCallback` directly (including lambda generation), which can trigger class resolution on runtimes older than API 33, where the class is not available. This was introduced in PR https://github.com/apache/cordova-android/pull/1831
- Replaced `OnBackInvokedCallback` with AndroidX `OnBackPressedCallback`
- Fixes error message: `java.lang.Class<org.apache.cordova.CoreAndroid$$ExternalSyntheticLambda0>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/window/OnBackInvokedCallback;` on older Android versions

---------

Generated-By: GPT-5.3-Codex, GitHub Copilot Chat
Co-authored-by: Norman Breau <norman@breautek.com>
2026-03-13 19:43:15 +01:00
エリスandGitHub c02d1b0331 chore(post-release): bump v15.0.1-dev.0 (#1899) 2026-03-06 16:55:03 +09:00
31f3d57c8d chore(deps): bump minimatch (#1898)
Bumps  and [minimatch](https://github.com/isaacs/minimatch). These dependencies needed to be updated together.

Updates `minimatch` from 3.1.3 to 3.1.5
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.3...v3.1.5)

Updates `minimatch` from 9.0.6 to 9.0.9
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.3...v3.1.5)

Updates `minimatch` from 10.2.2 to 10.2.4
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.3...v3.1.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 3.1.5
  dependency-type: indirect
- dependency-name: minimatch
  dependency-version: 9.0.9
  dependency-type: indirect
- dependency-name: minimatch
  dependency-version: 10.2.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-28 12:16:16 -08:00
177 changed files with 1277 additions and 1357 deletions
+16 -3
View File
@@ -39,8 +39,21 @@ github:
merge: false
rebase: false
rulesets:
- name: "Default Branch Protection"
type: branch
branches:
includes:
- "~DEFAULT_BRANCH"
- "release/*"
- "rel/*"
excludes: []
bypass_teams:
- root
restrict_deletion: true
restrict_force_push: true
notifications:
commits: commits@cordova.apache.org
issues: issues@cordova.apache.org
pullrequests_status: issues@cordova.apache.org
commits: commits@cordova.apache.org
issues: issues@cordova.apache.org
pullrequests_status: issues@cordova.apache.org
pullrequests_comment: issues@cordova.apache.org
+32
View File
@@ -0,0 +1,32 @@
# 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.
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
cooldown:
default-days: 4
schedule:
interval: "daily" # Every weekday, Monday to Friday
- package-ecosystem: "npm"
directory: "/"
cooldown:
default-days: 4
schedule:
interval: "weekly" # By default on a Monday
+62 -30
View File
@@ -25,28 +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@v6
- uses: actions/setup-node@v6
- 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@v5
- uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
with:
distribution: 'temurin'
java-version: '17'
@@ -57,32 +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@v4
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 i
npm t
npm cit
env:
CI: true
- uses: github/codeql-action/analyze@v4
# 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 }}
+65 -19
View File
@@ -31,36 +31,57 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- 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
package-manager-cache: false
cache: ''
- name: Setup environment variables
run: |
REPO_NAME="${GITHUB_REPOSITORY#*/}"
TAG_NAME="${GITHUB_REF#refs/tags/}"
TARGET_RELEASE_VERSION="${TAG_NAME#draft/}"
SRC_PACKAGE_NAME=${REPO_NAME}-source-${TARGET_RELEASE_VERSION}
SRC_PACKAGE_TAR=${SRC_PACKAGE_NAME}.tar
SRC_PACKAGE_TAR_GZ=${SRC_PACKAGE_NAME}.tar.gz
SRC_PACKAGE_ZIP=${SRC_PACKAGE_NAME}.zip
NPM_PACKAGE_NAME=${REPO_NAME}-npm-${TARGET_RELEASE_VERSION}
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
echo "TARGET_RELEASE_VERSION=$TARGET_RELEASE_VERSION" >> $GITHUB_ENV
echo "SRC_PACKAGE_NAME=$SRC_PACKAGE_NAME" >> $GITHUB_ENV
echo "SRC_PACKAGE_TAR=$SRC_PACKAGE_TAR" >> $GITHUB_ENV
echo "SRC_PACKAGE_TAR_GZ=$SRC_PACKAGE_TAR_GZ" >> $GITHUB_ENV
echo "SRC_PACKAGE_ZIP=$SRC_PACKAGE_ZIP" >> $GITHUB_ENV
echo "NPM_PACKAGE_NAME=$NPM_PACKAGE_NAME" >> $GITHUB_ENV
echo "REPO_NAME=$REPO_NAME"
echo "TAG_NAME=$TAG_NAME"
echo "TARGET_RELEASE_VERSION=$TARGET_RELEASE_VERSION"
echo "SRC_PACKAGE_NAME=$SRC_PACKAGE_NAME"
echo "SRC_PACKAGE_TAR=$SRC_PACKAGE_TAR"
echo "SRC_PACKAGE_TAR_GZ=$SRC_PACKAGE_TAR_GZ"
echo "SRC_PACKAGE_ZIP=$SRC_PACKAGE_ZIP"
echo "NPM_PACKAGE_NAME=$NPM_PACKAGE_NAME"
- name: Verify Target Release Version
run: |
PACKAGE_VERSION=$(jq -r '.version' package.json)
if [ $PACKAGE_VERSION != "$TARGET_RELEASE_VERSION" ]; then
if [ "$PACKAGE_VERSION" != "$TARGET_RELEASE_VERSION" ]; then
echo "Mismatch version detected between tag version ($TARGET_RELEASE_VERSION) and package version ($PACKAGE_VERSION)"
exit 1
fi
if [ -f "plugin.xml" ]; then
PLUGIN_VERSION=$(yq -p=xml -o=json '.plugin.+@version' plugin.xml)
if [ $PLUGIN_VERSION != "$TARGET_RELEASE_VERSION" ]; then
PLUGIN_VERSION=$(yq -p=xml -o=json '.plugin.+@version' plugin.xml | jq -r .)
if [ "$PLUGIN_VERSION" != "$TARGET_RELEASE_VERSION" ]; then
echo "Mismatch version detected between tag version ($TARGET_RELEASE_VERSION) and plugin version ($PLUGIN_VERSION)"
exit 1
fi
@@ -68,23 +89,51 @@ jobs:
- name: Generate "tgz" npm convenience package
run: |-
npm install
npm ci
NPM_PKG_NAME=$(npm pack --json | jq -r '.[0].filename')
mv ./.asf-release/$NPM_PKG_NAME ./.asf-release/${REPO_NAME}-npm-${TARGET_RELEASE_VERSION}.tgz
mv ./.asf-release/$NPM_PKG_NAME ./.asf-release/${NPM_PACKAGE_NAME}.tgz
env:
TZ: UTC
- name: Generate "tar" source package
run: |-
export SRC_LAST_COMMIT_EPOCH=$(git log -1 --format=%ct "$TAG_NAME")
git archive \
--prefix=$SRC_PACKAGE_NAME/ \
--mtime=$SRC_LAST_COMMIT_EPOCH \
-o ./.asf-release/${SRC_PACKAGE_TAR} \
$TAG_NAME
env:
TZ: UTC
- name: Generate "tar.gz" source archive
working-directory: ./.asf-release
run: |-
git archive --format=tar.gz \
--prefix=${REPO_NAME}-source-${TARGET_RELEASE_VERSION}/ \
-o ./.asf-release/${REPO_NAME}-source-${TARGET_RELEASE_VERSION}.tar.gz \
${TAG_NAME}
gzip -n -9 -c "$SRC_PACKAGE_TAR" > "$SRC_PACKAGE_TAR_GZ"
env:
TZ: UTC
- name: Generate "zip" source archive
working-directory: ./.asf-release
run: |-
git archive --format=zip \
--prefix=${REPO_NAME}-source-${TARGET_RELEASE_VERSION}/ \
-o ./.asf-release/${REPO_NAME}-source-${TARGET_RELEASE_VERSION}.zip \
${TAG_NAME}
export ASF_RELEASE_DIR=$(pwd)
export TMP_DIR=$(mktemp -d)
tar -xf "$SRC_PACKAGE_TAR" -C "$TMP_DIR"
(
cd "$TMP_DIR"
find . -type f | LC_ALL=C sort | zip -X -q "$ASF_RELEASE_DIR/$SRC_PACKAGE_ZIP" -@
)
rm -rf $TMP_DIR
env:
TZ: UTC
- name: Cleanup Process
working-directory: ./.asf-release
run: |-
rm -rf $SRC_PACKAGE_TAR
rm -rf .gitkeep
- name: Create Sign and Checksum
working-directory: .asf-release
@@ -98,11 +147,8 @@ jobs:
env:
CORDOVA_GPG_SECRET_KEY: ${{ secrets.CORDOVA_GPG_SECRET_KEY }}
- name: Remove ".gitkeep" from ".asf-release"
run: rm -rf ./.asf-release/.gitkeep
- name: Upload to Apache Trusted Release (ATR)
uses: apache/tooling-actions/upload-to-atr@b7e972c11790ee16eca101900af1b3c7fd1b106e
uses: apache/tooling-actions/upload-to-atr@f5f4c0e7ddfbde6b1f8288cef36324c6def68051
with:
project: ${{ env.REPO_NAME }}
version: ${{ env.TARGET_RELEASE_VERSION }}
+9 -6
View File
@@ -34,13 +34,16 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checkout project
- uses: actions/checkout@v6
- 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@v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
@@ -48,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
+3
View File
@@ -74,3 +74,6 @@ coverage/
# ASF release workspace
.asf-release/
!.asf-release/.gitkeep
# Gradle problems report, build artifact
problems-report.html
-4
View File
@@ -15,15 +15,11 @@
# specific language governing permissions and limitations
# under the License.
# This file used by ATR
**/*.txt
.git/
coverage/
framework/build/
node_modules/
templates/project/gitignore
test/androidx/app/.gitignore
test/androidx/app/build/
test/androidx/build/
test/androidx/tools/
+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:**
+16 -16
View File
@@ -1,20 +1,20 @@
/*
* 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.
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.
*/
/**
+16 -16
View File
@@ -1,20 +1,20 @@
/*
* 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.
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.
*/
/**
+16 -18
View File
@@ -1,22 +1,20 @@
/*
*
* 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.
*
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.
*/
/**
+16 -18
View File
@@ -1,22 +1,20 @@
/*
*
* 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.
*
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.
*/
// The last resume event that was received that had the result of a plugin call.
+16 -18
View File
@@ -1,22 +1,20 @@
/*
*
* 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.
*
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 exec = require('cordova/exec');
+16 -18
View File
@@ -1,22 +1,20 @@
/*
*
* 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.
*
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 exec = require('cordova/exec');
+48 -35
View File
@@ -1,22 +1,21 @@
/*
* 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.
*
*/
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 exec = require('cordova/exec');
@@ -27,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,
@@ -53,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,
@@ -61,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);
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+2 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
@@ -17,6 +17,7 @@
under the License.
*/
import groovy.xml.XmlParser
import java.util.regex.Pattern
import io.github.g00fy2.versioncompare.Version
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -121,8 +121,7 @@ public class CordovaActivity extends AppCompatActivity {
// need to activate preferences before super.onCreate to avoid "requestFeature() must be called before adding content" exception
loadConfig();
canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false)
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM;
canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false);
String logLevel = preferences.getString("loglevel", "ERROR");
LOG.setLogLevel(logLevel);
@@ -226,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,
@@ -578,7 +586,7 @@ public class CordovaActivity extends AppCompatActivity {
try
{
cordovaInterface.onRequestPermissionResult(requestCode, permissions, grantResults);
cordovaInterface.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
catch (JSONException e)
{
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -217,11 +217,15 @@ public class CordovaInterfaceImpl implements CordovaInterface {
* @param permissions
* @param grantResults
*/
public void onRequestPermissionResult(int requestCode, String[] permissions,
public void onRequestPermissionsResult(int requestCode, String[] permissions,
int[] grantResults) throws JSONException {
Pair<CordovaPlugin, Integer> callback = permissionResultCallbacks.getAndRemoveCallback(requestCode);
if(callback != null) {
// This one is deprecated - see https://github.com/apache/cordova-android/issues/592
// and should be removed in a future release
callback.first.onRequestPermissionResult(callback.second, permissions, grantResults);
// Call the new method
callback.first.onRequestPermissionsResult(callback.second, permissions, grantResults);
}
}
@@ -1,4 +1,4 @@
/**
/*
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
@@ -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 {
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -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;
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -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);
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -29,14 +29,16 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.SystemClock;
import android.content.IntentFilter;
import android.telephony.TelephonyManager;
import android.view.KeyEvent;
import android.window.OnBackInvokedCallback;
import android.window.OnBackInvokedDispatcher;
import java.util.HashMap;
import androidx.activity.OnBackPressedCallback;
import androidx.activity.OnBackPressedDispatcherOwner;
/**
* This class exposes methods in Cordova that can be called from JavaScript.
*/
@@ -48,7 +50,7 @@ public class CoreAndroid extends CordovaPlugin {
private CallbackContext messageChannel;
private PluginResult pendingResume;
private PluginResult pendingPause;
private OnBackInvokedCallback backCallback;
private OnBackPressedCallback backCallback;
private final Object messageChannelLock = new Object();
private final Object backButtonHandlerLock = new Object();
@@ -252,31 +254,65 @@ public class CoreAndroid extends CordovaPlugin {
* @param override T=override, F=cancel override
*/
public void overrideBackbutton(boolean override) {
LOG.i("App", "WARNING: Back Button Default Behavior will be overridden. The backbutton event will be fired!");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA) {
if (override) {
synchronized (backButtonHandlerLock) {
if (backCallback == null) {
// The callback is intentionally empty. Since API 36, intercepting the back button is ignored, which means
// the onDispatchKeyEvent boolean result won't actually stop native from consuming the back button and doing
// it's own logic, UNLESS if there is an OnBackInvokedCallback registered on the dispatcher.
// The key dispatch events will still fire, which still handles propagating back button events to the webview.
// See https://developer.android.com/about/versions/16/behavior-changes-16#predictive-back for more info on the caveat.
backCallback = () -> {};
this.cordova.getActivity().getOnBackInvokedDispatcher().registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_DEFAULT, backCallback);
}
}
} else {
synchronized (backButtonHandlerLock) {
if (backCallback != null) {
this.cordova.getActivity().getOnBackInvokedDispatcher().unregisterOnBackInvokedCallback(backCallback);
backCallback = null;
}
}
}
if (cordova.getActivity() == null) {
return;
}
webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_BACK, override);
final boolean shouldOverride = override;
cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if (shouldOverride) {
LOG.i("App", "WARNING: Back Button Default Behavior will be overridden. The backbutton event will be fired!");
synchronized (backButtonHandlerLock) {
if (backCallback == null) {
backCallback = new OnBackPressedCallback(true) {
@Override
public void handleOnBackPressed() {
dispatchBackKeyEvent();
}
};
OnBackPressedDispatcherOwner backPressedDispatcherOwner = cordova.getActivity();
backPressedDispatcherOwner.getOnBackPressedDispatcher().addCallback(backPressedDispatcherOwner, backCallback);
}
}
} else {
synchronized (backButtonHandlerLock) {
if (backCallback != null) {
backCallback.remove();
backCallback = null;
}
}
}
webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_BACK, shouldOverride);
}
});
}
private void dispatchBackKeyEvent() {
// Build a synthetic BACK key press (DOWN + UP) and route it through the WebView.
// This lets Cordova's existing key handling fire the JS "backbutton" event.
final long eventTime = SystemClock.uptimeMillis();
final KeyEvent downEvent = new KeyEvent(eventTime, eventTime, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK, 0);
final KeyEvent upEvent = new KeyEvent(eventTime, eventTime, KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK, 0);
final boolean handledDown = webView.getView().dispatchKeyEvent(downEvent);
final boolean handledUp = webView.getView().dispatchKeyEvent(upEvent);
// If either event was consumed, Cordova/WebView already handled back behavior.
if (handledDown || handledUp) {
return;
}
// Otherwise, delegate to Android's default back dispatcher.
// Temporarily disable this callback to avoid recursive re-entry.
backCallback.setEnabled(false);
try {
cordova.getActivity().getOnBackPressedDispatcher().onBackPressed();
} finally {
backCallback.setEnabled(true);
}
}
/**
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -18,19 +18,22 @@
*/
package org.apache.cordova;
import java.util.Arrays;
import org.json.JSONException;
import android.content.pm.PackageManager;
/**
* This class provides reflective methods for permission requesting and checking so that plugins
* 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
* written for cordova-android 5.0.0+ can still compile with earlier cordova-android versions.
*
* Some Cordova plugins still use this class, for example:
* - https://github.com/apache/cordova-plugin-file/blob/master/src/android/FileUtils.java#L42
* - https://github.com/apache/cordova-plugin-geolocation/blob/master/src/android/Geolocation.java#L27
* - https://github.com/apache/cordova-plugin-camera/blob/master/src/android/CameraLauncher.java#L52
* Before this class can be removed, those plugins need to be updated to call {@link CordovaInterface} methods directly.
*
* @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 {
private static final String LOG_TAG = "CordovaPermissionHelper";
/**
* Requests a "dangerous" permission for the application at runtime. This is a helper method
* alternative to cordovaInterface.requestPermission() that does not require the project to be
@@ -40,7 +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(CordovaPlugin, int, String)} instead.
*/
@Deprecated
public static void requestPermission(CordovaPlugin plugin, int requestCode, String permission) {
PermissionHelper.requestPermissions(plugin, requestCode, new String[] {permission});
}
@@ -54,7 +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(CordovaPlugin, int, String[])} instead.
*/
@Deprecated
public static void requestPermissions(CordovaPlugin plugin, int requestCode, String[] permissions) {
plugin.cordova.requestPermissions(plugin, requestCode, permissions);
}
@@ -67,22 +74,10 @@ 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(String)} instead.
*/
@Deprecated
public static boolean hasPermission(CordovaPlugin plugin, String permission) {
return plugin.cordova.hasPermission(permission);
}
private static void deliverPermissionResult(CordovaPlugin plugin, int requestCode, String[] permissions) {
// Generate the request results
int[] requestResults = new int[permissions.length];
Arrays.fill(requestResults, PackageManager.PERMISSION_GRANTED);
try {
// This one is deprecated - see https://github.com/apache/cordova-android/issues/592
plugin.onRequestPermissionResult(requestCode, permissions, requestResults);
plugin.onRequestPermissionsResult(requestCode, permissions, requestResults);
} catch (JSONException e) {
LOG.e(LOG_TAG, "JSONException when delivering permissions results", e);
}
}
}
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -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;
@@ -55,8 +55,7 @@ public class SystemBarPlugin extends CordovaPlugin {
protected void pluginInitialize() {
context = cordova.getContext();
resources = context.getResources();
canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false)
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM;
canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false);
}
@Override
@@ -81,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));
@@ -122,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
@@ -146,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();
}
@@ -262,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;
}
}
@@ -355,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;
}
}
}
@@ -1,3 +1,4 @@
<!DOCTYPE HTML>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -16,7 +17,6 @@
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320, user-scalable=no" />
@@ -1,3 +1,4 @@
<!DOCTYPE HTML>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -16,7 +17,6 @@
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320, user-scalable=no" />
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -23,6 +23,9 @@ import java.io.File;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import android.Manifest;
import android.app.Activity;
import android.content.ClipData;
import android.content.Context;
@@ -45,6 +48,9 @@ import android.webkit.PermissionRequest;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.core.content.FileProvider;
import org.apache.cordova.CordovaDialogsHelper;
@@ -59,24 +65,33 @@ import org.apache.cordova.LOG;
*/
public class SystemWebChromeClient extends WebChromeClient {
private interface PermissionListener {
void onPermissionSelect(Boolean isGranted);
}
private final ActivityResultLauncher<String[]> permissionLauncher;
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;
for (Map.Entry<String, Boolean> permission : isGranted.entrySet()) {
if (!permission.getValue()) granted = false;
}
permissionListener.onPermissionSelect(granted);
}
});
}
/**
@@ -84,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;
@@ -101,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;
@@ -129,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();
}
});
}
@@ -152,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);
}
@@ -160,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) {
@@ -275,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());
@@ -296,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);
@@ -312,20 +320,38 @@ 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
public void onPermissionRequest(final PermissionRequest request) {
LOG.d(LOG_TAG, "onPermissionRequest: " + Arrays.toString(request.getResources()));
request.grant(request.getResources());
List<String> permissionList = new ArrayList<>();
if (Arrays.asList(request.getResources()).contains("android.webkit.resource.VIDEO_CAPTURE")) {
permissionList.add(Manifest.permission.CAMERA);
}
if (Arrays.asList(request.getResources()).contains("android.webkit.resource.AUDIO_CAPTURE")) {
permissionList.add(Manifest.permission.MODIFY_AUDIO_SETTINGS);
permissionList.add(Manifest.permission.RECORD_AUDIO);
}
if (!permissionList.isEmpty()) {
String[] permissions = permissionList.toArray(new String[0]);
permissionListener = (isGranted) -> {
if (isGranted) {
request.grant(request.getResources());
} else {
request.deny();
}
};
permissionLauncher.launch(permissions);
} else {
request.grant(request.getResources());
}
}
public void destroyLastDialog(){
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+336 -477
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.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 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
+1 -1
View File
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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
@@ -1,4 +1,4 @@
/**
/*
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

Some files were not shown because too many files have changed in this diff Show More