Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • develop
  • feat/force-migration-check
  • feat/improve-network-scan
  • feature/android_api_19
  • feature/cordova-android-13
  • feature/encrypted_comment
  • feature/migrate-cordova-13
  • gitlab_migration_1
  • master
  • rml8
  • 0.0.1.ES.alpha1
  • 0.0.2
  • 0.1.13
  • 0.1.14
  • 0.1.15
  • 0.1.16
  • 0.1.17
  • 0.1.18
  • 0.1.19
  • 0.1.20
  • 0.1.21
  • 0.1.22
  • 0.1.23
  • 0.1.24
  • 0.1.25
  • 0.1.26
  • 0.1.27
  • 0.1.28
  • 0.1.4
  • 0.1.7
  • 0.1.8
  • 0.2.0
  • 0.2.1
  • v0.10.0
  • v0.10.1
  • v0.10.2
  • v0.11.0
  • v0.11.1
  • v0.11.2
  • v0.11.3
  • v0.11.4
  • v0.11.5
  • v0.11.6
  • v0.11.7
  • v0.11.8
  • v0.12.0
  • v0.12.1
  • v0.12.2
  • v0.12.3
  • v0.12.4
  • v0.12.5
  • v0.12.6
  • v0.12.7
  • v0.12.8
  • v0.12.9
  • v0.13.0
  • v0.14.0
  • v0.14.1
  • v0.15.0
  • v0.15.1
  • v0.15.2
  • v0.15.3
  • v0.15.4
  • v0.15.5
  • v0.15.6
  • v0.15.7
  • v0.16.0
  • v0.16.1
  • v0.17.0
  • v0.17.1
  • v0.17.2
  • v0.17.3
  • v0.17.4
  • v0.17.5
  • v0.17.6
  • v0.18.0
  • v0.18.1
  • v0.18.2
  • v0.18.3
  • v0.19.0
  • v0.19.1
  • v0.19.2
  • v0.19.3
  • v0.19.4
  • v0.19.5
  • v0.19.6
  • v0.2.10
  • v0.2.12
  • v0.2.13
  • v0.2.14
  • v0.2.3
  • v0.2.4
  • v0.2.5
  • v0.2.6
  • v0.2.7
  • v0.2.8
  • v0.2.9
  • v0.3.0
  • v0.3.1
  • v0.3.10
  • v0.3.11
  • v0.3.12
  • v0.3.13
  • v0.3.14
  • v0.3.15
  • v0.3.16
  • v0.3.17
  • v0.3.2
  • v0.3.3
  • v0.3.4
110 results

Target

Select target project
No results found
Select Git revision
  • Vivakvo-master-patch-80805
  • Vivakvo-master-patch-99327
  • dev
  • gitlab_migration_1
  • issue_4
  • issue_780
  • master
  • patch-1
  • patch-10
  • patch-11
  • patch-12
  • patch-13
  • patch-14
  • patch-15
  • patch-16
  • patch-17
  • patch-18
  • patch-19
  • patch-2
  • patch-21
  • patch-22
  • patch-23
  • patch-24
  • patch-25
  • patch-26
  • patch-3
  • patch-4
  • patch-5
  • patch-6
  • patch-7
  • patch-8
  • patch-9
  • rml8
  • undefined
  • 0.0.1.ES.alpha1
  • 0.0.2
  • 0.1.13
  • 0.1.14
  • 0.1.15
  • 0.1.16
  • 0.1.17
  • 0.1.18
  • 0.1.19
  • 0.1.20
  • 0.1.21
  • 0.1.22
  • 0.1.23
  • 0.1.24
  • 0.1.25
  • 0.1.26
  • 0.1.27
  • 0.1.28
  • 0.1.4
  • 0.1.7
  • 0.1.8
  • 0.2.0
  • 0.2.1
  • v0.10.0
  • v0.10.1
  • v0.10.2
  • v0.11.0
  • v0.11.1
  • v0.11.2
  • v0.11.3
  • v0.11.4
  • v0.11.5
  • v0.11.6
  • v0.11.7
  • v0.11.8
  • v0.12.0
  • v0.12.1
  • v0.12.2
  • v0.12.3
  • v0.12.4
  • v0.12.5
  • v0.12.6
  • v0.12.7
  • v0.12.8
  • v0.12.9
  • v0.13.0
  • v0.14.0
  • v0.14.1
  • v0.15.0
  • v0.15.1
  • v0.15.2
  • v0.15.3
  • v0.15.4
  • v0.15.5
  • v0.15.6
  • v0.15.7
  • v0.16.0
  • v0.16.1
  • v0.17.0
  • v0.17.1
  • v0.17.2
  • v0.17.3
  • v0.17.4
  • v0.17.5
  • v0.17.6
  • v0.18.0
  • v0.18.1
  • v0.18.2
  • v0.18.3
  • v0.19.0
  • v0.19.1
  • v0.19.2
  • v0.19.3
  • v0.19.4
  • v0.19.5
  • v0.19.6
  • v0.2.10
  • v0.2.12
  • v0.2.13
  • v0.2.14
  • v0.2.3
  • v0.2.4
  • v0.2.5
  • v0.2.6
  • v0.2.7
  • v0.2.8
  • v0.2.9
  • v0.3.0
  • v0.3.1
  • v0.3.10
  • v0.3.11
  • v0.3.12
  • v0.3.13
  • v0.3.14
  • v0.3.15
  • v0.3.16
  • v0.3.17
  • v0.3.2
  • v0.3.3
  • v0.3.4
134 results
Show changes
253 files
+ 24189
9484
Compare changes
  • Side-by-side
  • Inline

Files

+4 −2
Original line number Diff line number Diff line
@@ -2,8 +2,8 @@
# http://git-scm.com/docs/gitignore

/node_modules/
/platforms/*
#!/platforms/android
/platforms/ios
/platforms/android
/resources/android/build/local.properties
/resources/android/build/*.keystore
/resources/android/build/release-signing.properties
@@ -24,6 +24,8 @@
/hooks/uglify-config.json
/hooks/after_prepare/uglify.js

/scripts/sdkmanager.log

/www/js/config.js
/www/dist
/www/lib
+90 −46
Original line number Diff line number Diff line
# ---------------------------------------------------------------
# Global
# ---------------------------------------------------------------

# default image
image: node:12

# stages (main steps of pipeline)
stages:
  #- build
  #- alt_build
  #- publish
  - build
  - alt_build
  - deploy

fast-build:
  stage: build
  image: $CI_REGISTRY_IMAGE
# ---------------------------------------------------------------
# Global variables
# ---------------------------------------------------------------

variables:
    CI_BUILD_IMAGE: $CI_REGISTRY_IMAGE/build:develop

# ---------------------------------------------------------------
# Jobs templates
# ---------------------------------------------------------------

.docker:
  image: docker:latest
  tags: [redshift]
  services:
    - docker:dind
  before_script:
    - mv /customCache/node_modules ./
    - cp -rf /customCache/www ./
    - cp -rf /customCache/hooks ./
    - docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
    #- docker login -u "duniterteam" -p "$DUNITERTEAM_PASSWD"
  after_script:
    - docker logout ${CI_REGISTRY}
    #- docker logout
  allow_failure: false

# ---------------------------------------------------------------
# Build jobs
# ---------------------------------------------------------------

.build:
  stage: build
  tags: [redshift]
  script:
    - node ./node_modules/gulp/bin/gulp webBuild
    - yarn install
    - yarn run build:web
  after_script:
    - ls -la dist/web/
    - du -csh dist/web/
@@ -20,51 +53,63 @@ fast-build:
    paths:
      - dist/web
    expire_in: 60 minutes

build:
  extends: .build
  image: ${CI_BUILD_IMAGE}
  before_script:
    - mv /tmp/.build-cache/node_modules ./
  only:
    - master
    - tags
    - develop

failsafe-build:
  extends: .build
  stage: alt_build
  when: on_failure
  image: node:10
  script:
    - yarn
    - node ./node_modules/gulp/bin/gulp config --env default
    - node ./node_modules/gulp/bin/gulp webBuild
  artifacts:
    untracked: true
    paths:
      - dist/web
    expire_in: 60 minutes
  before_script:
    - yarn global add gulp
  only:
    - master
    - tags
docker-for-fast-build:
    - develop

docker:ci:
  extends: .docker
  stage: alt_build
  when: on_failure
  allow_failure: true
  tags:
    - doppler-docker
  image: docker:latest
  services:
    - docker:dind
  script:
    - echo 'FROM node:10' > Dockerfile
    - echo 'WORKDIR /customCache' >> Dockerfile
    # Create the target directory
    - mkdir -p dist/ci
    - cd dist/ci
    # Create the Dockerfile
    - echo 'FROM node:12' > Dockerfile
    - echo 'WORKDIR /tmp/.build-cache' >> Dockerfile
    - echo 'COPY ./ ./' >> Dockerfile
    - echo 'RUN du -s `find . -maxdepth 1 | egrep -v "^\.$"`>/before.txt' >> Dockerfile
    - echo 'RUN yarn' >> Dockerfile
    - echo 'RUN du -s `find . -maxdepth 1 | egrep -v "^\.$"`>/after.txt' >> Dockerfile
    # Store disk usage (before install)
    - echo 'RUN du -s `find . -maxdepth 1 | egrep -v "^\.$"` > /tmp/before.txt' >> Dockerfile
    - echo 'RUN du -s `find /tmp/.cache/yarn -maxdepth 1 | egrep -v "^\.$"` >> /tmp/before.txt' >> Dockerfile
    # Install dependencies
    - echo 'RUN yarn global add gulp web-ext @ionic/cli' >> Dockerfile
    - echo 'RUN yarn install' >> Dockerfile
    # Store disk usage (after install)
    - echo 'RUN du -s `find . -maxdepth 1 | egrep -v "^\.$"` > /tmp/after.txt' >> Dockerfile
    - echo 'RUN du -s `find /tmp/.cache/yarn -maxdepth 1 | egrep -v "^\.$"` >> /tmp/after.txt' >> Dockerfile
    # Force docker to detect any changes
    - echo "RUN diff /tmp/before.txt /tmp/after.txt || true" >> Dockerfile
    - echo 'WORKDIR /build' >> Dockerfile
    - echo "RUN diff /before.txt /after.txt || true" >> Dockerfile
    - docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY
    - docker build --pull -t "$CI_REGISTRY_IMAGE" .
    - docker push "$CI_REGISTRY_IMAGE"
    # Build and push the CI image
    - docker build --no-cache -t ${CI_BUILD_IMAGE} .
    - docker push ${CI_BUILD_IMAGE}
  artifacts:
    paths:
      - dist/ci/Dockerfile
    expire_in: 60 minutes

# ---------------------------------------------------------------
# Deploy jobs
# ---------------------------------------------------------------

pages:
  stage: publish
  image: node:10
  stage: deploy
  variables:
    GIT_STRATEGY: none
  script:
@@ -76,8 +121,9 @@ pages:
      - public
  only:
    - master

mirror:
  stage: publish
  stage: deploy
  image: liaohuqiu/rsync
  before_script:
    - eval $(ssh-agent -s)
@@ -94,10 +140,8 @@ mirror:
  only:
    - master


release-web:
  stage: publish
  image: node:10
release:
  stage: deploy
  variables:
    GIT_STRATEGY: none
  script:
+2 −2
Original line number Diff line number Diff line
[submodule "dist/desktop"]
	path = dist/desktop
	url = git@git.duniter.org:clients/cesium-grp/cesium-desktop.git
[submodule "android"]
	path = platforms/android
[submodule "dist/android/sources"]
	path = dist/android/sources
	url = git@git.duniter.org:clients/cesium-grp/cesium-android.git
+12 −10
Original line number Diff line number Diff line
FROM  node:10-alpine
FROM  node:12
LABEL maintainer="benoit [dot] lavenier [at] e-is [dot] pro"
LABEL version="1.6.3"
LABEL version="1.7.0-rc1"
LABEL description="Cesium Wallet for Ğ1 libre currency"

ARG CESIUM_VER="1.6.3"
ARG CESIUM_VER="1.7.0-rc1"

ENV DEBIAN_FRONTEND=noninteractive \
    NODE_VERSION=10.20.0 \
    NPM_VERSION=6.14.4 \
    YARN_VERSION=1.22.4 \
    IONIC_CLI_VERSION=6.6.0 \
    CORDOVA_VERSION=8.1.2 \
    GRADLE_VERSION=4.10.3 \
    GULP_VERSION=3.9.1
    NODE_VERSION=16.17.0 \
    NPM_VERSION=8.3.0 \
    YARN_VERSION=1.22.17 \
    IONIC_CLI_VERSION=6.20.9 \
    CORDOVA_VERSION=10.0.0 \
    GRADLE_VERSION=6.5.1 \
    GULP_VERSION=4.0.2

# Install basics
RUN apk update && \
@@ -31,6 +31,8 @@ RUN yarn global add gulp@"$GULP_VERSION" @ionic/cli@"$IONIC_CLI_VERSION"
# copy source tree
COPY ./ ./

RUN test -f package.json || git clone https://github.com/duniter/cesium.git && cd cesium

# Install project dependencies
# Workaround need for node-sass (- )see https://github.com/yarnpkg/yarn/issues/4867)
RUN yarn install --ignore-engines && \
+6 −3
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ Please visit th Cesium web site: [cesium.app](https://cesium.app)
    * Manual installation: download then install the `.apk` from your smartphone;
    * [Play Store](https://play.google.com/store/apps/details?id=fr.duniter.cesium);
 - iOS
    * Coming soon...;
    * [App Store](https://apps.apple.com/us/app/cesium-%C4%9F1/id1471028018);


 
@@ -55,11 +55,14 @@ A [Development Guide](doc/development_guide.md) is available to learn :
 - Development best practices.
 
A [development tutorial](doc/fr/development_tutorial-01.md) (in French) is also available.
The [first 3 lessons of the tutorial](doc/en/development_tutorial-01.md) have also been translated into english.

## Donate

To help developers with donation, use the [Cesium Team Ğ1 account](https://g1.duniter.fr#/app/wot/CitdnuQgZ45tNFCagay7Wh12gwwHM8VLej1sWmfHWnQX/) (public key: `CitdnuQgZ45tNFCagay7Wh12gwwHM8VLej1sWmfHWnQX`) 
To help developers with donation, use the [Cesium Team Ğ1 account](https://demo.cesium.app#/app/wot/CitdnuQgZ45tNFCagay7Wh12gwwHM8VLej1sWmfHWnQX/) (public key: `CitdnuQgZ45tNFCagay7Wh12gwwHM8VLej1sWmfHWnQX`) 

## License

This software is distributed under [GNU AGPL-3.0](https://raw.github.com/duniter/cesium/master/LICENSE).

Please read also our [privacy policy](./doc/privacy_policy.md).
 No newline at end of file
+80 −142
Original line number Diff line number Diff line
@@ -6,9 +6,10 @@
    "fallbackLanguage": "en",
    "rememberMe": true,
    "showUDHistory": true,
    "timeout": 40000,
    "timeout": 30000,
    "timeWarningExpireMembership": 5184000,
    "timeWarningExpire": 7776000,
    "minConsensusPeerCount": 10,
    "keepAuthIdle": 600,
    "useLocalStorage": true,
    "useRelative": false,
@@ -19,46 +20,57 @@
    "helptip": {
      "enable": true,
      "installDocUrl": {
        "fr-FR": "https://duniter.org/fr/miner-des-blocs/installer/",
        "en": "https://duniter.org/en/wiki/duniter/install/"
        "fr-FR": "https://duniter.fr/wiki/doc/installer/",
        "en": "https://duniter.org/wiki/doc/install/"
      }
    },
    "license": {
      "ca": "license/license_g1-ca",
      "de-DE": "license/license_g1-de-DE",
      "en": "license/license_g1-en",
      "fr-FR": "license/license_g1-fr-FR",
      "en-GB": "license/license_g1-en",
      "eo-EO": "license/license_g1-eo-EO",
      "es-ES": "license/license_g1-es-ES",
      "eo-EO": "license/license_g1-eo-EO"
      "fr-FR": "license/license_g1-fr-FR",
      "it-IT": "license/license_g1-it-IT",
      "pt-PT": "license/license_g1-pt-PT"
    },
    "feed": {
      "jsonFeed": {
        "fr-FR": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/feed-fr.json",
        "en": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/feed-en.json"
      },
      "maxContentLength": 1300
    },
    "node": {
      "host": "g1.duniter.org",
      "port": 443
        "ca": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-ca.json",
        "de-DE": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-de-DE.json",
        "en": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-en.json",
        "en-GB": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-en-GB.json",
        "eo-EO": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-eo-EO.json",
        "es-ES": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-es-ES.json",
        "fr-FR": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-fr-FR.json",
        "it-IT": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-it-IT.json",
        "nl-NL": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-nl-NL.json",
        "pt-PT": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-pt-PT.json"
      },
      "maxContentLength": 1300,
      "maxAgeInMonths": 3,
      "maxCount": 3
    },
    "fallbackNodes": [
      {
        "host": "g1.cgeek.fr",
        "host": "g1.e-is.pro",
        "port": 443
      },
      {
        "host": "g1.librelois.fr",
        "host": "vit.fdn.org",
        "port": 443
      },
      {
        "host": "g1.e-is.pro",
        "host": "g1.cgeek.fr",
        "port": 443
      },
      {
        "host": "duniter.moul.re",
        "host": "g1.mithril.re",
        "port": 443
      },
      {
        "host": "g1.presles.fr",
        "host": "g1.duniter.org",
        "port": 443
      },
      {
@@ -66,16 +78,23 @@
        "port": 443
      },
      {
        "host": "duniter.normandie-libre.fr",
        "host": "duniter.pini.fr",
        "port": 443
      },
      {
        "host": "g1.duniter.org",
        "host": "g1.moul.re",
        "port": 443
      },
      {
        "host": "duniter-v1.comunes.net",
        "port": 443
      }
    ],
    "developers": [
      {"name": "Benoit Lavenier", "pubkey": "38MEAZN68Pz1DTvT3tqgxx4yQP6snJCQhPqEFxbDk4aE"}
      {"name": "Benoit Lavenier", "pubkey": "38MEAZN68Pz1DTvT3tqgxx4yQP6snJCQhPqEFxbDk4aE"},
      {"name": "Cédric Moreau", "pubkey": "2ny7YAdmzReQxAayyJZsyVYwYhVyax2thKcGknmQy5nQ"},
      {"name": "Kapis", "pubkey": "24jaf8XhYZyDyUb7hMcy5qsanaHBC11AwPefcCQRBQNA"},
      {"name": "Matograine", "pubkey": "CmFKubyqbmJWbhyH2eEPVSSs4H4NeXGDfrETzEnRFtPd"}
    ],
    "plugins":{
      "es": {
@@ -94,114 +113,19 @@
            "port": 443
          },
          {
            "host": "g1.data.mithril.re",
            "port": 443
          }
        ],
        "notifications": {
          "txSent": true,
          "txReceived": true,
          "certSent": true,
          "certReceived": true
        },
        "defaultCountry": "France"
      }
    }
  },

  "default_fr": {
    "cacheTimeMs": 300000,
    "demo": false,
    "readonly": false,
    "fallbackLanguage": "fr",
    "rememberMe": true,
    "showUDHistory": true,
    "timeout": 300000,
    "timeWarningExpireMembership": 5184000,
    "timeWarningExpire": 7776000,
    "keepAuthIdle": 600,
    "useLocalStorage": true,
    "useRelative": false,
    "expertMode": false,
    "decimalCount": 2,
    "httpsMode": false,
    "shareBaseUrl": "https://demo.cesium.app/",
    "helptip": {
      "enable": true,
      "installDocUrl": {
        "fr-FR": "https://duniter.org/fr/miner-des-blocs/installer/",
        "en": "https://duniter.org/en/wiki/duniter/install/"
      }
    },
    "license": {
      "fr-FR": "license/license_g1-fr-FR",
      "en": "license/license_g1-en",
      "es-ES": "license/license_g1-es-ES",
      "eo-EO": "license/license_g1-eo-EO"
    },
    "feed": {
      "jsonFeed": {
        "fr-FR": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/feed-fr.json",
        "en": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/feed-en.json"
      },
      "maxContentLength": 1300
    },
    "node": {
      "host": "g1.duniter.org",
      "port": 443
    },
    "fallbackNodes": [
      {
        "host": "g1.cgeek.fr",
            "host": "g1.data.brussels.ovh",
            "port": 443
          },
          {
        "host": "g1.librelois.fr",
            "host": "g1.data.pini.fr",
            "port": 443
          },
          {
        "host": "g1.e-is.pro",
        "port": 443
      },
      {
        "host": "duniter.moul.re",
        "port": 443
      },
      {
        "host": "g1.presles.fr",
        "port": 443
      },
      {
        "host": "g1.le-sou.org",
        "port": 443
      },
      {
        "host": "duniter.normandie-libre.fr",
            "host": "g1.data.mithril.re",
            "port": 443
          },
          {
        "host": "g1.duniter.org",
        "port": 443
      }
    ],
    "plugins":{
      "es": {
        "enable": true,
        "askEnable": true,
        "useRemoteStorage": true,
            "host": "g1.data.e-is.pro",
        "port": 443,
        "fallbackNodes": [
          {
            "host": "g1.data.presles.fr",
            "port": 443
          },
          {
            "host": "g1.data.le-sou.org",
            "port": 443
          },
          {
            "host": "g1.data.mithril.re",
            "port": 443
          }
        ],
@@ -222,19 +146,22 @@
    "readonly": false,
    "fallbackLanguage": "en",
    "rememberMe": true,
    "timeout": 300000,
    "showUDHistory": true,
    "timeout": 30000,
    "timeWarningExpireMembership": 5184000,
    "timeWarningExpire": 7776000,
    "minConsensusPeerCount": -1,
    "useLocalStorage": true,
    "useRelative": false,
    "expertMode": true,
    "decimalCount": 2,
    "httpsMode": false,
    "shareBaseUrl": "https://g1-test.cesium.app",
    "helptip": {
      "enable": false,
      "installDocUrl": {
        "fr-FR": "https://duniter.org/fr/miner-des-blocs/installer/",
        "en": "https://duniter.org/en/wiki/duniter/install/"
        "fr-FR": "https://duniter.fr/wiki/doc/installer/",
        "en": "https://duniter.org/wiki/doc/install/"
      }
    },
    "node": {
@@ -243,23 +170,25 @@
    },
    "fallbackNodes": [
      {
        "host": "g1-test.cgeek.fr",
        "port": 443
      },
      {
        "host": "gtest.jytou.fr",
        "port": 443
        "host": "gt.moul.re",
        "port": 10902
      },
      {
        "host": "ts.gt.elo.tf",
        "host": "g1-test.duniter.org",
        "port": 443
      }
    ],
    "developers": [
      {"name": "Benoit Lavenier", "pubkey": "38MEAZN68Pz1DTvT3tqgxx4yQP6snJCQhPqEFxbDk4aE"},
      {"name": "Cédric Moreau", "pubkey": "2ny7YAdmzReQxAayyJZsyVYwYhVyax2thKcGknmQy5nQ"},
      {"name": "Kapis", "pubkey": "24jaf8XhYZyDyUb7hMcy5qsanaHBC11AwPefcCQRBQNA"},
      {"name": "Matograine", "pubkey": "CmFKubyqbmJWbhyH2eEPVSSs4H4NeXGDfrETzEnRFtPd"}
    ],
    "plugins":{
      "es": {
        "enable": true,
        "askEnable": true,
        "useRemoteStorage": true,
        "enable": false,
        "askEnable": false,
        "useRemoteStorage": false,
        "host": "g1-test.data.e-is.pro",
        "port": 443,
        "notifications": {
@@ -291,18 +220,21 @@
    "helptip": {
      "enable": false,
      "installDocUrl": {
        "fr-FR": "https://duniter.org/fr/wiki/duniter/installer/",
        "fr-FR": "https://duniter.fr/wiki/doc/installer/",
        "en": "https://duniter.org/en/wiki/duniter/install/"
      }
    },
    "license": {
      "fr-FR": "license/license_g1-fr-FR",
      "en": "license/license_g1-en",
      "fr-FR": "license/license_g1-fr-FR",
      "es-ES": "license/license_g1-es-ES",
      "eo-EO": "license/license_g1-eo-EO"
      "eo-EO": "license/license_g1-eo-EO",
      "pt-PT": "license/license_g1-pt-PT",
      "it-IT": "license/license_g1-it-IT",
      "de-DE": "license/license_g1-de-DE"
    },
    "node": {
      "host": "g1.duniter.fr",
      "host": "g1.e-is.pro",
      "port": 443
    },
    "fallbackNodes": [{
@@ -310,7 +242,7 @@
        "port": 443
      },
      {
        "host": "g1.duniter.fr",
        "host": "g1.e-is.pro",
        "port": 443
      }
    ],
@@ -366,13 +298,19 @@
    "httpsMode": false,
    "helptip": {
      "enable": false,
      "installDocUrl": "https://github.com/duniter/duniter/blob/master/doc/install-a-node.md"
      "installDocUrl": {
        "fr-FR": "https://duniter.fr/wiki/doc/installer/",
        "en": "https://duniter.org/en/wiki/duniter/install/"
      }
    },
    "license": {
      "fr-FR": "license/license_g1-fr-FR.txt",
      "en": "license/license_g1-en.txt",
      "en": "license/license_g1-en",
      "fr-FR": "license/license_g1-fr-FR",
      "es-ES": "license/license_g1-es-ES",
      "eo-EO": "license/license_g1-eo-EO"
      "eo-EO": "license/license_g1-eo-EO",
      "pt-PT": "license/license_g1-pt-PT",
      "it-IT": "license/license_g1-it-IT",
      "de-DE": "license/license_g1-de-DE"
    },
    "node": {
      "host": "g1.duniter.org",
+31 −34
Original line number Diff line number Diff line
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="106090" id="fr.duniter.cesium" ios-CFBundleIdentifier="org.duniter.cesium" version="1.6.9" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="107160" id="fr.duniter.cesium" ios-CFBundleIdentifier="org.duniter.cesium" version="1.7.16" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Cesium</name>
    <description>
    An simple App for Duniter wallet
      Cesium Wallet for Ğ1 libre currency
    </description>
    <author email="contact@e-is.pro">
      E-IS PRO
@@ -27,13 +27,11 @@
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="4000" />
    <preference name="SplashScreenDelay" value="2500" />
    <preference name="KeyboardDisplayRequiresUserAction" value="false" />
    <preference name="KeyboardResizeMode" value="ionic" />
    <preference name="xwalkVersion" value="19" />
    <preference name="xwalkMultipleApk" value="false" />
    <preference name="android-minSdkVersion" value="16" />
    <preference name="android-targetSdkVersion" value="29" />
    <preference name="StatusBarOverlaysWebView" value="false" />
    <preference name="StatusBarBackgroundColor" value="#000" />
    <preference name="StatusBarStyle" value="lightcontent" />
@@ -47,25 +45,31 @@
    <feature name="Device">
        <param name="android-package" onload="true" value="org.apache.cordova.device.Device" />
    </feature>
    <feature name="MiniSodium">
        <param name="android-package" onload="true" value="me.lockate.plugins.MiniSodium" />
    </feature>
    <feature name="Custom URL scheme">
        <param name="id" value="cordova-plugin-customurlscheme" />
        <param name="url" value="https://github.com/EddyVerbruggen/Custom-URL-scheme.git" />
        <variable name="URL_SCHEME" value="june" />
    </feature>
    <platform name="android">
        <preference name="AndroidXEnabled" value="true" />
        <preference name="AndroidLaunchMode" value="singleTask" />
        <preference name="android-minSdkVersion" value="16" />
        <preference name="android-targetSdkVersion" value="29" />
        <preference name="AndroidInsecureFileModeEnabled" value="true" />
        <preference name="android-minSdkVersion" value="22" />
        <preference name="android-targetSdkVersion" value="35" />
        <preference name="android-compileSdkVersion" value="35" />
        <preference name="AndroidJavaSourceCompatibility" value="8" />
        <preference name="AndroidTargetSourceCompatibility" value="8" />
        <preference name="GradlePluginKotlinEnabled" value="true" />
        <preference name="GradleVersion" value="8.7" />
        <preference name="AndroidKotlinJVMTarget" value="8" />
        <preference name="AndroidPersistentFileLocation" value="Compatibility" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <preference name="AndroidWindowSplashScreenAnimatedIcon" value="resources/android/splash/splashscreen.xml" />
        <preference name="AndroidWindowSplashScreenBackground" value="#1A237E" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
@@ -78,6 +82,9 @@
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <application android:networkSecurityConfig="@xml/network_security_config" />
        </edit-config>
    </platform>
    <platform name="ios">
        <preference name="BackupWebStorage" value="local" />
@@ -132,43 +139,33 @@
            <false />
        </config-file>
    </platform>
    <platform name="osx">
        <icon height="16" src="resources/osx/icon-16.png" width="16" />
        <icon height="32" src="resources/osx/icon-32.png" width="32" />
        <icon height="64" src="resources/osx/icon-64.png" width="64" />
        <icon height="128" src="resources/osx/icon-128.png" width="128" />
        <icon height="256" src="resources/osx/icon-256.png" width="256" />
        <icon height="512" src="resources/osx/icon-512.png" width="512" />
        <icon height="1024" src="resources/osx/icon-1024.png" width="1024" />
    </platform>
    <plugin name="cordova-plugin-camera" spec="^4.1.0">
        <variable name="CAMERA_USAGE_DESCRIPTION" value="Add picture to the user profile" />
        <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="Take a picture for the user profile" />
        <variable name="ANDROID_SUPPORT_V4_VERSION" value="28.+" />
    </plugin>
    <plugin name="cordova-plugin-ionic-webview" spec="^4.2.1">
    <plugin name="cordova-plugin-ionic-webview" spec="^5.0.1">
        <variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="28.+" />
    </plugin>
    <plugin name="cordova-plugin-device" spec="^2.0.3" />
    <plugin name="cordova-plugin-device" spec="^3.0.0" />
    <plugin name="cordova-plugin-dialogs" spec="^2.0.2" />
    <plugin name="cordova-clipboard" spec="^1.3.0" />
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.4" />
    <plugin name="cordova-plugin-statusbar" spec="^2.4.3" />
    <plugin name="cordova-plugin-file" spec="^6.0.2" />
    <plugin name="cordova-plugin-splashscreen" spec="^6.0.2" />
    <plugin name="cordova-plugin-statusbar" spec="^4.0.0" />
    <plugin name="cordova-plugin-file" spec="^8.1.3" />
    <plugin name="cordova-plugin-vibration" spec="^3.1.1" />
    <plugin name="cordova-plugin-websocket" spec="^0.12.2" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.4" />
    <plugin name="cordova-plugin-x-toast" spec="^2.7.2" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.2.0" />
    <plugin name="phonegap-plugin-barcodescanner" spec="^8.1.0">
    <plugin name="cordova-plugin-androidx-adapter" spec="^1.1.3" />
    <plugin name="cordova-plugin-x-toast" spec="^2.7.3" />
    <plugin name="@red-mobile/cordova-plugin-barcodescanner" spec="^9.1.0">
        <variable name="CAMERA_USAGE_DESCRIPTION" value="To scan QRCode" />
        <variable name="ANDROID_SUPPORT_V4_VERSION" value="28.+" />
    </plugin>
    <plugin name="cordova-plugin-customurlscheme" spec="^5.0.2">
        <variable name="URL_SCHEME" value="june" />
    </plugin>
    <plugin name="cordova-plugin-network-information" spec="~3.0.0">
    </plugin>
    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
    <plugin name="cordova-plugin-androidx" spec="^1.0.2" />
    <engine name="ios" spec="^6.1.0" />
    <engine name="osx" spec="^6.0.0" />
</widget>
+1 −0
Original line number Diff line number Diff line
Subproject commit 17788c85b43b1fa75287a80454349948068cc457
+1 −1
Original line number Diff line number Diff line
Subproject commit 366b85e16a589746f53ad260a02abdaa346a1212
Subproject commit 7f899bf2139dd7238840019d4365377341171f6d
Original line number Diff line number Diff line
@@ -16,9 +16,9 @@ After that you should be able to start the application using `npm start`, and to

You can choose to install
 
- on Linux, install OpenJDK 8:
- on Linux, install OpenJDK 11:
 
  * ``sudo apt-get install openjdk-8-jdk``
  * ``sudo apt-get install openjdk-11-jdk``
    
- or Oracle JDK 8 (all platforms supported):
  
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
## Install Node JS

1. Install NVM (node.js version manager) :
2. Install node.js v5  
2. Install node.js 16
3. Install common node.js dependencies
 
```bash
@@ -70,7 +70,7 @@ export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm

# Node.js
nvm install 6
nvm install 16

# node-pre-gyp
npm install -g nw-gyp node-pre-gyp
@@ -82,7 +82,7 @@ npm install -g nw-gyp node-pre-gyp

2. Install global dependencies (see [Development Guide](./development_guide.md) for versions to used) :
```
npm install -g yarn gulp@3.9.1 cordova @ionic/cli@6.6.0
npm install -g yarn gulp cordova @ionic/cli@6.20.9
```

3. Install project dependencies :
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ Cesium can be build as a simple web application, portable and runnable anywhere.

Follow all the steps defined in the [Development guide](./development_guide.md).

After that you should be able to start the application using `npm start`or `yarn run start`, and to test it.
After that you should be able to start the application using `npm start`or `yarn start`, and to test it.

## Build the unhosted web application

@@ -23,4 +23,4 @@ After that you should be able to start the application using `npm start`or `yarn

## Publishing to a web site 

Uncompress the web archive, then open the `ìndex.html` file in your web browser.
 No newline at end of file
Decompress the web archive, then open the `ìndex.html` file in your web browser.
 No newline at end of file
Original line number Diff line number Diff line
@@ -8,14 +8,15 @@ Cesium can be build as Web extension, for Mozilla Firefox extension (`.xpi`) and

Follow all the steps defined in the [Development guide](./development_guide.md).

After that you should be able to start the application using `npm start`or `yarn run start`, and to test it.
After that you should be able to start the application using `yarn run start`, and to test it.

## Build the web extension


- To create a uncompressed extension, use :
- To create an uncompressed extension, use :
  ```bash
     cd cesium
     gulp build
     gulp webExtCompile --release
  ```
  
@@ -24,6 +25,7 @@ After that you should be able to start the application using `npm start`or `yarn
- To create a portable and compressed ZIP extension : 
  ```bash
     cd cesium
     gulp build
     gulp webExtBuild --release
  ```
  
+6 −0
Original line number Diff line number Diff line
# Version v1.7.0

## All platforms

- [enh] Add mre languages : Italian, Deutsch, Catalan, Portuges
- [fix] Update default Duniter and Cesium+ Pod peers 
 No newline at end of file
Original line number Diff line number Diff line
@@ -3,10 +3,16 @@
## In a post-it

```bash
nvm use 12
# Install NodeJS v16
nvm use 16
npm install -g yarn 

# Clone and compile from source
git clone git@git.duniter.org:clients/cesium-grp/cesium.git
cd cesium
yarn

# Run the App !
yarn run start
```

@@ -22,7 +28,7 @@ To build Cesium, you will have to:
      sudo apt-get install git wget curl unzip build-essential software-properties-common ruby ruby-dev ruby-ffi gcc make
   ```

2. Installing node.js v12 :
2. Installing node.js v16 :

  * First, install [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager) :    
    ```bash
@@ -35,12 +41,12 @@ To build Cesium, you will have to:

  * Configure nvm to use the expected version: (**WARNING**: upper version will NOT work !) 
    ```bash
       nvm install 12
       nvm install 16
    ```
      
3. Installing node build tools, as global dependencies:
   ```bash
      npm install -g yarn gulp cordova@10.0.0 @ionic/cli web-ext
      npm install -g yarn gulp cordova @ionic/cli@6.20.9 web-ext
   ```
   
### Get the source code and dependencies
@@ -58,7 +64,7 @@ To build Cesium, you will have to:

3. Installing Cordova plugins (required to build Android and iOS artifacts): 
   ```bash
      export JAVA_HOME=/path/to/jdk-8
      export JAVA_HOME=/path/to/jdk-11
      export PATH=$JAVA_HOME/bin:$PATH
      ionic cordova prepare
   ```
@@ -67,7 +73,7 @@ To build Cesium, you will have to:

   > As a reminder: check that your command line is well configured:
   > - You must place yourself in the directory of the application: `cd cesium`
   > - and working with NodeJs **v12**: `nvm use 12` (please check using the command `node --version`)
   > - and working with NodeJs **v16**: `nvm use 16` (please check using the command `node --version`)
    

### Prepare configuration file
+390 −0
Original line number Diff line number Diff line
## Introduction

This article is an introductory tutorial to the source code of the Cesium software. 

This will allow you, through a succession of steps, to access the mastery of the tools and methods used daily by the developers of Cesium to create and modify the software.

At the end of this tutorial, you will be *able to modify the software*. And if you feel like it, you can even make a change and share it with the main code repository, so that it is officially integrated and available to users!

To your keyboards!

## Level I: Retrieve the source code

This first level consists of creating *your own version* of the software sources and retrieving this copy on your computer. You will produce:

* your own account on the [GitLab de Duniter](https://git.duniter.org)
* your own version of the software, your *fork*
* a local copy of the source code files from your *fork*

### Create a GitLab Duniter account

> If you already have a GitLab account, you can skip this step.

Go to [https://git.duniter.org](https://git.duniter.org/users/sign_in?redirect_to_referer=yes) (site in english).

In 'Register' Fill in the 3 proposed fields:

* Full name 
* Username 
* E-mail 
* Password

You will probably receive a confirmation email that you will need to validate. Once this step is over, you should have an account on the GitLab Duniter.

### Fork the main repo

Go to https://git.duniter.org/clients/cesium-grp/cesium.

Click the "Fork" button at the top of the page (below the logo).

### Install Git

Installing Git depends on your operating system. Simply follow the instructions on : https://git-scm.com/

### Clone your fork

At this point, you are able to retrieve your version of the source code (your *fork*), so that you can work on it.

#### Open Git from the command line

To retrieve the source code, launch Git in console mode.

* On Linux and MacOS, simply open Terminal
* On Windows launch the *Git Bash* program :

<img src="../fr/img/6fc638dc0a22d88da7e84dbf0371e69747767f78.png" width="432" height="80">

#### Clone your fork from the command line

Go back to the GitHub webpage and find the "Clone or download" button: Click on it, you can then copy the clone URL by clicking on the suitcase icon.

All you have to do is go back to your Git console and enter: 

    git clone <paste the copied URL>

which gives **in my case**:

```
git clone git@git.duniter.org:blavenie/cesium.git
Cloning into 'cesium'...
 (...)
Checking connectivity... done.
```

If you have come to a similar behavior, **great**, you now have the Cesium source code!
 
## Level II: Compiling and Launching in a Browser

This second level aims to obtain the basic tools to execute the source code, and verify its proper functioning. You will realize:

* installation of the JavaScript runtime *Node.js*
* the verification of the proper functioning of the source code *via* the launch of the application, in web mode.

If the application launches, you will already have a fully **functional** environment!

### Install Node.js

#### Under Linux / MacOS

Installing Node.js has become extremely simple for these OS: a tool allows you to install the version of Node.js you want, change it whenever you want and without conflict with a previous version: it is [nvm](https://github.com/creationix/nvm).

You can install nvm with the following command:

```bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
```

Close and reopen your terminal, as shown. Then, install Node.js (choose version 12):

```bash
nvm install 12
```

You will then have the latest version of node's 5.x branch.js ready to use.

##### Compilation tools

Install the necessary tools for compilation.
```bash
sudo apt-get install build-essential
```

(mac users https://appuals.com/how-to-fix-sudo-apt-get-command-not-found-on-macos/)

#### On Windows

For Windows, download version 6 available from the official website of Node.js: https://nodejs.org

Then launch the installer thus downloaded.

### Install Cesium Node.js modules

Cesium relies on third-party libraries to run called *dependencies*, such as compilation libraries (gulp, ionic, angularJS).

The fact that you cloned the sources is actually not enough to launch the application. We need to get the code of the dependencies to get all the executable code of the program. To do this, go back to the Git console and move to the cloned directory:

```bash
cd cesium
```

Then, start downloading and installing the Cesium modules using the command:

```bash
npm install -g yarn gulp cordova@10.0.0 @ionic/cli web-ext
```

Then for non-global dependencies:

```bash
yarn
```

> The installation process may take several minutes. Indeed, it is necessary to download all the dependencies of Cesium and even compile some of them.

If everything went well, you should get an end tree in the console, and the command prompt should have returned your hand:

```bash
yarn install v1.15.2
[1/4] Resolving packages...
  (...)
$ node -e "try { require('fs').symlinkSync(require('path').resolve('node_modules/@bower_components'), 'www/lib', 'junction') } catch (e) { }"
Done in 0.82s.
```

> You may get `npm WARN messages [...] `. Nothing serious: as the name of the message suggests, it is simply a non-blocking warning for the rest of the events.

Then install the remaining dependencies (via bower):

```bash
npm run postinstall
```

### Install an IDE

To develop in NodeJS, you can use the IDE of your choice:

 * For example Sublime Text (not free) : https://www.sublimetext.com/
 * Other possibilities : 
    * VS Code (free).
    * WebStorm (not free but very advanced operation).

### Install Chrome and/or Firefox

To debug Cesium javascript more easily, it is easier to use the Chrome browser

## Level III: Mastering the usual commands

This third level allows you to discover the few (five) commands that you will use all the time if you develop Cesium. You will learn:

* configure Cesium, including the Duniter node it will use (default);
* to launch Cesium in your browser;

### Configure Cesium

The default configuration of our environment is visible in the file 'app/config.json'. Several profiles are present: 'default', 'dev', etc.

```json
{
   "default": {
       "cacheTimeMs": 60000,
       "fallbackLanguage": "en",
       "rememberMe": false,
       "showUDHistory": false,
       "timeout": 10000,
       "timeWarningExpireMembership": 5184000,
       "timeWarningExpire": 7776000,
       "useLocalStorage": true,
       "useRelative": true,
       "initPhase": false,
       "expertMode": false,
       "decimalCount": 4,
       "helptip": {
         "enable": true,
         "installDocUrl": "https://github.com/duniter/duniter/blob/master/doc/install-a-node.md"
       },
       "node": {
         "host": "g1.duniter.org",
         "port": "443"
       },
       "plugins":{
         "es": {
           "enable": true,
           "askEnable": false,
           "host": "g1.data.duniter.fr",
           "port": "443"
         }
       }
     },
     
     (...)
     "dev": {
         "cacheTimeMs": 60000,
         "fallbackLanguage": "fr-FR",
         "defaultLanguage": "fr-FR",
         "rememberMe": true,
         "showUDHistory": false,
         "timeout": 6000,
         "timeWarningExpireMembership": 5184000,
         "timeWarningExpire": 7776000,
         "useLocalStorage": true,
         "useRelative": true,
         "initPhase": false,
         "expertMode": false,
         "decimalCount": 2,
         "helptip": {
           "enable": true,
         },
         "node": {
           "host": "localhost",
           "port": "9600"
         },
         "plugins":{
           "es": {
             "enable": false
           }
         }
       },
}
```

We will use the "dev" configuration, you  may use your Duniter node.

Change the 'host' and 'port' values of the 'dev' configuration profile to match your Duniter node:

```json
  "dev: {
  ...
         "node": {
           "host": "localhost",
           "port": "9600"
         },
  ...
```

Disable the plugin "es" (used for Cesium+) :

```json
  "dev: {
  ...
         "plugins":{
           "es": {
             "enable": false
           }
         }
  ...
```

To enable this configuration, now run the command:

```bash
 gulp config --env dev
```

```bash
[17:32:34] Using gulpfile (...)/cesium/gulpfile.js
[17:32:34] Starting 'config'...
[17:32:34] Building `www/js/config.js` for `dev` environment...
[17:32:36] Finished 'config' after 10 μs
```

> This command will be restarted at the time of your changes to the `app/config` file.

Cesium is now configured to use your local Duniter node.

### Launch Cesium (web mode)

All you have to do is launch the application (in web mode) to find out if everything went well and that you are ready for the future.

Run the following command :

```bash
npm start
```

 > Alternative : `ionic serve`

When complete, the command displays :

```bash
Running live reload server: http://localhost:35729
Watching: 0=www/**/*, 1=!www/lib/**/*
Running dev server:  http://localhost:8100
Ionic server commands, enter:
  restart or r to restart the client app from the root
  goto or g and a url to have the app navigate to the given url
  consolelogs or c to enable/disable console log output
  serverlogs or s to enable/disable server log output
  quit or q to shutdown the server and exit

ionic $ 
```

You can open a web browser at http://localhost:8100
You should see the Cesium homepage there.
 
Congratulations, you have an operational Cesium installation!

### Documentation

Cesium uses the Ionic framework, which has good documentation : http://ionicframework.com.

Visit this site to learn more.

## Level IV: Finding your way around the code

### Locate software layers

Open your IDE, and open the Cesium project.

Search and locate in the code:

* HTML templates that carry HMIs: www/templates 
* controllers (JS): www/js/controllers 
* services (JS): www/js/services

<img src="../fr/img/a5078db3abdf71c87f245e948ce94a181b0e0f37.png" width="690" height="369">


### Go further in the code

Cesium relies on AngularJS. Excellent documentation is available on the web.

__Note :__ The version of AngularJS used is a 1.x. The 2.x and above change completely and impose a complete redesign... This redesign is planned by 2019, in a version 2 of Cesium.

## Level V: Debugging

### On Chrome

#### Open The Source Explorer

Open the app in Chrome at http://localhost:8100

Open the developer tools: 
* Menu `Option > More Tools > Developer Tools` 
* or by the keyboard shortcuts: `Ctrl + Shift + i`

#### Debug a user's certification

Open the source explorer, and then locate the file `dist/dist_js/app/controllers/wot-controllers.js`.

Find the method `$scope.certify()`, and place a breakpoint there.

Navigate the Cesium app as follows:

 * Click in the menu (on the left) `Annuaire`;
 * Searches for a user and then visualizes their identity;
 * In `Certification received`, click on the `Certify` button;
 * Verify that the console stops at the breakpoint.

<img src="../fr/img/eca671a6d24b8e11566cfcca11b65e6c9c9c370c.png" width="690" height="223">

Discover the code by scrolling down the step-by-step action.

> Use the keys from `F9` to `F11`, to enter a method (F11), advance step by step (F10) or to the next breakpoint (F9), etc.


## See more ?!

You can now continue with the following levels. We will see how to modify a Cesium screen.

[See more here >>](./development_tutorial-02.md)
+180 −0
Original line number Diff line number Diff line
## Presentation

This article is the 2nd initiation tutorial to the Cesium software source code.

You will be able to understand the role of the different software layers,
by modifying them in order to improve a screen of Cesium.

## Prerequisites

Before doing this tutorial, you must:
  
 - Know the functionalities of Cesium. If not, refer to [la vidéo de présentation générale des fonctionnalités](https://www.youtube.com/watch?v=FQzGIzJf9Nw&list=PLr7acQJbh5rzgkXOrCws2bELR8TNRIuv0&index=6) (RML7) and the one detailing the new features (RML8 - link to come)
 - Have followed the 1st tutorial for setting up the environment [jusqu'au niveau III](https://github.com/duniter/cesium/blob/master/doc/fr/development_tutorial.md)

## Level VI: Display a missing currency parameter

__Objective :__ In this level, the objective is to display in the [`Currency`](http://g1.duniter.fr/#/app/currency/view/lg/) page the monetary parameter `stepMax`.

> As a reminder, `stepMax` is the maximum distance between a member and an applicant, so that the latter can enter the web of trust.

### Modify the HTML template

Open the template file `/www/templates/currency/items_parameters.html`.

Add a new item in the list of parameters, i.e. a new `<ion-item>` tag, below the other tags of the same name:

```html
   (...)

   <ion-item class="item-icon-left">
     <i class="icon ion-steam"></i>
     <span translate>CURRENCY.VIEW.STEP_MAX</span>
     <span class="badge badge-stable">{{stepMax}}</span>
   </ion-item>
```

If you refresh the `Currency` page of your browser, you should see the change:

<img src="../fr/img/19a637b1fa847aa5bbb18565737e9e5e28729221.jpg" width="431" height="97">

### Internationalizing a Label

The `CURRENCY.VIEW.STEP_MAX` string actually represents an **internationalized message key**.
We now need to add the translation of this key.

> The icon is configured simply by the `ion-stream` CSS class. To find out which icons are available, see
[ionicons.com](http://ionicons.com/)

Open the file `www/i18n/locale-fr-FR.json` and identify the element `CURRENCY` then `VIEW`.
Add the translation for our new key:

```json
  "CURRENCY": {
   (...)

  "VIEW": {
    "TITLE": "Monnaie",
    (...)
    "SIG_WINDOW": "Maximum delay a certification can wait<br/>before being expired for non-writing.",
    "STEP_MAX": "Distance maximale dans la toile de confiance<br/>entre chaque membre et un nouvel entrant"
  }
}
```

Don't forget **to add a comma** on the preceding line...

> Note: Cesium internationalization uses the AngularJS plugin [angular-translate](https://github.com/angular-translate/angular-translate).
> Depending on the case, it is possible to use HTML tags, like here the tag `<br/>`

Refresh your browser page: the key has been translated! 

<img src="../fr/img/6bd04622dd2eb59f6d716ae9e2f114276e4ca35a.jpg" width="690" height="116">

Repeat the operation in the **other translation files** present in `www/i18n`:

```
    (...)
    "STEP_MAX": "Maximum distance between<br/>each WoT member and a newcomer"
   }  

```

### Add a dynamic variable

All that remains is to dynamically display the value of our `stepMax` parameter. We will use the `data-binding` functions that AngularJS allows.

> In AngularJS, it is a controller that manages the filling of values, typically from data obtained on the network.

Open the `CurrencyViewController` controller present in the file `www/js/controllers/currency-controllers.js`
This controller already makes a call to the Duniter API [`/blockchain/parameters`](http://cgeek.fr:9330/blockchain/parameters).

Identify the `load()` function.
Modify the return code of the `/blockchain/parameters` call, to store the `stepMax` value in the `$scope`:

```
function CurrencyViewController($scope, $q, $translate, $timeout, BMA, UIUtils, csSettings, csCurrency, csNetwork) {
  // Ajout d'une propriété qui stockera la valeur de stepMax
  // (On met ici la valeur par défaut)
  $scope.stepMax = 0;
  (...)

  $scope.load = function() {
    (...)
    
    return $q.all([

      // Get the currency parameters
      BMA.node.blockchain.parameters() 
       .then(function(json){
          $scope.currency = json.currency;
          (...)
          // Mise à jour de la valeur, à partir du résultat que renvoi le noeud Duniter
          $scope.stepMax = json.stepMax;
        }),
      (...)
```

> The '$scope' object is used to manipulate values shared between the controller and the template.
> The value we put in `$scope.stepMax` is displayed thanks to the `{{stepMax}}` instruction that you put in the HTML template.

Your browser should now display:

<img src="../fr/img/3df8cbd2133ea9e9a28855f4b50413846fdf292c.jpg" width="519" height="85">

Congratulations, you now know how to display new values in Cesium screens!

## Level VII: Publish your changes

__Objective :__  Become an official contributor, by publishing your code!

### Make a `pull request`

If you have never used git on your current machine, you will first need to define

1. your email address: `git config --global user.email "your@email.xyz"`
2. your first and last name: `git config --global user.name "First name NAME"`

The change you just made actually corresponds to [ticket #209](https://git.duniter.org/clients/cesium-grp/cesium/issues/209).
To add your modification to it, and thus **become an official contributor** of Cesium:

 * Type the command `git add` followed by the names of the files you modified or, more simply, `git add *` to add all modified files to the commit.
 * Then do a `git commit` to commit your code;
 * Finally, do a `git push` to push to your GitHub repo.
 * In GitLab, log in to your account;
 * Open your `Cesium` repository via the "Projects" > "Your projects" menu that you will find at the top left, in the navigation bar.
 * In the left menu, go to "Merge requests", and click on the "New merge request" button
 * Most of the fields are already pre-populated, so all you have to do is select the source branch (if you haven't changed your branch via the git command line, it's "master")
 * Click on `Compare branches and continue`
 * In the title the reference to the ticket: `#209`

Your contribution is now visible to Cesium developers, who will be able to integrate your code more easily.

> _Note :_ Since RML7, this ticket has been closed. You can therefore continue this level, by adding other missing variables (see next paragraph), then 
> publish your changes: the `pull request` process remains the same.

## Niveau VIII : Free modification

__Objective :__  Now it's up to you to add the missing information that seems interesting.

### Add new variables

To get your hands on the changes in Cesium, you can add other missing currency settings.
For example, among those concerning the _BlockChain_: `xpercent`, `percentRot`, `blocksRot`...

You can find their definition in the [Duniter protocol documentation](https://github.com/duniter/duniter/blob/master/doc/Protocol.md#protocol-parameters).

> _Tip:_ to separate the different parts of the screen, add a separator, i.e. a `<div>` tag with the CSS class `item item-divider`:

```html
  <div class="item item-divider">
      <span translate>CURRENCY.VIEW.BLOCKCHAIN_DIVIDER</span>
  </div>
  <!-- paramètres relatifs à la blockchain -->
```

## See more ?!

You can now continue with the following levels. We will see how to compile and deploy Cesium on Android, then how to add a plugin, and even add a dynamic graph!

[See more here >>](./development_tutorial-03-android.md)
 No newline at end of file
Original line number Diff line number Diff line
## Introduction

This article is a tutorial to develop on Cesium, to compile and test the application on Android.

## Prerequisites

Before doing this tutorial, you must: 

 - Have followed the tutorials on Cesium [up to level VIII] (./development_tutorial-02.md)

## Level IX

### Objective

The objective here is to install the basic tools to compile and verify its proper functioning under Android. You will achieve: </p>

- installation of `JDK`
- installation of `Android Studio` software
- installation of  `KVM` emulator
- installation of `NDK Android` (optional - will be needed later)

### Installing software

#### Installing JDK

The JDK or _Java Development Kit_

You can download it from [Oracle](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html).

<img src="../fr/img/fef4f4dfe7c2168cb27c9e7f5e399fd547ce774a.png" width="400">

Depending on your operating system, download corresponding.

Then install the file as normal, following the guided steps.

#### Install Android Studio

You can find all files at [AndroidStudio-Downloads](https://developer.android.com/studio/index.html#downloads)

For Windows download file without Android SDK:

<img src="../fr/img/3b8fa2f5c0465b13ae5ce74d49702e0c9f027866.png" width="690" height="237">

##### For Linux

All you need to do is unzip the ZIP file, open a terminal in that folder, and type the command:
```bash
./bin/studio.sh
```

##### For Windows and Mac OS

Install the executable you downloaded earlier.

##### All machines combined

At the end of the installation or at the first launch, Android Studio will tell you that you do not have an SDK and will offer to install it:

- If you have already installed it, you can indicate where it is.
- Otherwise install the version it offers.


#### Install NDK (optional)

> The NDK is used for executing code under C++, in particular the NaCL cryptography library.
> This step is currently optional (for experts only).

You can download it at: [this site](https://developer.android.com/ndk/downloads/index.html)

Warning: do not install version 12 of the NDK. It's not stable yet.

Once again downloaded the correct version, unzip the file next to your SDK.

Under Android Studio go to the menu `File > Project Structure...`

<img src="../fr/img/04e64b769cbd45b9d275cd5f81002a399a1a7684.png" width="300">

A window like this should open:

<img src="../fr/img/ceb75301172038e75f5c43b328dd7febd7bedc7e.png" width="450">

Enter the NDK installation path.

#### Install KVM emulator (optional)

For Linux / Debian only:

```bash
sudo apt-get install kvm qemu-kvm libvirt-bin bridge-utils virt-manager
sudo groupadd libvirtd
sudo adduser `id -un` libvirtd
```

##### In case of problem...

If you get this error :
```
Cannot run program "/home/eis/android-sdks/build-tools/21.1.2/aapt": error=2, Aucun fichier ou dossier de ce type
```

Install two additional compatibility libraries (solution from [this post](http://stackoverflow.com/questions/22701405/aapt-ioexception-error-2-no-such-file-or-directory-why-cant-i-build-my-grad)) :                            
```bash
sudo apt-get install lib32stdc++6 lib32z1
```


## Level X: Launching the application in Android Studio

### Project Setup

Go to the folder in which you installed cesium using the `cd` command followed by the path to the appropriate directory.

Check that you are using the version of NodeJs that Cesium needs using the command

```
node --version
```

If you are not on a v6, use the command

```
nvm use 12
```

You can now launch the installation of the Cesium project for Android:


```
ionic cordova prepare
```

Normally, this command should initialize (among other things) a `platforms/android` directory.

> This command may take a moment to complete.

Now run the build for Android:

```
ionic build android
```

Now launch Android Studio. You should arrive at this window:


<img src="../fr/img/33266d44fdbfd6c8b44e46a3664edafacaf0a316.png" width="500">

Select "Open an existing Android Studio project" and point the folder to `cesium/platforms/android`.

### Launch the application

To be able to launch an emulator, we will have to create one.

To do this, go to `Tools` > `AVD Manager`, or click on the following icon:

<img src="../fr/img/46e959d1e616e34972a41f4d120a1d4f5beb0955.png" width="690" height="42">

A window will open and offer you to create a "Virtual Device" follow the software.

If you have an Android phone you can put it in developer mode and plug it in if you want to see the app on your phone.

Then, once the emulator is created, you can click the "Play" button (<img src="../fr/img/70b2ce88a5e7aa5754f6a771cf5efed3c639a27b.png" width="46" height="44">) to launch the application.
You can also use the icon (<img src="../fr/img/b7c419b33a43f6a43c5b756074ee0c199072f7d1.png" width="40" height="44">) to launch the application in debug mode.

Android Studio will ask you which device you want to launch the app on, select emulator or phone and leave it alone.


## Level XI: Application launched by `ionic`

You can now use the `ionic` tool directly:

 - Either to launch your application on a connected phone:
  ```bash
  ionic run android
  ```

 - Either to launch it on an emulator:
  ```bash
  ionic emulate android
  ```

## The following ?!

You can now continue with the following levels. We will see there how to add a plugin to Cesium.

[See more here >>](../fr/development_tutorial-04-add_plugin.md)
 No newline at end of file
+9 −0
Original line number Diff line number Diff line
{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "News",
  "user_comment": "Ce fichier redirige vers le forum Duniter (via 'next_url')",
  "feed_url": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-en-GB.json",

  "home_page_url": "https://forum.duniter.org/t/new-version-of-cesium-en/11460",
  "next_url": "https://forum.duniter.org/t/new-version-of-cesium-en/11460.json"
}
+9 −0
Original line number Diff line number Diff line
{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "News",
  "user_comment": "Ce fichier redirige vers le forum Duniter (via 'next_url')",
  "feed_url": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-en.json",

  "home_page_url": "https://forum.duniter.org/t/new-version-of-cesium-en/11460",
  "next_url": "https://forum.duniter.org/t/new-version-of-cesium-en/11460.json"
}
+9 −0
Original line number Diff line number Diff line
{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "Noticias",
  "user_comment": "Ce fichier redirige vers le forum Duniter (via 'next_url')",
  "feed_url": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-es-ES.json",

  "home_page_url": "https://forum.duniter.org/t/nueva-version-de-cesium-es/11459",
  "next_url": "https://forum.duniter.org/t/nueva-version-de-cesium-es/11459.json"
}
+9 −0
Original line number Diff line number Diff line
{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "Actualités",
  "user_comment": "Ce fichier redirige vers le forum Duniter (via 'next_url')",
  "feed_url": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-fr-FR.json",

  "home_page_url": "https://forum.monnaie-libre.fr/t/actu-generale-la-1-bouge/31318",
  "next_url": "https://forum.monnaie-libre.fr/t/actu-generale-la-1-bouge/31318.json"
}
+9 −0
Original line number Diff line number Diff line
{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "Actualités",
  "user_comment": "Ce fichier redirige vers le forum Duniter (via 'next_url')",
  "feed_url": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/1.1/feed-fr-FR.json",

  "home_page_url": "https://forum.monnaie-libre.fr/t/actu-generale-la-1-bouge/31318",
  "next_url": "https://forum.monnaie-libre.fr/t/actu-generale-la-1-bouge/31318.json"
}

doc/feed/feed-en.json

0 → 100644
+27 −0
Original line number Diff line number Diff line
{
  "version": "https://jsonfeed.org/version/1",
  "title": "News",
  "user_comment": "Ce fichier est nécessaire pour les versions avant la 1.7.7",
  "feed_url": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/feed-en.json",

  "home_page_url": "https://forum.duniter.org/t/nouvelle-version-de-cesium-fr/11458/2",
  "author": {
    "name": "Benoit Lavenier",
    "url": "@BenoitLavenier",
    "avatar": "https://forum.duniter.org//user_avatar/forum.duniter.org/kimamila/48/185_2.png"
  },
  "items": [
    {
      "title": "New version of Cesium",
      "author": {
        "name": "Benoit Lavenier",
        "url": "@BenoitLavenier",
        "avatar": "https://forum.duniter.org//user_avatar/forum.duniter.org/kimamila/48/185_2.png"
      },
      "date_published": "2023-08-14T19:30:00+02:00",
      "id": "https://forum.duniter.org/t/new-version-of-cesium-en/11460",
      "url": "https://forum.duniter.org/t/new-version-of-cesium-en/11460",
      "content_html": "<p>A new release version of Cesium <a href=\"https://cesium.app\">is available</a>!</p><blockquote><p>The cesium.app website is currently being updated... The same goes for the Play Store, App Store, etc.\nPlease be patient! :slight_smile:</p></blockquote><p>In recent months, many of you have encountered multiple difficulties: transactions disappearing or being completely lost, “timeout” error, desynchronized node, etc.</p><p>We are well aware of these issues. They are related to several factors:</p><ul><li>on the one hand, to the new version 1.7 of Cesium, which introduces automatic node selection for Duniter, by random drawing among synchronized nodes;</li><li>on the other hand, to the state of the Duniter nodes network, some nodes have been found to be misconfigured to work with Cesium, or using unstable versions of Duniter.</li></ul><h2><a name=\"new-features-1\" class=\"anchor\" href=\"#new-features-1\"></a>New Features</h2><h3><a name=\"at-start-up-2\" class=\"anchor\" href=\"#at-start-up-2\"></a>At Start-Up</h3><p>Node selection at startup has been reviewed to select only those compatible with Cesium’s features. This should fix the previously explained problems.</p><h3><a name=\"my-operations-3\" class=\"anchor\" href=\"#my-operations-3\"></a>My Operations</h3><p>In “My Operations,” long comments are now more visible, whether on a phone:<br><img src=\"https://forum.duniter.org/uploads/default/original/2X/4/4fa5d83286441e6689d93b6d636a46771fcb543d.png\" alt=\"image\" data-base62-sha1=\"bmB2vlwdnBe1zK86r7RGiQpJesl\" width=\"594\" height=\"357\"></p><p>…or in a web browser:</p><p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://forum.duniter.org/uploads/default/original/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e.png\" data-download-href=\"https://forum.duniter.org/uploads/default/7d081473f9398e237425c96c8b9d55ef81e5662e\" title=\"image\"><img src=\"https://forum.duniter.org/uploads/default/optimized/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e_2_690x192.png\" alt=\"image\" data-base62-sha1=\"hQ4ZGoEbNyaKoAMxEGc1d0Ksby6\" width=\"690\" height=\"192\" srcset=\"https://forum.duniter.org/uploads/default/optimized/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e_2_690x192.png, https://forum.duniter.org/uploads/default/original/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e.png 1.5x, https://forum.duniter.org/uploads/default/original/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e.png 2x\" data-dominant-color=\"F2F6F8\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">819×229 36.5 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></p><p>Other small improvements on this page:</p><ul><li>Refreshing the list no longer causes flickering of existing operations. Only new operations are animated;</li><li>loading older operations (at the bottom of the page) is now done directly by scrolling down. No need to click on “Show More” or “Show All”! Beyond 6 months of history, these buttons appear to limit the number of network requests.<br><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://forum.duniter.org/uploads/default/original/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699.png\" data-download-href=\"https://forum.duniter.org/uploads/default/8617ad8aa899debbc16bd92f38f1eefe68ed4699\" title=\"image\"><img src=\"https://forum.duniter.org/uploads/default/optimized/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699_2_690x211.png\" alt=\"image\" data-base62-sha1=\"j8eI3VQg2QseXemuowxFVl8qFlf\" width=\"690\" height=\"211\" srcset=\"https://forum.duniter.org/uploads/default/optimized/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699_2_690x211.png, https://forum.duniter.org/uploads/default/optimized/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699_2_1035x316.png 1.5x, https://forum.duniter.org/uploads/default/original/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699.png 2x\" data-dominant-color=\"F7F9FA\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">1094×335 36.1 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></li></ul><h3><a name=\"networks-in-expert-mode-4\" class=\"anchor\" href=\"#networks-in-expert-mode-4\"></a>Networks (in expert mode)</h3><p>The network view now allows you to see the status of the waiting queues (or pools) containing pending documents (transactions and membership requests).</p><blockquote><p>Only if you have activated “expert mode” in the settings,<br>and for nodes that have activated the BMA API</p></blockquote><p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://forum.duniter.org/uploads/default/original/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5.png\" data-download-href=\"https://forum.duniter.org/uploads/default/f475de5c8c5f2e8efa21e33a387c3262a33eded5\" title=\"image\"><img src=\"https://forum.duniter.org/uploads/default/optimized/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5_2_690x258.png\" alt=\"image\" data-base62-sha1=\"ySB2aVf3V1kcQ5aWwasCVNCX9kN\" width=\"690\" height=\"258\" srcset=\"https://forum.duniter.org/uploads/default/optimized/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5_2_690x258.png, https://forum.duniter.org/uploads/default/original/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5.png 1.5x, https://forum.duniter.org/uploads/default/original/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5.png 2x\" data-dominant-color=\"F3F7F4\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">781×293 36.4 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></p><p>Another small novelty: you can now see if a node (BMA) properly archives the history of transactions. The symbol <strong><img src=\"https://forum.duniter.org/images/emoji/twitter/credit_card.png?v=12\" title=\":credit_card:\" class=\"emoji\" alt=\":credit_card:\" loading=\"lazy\" width=\"20\" height=\"20\"> <code>TX</code></strong> now appears in the <code>API</code> column.</p><blockquote><p>Only visible in expert mode, by <strong>expanding the display</strong> of rows</p></blockquote><p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://forum.duniter.org/uploads/default/original/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c.png\" data-download-href=\"https://forum.duniter.org/uploads/default/f6c5abe0063f927df3b6a1814f3265d611c4ac4c\" title=\"image\"><img src=\"https://forum.duniter.org/uploads/default/optimized/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c_2_690x40.png\" alt=\"image\" data-base62-sha1=\"zd2XW5qedxuZ7gjgSiRiYV6K2D2\" width=\"690\" height=\"40\" srcset=\"https://forum.duniter.org/uploads/default/optimized/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c_2_690x40.png, https://forum.duniter.org/uploads/default/original/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c.png 1.5x, https://forum.duniter.org/uploads/default/original/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c.png 2x\" data-dominant-color=\"EFF3F1\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">787×46 8.14 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></p><h3><a name=\"other-fixes-5\" class=\"anchor\" href=\"#other-fixes-5\"></a>Other Fixes</h3><ul><li>Android / iOS: file downloading works! For the revocation file in particular, but also for the list of operations, the saving of identifiers, etc.<blockquote><p>You will find the downloaded file in the “Downloads” directory (on Android) or “Documents” (on iOS);</p></blockquote></li><li>My Operations: the list of UDs is now correctly displayed (without going through the Duniter nodes to bypass a limitation, but through the Cesium+ pod if activated);</li><li>Notifications: the number of messages or notifications is now correct when you log in for the first time on an account.</li></ul><br/><br/>(...)"
    }
  ]
}

doc/feed/feed-es.json

0 → 100644
+27 −0
Original line number Diff line number Diff line
{
  "version": "https://jsonfeed.org/version/1",
  "title": "News",
  "user_comment": "Ce fichier est nécessaire pour les versions avant la 1.7.7",
  "feed_url": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/feed-es.json",

  "home_page_url": "https://forum.duniter.org/t/nueva-version-de-cesium-es/11459/3",
  "author": {
    "name": "Benoit Lavenier",
    "url": "@BenoitLavenier",
    "avatar": "https://forum.duniter.org//user_avatar/forum.duniter.org/kimamila/48/185_2.png"
  },
  "items": [
    {
      "title": "Nueva versión de Cesium",
      "author": {
        "name": "Benoit Lavenier",
        "url": "@BenoitLavenier",
        "avatar": "https://forum.duniter.org//user_avatar/forum.duniter.org/kimamila/48/185_2.png"
      },
      "date_published": "2023-08-14T19:30:00+02:00",
      "id": "https://forum.duniter.org/t/nueva-version-de-cesium-es/11459",
      "url": "https://forum.duniter.org/t/nueva-version-de-cesium-es/11459",
      "content_html": "<p>¡Una nueva versión de Cesium <a href=\"https://cesium.app\">está disponible</a>!</p><blockquote><p>El sitio cesium.app está siendo actualizado... Lo mismo para Play Store, App Store, etc.\n¡Tengan paciencia!</p></blockquote><p>En los últimos meses, muchos de ustedes han encontrado múltiples dificultades: transacciones que desaparecen o se pierden completamente, error de “tiempo de espera excedido”, nodo desincronizado, etc.</p><p>Somos muy conscientes de estos problemas. Están relacionados con varios factores:</p><ul><li>por un lado, a la nueva versión 1.7 de Cesium, que introduce la selección automática del nodo Duniter, mediante sorteo entre los nodos sincronizados;</li><li>por otro lado, al estado de la red de nodos Duniter, algunos de los cuales se han revelado mal configurados para funcionar con Cesium, o utilizando versiones inestables de Duniter.</li></ul><h2><a name=\"novedades-1\" class=\"anchor\" href=\"#novedades-1\"></a>Novedades</h2><h3><a name=\"al-inicio-2\" class=\"anchor\" href=\"#al-inicio-2\"></a>Al inicio</h3><p>La selección de nodos al inicio ha sido revisada, para seleccionar solo aquellos compatibles con las funcionalidades de Cesium. Esto debería corregir los problemas explicados anteriormente.</p><h3><a name=\"mis-operaciones-3\" class=\"anchor\" href=\"#mis-operaciones-3\"></a>Mis operaciones</h3><p>En “Mis operaciones”, los comentarios largos son ahora más visibles, ya sea en un teléfono:<br><img src=\"https://forum.duniter.org/uploads/default/original/2X/4/4fa5d83286441e6689d93b6d636a46771fcb543d.png\" alt=\"image\" data-base62-sha1=\"bmB2vlwdnBe1zK86r7RGiQpJesl\" width=\"594\" height=\"357\"></p><p>…o en un navegador web:</p><p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://forum.duniter.org/uploads/default/original/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e.png\" data-download-href=\"https://forum.duniter.org/uploads/default/7d081473f9398e237425c96c8b9d55ef81e5662e\" title=\"image\"><img src=\"https://forum.duniter.org/uploads/default/optimized/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e_2_690x192.png\" alt=\"image\" data-base62-sha1=\"hQ4ZGoEbNyaKoAMxEGc1d0Ksby6\" width=\"690\" height=\"192\" srcset=\"https://forum.duniter.org/uploads/default/optimized/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e_2_690x192.png, https://forum.duniter.org/uploads/default/original/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e.png 1.5x, https://forum.duniter.org/uploads/default/original/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e.png 2x\" data-dominant-color=\"F2F6F8\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">819×229 36.5 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></p><p>Otras pequeñas mejoras en esta página:</p><ul><li>El hecho de refrescar la lista ya no provoca el parpadeo de las operaciones existentes. Solo las nuevas operaciones están animadas;</li><li>la carga de las operaciones más antiguas (en la parte inferior de la página) se hace directamente desplazándose hacia abajo. ¡No es necesario hacer clic en “Mostrar más” o “Mostrar todo”! Más allá de 6 meses de historial, estos botones aparecen para limitar el número de solicitudes a la red.<br><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://forum.duniter.org/uploads/default/original/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699.png\" data-download-href=\"https://forum.duniter.org/uploads/default/8617ad8aa899debbc16bd92f38f1eefe68ed4699\" title=\"image\"><img src=\"https://forum.duniter.org/uploads/default/optimized/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699_2_690x211.png\" alt=\"image\" data-base62-sha1=\"j8eI3VQg2QseXemuowxFVl8qFlf\" width=\"690\" height=\"211\" srcset=\"https://forum.duniter.org/uploads/default/optimized/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699_2_690x211.png, https://forum.duniter.org/uploads/default/optimized/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699_2_1035x316.png 1.5x, https://forum.duniter.org/uploads/default/original/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699.png 2x\" data-dominant-color=\"F7F9FA\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">1094×335 36.1 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></li></ul><h3><a name=\"redes-en-modo-experto-4\" class=\"anchor\" href=\"#redes-en-modo-experto-4\"></a>Redes (en modo experto)</h3><p>La vista de red permite ahora ver el estado de las colas de espera (o piscinas) que contienen los documentos pendientes (transacciones y solicitudes de membresía).</p><blockquote><p>Solo si ha activado el “modo experto” en la configuración,<br>y para los nodos que han activado la API BMA</p></blockquote><p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://forum.duniter.org/uploads/default/original/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5.png\" data-download-href=\"https://forum.duniter.org/uploads/default/f475de5c8c5f2e8efa21e33a387c3262a33eded5\" title=\"image\"><img src=\"https://forum.duniter.org/uploads/default/optimized/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5_2_690x258.png\" alt=\"image\" data-base62-sha1=\"ySB2aVf3V1kcQ5aWwasCVNCX9kN\" width=\"690\" height=\"258\" srcset=\"https://forum.duniter.org/uploads/default/optimized/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5_2_690x258.png, https://forum.duniter.org/uploads/default/original/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5.png 1.5x, https://forum.duniter.org/uploads/default/original/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5.png 2x\" data-dominant-color=\"F3F7F4\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">781×293 36.4 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></p><p>Otra pequeña novedad: ahora puede ver si un nodo (BMA) archiva correctamente el historial de transacciones. El símbolo <strong><img src=\"https://forum.duniter.org/images/emoji/twitter/credit_card.png?v=12\" title=\":credit_card:\" class=\"emoji\" alt=\":credit_card:\" loading=\"lazy\" width=\"20\" height=\"20\"> <code>TX</code></strong> aparece ahora en la columna <code>API</code>.</p><blockquote><p>Solo visible en modo experto, al <strong>expandir la visualización</strong> de las filas</p></blockquote><p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://forum.duniter.org/uploads/default/original/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c.png\" data-download-href=\"https://forum.duniter.org/uploads/default/f6c5abe0063f927df3b6a1814f3265d611c4ac4c\" title=\"image\"><img src=\"https://forum.duniter.org/uploads/default/optimized/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c_2_690x40.png\" alt=\"image\" data-base62-sha1=\"zd2XW5qedxuZ7gjgSiRiYV6K2D2\" width=\"690\" height=\"40\" srcset=\"https://forum.duniter.org/uploads/default/optimized/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c_2_690x40.png, https://forum.duniter.org/uploads/default/original/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c.png 1.5x, https://forum.duniter.org/uploads/default/original/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c.png 2x\" data-dominant-color=\"EFF3F1\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">787×46 8.14 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></p><h3><a name=\"otras-correcciones-5\" class=\"anchor\" href=\"#otras-correcciones-5\"></a>Otras correcciones</h3><ul><li>Android / iOS: ¡la descarga de archivos funciona! Para el archivo de revocación en particular, pero también para la lista de operaciones, la salvaguardia de identificadores, etc.<blockquote><p>Encontrarás el archivo descargado en el directorio “Descargas” (en Android) o “Documentos” (en iOS);</p></blockquote></li><li>Mis operaciones: la lista de UDs se muestra ahora correctamente (sin pasar por los nodos Duniter para eludir una limitación, pero a través del pod Cesium+ si está activado);</li><li>Notificaciones: el número de mensajes o notificaciones es ahora correcto cuando inicia sesión por primera vez en una cuenta.</li></ul><br/><br/>(...)"
    }
  ]
}
Original line number Diff line number Diff line
{
  "version": "https://jsonfeed.org/version/1",
  "user_comment": "Feed that use the jsonFeed format (see jsonFeed.org for details).",
  "title": "Actualités",
  "description": "Actualités de Cesium",
  "home_page_url": "https://forum.monnaie-libre.fr/tag/cesium",
  "feed_url": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/feed-fr.json",
  "user_comment": "Ce fichier est nécessaire pour les versions avant la 1.7.7",
  "feed_url": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/feed-ff.json",
  "home_page_url": "https://forum.duniter.org/t/nouvelle-version-de-cesium-fr/11458/2",
  "author": {
    "name": "Benoit Lavenier",
    "url": "@BenoitLavenier",
    "avatar": "https://g1.data.duniter.fr/user/profile/38MEAZN68Pz1DTvT3tqgxx4yQP6snJCQhPqEFxbDk4aE/_image/avatar.png"
    "avatar": "https://forum.duniter.org//user_avatar/forum.duniter.org/kimamila/48/185_2.png"
  },
  "items": [
    {
      "title": "Cesium évolue ! Aïe, ça va piquer mais…",
      "title": "Nouvelle version de Cesium",
      "author": {
        "name": "Elois",
        "url": "@elois",
        "avatar": "https://forum.monnaie-libre.fr/user_avatar/forum.monnaie-libre.fr/elois/45/185_2.png"
        "name": "Benoit Lavenier",
        "url": "@BenoitLavenier",
        "avatar": "https://forum.duniter.org//user_avatar/forum.duniter.org/kimamila/48/185_2.png"
      },
      "date_published": "2023-08-14T19:30:00+02:00",
      "id": "https://forum.duniter.org/t/nouvelle-version-de-cesium/11458",
      "url": "https://forum.duniter.org/t/nouvelle-version-de-cesium/11458",
      "content_html": "<p>Une nouvelle version de Cesium <a href=\"https://cesium.app\">est disponible</a> !</p><blockquote><p>La mise jour du site et des Play Store est en cours.\nSoyez patient !</p></blockquote><p>Ces derniers mois, beaucoup d’entre vous ont rencontré des difficultés multiples : transactions qui disparaissent ou sont carrément perdues, erreur “délai d’attente dépassé”, nœud désynchronisé, etc.</p><p>Nous sommes bien conscients de ces problèmes. Ils sont liés à plusieurs facteurs :</p><ul><li>d’une part, à la nouvelle version 1.7 de Cesium, qui introduit la sélection automatique du nœud Duniter, par tirage au sort parmi les nœuds synchronisés ;</li><li>d’autre part, à l’état du réseau des nœuds Duniter, dont certains nœuds se sont révélés mal configurés pour fonctionner avec Cesium, ou utilisant des versions de Duniter non stables.</li></ul><h2><a name=\"nouveauts-1\" class=\"anchor\" href=\"#nouveauts-1\"></a>Nouveautés</h2><h3><a name=\"au-dmarrage-2\" class=\"anchor\" href=\"#au-dmarrage-2\"></a>Au démarrage</h3><p>La sélection des nœuds au démarrage a été revue, pour ne sélectionner que ceux compatibles avec les fonctionnalités de Cesium. Ceci devrait corriger les problèmes précédemment expliqués.</p><h3><a name=\"mes-oprations-3\" class=\"anchor\" href=\"#mes-oprations-3\"></a>Mes opérations</h3><p>Dans “Mes opérations”, les longs commentaires sont mieux visibles, que ce soit sur téléphone :<br><img src=\"https://forum.duniter.org/uploads/default/original/2X/4/4fa5d83286441e6689d93b6d636a46771fcb543d.png\" alt=\"image\" data-base62-sha1=\"bmB2vlwdnBe1zK86r7RGiQpJesl\" width=\"594\" height=\"357\"></p><p>…ou dans un navigateur web :</p><p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://forum.duniter.org/uploads/default/original/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e.png\" data-download-href=\"https://forum.duniter.org/uploads/default/7d081473f9398e237425c96c8b9d55ef81e5662e\" title=\"image\"><img src=\"https://forum.duniter.org/uploads/default/optimized/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e_2_690x192.png\" alt=\"image\" data-base62-sha1=\"hQ4ZGoEbNyaKoAMxEGc1d0Ksby6\" width=\"690\" height=\"192\" srcset=\"https://forum.duniter.org/uploads/default/optimized/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e_2_690x192.png, https://forum.duniter.org/uploads/default/original/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e.png 1.5x, https://forum.duniter.org/uploads/default/original/2X/7/7d081473f9398e237425c96c8b9d55ef81e5662e.png 2x\" data-dominant-color=\"F2F6F8\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">819×229 36.5 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></p><p>Autres petites améliorations sur cette page :</p><ul><li>Le fait de rafraîchir la liste ne provoque plus de clignotement des opérations déjà existantes. Seules les nouvelles opérations sont animées ;</li><li>le chargement des opérations plus anciennes (en bas de page) se fait directement par défilement vers le bas. Plus besoin de cliquer sur “Afficher plus” ou “Afficher tout” ! Au-delà de 6 mois d’historique, ces boutons apparaissent, pour limiter le nombre de requêtes au réseau.<br><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://forum.duniter.org/uploads/default/original/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699.png\" data-download-href=\"https://forum.duniter.org/uploads/default/8617ad8aa899debbc16bd92f38f1eefe68ed4699\" title=\"image\"><img src=\"https://forum.duniter.org/uploads/default/optimized/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699_2_690x211.png\" alt=\"image\" data-base62-sha1=\"j8eI3VQg2QseXemuowxFVl8qFlf\" width=\"690\" height=\"211\" srcset=\"https://forum.duniter.org/uploads/default/optimized/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699_2_690x211.png, https://forum.duniter.org/uploads/default/optimized/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699_2_1035x316.png 1.5x, https://forum.duniter.org/uploads/default/original/2X/8/8617ad8aa899debbc16bd92f38f1eefe68ed4699.png 2x\" data-dominant-color=\"F7F9FA\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">1094×335 36.1 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></li></ul><h3><a name=\"rseaux-en-mode-expert-4\" class=\"anchor\" href=\"#rseaux-en-mode-expert-4\"></a>Réseaux (en mode expert)</h3><p>La vue réseau permet maintenant de voir l’état des files d’attente (ou piscines) contenant les documents en attente (transactions et demandes d’adhésion).</p><blockquote><p>Uniquement si vous avez activé le “mode expert” dans les paramètres,<br>et pour les nœuds ayant activé l’API BMA</p></blockquote><p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://forum.duniter.org/uploads/default/original/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5.png\" data-download-href=\"https://forum.duniter.org/uploads/default/f475de5c8c5f2e8efa21e33a387c3262a33eded5\" title=\"image\"><img src=\"https://forum.duniter.org/uploads/default/optimized/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5_2_690x258.png\" alt=\"image\" data-base62-sha1=\"ySB2aVf3V1kcQ5aWwasCVNCX9kN\" width=\"690\" height=\"258\" srcset=\"https://forum.duniter.org/uploads/default/optimized/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5_2_690x258.png, https://forum.duniter.org/uploads/default/original/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5.png 1.5x, https://forum.duniter.org/uploads/default/original/2X/f/f475de5c8c5f2e8efa21e33a387c3262a33eded5.png 2x\" data-dominant-color=\"F3F7F4\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">781×293 36.4 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></p><p>Autre petite nouveauté : vous pouvez voir si un nœud (BMA) archive bien l’historique des transactions. Le symbole <strong><img src=\"https://forum.duniter.org/images/emoji/twitter/credit_card.png?v=12\" title=\":credit_card:\" class=\"emoji\" alt=\":credit_card:\" loading=\"lazy\" width=\"20\" height=\"20\"> <code>TX</code></strong> s’affiche maintenant, dans la colonne <code>API</code>.</p><blockquote><p>Visible uniquement en mode expert, en <strong>décompactant l’affichage</strong> des lignes</p></blockquote><p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://forum.duniter.org/uploads/default/original/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c.png\" data-download-href=\"https://forum.duniter.org/uploads/default/f6c5abe0063f927df3b6a1814f3265d611c4ac4c\" title=\"image\"><img src=\"https://forum.duniter.org/uploads/default/optimized/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c_2_690x40.png\" alt=\"image\" data-base62-sha1=\"zd2XW5qedxuZ7gjgSiRiYV6K2D2\" width=\"690\" height=\"40\" srcset=\"https://forum.duniter.org/uploads/default/optimized/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c_2_690x40.png, https://forum.duniter.org/uploads/default/original/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c.png 1.5x, https://forum.duniter.org/uploads/default/original/2X/f/f6c5abe0063f927df3b6a1814f3265d611c4ac4c.png 2x\" data-dominant-color=\"EFF3F1\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">787×46 8.14 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></p><h3><a name=\"autres-correctifs-5\" class=\"anchor\" href=\"#autres-correctifs-5\"></a>Autres correctifs</h3><ul><li>Android / iOS : le téléchargement de fichier fonctionne ! Pour le fichier de révocation notamment, mais aussi pour la liste des opérations, la sauvegarde des identifiants, etc.<blockquote><p>Vous trouverez le fichier téléchargé dans le répertoire “Téléchargements” (sous Android) ou “Documents” (sous iOS) ;</p></blockquote></li><li>Mes opérations : la liste des DU s’affiche maintenant correctement (sans passer par les nœuds Duniter pour contourner une limitation, mais par le pod Cesium+ s’il est activé) ;</li><li>Notifications : le nombre de messages ou de notifications est maintenant correct lorsque vous vous connectez pour la première fois sur un compte.</li></ul><br/> (...)"
    },
    {
      "title": "Actu générale : La Ǧ1 bouge !",
      "author": {
        "name": "Collectif MaJ V2",
        "url": "@LeForum",
        "avatar": "https://forum.monnaie-libre.fr/user_avatar/forum.monnaie-libre.fr/leforum/48/8260_2.png"
      },
      "date_published": "2020-03-07T19:42:00+01:00",
      "id": "https://forum.monnaie-libre.fr/t/cesium-evolue-aie-ca-va-piquer-mais/10015",
      "url": "https://forum.monnaie-libre.fr/t/cesium-evolue-aie-ca-va-piquer-mais/10015",
      "content_html": "<p>Au <b>1er mai 2020</b>, certains d’entre vous vont devoir changer leurs habitudes :</p>\n<ul>\n<li>pour ceux d’entre vous qui ont <strong>installé</strong> Cesium sur leur appareil : rien ne change</li>\n<li>pour ceux qui n’en sont pas sûrs : vous utilisez probablement la version «&nbsp;<strong>en ligne</strong>&nbsp;» (par exemple <code>g1․duniter․fr</code>), elle sera désactivée le 1er mai 2020. <strong>Relocalisez</strong> la gestion de votre compte en téléchargeant votre propre copie de Cesium dès maintenant :\n<a href=\"https://cesium.app/\">Je télécharge ma copie de Cesium</a> !</li>\n</ul>\n<h4>Besoin d’aide ? On est là pour vous !</h4>\n<p>Vous ne serez pas seul·e :</p>\n<p>La communauté G1 et les développeurs de Cesium sont là pour répondre à vos questions si jamais vous rencontrez un problème dans l’installation ou dans l’usage.</p>\n<p>Trois possibilités s’offrent à vous :</p>\n<ul>\n<li>Rendez-vous aux prochaines rencontres organisées par votre groupe local,</li>\n<li>ou : dites-le-nous sur le forum : <a href=\"https://forum.monnaie-libre.fr/c/tools/13\">Support cesium.app</a>\n</li>\n<li>ou : envoyez un e-mail à <a href=\"mailto:support@cesium.app\">support@cesium.app</a> créée pour l’occasion avec une équipe derrière.</li>\n</ul>\n<p>Pour effectuer votre transition en douceur, Cesium-web reste utilisable jusqu’au 1er mai 2020 .</p>\n<p>Cependant, plus vite vous <a href=\"https://cesium.app\">installez Cesium</a>, plus nous aurons de temps pour vous aider avant la fermeture du site.</p>\n"
      "date_published": "2025-02-25T12:09:00+02:00",
      "id": "https://forum.monnaie-libre.fr/t/actu-generale-la-1-bouge/31318",
      "url": "https://forum.monnaie-libre.fr/t/actu-generale-la-1-bouge/31318",
      "content_html": "<p>La Ǧ1 bouge, plusieurs chantiers importants sont en cours :</p>\n<ul>\n<li>Son écosystème technique qui approche de sa <a href=\"https://monnaie-libre.fr/maj-v2/\">mise à jour (V2) </a> sur laquelle nous travaillons depuis plusieurs années.</li>\n<li>Organisation et prises des décisions (gouvernance) dont un <a href=\"https://forum.monnaie-libre.fr/t/proposition-licence-g1-v0-3-0/31234\">vote pour faire évoluer la licence Ǧ1</a> auquel vous pouvez prendre part avant le 13 mars.</li>\n</ul>\n<p><strong>Pour la dernière ligne droite, la Ǧ1 a besoin de vous :</strong></p>\n<ul>\n<li>Pour accélérer les développements restants par un <a href=\"https://www.helloasso.com/associations/axiom-team/collectes/finalisation-de-cesium-v2-et-duniter-v2\">financement participatif</a> pour rémunérer quelques mois un développeur afin de finaliser Cesium².</li>\n<li>Pour tester les logiciels et nous dire ce qui ne marche pas sur votre appareil (ordi, tablette ou smartphone).</li>\n</ul>\n<p>Pour être tenu au courant d’un ou plusieurs des sujets évoqués, <a href=\"https://s.42l.fr/form-g1v2\">laissez-nous votre email</a>.</p>"
    }
  ]
}
Original line number Diff line number Diff line
# Connexion automatique, par fichier de trousseau

> Possible uniquement sur la version de bureau (desktop) de Cesium

Pour se connecter dès la lancement, à partir d'une fichier de trousseau (ou fichier de clefs), suivez les étapes suivantes :

1. Générer un fichier de trousseau :
  * Allez dans "Mon compte > Options > Compte et sécurité";
  * Choisissez "Générer mon fichier de trousseau";
  * Puis "format "PubSec".
  
2. Placer le fichier à l'emplacement suivant `<home>/.config/cesium/keyring.yml`
   
3. Lancer Cesium : vous devriez être directement connecté sur ce compte. 
Original line number Diff line number Diff line
@@ -90,16 +90,16 @@ Installer Node.js est devenu extrêmement simple pour ces OS : un outil vous per
Vous pouvez installer nvm avec la commande suivante :

```bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.39.3/install.sh | bash
```

Fermez puis rouvrez votre terminal, comme indiqué. Puis, installez Node.js (choisissez la version 6) : 
Fermez puis rouvrez votre terminal, comme indiqué. Puis, installez Node.js (choisissez la version 12) : 

```bash
nvm install 6
nvm install 12
```

Vous aurez alors la dernière version de la branche 5.x de Node.js prête à l'emploi.
Vous aurez alors la dernière version de la branche 12.x de Node.js prête à l'emploi.

##### Outils de compilation

@@ -110,7 +110,7 @@ sudo apt-get install build-essential

#### Sous Windows

Pour Windows, téléchargez la version 6 disponible sur le site officiel de Node.js : https://nodejs.org
Pour Windows, téléchargez la version 12 disponible sur le site officiel de Node.js : https://nodejs.org

Puis lancez l'installeur ainsi téléchargé.

Original line number Diff line number Diff line
@@ -7,5 +7,5 @@ Cesium Android allow user to upload user profile (avatar, pictures), when the Ce
Privacy policy are : 
 
- Profile data and avatar are public data;
- Profile data and avatar on an [ES Duniter4j node](https://github.com/duniter/duniter4j); Open Cesium+ settings to known the node address;  
- Profile data and avatar on an [Cesium+ node](https://github.com/duniter/cesium-plus-pod); Open Cesium+ settings to know the node address;  
- User can remove profile and avatar (open the Settings page, then use the options menu).
 No newline at end of file
+138 −19
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

const gulp = require('gulp'),
  path = require("path"),
  sass = require('gulp-sass'),
  sass = require('gulp-sass')(require('node-sass')),
  cleanCss = require('gulp-clean-css'),
  base64 = require('gulp-base64-v2'),
  rename = require('gulp-rename'),
@@ -79,6 +79,9 @@ const uglifyBaseOptions = {
    max_line_len: 120000
  }
};
const cleanCssOptions = {
  specialComments: 0 // new name of 'keepSpecialComments', since 4.0
}
const debugBaseOptions = {
  title: 'Processing',
  minimal: true,
@@ -134,9 +137,7 @@ function appSass() {
      maxImageSize: 14 * 1024
    }))
    .pipe(gulp.dest('./www/css/'))
    .pipe(cleanCss({
      keepSpecialComments: 0
    }))
    .pipe(cleanCss(cleanCssOptions))
    .pipe(rename({ extname: '.min.css' }))
    .pipe(gulp.dest('./www/css/'));
}
@@ -172,7 +173,38 @@ function appConfig() {
    .pipe(gulp.dest('www/js'));
}

function appAndPluginLint(done) {
function appConfigTest() {
  const allConfig = JSON.parse(fs.readFileSync('./app/config.json', 'utf8'));

  // Determine which environment to use when building config.
  const env = 'g1-test';
  const config = allConfig[env];

  if (!config) {
    throw new Error(colors.red("=> Could not load `" + env + "` environment!"));
  }

  log(colors.green("Building App test config at `www/js/config-test.js` for `" + env + "` environment..."));

  const project = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
  config['version'] = project.version;
  config['build'] = (new Date()).toJSON();
  config['newIssueUrl'] = project.bugs.new;

  return ngConstant({
    name: 'cesium.config',
    constants: {"csConfig": config},
    stream: true,
    dest: 'config-test.js'
  })
    // Add a warning header
    .pipe(header("/******\n* !! WARNING: This is a generated file !!\n*\n* PLEASE DO NOT MODIFY DIRECTLY\n*\n* => Changes should be done on file 'app/config.json'.\n******/\n\n"))
    // Writes into file www/js/config-test.js
    .pipe(rename('config-test.js'))
    .pipe(gulp.dest('www/js'));
}

function appAndPluginLint() {
  log(colors.green('Linting JS files...'));

  // Copy Js (and remove unused code)
@@ -185,8 +217,8 @@ function appAndPluginLint(done) {
        console.error('jshint failed');
        process.exit(1);
      }
    }))
    .on('end', done);
      cb();
    }));
}

function appNgTemplate() {
@@ -334,9 +366,7 @@ function pluginSass() {
        deleteAfterEncoding: false
      }))
      .pipe(gulp.dest('./www/css/'))
      .pipe(cleanCss({
        keepSpecialComments: 0
      }))
      .pipe(cleanCss(cleanCssOptions))
      .pipe(rename({ extname: '.min.css' }))
      .pipe(gulp.dest('./www/css/'))
  );
@@ -391,6 +421,11 @@ function webCopyFiles() {
      .pipe(htmlmin())
      .pipe(gulp.dest(targetPath + '/api')),

    // Copy config-test.js
    gulp.src('./www/js/config*.js')
      .pipe(debug(debugOptions))
      .pipe(gulp.dest(targetPath)),

    // Copy fonts
    gulp.src('./www/fonts/**/*.*')
      .pipe(debug(debugOptions))
@@ -530,7 +565,7 @@ function webUglify() {
    log(colors.green('Minify JS and CSS files...'));

    const indexFilter = filter('**/index.html', {restore: true});
    const jsFilter = filter(["**/*.js", '!**/config.js'], {restore: true});
    const jsFilter = filter(["**/*.js", '!**/config.js', '!**/config-test.js'], {restore: true});
    const cssFilter = filter("**/*.css", {restore: true});

    // Process index.html
@@ -588,7 +623,7 @@ function webApiUglify() {
  const targetPath = './dist/web/www';
  const version = JSON.parse(fs.readFileSync('./package.json', 'utf8')).version;

  const jsFilter = filter(["**/*.js", '!**/config.js'], {restore: true});
  const jsFilter = filter(["**/*.js", '!**/config.js', '!**/config-test.js'], {restore: true});
  const cssFilter = filter("**/*.css", {restore: true});
  const indexFilter = filter('**/index.html', {restore: true});

@@ -621,6 +656,7 @@ function webApiUglify() {
      .pipe(replace("dist_js", "../dist_js"))
      .pipe(replace("dist_css", "../dist_css"))
      .pipe(replace("config.js", "../config.js"))
      .pipe(replace("config-test.js", "../config-test.js"))
      .pipe(indexFilter.restore)

      .pipe(sourcemaps.write('maps'))
@@ -638,6 +674,7 @@ function webApiUglify() {
      .pipe(replace("dist_js", "../dist_js"))
      .pipe(replace("dist_css", "../dist_css"))
      .pipe(replace("config.js", "../config.js"))
      .pipe(replace("config-test.js", "../config-test.js"))
      .pipe(indexFilter.restore)

      .pipe(gulp.dest(targetPath));
@@ -676,6 +713,9 @@ function webCleanUnusedFiles(done) {

      // Unused maps/config.js.map
      gulp.src(targetPath + '/maps/config.js.map', {read: false, allowEmpty: true})
        .pipe(debug(debugOptions))
        .pipe(clean()),
      gulp.src(targetPath + '/maps/config-test.js.map', {read: false, allowEmpty: true})
        .pipe(debug(debugOptions))
        .pipe(clean())
    )
@@ -752,7 +792,13 @@ function webZip() {

function webExtClean() {
  return del([
    './dist/web/ext'
    './dist/web/ext',
  ]);
}

function chromeExtClean() {
  return del([
    './dist/web/chrome-ext'
  ]);
}

@@ -796,7 +842,47 @@ function webExtCopyFiles() {
  .pipe(gulp.dest('./dist/web/ext'));
}

function webExtensionZip() {
function chromeExtCopyFiles() {
  const wwwPath = './dist/web/www';
  const resourcesPath = './resources/chrome-ext';
  log(colors.green('Copy chrome extension files...'));

  const version = JSON.parse(fs.readFileSync('./package.json', 'utf8')).version;
  const manifestFilter = filter(["**/manifest.json"], { restore: true });
  const txtFilter = filter(["**/*.txt"], { restore: true });

  // Copy files
  return gulp.src([
    wwwPath + '/**/*',

    // Skip API files
    '!' + wwwPath + '/api',
    '!' + wwwPath + '/dist_js/*-api.js',
    '!' + wwwPath + '/dist_css/*-api.css',
    '!' + wwwPath + '/maps/dist_js/*-api.js.map',
    '!' + wwwPath + '/maps/dist_css/*-api.css.map',

    // Skip web manifest
    '!' + wwwPath + '/manifest.json',

    // Add specific resources (and overwrite the default 'manifest.json')
    resourcesPath + '/**/*.*'
  ])

  // Process TXT files: Add the UTF-8 BOM character
  .pipe(txtFilter)
  .pipe(header('\ufeff'))
  .pipe(txtFilter.restore)

  // Replace version in 'manifest.json' file
  .pipe(manifestFilter)
  .pipe(replace(/\"version\": \"[^\"]*\"/, '"version": "' + version + '"'))
  .pipe(manifestFilter.restore)

  .pipe(gulp.dest('./dist/web/chrome-ext'));
}

function webExtZip() {
  const srcPath = './dist/web/ext';
  const distPath = './dist/web/build';
  const version = JSON.parse(fs.readFileSync('./package.json', 'utf8')).version;
@@ -806,6 +892,16 @@ function webExtensionZip() {
    .pipe(gulp.dest(distPath));
}

function chromeExtZip() {
  const srcPath = './dist/web/chrome-ext';
  const distPath = './dist/web/build';
  const version = JSON.parse(fs.readFileSync('./package.json', 'utf8')).version;

  return gulp.src(srcPath + '/**/*.*')
    .pipe(zip('cesium-v'+version+'-extension-chrome.zip'))
    .pipe(gulp.dest(distPath));
}

function webBuildSuccess(done) {
  var version = JSON.parse(fs.readFileSync('./package.json', 'utf8')).version;
  log(colors.green("Web artifact created at: 'dist/web/build/cesium-v" + version + "-web.zip'"));
@@ -818,6 +914,12 @@ function webExtBuildSuccess(done) {
  if (done) done();
}

function chromeExtBuildSuccess(done) {
  var version = JSON.parse(fs.readFileSync('./package.json', 'utf8')).version;
  log(colors.green("Web extension artifact created at: 'dist/web/build/cesium-v" + version + "-extension-chrome.zip'"));
  if (done) done();
}

function cdvAddPlatformToBodyTag() {
  log(colors.green('Add platform CSS class to <body>... '));

@@ -1330,6 +1432,7 @@ const appAndPluginSass = gulp.series(appSass, pluginSass);
const app = gulp.series(appSass, appNgTemplate, appNgAnnotate, appNgTranslate);
const plugin = gulp.series(pluginSass, pluginNgTemplate, pluginNgAnnotate, pluginNgTranslate);
const build = gulp.series(appLicense, app, plugin);
const config = gulp.series(appConfig, appConfigTest);

const webApp = gulp.series(appSass, webCopyFiles, webNgTemplate, webAppNgAnnotate);
const webPlugin = gulp.series(pluginSass, webPluginCopyFiles, webPluginNgTemplate, webPluginNgAnnotate);
@@ -1357,13 +1460,25 @@ const webExtCompile = gulp.series(
  webExtCopyFiles
);

const chromeExtCompile = gulp.series(
  chromeExtClean,
  webCompile,
  chromeExtCopyFiles
);

// note : Do not call config, to keep same config between web and webExt artifacts
const webExtBuild = gulp.series(
  webExtCompile,
  webExtensionZip,
  webExtZip,
  webExtBuildSuccess
);

const chromeExtBuild = gulp.series(
  chromeExtCompile,
  chromeExtZip,
  chromeExtBuildSuccess
);



/* --------------------------------------------------------------------------
@@ -1371,7 +1486,7 @@ const webExtBuild = gulp.series(
   --------------------------------------------------------------------------*/

exports.help = help;
exports.config = appConfig;
exports.config = config;
exports.license = appLicense;
exports.sass = appAndPluginSass;
exports.translate = translate;
@@ -1395,6 +1510,10 @@ exports.webExtBuild = webExtBuild;
exports.webExtCopyFiles = webExtCopyFiles;
exports['build:webExt'] = exports.webExtBuild; // Alias

// Chrome extension
exports.chromeExtBuild = chromeExtBuild;
exports['build:chromeExt'] = exports.chromeExtBuild; // Alias

// Cordova (hooks)
const cdvAfterPrepare = gulp.series(
  gulp.parallel(cdvNgAnnotate, cdvAddPlatformToBodyTag),
@@ -1415,6 +1534,6 @@ const cdvBeforeCompile = gulp.series(
);
exports.cdvBeforeCompile = cdvAsHook(cdvBeforeCompile);

exports.default = gulp.series(appConfig, build);
exports.default = gulp.series(config, build);
exports.serveBefore = gulp.series(build, appAndPluginWatch);
exports['ionic:serve:before'] = exports.serveBefore; // Alias need need by @ionic/cli
exports['ionic:serve:before'] = exports.serveBefore; // Alias need by @ionic/cli
+22 −30
Original line number Diff line number Diff line
@@ -6,16 +6,10 @@ is_installed() {
  type "$1" > /dev/null 2>&1
}

if [ "_$1" != "_" ]; then
  CESIUM_DIR="$1"
fi
if [ "_$CESIUM_DIR" = "_" ]; then
  DIRNAME=`pwd`
  CESIUM_DIR="$DIRNAME/cesium"
fi
CESIUM_DIR=${1:-$(pwd)/cesium}

latest_version() {
  echo "v1.6.9" #lastest
  echo "v1.7.16" # lastest
}

api_release_url() {
@@ -39,16 +33,15 @@ download() {

install_from_github() {

  local RELEASE=`curl -XGET -i $(api_release_url)`
  local CESIUM_URL=`echo "$RELEASE" | grep -P "\"browser_download_url\": \"[^\"]+" | grep -oP "https://[a-zA-Z0-9/.-]+-web.zip"`
  local CESIUM_ARCHIVE=$CESIUM_DIR/cesium.zip
  if [ -d "$CESIUM_DIR" ]; then
    if [ -f "$CESIUM_ARCHIVE" ]; then
      echo "WARNING: Deleting existing archive [$CESIUM_ARCHIVE]"
      rm $CESIUM_ARCHIVE
    fi
  else
  local RELEASE=$(curl -XGET -i "$(api_release_url)")
  local CESIUM_URL=$(echo "$RELEASE" | grep -P '"browser_download_url": "[^"]+' | grep -oP "https://[a-zA-Z0-9/.-]+-web.zip" | head -n 1)
  local CESIUM_ARCHIVE="$CESIUM_DIR/cesium.zip"

  if [ ! -d "$CESIUM_DIR" ]; then
    mkdir -p "$CESIUM_DIR"
  elif [ -f "$CESIUM_ARCHIVE" ]; then
    echo "WARNING: Deleting existing archive [$CESIUM_ARCHIVE]"
    rm "$CESIUM_ARCHIVE"
  fi

  echo "Downloading [$CESIUM_URL]"
@@ -56,23 +49,23 @@ install_from_github() {
    echo >&2 "Failed to download '$CESIUM_URL'"
    return 4
  }
  echo "Unarchive to $CESIUM_DIR"
  unzip -o $CESIUM_ARCHIVE -d $CESIUM_DIR
  rm $CESIUM_ARCHIVE

  echo
  echo "Unarchiving to $CESIUM_DIR"
  unzip -o "$CESIUM_ARCHIVE" -d "$CESIUM_DIR"
  rm "$CESIUM_ARCHIVE"

  echo "Cesium successfully installed at $CESIUM_DIR"
}

do_install() {

  if ! is_installed "curl"; then
    echo "=> curl is not available. You will likely need to install 'curl' package."
  if ! is_installed "curl" && ! is_installed "wget"; then
    echo "=> Neither 'curl' nor 'wget' is available. Please install one of them."
    exit 1
  fi

  if ! is_installed "unzip"; then
    echo "=> unzip is not available. You will likely need to install 'unzip' package."
    echo "=> 'unzip' is not available. You will likely need to install the 'unzip' package."
    exit 1
  fi

@@ -84,10 +77,9 @@ do_install() {
# during the execution of the install script
#
reset() {
  unset -f reset is_installed latest_version \
    download install_from_github do_install
  unset -f reset is_installed latest_version api_release_url download install_from_github do_install
}

[ "_$CESIUM_ENV" = "_testing" ] || do_install $1
[ "_$CESIUM_ENV" = "_testing" ] || do_install "$1"

} # this ensures the entire script is downloaded #
Original line number Diff line number Diff line
@@ -4,10 +4,11 @@
  "integrations": {
    "cordova": {}
  },
  "type": "ionic1",
  "watchPatterns": [
    "www/index.html",
    "www/api/index.html",
    "www/dist/**/*",
    "www/css/*.css"
  ]
  ],
  "yarn": true
}
+3 −1
Original line number Diff line number Diff line
{}
 No newline at end of file
{
  "compileOnSave": false
}
+38 −41
Original line number Diff line number Diff line
{
  "name": "cesium",
  "version": "1.6.9",
  "version": "1.7.16",
  "description": "Cesium Wallet for G1 libre currency",
  "author": "Benoit Lavenier <benoit.lavenier@e-is.pro>",
  "license": "AGPL-3.0",
@@ -10,20 +10,22 @@
    "url": "git@git.duniter.org:clients/cesium/cesium.git"
  },
  "scripts": {
    "clean": "clean webClean webExtClean && trash dist/desktop/**/*.deb platforms/android/**/*.apk",
    "clean": "gulp clean webClean webExtClean && rm -rf dist/web dist/android && rm -f desktop/**/cesium-*.deb desktop/**/cesium-*.exe platforms/android/**/*.apk",
    "postinstall": "node scripts/node/postinstall.js",
    "lint": "gulp lint",
    "gulp": "npx gulp",
    "lint": "npx gulp lint",
    "install-platforms": "ionic cordova prepare",
    "start": "ionic serve",
    "start:webExt": "gulp webExtCompile && web-ext run --source-dir ./dist/web/ext/",
    "start:webExt": "npx gulp webExtCompile && web-ext run --source-dir ./dist/web/ext/ --devtools",
    "start:android": "ionic cordova run android --color",
    "docker:build": "sudo docker build . -t cesium/release",
    "docker:run": "sudo docker run -ti --rm -p 8100:8100 -p 35729:35729 -v .:/cesium:rw cesium/release",
    "build": "gulp build",
    "build:web": "gulp config --env default && gulp webBuild --release",
    "build:webExt": "gulp config --env default && gulp webExtBuild --release",
    "build:android": "ionic cordova build android --color --release",
    "build:ios": "ionic cordova build ios --color --release"
    "build": "npx gulp build",
    "build:web": "npx gulp config --env default && npx gulp webBuild --release",
    "build:webExt": "npx gulp config --env default && npx gulp webExtBuild --release",
    "build:android": "ionic cordova build android --warning-mode=none --color --release -- -- --packageType=apk",
    "build:ios": "ionic cordova build ios --warning-mode=none --color --release",
    "build:chromeExt": "npx gulp config --env default && npx gulp chromeExtBuild --release"
  },
  "keywords": [
    "duniter",
@@ -64,11 +66,11 @@
    "@bower_components/angular-ui-router": "angular-ui/angular-ui-router-bower#0.2.18",
    "@bower_components/blob-polyfill": "bjornstar/blob-polyfill#~1.0.20150320",
    "@bower_components/chart.js": "chartjs/Chart.js#v2.9.3",
    "@bower_components/file-saver.js": "Teleborder/FileSaver.js#~1.20150507.2",
    "@bower_components/ion-digit-keyboard": "skol-pro/ion-digit-keyboard#973b90c2fc",
    "@bower_components/ionic": "driftyco/ionic-bower#v1.3.5",
    "@bower_components/ionic-material": "zachsoft/Ionic-Material#v0.4.2",
    "@bower_components/js-nacl": "tonyg/js-nacl#1.3.2",
    "@bower_components/jdenticon": "dmester/jdenticon#3.1.0",
    "@bower_components/js-nacl": "tonyg/js-nacl#1.4.0",
    "@bower_components/js-scrypt": "tonyg/js-scrypt#v1.2.0",
    "@bower_components/leaflet": "Leaflet/Leaflet#v0.7.7",
    "@bower_components/leaflet-search": "stefanocudini/leaflet-search#v2.7.2",
@@ -88,33 +90,31 @@
    "uuid": "3.2.1"
  },
  "devDependencies": {
    "@ionic/cli": "^6.11.7",
    "@ionic/v1-toolkit": "^3.2.8",
    "@ionic/cli": "~6.20.9",
    "@ionic/v1-toolkit": "^3.2.20",
    "@prantlf/gulp-jsonlint": "^2.4.0",
    "ansi-colors": "^4.1.1",
    "cordova": "^10.0.0",
    "cordova-android": "^9.0.0",
    "cordova": "^12.0.0",
    "cordova-android": "^13.0.0",
    "cordova-clipboard": "^1.3.0",
    "cordova-ios": "^6.1.0",
    "cordova-osx": "^6.0.0",
    "cordova-plugin-androidx": "^2.0.0",
    "cordova-plugin-androidx-adapter": "^1.1.1",
    "cordova-plugin-camera": "^4.1.0",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-fetch": "^5.0.0",
    "cordova-ios": "^7.1.1",
    "cordova-plugin-androidx-adapter": "^1.1.3",
    "cordova-plugin-inappbrowser": "^6.0.0",
    "cordova-plugin-camera": "^8.0.0",
    "cordova-plugin-customurlscheme": "^5.0.2",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-device": "^3.0.0",
    "cordova-plugin-dialogs": "^2.0.2",
    "cordova-plugin-file": "^6.0.2",
    "cordova-plugin-file": "^8.1.3",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^4.2.1",
    "cordova-plugin-minisodium": "git+https://github.com/duniter-cesium/cordova-plugin-minisodium.git#v1.0.2",
    "cordova-plugin-secure-storage-android10": "git+https://github.com/duniter-cesium/cordova-plugin-secure-storage-android10.git#6.0.4",
    "cordova-plugin-splashscreen": "^6.0.0",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-ionic-webview": "^5.0.1",
    "cordova-plugin-network-information": "~3.0.0",
    "cordova-plugin-secure-storage-android10": "~6.0.7",
    "cordova-plugin-splashscreen": "^6.0.2",
    "cordova-plugin-statusbar": "^4.0.0",
    "cordova-plugin-vibration": "^3.1.1",
    "cordova-plugin-websocket": "^0.12.2",
    "cordova-plugin-whitelist": "^1.3.4",
    "cordova-plugin-x-toast": "^2.7.2",
    "cordova-plugin-x-toast": "^2.7.3",
    "del": "^5.1.0",
    "delete-empty": "^0.1.3",
    "event-stream": "3.3.4",
@@ -122,7 +122,7 @@
    "glob": "^5.0.15",
    "graceful-fs": "^4.2.3",
    "gulp": "^4.0.2",
    "gulp-angular-templatecache": "^3.0.0",
    "gulp-angular-templatecache": "^3.0.1",
    "gulp-angular-translate": "^0.1.4",
    "gulp-base64-v2": "^1.0.4",
    "gulp-bump": "^3.1.3",
@@ -144,7 +144,7 @@
    "gulp-remove-code": "^3.0.4",
    "gulp-rename": "^2.0.0",
    "gulp-replace": "^1.0.0",
    "gulp-sass": "^4.1.0",
    "gulp-sass": "^5.1.0",
    "gulp-sort": "^2.0.0",
    "gulp-sourcemaps": "^2.6.5",
    "gulp-sri-hash": "^2.2.1",
@@ -158,11 +158,11 @@
    "map-stream": "0.0.7",
    "merge2": "^1.3.0",
    "mv": "^2.1.1",
    "node-sass": "^4.14.1",
    "phonegap-plugin-barcodescanner": "^8.1.0",
    "node-sass": "^9.0.0",
    "@red-mobile/cordova-plugin-barcodescanner": "^9.1.0",
    "playup": "^1.1.0",
    "vinyl-fs": "^3.0.3",
    "web-ext": "^4.3.0",
    "web-ext": "^8.9.0",
    "yargs": "^5.0.0"
  },
  "peerDependencies": {
@@ -189,10 +189,9 @@
      "cordova-plugin-statusbar": {},
      "cordova-plugin-vibration": {},
      "cordova-plugin-websocket": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-x-toast": {},
      "cordova-plugin-ionic-keyboard": {},
      "phonegap-plugin-barcodescanner": {
      "@red-mobile/cordova-plugin-barcodescanner": {
        "CAMERA_USAGE_DESCRIPTION": "To scan QRCode",
        "ANDROID_SUPPORT_V4_VERSION": "28.+"
      },
@@ -202,7 +201,6 @@
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "28.+"
      },
      "cordova-plugin-file": {},
      "cordova-plugin-androidx": {},
      "cordova-plugin-androidx-adapter": {},
      "cordova-plugin-customurlscheme": {
        "URL_SCHEME": "june",
@@ -211,16 +209,15 @@
        "ANDROID_PATHPREFIX": "/wallet"
      },
      "cordova-plugin-secure-storage-android10": {},
      "cordova-plugin-minisodium": {}
      "cordova-plugin-network-information": {}
    },
    "platforms": [
      "ios",
      "osx",
      "android"
    ]
  },
  "engines": {
    "node": ">= 12.18.3",
    "node": ">= 16.17.0",
    "yarn": ">= 1.22.0"
  }
}
Original line number Diff line number Diff line
@@ -2,16 +2,16 @@ FROM ubuntu:18.04
LABEL maintainer="benoit [dot] lavenier [at] e-is [dot] pro"

ENV DEBIAN_FRONTEND=noninteractive \
    ANDROID_HOME=/opt/android-sdk-linux \
    NODE_VERSION=10.20.0 \
    NPM_VERSION=6.14.4 \
    YARN_VERSION=1.22.4 \
    IONIC_CLI_VERSION=6.5.0 \
    CORDOVA_VERSION=8.1.2 \
    CORDOVA_RES_VERSION=0.11.0 \
    NATIVE_RUN_VERSION=1.0.0 \
    GRADLE_VERSION=4.10.3 \
    GULP_VERSION=2.2.0 \
    ANDROID_SDK_ROOT=/opt/android-sdk-linux \
    NODE_VERSION=16.20.2 \
    NPM_VERSION=8.19.4 \
    YARN_VERSION=1.22.22 \
    IONIC_CLI_VERSION=6.20.9 \
    CORDOVA_VERSION=12.0.0 \
    CORDOVA_RES_VERSION=0.15.4 \
    NATIVE_RUN_VERSION=2.0.0 \
    GRADLE_VERSION=8.7 \
    GULP_VERSION=4.0.2 \
    ANDROID_NDK_VERSION=r19c \
    ANDROID_SDK_VERSION=r29.0.2

@@ -33,10 +33,10 @@ RUN npm install -g cordova@"$CORDOVA_VERSION" cordova-res@"$CORDOVA_RES_VERSION"
    npm cache clear --force

# Install Android prerequisites
RUN echo ANDROID_HOME="${ANDROID_HOME}" >> /etc/environment && \
RUN echo ANDROID_SDK_ROOT="${ANDROID_SDK_ROOT}" >> /etc/environment && \
    dpkg --add-architecture i386 && \
    apt-get update && \
    apt-get -y install openjdk-8-jdk-headless && \
    apt-get -y install openjdk-11-jdk-headless && \
    apt-get install -y --force-yes expect ant wget zipalign libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 qemu-kvm kmod && \
    apt-get clean && \
    apt-get autoclean && \
@@ -65,13 +65,13 @@ RUN echo ANDROID_HOME="${ANDROID_HOME}" >> /etc/environment && \

# Setup environment

#ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:/opt/tools:/opt/gradle/gradle-"$GRADLE_VERSION"/bin
#ENV PATH ${PATH}:${ANDROID_SDK_ROOT}/tools:${ANDROID_SDK_ROOT}/platform-tools:/opt/tools:/opt/gradle/gradle-"$GRADLE_VERSION"/bin

# Install sdk elements
#COPY resources/android/build/tools /opt/tools
#RUN chmod u+x /opt/tools/*.sh
#RUN ["/opt/tools/android-accept-licenses.sh", "android update sdk --all --no-ui --filter platform-tools,tools,build-tools-29.0.0,android-29,build-tools-26.0.0,android-26,build-tools-25.0.0,android-25,extra-android-support,extra-android-m2repository,extra-google-m2repository"]
#RUN unzip ${ANDROID_HOME}/temp/*.zip -d ${ANDROID_HOME}
#RUN unzip ${ANDROID_SDK_ROOT}/temp/*.zip -d ${ANDROID_SDK_ROOT}


# Install source code
+0 −11
Original line number Diff line number Diff line
configurations.all {
    resolutionStrategy {
      force 'androidx.legacy:legacy-support-v4:1.0.0'
      force 'androidx.appcompat:appcompat:1.2.0'
    }
}
dependencies {
  implementation(project(path: ":CordovaLib")) {
    exclude group: 'com.android.support', module:'support-v4'
  }
}
Original line number Diff line number Diff line
package com.crypho.plugins;

import android.annotation.TargetApi;
import android.app.KeyguardManager;
import android.content.Context;
import android.content.Intent;
import android.hardware.biometrics.BiometricPrompt;
import android.os.Build;
import android.os.CancellationSignal;
import android.os.Handler;
import android.provider.Settings;
import android.util.Base64;
import android.util.Log;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaArgs;
import org.apache.cordova.CordovaPlugin;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.lang.reflect.Method;
import java.util.Hashtable;
import java.util.Map;
import java.util.concurrent.Executor;

/**
* CHANGES :
*   31/05/2023 - BLA - Report MR as a workaround for issue #6 (https://github.com/Sotam/cordova-plugin-secure-storage-android10/issues/6)
*                      TODO: remove this file after new release, with this fixed issue
*/
public class SecureStorage extends CordovaPlugin {
    private static final String TAG = "SecureStorage";

    private static final boolean SUPPORTED = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
    private static final Boolean IS_API_29_AVAILABLE = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
    private static final Integer DEFAULT_AUTHENTICATION_VALIDITY_TIME = 60 * 60 * 24; // Fallback to 24h. Workaround to avoid asking for credentials too "often"

    private static final String MSG_NOT_SUPPORTED = "API 19 (Android 4.4 KitKat) is required. This device is running API " + Build.VERSION.SDK_INT;
    private static final String MSG_DEVICE_NOT_SECURE = "Device is not secure";
    private static final String MSG_KEYS_FAILED = "Generate RSA Encryption Keys failed. ";

    private Hashtable<String, SharedPreferencesHandler> SERVICE_STORAGE = new Hashtable<String, SharedPreferencesHandler>();
    private String INIT_SERVICE;
    private String INIT_PACKAGENAME;
    private volatile CallbackContext secureDeviceContext, generateKeysContext, unlockCredentialsContext;
    private volatile boolean generateKeysContextRunning = false;

    private AbstractRSA rsa = RSAFactory.getRSA();

    @Override
    public void onResume(boolean multitasking) {
        if (secureDeviceContext != null) {

            if (isDeviceSecure()) {
                secureDeviceContext.success();
            } else {
                secureDeviceContext.error(MSG_DEVICE_NOT_SECURE);
            }
            secureDeviceContext = null;
        }

        if (unlockCredentialsContext != null) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                cordova.getThreadPool().execute(new Runnable() {
                    public void run() {
                        if (unlockCredentialsContext != null) {
                            String alias = service2alias(INIT_SERVICE);
                            if (rsa.userAuthenticationRequired(alias)) {
                                unlockCredentialsContext.error("User not authenticated");
                            }
                            unlockCredentialsContext.success();
                            unlockCredentialsContext = null;
                        }
                    }
                });
            }
        }
    }

    @Override
    public boolean execute(String action, CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
        if (!SUPPORTED) {
            Log.w(TAG, MSG_NOT_SUPPORTED);
            callbackContext.error(MSG_NOT_SUPPORTED);
            return false;
        }
        if ("init".equals(action)) {
            String service = args.getString(0);
            JSONObject options = args.getJSONObject(1);

            String packageName = options.optString("packageName", getContext().getPackageName());

            Context ctx = null;

            // Solves #151. By default, we use our own ApplicationContext
            // If packageName is provided, we try to get the Context of another Application with that packageName
            try {
                ctx = getPackageContext(packageName);
            } catch (Exception e) {
                // This will fail if the application with given packageName is not installed
                // OR if we do not have required permissions and cause a security violation
                Log.e(TAG, "Init failed :", e);
                callbackContext.error(e.getMessage());
            }

            INIT_PACKAGENAME = ctx.getPackageName();
            String alias = service2alias(service);
            INIT_SERVICE = service;

            SharedPreferencesHandler PREFS = new SharedPreferencesHandler(alias, ctx);
            SERVICE_STORAGE.put(service, PREFS);
            if (!isDeviceSecure()) {
                Log.e(TAG, MSG_DEVICE_NOT_SECURE);
                callbackContext.error(MSG_DEVICE_NOT_SECURE);
            } else if (!rsa.encryptionKeysAvailable(alias)) {
                // Encryption Keys aren't available, proceed to generate them
                Integer userAuthenticationValidityDuration = options.optInt("userAuthenticationValidityDuration", DEFAULT_AUTHENTICATION_VALIDITY_TIME);
                generateKeysContext = callbackContext;
                generateEncryptionKeys(userAuthenticationValidityDuration);
                if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
                    unlockCredentialsLegacy();
                }
            } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && rsa.userAuthenticationRequired(alias)) {
                // User has to confirm authentication via device credentials.
                String title = options.optString("unlockCredentialsTitle", null);
                String description = options.optString("unlockCredentialsDescription", null);

                unlockCredentialsContext = callbackContext;
                unlockCredentials(title, description);
            } else {
                initSuccess(callbackContext);
            }

            return true;
        }
        if ("set".equals(action)) {
            final String service = args.getString(0);
            final String key = args.getString(1);
            final String value = args.getString(2);
            final String cipherMode = args.isNull(3) ? null : args.getString(3); // Close #6 - cipherMode is optional
            final String adata = service;
            cordova.getThreadPool().execute(new Runnable() {
                public void run() {
                    try {
                        JSONObject result = AES.encrypt(value.getBytes(), adata.getBytes(), cipherMode);
                        byte[] aes_key = Base64.decode(result.getString("key"), Base64.DEFAULT);
                        byte[] aes_key_enc = rsa.encrypt(aes_key, service2alias(service));
                        result.put("key", Base64.encodeToString(aes_key_enc, Base64.DEFAULT));
                        if (cipherMode != null) result.put("mode", cipherMode);
                        getStorage(service).store(key, result.toString());
                        callbackContext.success(key);
                    } catch (Exception e) {
                        Log.e(TAG, "Encrypt failed :", e);
                        callbackContext.error(e.getMessage());
                    }
                }
            });
            return true;
        }
        if ("get".equals(action)) {
            final String service = args.getString(0);
            final String key = args.getString(1);
            String value = getStorage(service).fetch(key);
            if (value != null) {
                JSONObject json = new JSONObject(value);
                final byte[] encKey = Base64.decode(json.getString("key"), Base64.DEFAULT);
                final JSONObject data = json.getJSONObject("value");
                final byte[] ct = Base64.decode(data.getString("ct"), Base64.DEFAULT);
                final byte[] iv = Base64.decode(data.getString("iv"), Base64.DEFAULT);
                final byte[] adata = Base64.decode(data.getString("adata"), Base64.DEFAULT);
                cordova.getThreadPool().execute(new Runnable() {
                    public void run() {
                        try {
                            byte[] decryptedKey = rsa.decrypt(encKey, service2alias(service));
                            String cipherMode = data.isNull("mode") ? null : data.getString("mode");
                            String decrypted = new String(AES.decrypt(ct, decryptedKey, iv, adata, cipherMode));
                            callbackContext.success(decrypted);
                        } catch (Exception e) {
                            Log.e(TAG, "Decrypt failed :", e);
                            callbackContext.error(e.getMessage());
                        }
                    }
                });
            } else {
                callbackContext.error("Key [" + key + "] not found.");
            }
            return true;
        }
        if ("secureDevice".equals(action)) {
            // Open the Security Settings screen. The app developer should inform the user about
            // the security requirements of the app and initialize again after the user has changed the screen-lock settings
            secureDeviceContext = callbackContext;
            secureDevice();
            return true;
        }
        if ("remove".equals(action)) {
            String service = args.getString(0);
            String key = args.getString(1);
            getStorage(service).remove(key);
            callbackContext.success(key);
            return true;
        }
        if ("keys".equals(action)) {
            String service = args.getString(0);
            callbackContext.success(new JSONArray(getStorage(service).keys()));
            return true;
        }
        if ("clear".equals(action)) {
            String service = args.getString(0);
            getStorage(service).clear();
            callbackContext.success();
            return true;
        }
        return false;
    }

    private boolean isDeviceSecure() {
        KeyguardManager keyguardManager = (KeyguardManager) (getContext().getSystemService(Context.KEYGUARD_SERVICE));
        try {
            Method isSecure = null;
            isSecure = keyguardManager.getClass().getMethod("isDeviceSecure");
            return ((Boolean) isSecure.invoke(keyguardManager)).booleanValue();
        } catch (Exception e) {
            return keyguardManager.isKeyguardSecure();
        }
    }

    private String service2alias(String service) {
        String res = INIT_PACKAGENAME + "." + service;
        return res;
    }

    private SharedPreferencesHandler getStorage(String service) {
        return SERVICE_STORAGE.get(service);
    }

    private void initSuccess(CallbackContext context) {
        context.success();
    }

    /**
     * Create the Confirm Credentials screen.
     * You can customize the title and description or Android will provide a generic one for you if you leave it null
     *
     * @param title
     * @param description
     */
    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    private void unlockCredentials(final String title, final String description) {
        cordova.getActivity().runOnUiThread(new Runnable() {
            public void run() {
                if (IS_API_29_AVAILABLE && isDeviceSecure()) {
                    // Building a biometric prompt instance with custom title and description.
                    BiometricPrompt.Builder biometricPromptBuilder = new BiometricPrompt.Builder(getContext());
                    biometricPromptBuilder.setTitle(title);
                    biometricPromptBuilder.setDescription(description);
                    //biometricPromptBuilder.setDeviceCredentialAllowed(true);
                    BiometricPrompt biometricPrompt = biometricPromptBuilder.build();
                    CancellationSignal cancellationSignal = new CancellationSignal();
                    final Executor executor = getExecutor();
                    // Launching the credential confirmation popup to get biometric validation.
                    // If biometric is not available will open the other unlock methods.
                    biometricPrompt.authenticate(cancellationSignal, executor, new BiometricPrompt.AuthenticationCallback() {
                        @Override
                        public void onAuthenticationError(int errorCode, CharSequence errString) {
                            super.onAuthenticationError(errorCode, errString);
                        }

                        @Override
                        public void onAuthenticationHelp(int helpCode, CharSequence helpString) {
                            super.onAuthenticationHelp(helpCode, helpString);
                        }

                        @Override
                        public void onAuthenticationSucceeded(BiometricPrompt.AuthenticationResult result) {
                            super.onAuthenticationSucceeded(result);
                        }

                        @Override
                        public void onAuthenticationFailed() {
                            super.onAuthenticationFailed();
                        }
                    });
                } else {
                    KeyguardManager keyguardManager = (KeyguardManager) (getContext().getSystemService(Context.KEYGUARD_SERVICE));
                    Intent intent = keyguardManager.createConfirmDeviceCredentialIntent(title, description);
                    if (intent != null) {
                        startActivity(intent);
                    } else {
                        Log.e(TAG, "Error creating Confirm Credentials Intent");
                        unlockCredentialsContext.error("Cant't unlock credentials, error creating Confirm Credentials Intent");
                    }
                }
            }
        });
    }

    @TargetApi(Build.VERSION_CODES.KITKAT)
    private void unlockCredentialsLegacy() {
        cordova.getActivity().runOnUiThread(new Runnable() {
            @Override
            public void run() {
                Intent intent = new Intent("com.android.credentials.UNLOCK");
                startActivity(intent);
            }
        });
    }

    /**
     * Generate Encryption Keys in the background.
     *
     * @param userAuthenticationValidityDuration User authentication validity duration in seconds
     */
    private void generateEncryptionKeys(final Integer userAuthenticationValidityDuration) {
        if (generateKeysContext != null && !generateKeysContextRunning) {
            cordova.getThreadPool().execute(new Runnable() {
                public void run() {
                    generateKeysContextRunning = true;
                    try {
                        String alias = service2alias(INIT_SERVICE);
                        SharedPreferencesHandler storage = getStorage(INIT_SERVICE);
                        if(storage.isEmpty()){
                            //Solves Issue #96. The RSA key may have been deleted by changing the lock type.
                            getStorage(INIT_SERVICE).clear();
                            rsa.createKeyPair(getContext(), alias, userAuthenticationValidityDuration);
                        }
                        generateKeysContext.success();
                    } catch (Exception e) {
                        Log.e(TAG, MSG_KEYS_FAILED, e);
                        generateKeysContext.error(MSG_KEYS_FAILED + e.getMessage());
                    } finally {
                        generateKeysContext = null;
                        generateKeysContextRunning = false;
                    }
                }
            });
        }
    }

    /**
     * Open Security settings screen.
     */
    private void secureDevice() {
        cordova.getActivity().runOnUiThread(new Runnable() {
            public void run() {
                try {
                    Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS);
                    startActivity(intent);
                } catch (Exception e) {
                    Log.e(TAG, "Error opening Security settings to secure device : ", e);
                    secureDeviceContext.error(e.getMessage());
                }
            }
        });
    }

    private Context getContext() {
        return cordova.getActivity().getApplicationContext();
    }

    /**
     * Creates a executor with handler to run runnable tasks.
     */
    private Executor getExecutor() {
        return new Executor() {
            @Override
            public void execute(Runnable command) {
                Handler handler = new Handler();
                handler.post(command);
            }
        };
    }

    private Context getPackageContext(String packageName) throws Exception {
        Context pkgContext = null;

        Context context = getContext();
        if (context.getPackageName().equals(packageName)) {
            pkgContext = context;
        } else {
            pkgContext = context.createPackageContext(packageName, 0);
        }

        return pkgContext;
    }

    private void startActivity(Intent intent) {
        cordova.getActivity().startActivity(intent);
    }

}
Original line number Diff line number Diff line
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-6.5.1-all.zip
Original line number Diff line number Diff line
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="108"
    android:viewportHeight="108">
  <group android:scaleX="0.13176"
      android:scaleY="0.13176"
      android:translateX="21.06"
      android:translateY="21.06">
    <path
        android:pathData="M390.99,122.28C418.21,157.18 434.92,200.28 441.2,248.24C441.19,276.71 435.71,305.29 425.31,333.28C371.1,416.73 274.95,449.21 167.67,434.28C136.41,416.04 109.01,390.08 86.27,358.02C67.78,323.79 57.94,284.4 56.49,242.06C62.21,199.77 79.62,161.91 106.3,129.62C162.52,85.44 239.03,70.18 321.97,82.52C345.51,92.54 368.66,105.88 390.99,122.28Z"
        android:fillColor="#FFFFFF"/>
    <path
        android:pathData="M324.59,193.42C253.25,304.2 169.63,334.67 69.9,336.41 103.72,398.97 170.29,441.08 246.33,440.09 336.19,438.92 411.25,377.91 434.1,295.46c-1.39,-3.41 -3.21,-7.05 -5.6,-10.94C419.62,272.2 388.77,215.98 324.59,193.42Z"
        android:strokeAlpha="0.5"
        android:strokeLineJoin="miter"
        android:strokeWidth="1"
        android:fillColor="#ffd086"
        android:strokeColor="#00000000"
        android:fillType="evenOdd"
        android:fillAlpha="0.5"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M325.15,193.01C313.98,258.43 269.08,312.3 279.75,354.31C293.25,407.44 238.77,419.51 194.51,433.92C211.05,438.17 228.43,440.32 246.33,440.09C349.9,438.74 433.81,357.9 440.79,256.35C432.31,253.94 424.15,250.27 418.61,244.08C401.68,225.19 358.22,204.63 325.15,193.01Z"
        android:strokeAlpha="0.5"
        android:strokeLineJoin="miter"
        android:strokeWidth="1"
        android:fillColor="#270b0b"
        android:strokeColor="#00000000"
        android:fillType="evenOdd"
        android:fillAlpha="0.4969697"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M325.15,193.01C313.98,258.43 269.08,312.3 279.75,354.31C293.25,407.44 238.77,419.51 194.51,433.92C211.05,438.17 228.43,440.32 246.33,440.09C349.9,438.74 433.81,357.9 440.79,256.35C432.31,253.94 424.15,250.27 418.61,244.08C401.68,225.19 358.22,204.63 325.15,193.01Z"
        android:strokeAlpha="0.5"
        android:strokeLineJoin="miter"
        android:strokeWidth="1"
        android:fillColor="#CB8903"
        android:strokeColor="#00000000"
        android:fillType="evenOdd"
        android:fillAlpha="0.4969695"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M282.69,180.67l12.17,0l0,13.22l-12.17,0z"
        android:strokeAlpha="0.99607843"
        android:strokeWidth="18.07"
        android:fillColor="#fabb37"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M212.74,136.72l11.59,0l0,12.65l-11.59,0z"
        android:strokeAlpha="0.99607843"
        android:strokeWidth="18.07"
        android:fillColor="#ffd086"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M238.53,145.83l15.81,0l0,15.81l-15.81,0z"
        android:strokeAlpha="0.99607843"
        android:strokeWidth="18.07"
        android:fillColor="#fabb37"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M237.68,259.52l24.24,0l0,24.24l-24.24,0z"
        android:strokeAlpha="0.99607843"
        android:strokeWidth="18.07"
        android:fillColor="#fbc14c"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M240.39,168.03l15.81,0l0,15.81l-15.81,0z"
        android:strokeAlpha="0.99607843"
        android:strokeWidth="18.07"
        android:fillColor="#fabb37"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M266.3,235.13l12.65,0l0,13.7l-12.65,0z"
        android:strokeAlpha="0.99607843"
        android:strokeWidth="18.07"
        android:fillColor="#cc8902"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M291.24,210.5l9.48,0l0,9.48l-9.48,0z"
        android:strokeAlpha="0.99607843"
        android:strokeWidth="18.07"
        android:fillColor="#fabb37"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M257.07,213.16l15.81,0l0,15.81l-15.81,0z"
        android:strokeAlpha="0.99607843"
        android:strokeWidth="18.07"
        android:fillColor="#fabb37"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M195.22,294.95l20.02,0l0,21.08l-20.02,0z"
        android:strokeAlpha="0.99607843"
        android:strokeWidth="18.07"
        android:fillColor="#fbc14c"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M214.18,264.4l13.7,0l0,15.81l-13.7,0z"
        android:strokeAlpha="0.99607843"
        android:strokeWidth="18.07"
        android:fillColor="#fbc14c"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M243.16,237.52l-12.69,0l-0,12.65l12.69,0z"
        android:strokeAlpha="0.99607843"
        android:strokeWidth="18.07"
        android:fillColor="#cc8902"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M270.34,192.67l10.54,0l0,11.59l-10.54,0z"
        android:strokeAlpha="0.99607843"
        android:strokeWidth="18.07"
        android:fillColor="#ffd086"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M280.22,163.07l-12.69,0l-0,12.65l12.69,0z"
        android:strokeAlpha="0.99607843"
        android:strokeWidth="18.07"
        android:fillColor="#cc8902"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M324.59,193.42C253.25,304.2 169.63,334.67 69.9,336.41 103.72,398.97 170.29,441.08 246.33,440.09 336.19,438.92 411.25,377.91 434.1,295.46c-1.39,-3.41 -3.21,-7.05 -5.6,-10.94C419.62,272.2 388.77,215.98 324.59,193.42Z"
        android:strokeLineJoin="miter"
        android:strokeWidth="1.22"
        android:fillColor="#00000000"
        android:strokeColor="#FF7A00"
        android:fillType="evenOdd"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M325.15,193.01C313.98,258.43 269.08,312.3 279.75,354.31C293.25,407.44 238.77,419.51 194.51,433.92C211.05,438.17 228.43,440.32 246.33,440.09C349.9,438.74 433.81,357.9 440.79,256.35C432.31,253.94 424.15,250.27 418.61,244.08C401.68,225.19 358.22,204.63 325.15,193.01Z"
        android:strokeLineJoin="miter"
        android:strokeWidth="1.22"
        android:fillColor="#00000000"
        android:strokeColor="#FF7A00"
        android:fillType="evenOdd"
        android:fillAlpha="0.993939"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M325.15,193.01C313.98,258.43 269.08,312.3 279.75,354.31C293.25,407.44 238.77,419.51 194.51,433.92C211.05,438.17 228.43,440.32 246.33,440.09C349.9,438.74 433.81,357.9 440.79,256.35C432.31,253.94 424.15,250.27 418.61,244.08C401.68,225.19 358.22,204.63 325.15,193.01Z"
        android:strokeLineJoin="miter"
        android:strokeWidth="1.22"
        android:fillColor="#00000000"
        android:strokeColor="#FF7A00"
        android:fillType="evenOdd"
        android:fillAlpha="0.993939"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M266.14,38.46C265.06,38.16 263.98,37.87 262.89,37.58C228.32,28.5 193.55,26.83 160.25,31.59C374.63,22.72 466.78,173.24 439.31,353.41L448.18,354.83C474.18,190.78 402.95,76.25 266.14,38.46Z"
        android:strokeAlpha="0.78"
        android:strokeLineJoin="miter"
        android:strokeWidth="1"
        android:fillColor="#40B2FF"
        android:strokeColor="#00000000"
        android:fillType="evenOdd"
        android:fillAlpha="0.78"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M56.03,323.9C56.23,325 56.44,326.1 56.66,327.2C63.6,362.26 77.29,394.27 96.11,422.14C-5.53,233.18 89.61,84.53 263.67,30.53L261.07,21.93C102.15,70.22 30.25,184.32 56.03,323.9Z"
        android:strokeLineJoin="miter"
        android:strokeWidth="1"
        android:fillColor="#40B2FF"
        android:strokeColor="#00000000"
        android:fillType="evenOdd"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M389.87,100.01C389.17,99.13 388.47,98.26 387.77,97.39C365.23,69.64 338.16,47.76 308.48,31.93C486.7,151.39 472.15,327.28 343.56,456.43L349.89,462.81C467.76,345.8 477.93,211.31 389.87,100.01Z"
        android:strokeAlpha="0.4"
        android:strokeLineJoin="miter"
        android:strokeWidth="1"
        android:fillColor="#40B2FF"
        android:strokeColor="#00000000"
        android:fillType="evenOdd"
        android:fillAlpha="0.4"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M336.1,461.47C337.19,461.24 338.29,461 339.38,460.76C374.27,452.98 405.94,438.52 433.35,419.03C246.89,525.18 95.99,433.65 37.82,260.94L29.29,263.74C81.38,421.45 197.19,490.59 336.1,461.47Z"
        android:strokeAlpha="0.84"
        android:strokeLineJoin="miter"
        android:strokeWidth="1"
        android:fillColor="#40B2FF"
        android:strokeColor="#00000000"
        android:fillType="evenOdd"
        android:fillAlpha="0.84"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M27.33,237.68C26.96,238.73 26.58,239.79 26.22,240.85C14.56,274.64 10.29,309.19 12.52,342.75C19.8,128.32 176.83,47.74 354.42,88.69L356.5,79.94C194.87,41.69 75.31,104.1 27.33,237.68Z"
        android:strokeAlpha="0.4"
        android:strokeLineJoin="miter"
        android:strokeWidth="1"
        android:fillColor="#40B2FF"
        android:strokeColor="#00000000"
        android:fillType="evenOdd"
        android:fillAlpha="0.4"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M454.96,190.72C454.78,189.62 454.59,188.51 454.39,187.41C448.03,152.24 434.87,120 416.51,91.83C515.01,282.44 417.42,429.5 242.48,480.61L244.94,489.26C404.64,443.6 478.43,330.7 454.96,190.72Z"
        android:strokeLineJoin="miter"
        android:strokeWidth="1"
        android:fillColor="#40B2FF"
        android:strokeColor="#00000000"
        android:fillType="evenOdd"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M209.13,466.55C210.17,466.96 211.21,467.36 212.26,467.75C245.73,480.32 280.15,485.53 313.75,484.2C99.6,471.12 23.31,311.96 69.06,135.55L60.38,133.23C17.75,293.76 76.9,414.98 209.13,466.55Z"
        android:strokeAlpha="0.4"
        android:strokeLineJoin="miter"
        android:strokeWidth="1"
        android:fillColor="#40B2FF"
        android:strokeColor="#00000000"
        android:fillType="evenOdd"
        android:fillAlpha="0.4"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M63.73,120.32C62.89,121.06 62.06,121.81 61.22,122.56C34.72,146.54 14.3,174.74 0.08,205.22C109.88,20.89 286.3,26.04 422.11,147.57L428.15,140.91C305.02,29.44 170.18,26.45 63.73,120.32Z"
        android:strokeLineJoin="miter"
        android:strokeWidth="1"
        android:fillColor="#40B2FF"
        android:strokeColor="#00000000"
        android:fillType="evenOdd"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M454.1,283.08C454.5,282.03 454.89,280.98 455.28,279.93C467.58,246.37 472.52,211.9 470.92,178.31C459.53,392.57 300.99,470.13 124.22,425.78L121.97,434.48C282.84,475.83 403.58,415.72 454.1,283.08Z"
        android:strokeAlpha="0.4"
        android:strokeLineJoin="miter"
        android:strokeWidth="1"
        android:fillColor="#40B2FF"
        android:strokeColor="#00000000"
        android:fillType="evenOdd"
        android:fillAlpha="0.4"
        android:strokeLineCap="butt"/>
    <path
        android:pathData="M254.38,72.68L254.38,100.08C254.1,100.08 253.82,100.08 253.54,100.08C252.06,100.08 250.59,100.1 249.13,100.14L249.13,72.68ZM412.91,252.64L435.5,252.64L435.5,257.88L413.04,257.88C413.03,256.14 412.98,254.39 412.91,252.64ZM254.38,418.61L254.38,437.84L249.13,437.84L249.13,418.56C250.6,418.6 252.07,418.62 253.54,418.62C253.82,418.62 254.1,418.62 254.38,418.61ZM94.05,257.88L70.34,257.88L70.34,252.64L94.19,252.64C94.11,254.38 94.06,256.13 94.05,257.88Z"
        android:fillColor="#402800"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M344.19,97.81L324.35,132.18C323.6,131.76 322.85,131.35 322.09,130.94L341.96,96.52ZM376.66,181.7L409.26,162.88L410.55,165.11L378.01,183.89C377.57,183.16 377.11,182.43 376.66,181.7ZM381.52,328.7L410.55,345.46L409.26,347.69L380.27,330.95C380.69,330.2 381.11,329.45 381.52,328.7ZM327.98,384.68L344.19,412.76L341.96,414.04L325.76,385.98C326.5,385.55 327.24,385.12 327.98,384.68ZM178.81,384.26L161.61,414.04L159.38,412.76L176.61,382.92C177.34,383.37 178.07,383.81 178.81,384.26ZM125.96,329.42L94.31,347.69L93.03,345.46L124.73,327.15C125.13,327.91 125.54,328.66 125.96,329.42ZM128.17,185.4L93.03,165.11L94.31,162.88L129.5,183.19C129.05,183.92 128.61,184.66 128.17,185.4ZM179.99,133.49L159.38,97.81L161.61,96.52L182.22,132.21C181.47,132.63 180.73,133.06 179.99,133.49Z"
        android:fillColor="#402800"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M57.77,128.85l12.17,0l0,13.22l-12.17,0z"
        android:strokeAlpha="0.996078"
        android:strokeWidth="21.23"
        android:fillColor="#5096C8"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M251.72,18.74l15.81,0l0,15.81l-15.81,0z"
        android:strokeAlpha="0.996078"
        android:strokeWidth="21.23"
        android:fillColor="#5096C8"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M411.91,131.1l24.24,0l0,24.24l-24.24,0z"
        android:strokeAlpha="0.996078"
        android:strokeWidth="21.23"
        android:fillColor="#5096C8"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M117.25,422.86l15.81,0l0,15.81l-15.81,0z"
        android:strokeAlpha="0.996078"
        android:strokeWidth="21.23"
        android:fillColor="#5096C8"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M341.23,451.63l12.65,0l0,13.7l-12.65,0z"
        android:strokeAlpha="0.996078"
        android:strokeWidth="21.23"
        android:fillColor="#5096C8"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M437.64,343.09l15.81,0l0,15.81l-15.81,0z"
        android:strokeAlpha="0.996078"
        android:strokeWidth="21.23"
        android:fillColor="#5096C8"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M236.58,475.23l20.02,0l0,21.08l-20.02,0z"
        android:strokeAlpha="0.996078"
        android:strokeWidth="21.23"
        android:fillColor="#5096C8"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M39.7,256.15l-12.69,0l-0,12.65l12.69,0z"
        android:strokeAlpha="0.996078"
        android:strokeWidth="21.23"
        android:fillColor="#5096C8"
        android:strokeColor="#00000000"/>
    <path
        android:pathData="M154.53,230.66C148.8,230.66 144.28,232.57 140.96,236.38C137.65,240.2 135.99,245.42 135.99,252.05C135.99,258.86 137.59,264.13 140.79,267.85C143.98,271.57 148.54,273.43 154.45,273.43C158.09,273.43 162.23,272.77 166.89,271.47L166.89,276.78C163.28,278.13 158.82,278.81 153.53,278.81C145.85,278.81 139.93,276.48 135.76,271.83C131.59,267.17 129.5,260.55 129.5,251.97C129.5,246.6 130.51,241.9 132.52,237.86C134.53,233.82 137.42,230.71 141.21,228.52C145,226.34 149.46,225.25 154.59,225.25C160.06,225.25 164.84,226.24 168.92,228.24L166.36,233.44C162.41,231.59 158.47,230.66 154.53,230.66ZM193.47,278.81C187.69,278.81 183.14,277.05 179.8,273.54C176.46,270.02 174.79,265.14 174.79,258.89C174.79,252.59 176.34,247.59 179.44,243.88C182.54,240.18 186.71,238.32 191.93,238.32C196.83,238.32 200.7,239.93 203.55,243.15C206.4,246.37 207.83,250.62 207.83,255.9L207.83,259.64L180.93,259.64C181.04,264.22 182.2,267.7 184.4,270.08C186.6,272.46 189.69,273.65 193.68,273.65C197.88,273.65 202.04,272.76 206.15,271.01L206.15,276.28C204.06,277.18 202.08,277.83 200.22,278.23C198.36,278.61 196.11,278.81 193.47,278.81M191.86,243.27C188.73,243.27 186.23,244.3 184.36,246.34C182.5,248.38 181.4,251.21 181.07,254.83L201.49,254.83C201.49,251.1 200.66,248.24 198.99,246.26C197.33,244.27 194.95,243.27 191.86,243.27ZM242.76,267.44C242.76,271.08 241.4,273.88 238.7,275.85C235.99,277.82 232.18,278.81 227.29,278.81C222.11,278.81 218.07,277.99 215.17,276.35L215.17,270.87C217.05,271.82 219.06,272.56 221.21,273.11C223.36,273.65 225.43,273.92 227.43,273.92C230.52,273.92 232.9,273.43 234.56,272.45C236.22,271.46 237.05,269.96 237.05,267.94C237.05,266.42 236.39,265.12 235.08,264.04C233.76,262.96 231.18,261.68 227.36,260.21C223.73,258.85 221.14,257.67 219.61,256.66C218.07,255.65 216.93,254.51 216.19,253.22C215.44,251.94 215.06,250.41 215.06,248.62C215.06,245.44 216.36,242.93 218.95,241.09C221.54,239.24 225.09,238.32 229.61,238.32C233.81,238.32 237.92,239.18 241.94,240.89L239.83,245.7C235.91,244.08 232.36,243.27 229.18,243.27C226.37,243.27 224.26,243.71 222.83,244.59C221.41,245.48 220.7,246.69 220.7,248.23C220.7,249.28 220.96,250.17 221.5,250.9C222.04,251.64 222.9,252.34 224.09,253.01C225.27,253.67 227.55,254.64 230.93,255.9C235.56,257.58 238.68,259.28 240.31,260.99C241.94,262.7 242.76,264.85 242.76,267.44ZM257.99,278.1L252.07,278.1L252.07,239.04L257.99,239.04L257.99,278.1M251.57,228.45C251.57,227.1 251.91,226.11 252.57,225.48C253.24,224.84 254.07,224.53 255.07,224.53C256.02,224.53 256.84,224.85 257.53,225.49C258.22,226.13 258.56,227.12 258.56,228.45C258.56,229.78 258.22,230.77 257.53,231.43C256.84,232.08 256.02,232.4 255.07,232.4C254.07,232.4 253.24,232.08 252.57,231.43C251.91,230.77 251.57,229.78 251.57,228.45ZM275.93,239.04L275.93,264.38C275.93,267.56 276.66,269.93 278.11,271.5C279.56,273.07 281.83,273.86 284.92,273.86C289,273.86 291.99,272.74 293.88,270.51C295.77,268.27 296.71,264.63 296.71,259.56L296.71,239.04L302.63,239.04L302.63,278.1L297.74,278.1L296.89,272.86L296.57,272.86C295.36,274.78 293.68,276.25 291.53,277.28C289.38,278.3 286.93,278.81 284.17,278.81C279.42,278.81 275.86,277.68 273.49,275.43C271.13,273.17 269.95,269.56 269.95,264.59L269.95,239.04L275.93,239.04ZM364.57,278.1L364.57,252.68C364.57,249.57 363.91,247.24 362.58,245.68C361.25,244.13 359.18,243.35 356.37,243.35C352.69,243.35 349.97,244.41 348.21,246.52C346.45,248.64 345.58,251.89 345.58,256.29L345.58,278.1L339.66,278.1L339.66,252.68C339.66,249.57 338.99,247.24 337.66,245.68C336.33,244.13 334.26,243.35 331.43,243.35C327.72,243.35 325.01,244.46 323.28,246.68C321.56,248.9 320.7,252.55 320.7,257.61L320.7,278.1L314.78,278.1L314.78,239.04L319.59,239.04L320.55,244.38L320.84,244.38C321.96,242.48 323.54,241 325.57,239.93C327.6,238.86 329.87,238.32 332.39,238.32C338.5,238.32 342.49,240.53 344.37,244.95L344.65,244.95C345.82,242.91 347.5,241.29 349.71,240.11C351.92,238.92 354.44,238.32 357.27,238.32C361.68,238.32 364.99,239.46 367.19,241.73C369.39,244 370.48,247.63 370.48,252.62L370.48,278.1L364.57,278.1Z"
        android:fillColor="#402800"/>
  </group>
</vector>
+13 −0
Original line number Diff line number Diff line
# Chrome Extension (Manifest V3)

This folder contains the specific files for the Chrome Extension, which uses the Manifest V3 format.

## Build

To build the Chrome extension, run the following command from the root of the project:

```bash
npm run build:chromeExt
```

This will generate a zip file in the `dist/web/build` directory, which can then be uploaded to the Chrome Web Store.
+62 −0
Original line number Diff line number Diff line
/**
 * Add browser actions, for WebExtension
 * (e.g. to open Cesium in a tab, when integrated as a Firefox extension).
 *
 * See https://forum.duniter.org/t/premiere-version-du-module-cesium-pour-firefox/6944
 *
 **/
var browser, chrome;

browser = browser || chrome;

var action = browser.browserAction || (chrome && chrome.action);

var browserExtensionRequirements = browser.tabs && action && action.onClicked;

// If integrated as a browser extension
if (browserExtensionRequirements) {
  console.debug("[extension] Initializing...");

  /**
   * Open Cesium in a new browser's tab
   */
  function openInTab() {
    console.debug("[extension] Opening Cesium...")
    browser.tabs.create({
      url: "index.html"
    });
  }

  // Adding browser action
  action.onClicked.addListener(openInTab);

  // FIXME: This code has been updated to use the chrome.alarms API for Manifest V3 compatibility.
  function checkNotifications() {
    console.debug("[extension] Checking for notifications...");

    action.setBadgeText({
      text: '0'
    });
    action.setBadgeBackgroundColor({
      color: '#387EF5' // = $positive color - see the SCSS theme
    });
  }

  // Create an alarm to run the notification check periodically.
  // The minimum period for Manifest V3 is 1 minute.
  chrome.alarms.create('notificationTimer', {
    periodInMinutes: 1
  });

  // Add a listener for when the alarm goes off.
  chrome.alarms.onAlarm.addListener(alarm => {
    if (alarm.name === 'notificationTimer') {
      checkNotifications();
    }
  });

  checkNotifications();
}
else {
  console.error("[extension] Cannot init extension: missing some API requirements (action or tabs");
}
+36 −0
Original line number Diff line number Diff line
{
  "manifest_version": 3,
  "name": "Cesium",
  "version": "1.7.15",
  "description": "Cesium Wallet for Ğ1 libre currency",
  "icons": {
    "32": "img/logo_32px.png",
    "60": "img/logo_60px.png",
    "96": "img/logo_96px.png",
    "144": "img/logo_144px.png",
    "192": "img/logo.svg"
  },
  "permissions": [
    "storage",
    "alarms"
  ],
  "host_permissions": [
    "*://*/*"
  ],
  "background": {
    "service_worker": "background.js"
  },
  "action": {
    "default_title": "Cesium",
    "default_icon": {
      "32": "img/logo_32px.png",
      "60": "img/logo_60px.png",
      "96": "img/logo_96px.png",
      "144": "img/logo_144px.png",
      "192": "img/logo.svg"
    }
  },
  "content_security_policy": {
    "extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';"
  }
}
+4 −0
Original line number Diff line number Diff line
<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-es-ct" viewBox="0 0 640 480">
  <path fill="#fcdd09" d="M0 0h640v480H0z"/>
  <path stroke="#da121a" stroke-width="60" d="M0 90h810m0 120H0m0 120h810m0 120H0" transform="scale(.79012 .88889)"/>
</svg>
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-de" viewBox="0 0 640 480">
  <path fill="#ffce00" d="M0 320h640v160H0z"/>
  <path d="M0 0h640v160H0z"/>
  <path fill="#d00" d="M0 160h640v160H0z"/>
</svg>
 No newline at end of file
+57 −0
Original line number Diff line number Diff line
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="flag-icons-pt" viewBox="0 0 640 480">
  <path fill="red" d="M256 0h384v480H256z"/>
  <path fill="#060" d="M0 0h256v480H0z"/>
  <g fill="#ff0" fill-rule="evenodd" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width=".6">
    <path d="M339.5 306.2c-32.3-1-180-93.2-181-108l8.1-13.5c14.7 21.3 165.7 111 180.6 107.8l-7.7 13.7"/>
    <path d="M164.9 182.8c-2.9 7.8 38.6 33.4 88.4 63.8 49.9 30.3 92.9 49 96 46.4l1.5-2.8c-.6 1-2 1.3-4.3.6-13.5-3.9-48.6-20-92.1-46.4-43.6-26.4-81.4-50.7-87.3-61a6.3 6.3 0 0 1-.6-3.1h-.2l-1.2 2.2-.2.3zm175.3 123.8c-.5 1-1.6 1-3.5.8-12-1.3-48.6-19.1-91.9-45-50.4-30.2-92-57.6-87.4-64.8l1.2-2.2.2.1c-4 12.2 82.1 61.4 87.2 64.6 49.8 30.8 91.8 48.9 95.5 44.2l-1.3 2.3z"/>
    <path d="M256.2 207.2c32.2-.3 72-4.4 95-13.6l-5-8c-13.5 7.5-53.5 12.5-90.3 13.2-43.4-.4-74.1-4.5-89.5-14.8l-4.6 8.6c28.2 12 57.2 14.5 94.4 14.6"/>
    <path d="M352.5 193.8c-.8 1.3-15.8 6.4-37.8 10.2a381.2 381.2 0 0 1-58.6 4.3 416.1 416.1 0 0 1-56.2-3.6c-23.1-3.6-35-8.6-39.5-10.4l1.1-2.2c12.7 5 24.7 8 38.7 10.2A411.5 411.5 0 0 0 256 206a391.8 391.8 0 0 0 58.3-4.3c22.5-3.7 34.8-8.4 36.6-10.5l1.6 2.7zm-4.4-8.1c-2.4 2-14.6 6.3-36 9.7a388.2 388.2 0 0 1-55.8 4c-22 0-40.1-1.6-53.8-3.6-21.8-2.8-33.4-8-37.6-9.4l1.3-2.2c3.3 1.7 14.4 6.2 36.5 9.3a385 385 0 0 0 53.6 3.4 384 384 0 0 0 55.4-4c21.5-3 33.1-8.4 34.9-9.8l1.5 2.6zM150.3 246c19.8 10.7 63.9 16 105.6 16.4 38 .1 87.4-5.8 105.9-15.6l-.5-10.7c-5.8 9-58.8 17.7-105.8 17.4-47-.4-90.7-7.6-105.3-17v9.5"/>
    <path d="M362.8 244.5v2.5c-2.8 3.4-20.2 8.4-42 12a434 434 0 0 1-65.4 4.4 400 400 0 0 1-62-4.3 155 155 0 0 1-44.4-12v-2.9c9.7 6.4 35.9 11.2 44.7 12.6 15.8 2.4 36.1 4.2 61.7 4.2 26.9 0 48.4-1.9 65-4.4 15.7-2.3 38-8.2 42.4-12.1zm0-9v2.5c-2.8 3.3-20.2 8.3-42 11.9a434 434 0 0 1-65.4 4.5 414 414 0 0 1-62-4.3 155 155 0 0 1-44.4-12v-3c9.7 6.5 36 11.2 44.7 12.6a408 408 0 0 0 61.7 4.3c26.9 0 48.5-2 65-4.5 15.7-2.2 38-8.1 42.4-12zm-107 68.8c-45.6-.2-84.7-12.4-93-14.4l6 9.4a249.8 249.8 0 0 0 87.4 14.3c34.7-1 65-3.7 86.3-14.1l6.2-9.8c-14.5 6.9-64 14.6-93 14.6"/>
    <path d="M344.9 297.3a143 143 0 0 1-2.8 4c-10 3.6-26 7.4-32.6 8.4a295.5 295.5 0 0 1-53.7 5c-40.4-.6-73.5-8.5-89-15.3l-1.3-2.1.2-.4 2.1.9a286.5 286.5 0 0 0 88.2 14.5c18.8 0 37.5-2.1 52.6-4.8 23.2-4.7 32.6-8.2 35.5-9.8l.7-.4zm5.3-8.8a287.2 287.2 0 0 1-2 3.5c-5.4 2-20 6.2-41.3 9.2-14 1.9-22.7 3.8-50.6 4.3a347.4 347.4 0 0 1-94.2-14L161 289a390 390 0 0 0 95.4 14c25.5-.5 36.4-2.4 50.3-4.3 24.8-3.8 37.3-8 41-9.1a2.9 2.9 0 0 0 0-.2l2.6-1z"/>
    <path d="M350.8 237.6c.1 30-15.3 57-27.6 68.8a99.3 99.3 0 0 1-67.8 28.2c-30.3.5-58.8-19.2-66.5-27.9a101 101 0 0 1-27.5-67.4c1.8-32.8 14.7-55.6 33.3-71.3a99.6 99.6 0 0 1 64.2-22.7 98.2 98.2 0 0 1 71 35.6c12.5 15.2 18 31.7 20.9 56.7zM255.6 135a106 106 0 0 1 106 105.2 105.6 105.6 0 1 1-211.4 0c-.1-58 47.3-105.2 105.4-105.2"/>
    <path d="M255.9 134.5c58.2 0 105.6 47.4 105.6 105.6S314.1 345.7 256 345.7s-105.6-47.4-105.6-105.6c0-58.2 47.4-105.6 105.6-105.6zM152.6 240c0 56.8 46.7 103.3 103.3 103.3 56.6 0 103.3-46.5 103.3-103.3s-46.7-103.3-103.3-103.3S152.6 183.2 152.6 240z"/>
    <path d="M256 143.3a97 97 0 0 1 96.7 96.7 97.1 97.1 0 0 1-96.7 96.8c-53 0-96.7-43.6-96.7-96.8a97.1 97.1 0 0 1 96.7-96.7zM161.6 240c0 52 42.6 94.4 94.4 94.4s94.4-42.5 94.4-94.4c0-52-42.6-94.4-94.4-94.4a94.8 94.8 0 0 0-94.4 94.4z"/>
    <path d="M260.3 134h-9.1v212.3h9z"/>
    <path d="M259.3 132.8h2.3v214.7h-2.2V132.8zm-9 0h2.4v214.7h-2.3V132.8z"/>
    <path d="M361.6 244.2v-7.8l-6.4-6-36.3-9.6-52.2-5.3-63 3.2-44.8 10.6-9 6.7v7.9l22.9-10.3 54.4-8.5h52.3l38.4 4.2 26.6 6.4z"/>
    <path d="M256 223.8c24.9 0 49 2.3 68.3 6 19.8 4 33.7 9 38.5 14.5v2.8c-5.8-7-24.5-12-39-15-19-3.6-43-6-67.9-6-26.1 0-50.5 2.6-69.3 6.2-15 3-35.1 9-37.6 14.8v-2.9c1.3-4 16.3-10 37.3-14.3 18.9-3.7 43.3-6.1 69.6-6.1zm0-9.1a383 383 0 0 1 68.3 6c19.8 4 33.7 9 38.5 14.6v2.7c-5.8-6.9-24.5-12-39-14.9-19-3.7-43-6-67.9-6a376 376 0 0 0-69.2 6.2c-14.5 2.7-35.4 8.9-37.7 14.7v-2.8c1.4-4 16.6-10.3 37.3-14.3 19-3.7 43.3-6.2 69.7-6.2zm-.6-46.2c39.3-.2 73.6 5.5 89.3 13.5l5.7 10c-13.6-7.4-50.6-15-94.9-14-36.1.3-74.7 4-94 14.4l6.8-11.4c15.9-8.3 53.3-12.5 87.1-12.5"/>
    <path d="M256 176.7a354 354 0 0 1 61.3 4.3c16 3 31.3 7.4 33.5 9.8l1.7 3c-5.3-3.4-18.6-7.3-35.6-10.5s-38.7-4.3-61-4.2c-25.3-.1-45 1.2-61.8 4.2a108.9 108.9 0 0 0-33.3 10.3l1.7-3.1c6-3 15.3-6.7 31.1-9.6 17.5-3.2 37.4-4.1 62.4-4.2zm0-9c21.4-.2 42.6 1 59.1 4a96 96 0 0 1 30.6 10l2.5 4c-4.2-4.7-20-9.2-34.1-11.6-16.4-2.9-36.7-4-58.1-4.2a361 361 0 0 0-59.5 4.4 97.3 97.3 0 0 0-29.6 9.1l2.2-3.3c5.8-3 15.2-5.8 27-8.1a357 357 0 0 1 59.9-4.4zM308.4 284a276.4 276.4 0 0 0-52.5-4c-65.5.8-86.6 13.5-89.2 17.3l-5-8c16.8-12 52.4-18.8 94.6-18.2 21.9.4 40.8 1.9 56.6 5l-4.5 8"/>
    <path d="M255.6 278.9c18.2.3 36 1 53.3 4.2l-1.2 2.2c-16-3-33.2-4-52-4-24.3-.2-48.7 2.1-70 8.2-6.7 1.9-17.8 6.2-19 9.8l-1.2-2c.4-2.2 7-6.6 19.6-10 24.4-7 47.2-8.3 70.5-8.4zm.8-9.2a327 327 0 0 1 57.3 5l-1.3 2.3a299 299 0 0 0-56-4.9c-24.2 0-49.9 1.8-73.3 8.6-7.5 2.2-20.6 7-21 10.7l-1.2-2.2c.2-3.4 11.5-7.9 21.7-10.8 23.5-6.9 49.3-8.6 73.8-8.7z"/>
    <path d="m349.4 290.5-7.8 12.3-22.7-20.1-58.6-39.5-66.2-36.3-34.3-11.7 7.3-13.6 2.5-1.3 21.3 5.3 70.4 36.3 40.6 25.6L336 272l13.9 16z"/>
    <path d="M158.6 195.5c6-4 50.2 15.6 96.6 43.6 46.1 28 90.3 59.6 86.3 65.5l-1.3 2.1-.6.5c.1-.1.8-1 0-3.1-2-6.5-33.4-31.5-85.3-62.9-50.7-30.1-92.9-48.3-97-43.1l1.3-2.6zM351 290.4c3.8-7.6-37.2-38.5-88.1-68.6-52-29.5-89.6-46.9-96.5-41.7L165 183c0 .1 0-.2.4-.5 1.2-1 3.3-1 4.2-1 11.8.2 45.5 15.7 92.8 42.8 20.8 12 87.6 55 87.3 67 0 1 .1 1.2-.3 1.8l1.7-2.6z"/>
  </g>
  <g transform="translate(0 26.7) scale(1.06667)">
    <path fill="#fff" stroke="#000" stroke-width=".7" d="M180.6 211a58.7 58.7 0 0 0 17.5 41.7 59 59 0 0 0 41.8 17.6 59.4 59.4 0 0 0 42-17.4 59 59 0 0 0 17.4-41.8v-79.2l-118.7-.2V211z"/>
    <path fill="red" stroke="#000" stroke-width=".5" d="M182.8 211.1a56.4 56.4 0 0 0 16.8 40 57 57 0 0 0 40.2 16.8 56.9 56.9 0 0 0 40.2-16.6 56.4 56.4 0 0 0 16.7-40v-77H183v76.8m91-53.7v48.9l-.1 5.1a33.2 33.2 0 0 1-10 24 34 34 0 0 1-24 10c-9.4 0-17.7-4-23.9-10.2a34 34 0 0 1-10-24v-54l68 .2z"/>
    <g id="e">
      <g id="d" fill="#ff0" stroke="#000" stroke-width=".5">
        <path stroke="none" d="M190.2 154.4c.1-5.5 4-6.8 4-6.8.1 0 4.3 1.4 4.3 6.9h-8.3"/>
        <path d="m186.8 147.7-.7 6.3h4.2c0-5.2 4-6 4-6 .1 0 4 1.1 4.1 6h4.2l-.8-6.4h-15zm-1 6.4h17c.3 0 .6.3.6.7 0 .5-.3.8-.6.8h-17c-.3 0-.6-.3-.6-.8 0-.4.3-.7.7-.7z"/>
        <path d="M192 154c0-3.3 2.3-4.2 2.3-4.2s2.3 1 2.3 4.2H192m-5.8-9h16.3c.3 0 .6.4.6.8 0 .3-.3.6-.6.6h-16.3c-.3 0-.6-.3-.6-.7 0-.3.3-.6.6-.6zm.4 1.5H202c.3 0 .6.3.6.7 0 .4-.3.7-.6.7h-15.5c-.4 0-.6-.3-.6-.7 0-.4.2-.7.6-.7zm5-10.6h1.2v.8h.9v-.8h1.3v.9h.9v-1h1.2v2c0 .4-.2.6-.5.6h-4.4c-.3 0-.6-.2-.6-.5v-2zm4.6 2.7.3 6.4h-4.3l.3-6.5h3.7"/>
        <path id="a" d="M191 141.6v3.4h-4v-3.4h4z"/>
        <use xlink:href="#a" width="100%" height="100%" x="10.6"/>
        <path id="b" d="M186.3 139h1.2v1h.9v-1h1.2v1h.9v-1h1.2v2c0 .4-.2.6-.5.6h-4.3a.6.6 0 0 1-.6-.6v-2z"/>
        <use xlink:href="#b" width="100%" height="100%" x="10.6"/>
        <path fill="#000" stroke="none" d="M193.9 140.6c0-.6.9-.6.9 0v1.6h-.9v-1.6"/>
        <path id="c" fill="#000" stroke="none" d="M188.6 142.8c0-.6.8-.6.8 0v1.2h-.8v-1.2"/>
        <use xlink:href="#c" width="100%" height="100%" x="10.6"/>
      </g>
      <use xlink:href="#d" width="100%" height="100%" y="46.3"/>
      <use xlink:href="#d" width="100%" height="100%" transform="rotate(-45.2 312.8 180)"/>
    </g>
    <use xlink:href="#d" width="100%" height="100%" x="45.7"/>
    <use xlink:href="#e" width="100%" height="100%" transform="matrix(-1 0 0 1 479.8 0)"/>
    <g id="f" fill="#fff">
      <path fill="#039" d="M232.6 202.4a8.3 8.3 0 0 0 2.2 5.7 7.2 7.2 0 0 0 5.3 2.4c2.1 0 4-1 5.3-2.4a8.3 8.3 0 0 0 2.2-5.7v-10.8h-15v10.8"/>
      <circle cx="236.1" cy="195.7" r="1.5"/>
      <circle cx="244.4" cy="195.7" r="1.5"/>
      <circle cx="240.2" cy="199.7" r="1.5"/>
      <circle cx="236.1" cy="203.9" r="1.5"/>
      <circle cx="244.4" cy="203.9" r="1.5"/>
    </g>
    <use xlink:href="#f" width="100%" height="100%" y="-26"/>
    <use xlink:href="#f" width="100%" height="100%" x="-20.8"/>
    <use xlink:href="#f" width="100%" height="100%" x="20.8"/>
    <use xlink:href="#f" width="100%" height="100%" y="25.8"/>
  </g>
</svg>
 No newline at end of file
Original line number Diff line number Diff line
@@ -9,10 +9,13 @@ var browser, chrome;

browser = browser || chrome;

var browserExtensionRequirements = browser.browserAction && browser.browserAction.onClicked && browser.tabs;
var action = browser.browserAction || (chrome && chrome.action);

var browserExtensionRequirements = browser.tabs && action && action.onClicked;

// If integrated as a browser extension
if (browserExtensionRequirements) {
  console.debug("[extension] Initializing...");

  /**
   * Open Cesium in a new browser's tab
@@ -22,18 +25,19 @@ if (browserExtensionRequirements) {
    browser.tabs.create({
      url: "index.html"
    });


  }

  // Adding browser action
  action.onClicked.addListener(openInTab);

  // FIXME: finish this code
  function checkNotifications() {
    console.debug("[extension] Checking for notifications...");

    browser.browserAction.setBadgeText({
    action.setBadgeText({
      text: '0'
    });
    browser.browserAction.setBadgeBackgroundColor({
    action.setBadgeBackgroundColor({
      color: '#387EF5' // = $positive color - see the SCSS theme
    });

@@ -42,8 +46,8 @@ if (browserExtensionRequirements) {
      checkNotifications();
    }, 60 * 1000 /*1min*/);
  }

  // Adding browser action
  browser.browserAction.onClicked.addListener(openInTab);

  //checkNotifications();
}
else {
  console.error("[extension] Cannot init extension: missing some API requirements (action or tabs");
}
Original line number Diff line number Diff line
{
  "name": "Cesium",
  "short_name": "Cesium",
  "version": "1.6.9",
  "description": "Manage your Duniter Wallet on a libre currency, like Ğ1",
  "version": "1.7.15.1",
  "description": "Cesium Wallet for Ğ1 libre currency",
  "background": {
    "scripts": ["background.js"]
  },
@@ -13,14 +13,28 @@
      "32": "img/logo_32px.png",
      "60": "img/logo_60px.png",
      "96": "img/logo_96px.png",
      "128": "img/logo_128px.png"
      "128": "img/logo_128px.png",
      "192": "img/logo.svg"
    }
  },
  "browser_specific_settings": {
    "gecko": {
      "id": "{6f9922f7-a054-4609-94ce-d269993246a5}"
    }
  },
  "icons": {
    "32": "img/logo_32px.png",
    "60": "img/logo_60px.png",
    "96": "img/logo_96px.png",
    "128": "img/logo_128px.png"
    "128": "img/logo_128px.png",
    "192": "img/logo.svg"
  },
  "protocol_handlers": [
    {
      "protocol": "web+june",
      "name": "web Ğ1",
      "uriTemplate": "index.html#/app/home?uri=%s"
    }
  ],
  "manifest_version": 2
}
Original line number Diff line number Diff line
@@ -15,11 +15,16 @@ fi

cd ${PROJECT_DIR}

if [[ ! -d "${ANDROID_SDK_CLI_ROOT}/bin" ]]; then
  echo "Failed to find the Android SDK CLI. Please run first:  \`scripts/install-android-sdk-tools.sh\`"
  exit 1
fi

# Run the build
echo "Cleaning previous android APK files..."
rm -rf ${ANDROID_OUTPUT_APK_DEBUG}/*.apk
rm -rf ${ANDROID_OUTPUT_APK_RELEASE}/*.apk
rm -f ${ANDROID_OUTPUT_APK_DEBUG}/*.apk
rm -f ${ANDROID_OUTPUT_APK_RELEASE}/*.apk*

echo "Running cordova build android..."
ionic cordova build android --warning-mode=none --color $*
#ionic cordova build android --warning-mode=none --color --verbose
ionic cordova build android --warning-mode=none --color $* -- -- --packageType=apk
#ionic cordova build android --warning-mode=none --color --verbose -- -- --packageType=apk --stacktrace --debug
Original line number Diff line number Diff line
#!/bin/sh

# Get to the root project
if [[ "_" == "_${PROJECT_DIR}" ]]; then
  SCRIPT_DIR=$(dirname "$(readlink "$BASH_SOURCE" || echo "$BASH_SOURCE")")
  PROJECT_DIR=$(cd "${SCRIPT_DIR}/.." && pwd -P)
  export PROJECT_DIR

fi;

# Preparing environment
. "${PROJECT_DIR}/scripts/env-global.sh"

BUILD_TOOLS_DIR="${ANDROID_SDK_ROOT}/build-tools/${ANDROID_SDK_VERSION}/"

if test -z "${CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL}"; then
  echo "ERROR: Missing Gradle distribution URL - please export env variable 'CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'"
fi

echo "Preparing Android environment:"
echo " - using Android SDK: ${ANDROID_SDK_ROOT}"
echo " - using Android SDK tools: ${ANDROID_SDK_TOOLS_ROOT}"
echo " - using Gradle: ${GRADLE_HOME}"
echo " - using Java: ${JAVA_HOME}"
echo " - project dir: ${PROJECT_DIR}"
echo "--- Preparing Android environment:"
echo "        Root: ${PROJECT_DIR}"
echo "      NodeJS: ${NODE_VERSION} with options: ${NODE_OPTIONS}"
echo " Android SDK: ${ANDROID_SDK_ROOT}"
echo " Android CLI: ${ANDROID_SDK_CLI_ROOT}"
echo " Build Tools: ${ANDROID_BUILD_TOOLS_ROOT}"
echo "      Gradle: ${GRADLE_HOME} with options: ${GRADLE_OPTS}"
echo "        Java: ${JAVA_HOME}"

# Make sure javac exists
JAVAC_PATH=$(which javac)
@@ -28,18 +33,20 @@ if test -z "${JAVAC_PATH}"; then
fi

# Prepare Android SDK tools
if ! test -d "${ANDROID_SDK_TOOLS_ROOT}"; then
  cd "${PROJECT_DIR}/scripts"
  ./install-android-sdk-tools.sh
if ! test -d "${ANDROID_SDK_CLI_ROOT}"; then
  . ${PROJECT_DIR}/scripts/install-android-sdk-tools.sh
  if test $? -ne 0; then
    echo "ERROR: Unable to install Android SDK Tools"
    echo "ERROR: Unable to install Android SDK Tools & CLI"
  fi
else
  # Add SDK CLI to path
  export PATH=${ANDROID_SDK_CLI_ROOT}/bin:$PATH
fi

# Install Gradle
if test -z "$(which gradle)" && ! test -d "${GRADLE_HOME}"; then
  cd "${PROJECT_DIR}/scripts"
  echo "Installing gradle...  ${GRADLE_HOME}"
  echo "--- Installing gradle...  ${GRADLE_HOME}"
  test -e "gradle-${GRADLE_VERSION}-all.zip" || wget -kL ${CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL}
  GRADLE_PARENT=$(dirname $GRADLE_HOME)
  test -e "${GRADLE_PARENT}" || mkdir -p ${GRADLE_PARENT}
@@ -55,10 +62,9 @@ if test -z "$(which gradle)" && ! test -d "${GRADLE_HOME}"; then
  fi
fi


# Prepare Android platform
if ! test -d "${PROJECT_DIR}/platforms/android"; then
  echo "Adding Cordova Android platform..."
  echo "--- Adding Cordova Android platform..."
  cd "${PROJECT_DIR}"
  ionic cordova prepare android --color --verbose
  if test $? -ne 0; then
@@ -69,6 +75,7 @@ fi
# Copy local files
ANDROID_OVERWRITE_DIR=${PROJECT_DIR}/.local/android
if test -d "${ANDROID_OVERWRITE_DIR}"; then
  echo ""
  echo "Copying files from directory '${ANDROID_OVERWRITE_DIR}' into '${PROJECT_DIR}/platforms/android'..."
  cp -rf ${ANDROID_OVERWRITE_DIR}/* ${PROJECT_DIR}/platforms/android
  if test $? -ne 0; then
@@ -78,6 +85,18 @@ else
  echo "No directory '${ANDROID_OVERWRITE_DIR}' not found. Please create it, with a file 'release-signing.properties' for release signing"
fi

export PATH=${GRADLE_HOME}/bin:${PATH}
echo
echo "--- Checking Android requirements..."
cordova requirements android --verbose
if test $? -ne 0; then
  echo "ERROR: Check Cordova requirements failed"
fi

# Add Gradle to path
PATH=${GRADLE_HOME}/bin:${PATH}

# Export useful variables
export PATH \
  BUILD_TOOLS_DIR

echo "Android environment is ready!"
echo "--- Android environment is ready!"
Original line number Diff line number Diff line
@@ -20,30 +20,38 @@ REPO="duniter/cesium"
REPO_API_URL="https://api.github.com/repos/${REPO}"
REPO_PUBLIC_URL="https://github.com/${REPO}"

NODEJS_VERSION=12

ANDROID_NDK_VERSION=r19c
ANDROID_SDK_VERSION=r29.0.2
ANDROID_SDK_TOOLS_VERSION=4333796
ANDROID_SDK_ROOT=/usr/lib/android-sdk
ANDROID_ALTERNATIVE_SDK_ROOT="${HOME}/Android/Sdk"
ANDROID_SDK_TOOLS_ROOT=${ANDROID_SDK_ROOT}/build-tools
ANDROID_OUTPUT_APK=${PROJECT_DIR}/platforms/android/app/build/outputs/apk
NODE_VERSION=16
#NODE_OPTIONS=--max-old-space-size=4096
IONIC_CLI_VERSION=6.20.9

ANDROID_NDK_VERSION=21.0.6113669 # Should be compatible with 'cordova-sqlite-storage' plugin
ANDROID_SDK_VERSION=35.0.0
ANDROID_SDK_CLI_VERSION=8512546 # See https://developer.android.com/studio#command-tools
ANDROID_SDK_ROOT="${HOME}/Android/Sdk"
ANDROID_ALTERNATIVE_SDK_ROOT=/usr/lib/android-sdk
ANDROID_SDK_CLI_ROOT=${ANDROID_SDK_ROOT}/cmdline-tools/${ANDROID_SDK_CLI_VERSION}
ANDROID_BUILD_TOOLS_ROOT="${ANDROID_SDK_ROOT}/build-tools/${ANDROID_SDK_VERSION}"
ANDROID_OUTPUT_APK_PREFIX=app
ANDROID_OUTPUT_APK=${PROJECT_DIR}/platforms/android/${ANDROID_OUTPUT_APK_PREFIX}/build/outputs/apk
ANDROID_OUTPUT_APK_DEBUG=${ANDROID_OUTPUT_APK}/debug
ANDROID_OUTPUT_APK_RELEASE=${ANDROID_OUTPUT_APK}/release
ANDROID_OUTPUT_MIN_SDK_VERSION=22 # Used by release-android-sign.sh
ANDROID_OUTPUT_MAX_SDK_VERSION=34 # Used by release-android-sign.sh

DIST_WEB=${PROJECT_DIR}/dist/web/build
DIST_ANDROID=${PROJECT_DIR}/dist/android
DIST_ANDROID=${PROJECT_DIR}/dist/android/build # Where APK are stored
SOURCES_ANDROID=${PROJECT_DIR}/dist/android/sources # Where git cesium-android is checkout

# Addons Mozilla Web extension ID
WEB_EXT_ID="{6f9922f7-a054-4609-94ce-d269993246a5}"
WEB_EXT_ID=${WEB_EXT_ID:-"{6f9922f7-a054-4609-94ce-d269993246a5}"}

# /!\ WARN can be define in your <project>/.local/env.sh file
#JAVA_HOME=

GRADLE_VERSION=6.5.1
GRADLE_VERSION=8.7
GRADLE_HOME=${HOME}/.gradle/${GRADLE_VERSION}
CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-all.zip
GRADLE_OPTS=-Dorg.gradle.jvmargs=-Xmx512m

# Override with a local file, if any
if test -f "${PROJECT_DIR}/.local/env.sh"; then
@@ -54,7 +62,7 @@ else
fi

# Checking Java installed
if test -z "${JAVA_HOME}"; then
if test -d "${JAVA_HOME}"; then
  JAVA_CMD=`which java`
  if test -z "${JAVA_CMD}"; then
    echo "ERROR: No Java installed. Please install java, or set env variable JAVA_HOME "
@@ -64,12 +72,13 @@ if test -z "${JAVA_HOME}"; then
  # Check the Java version
  JAVA_VERSION=$(java -version 2>&1 | egrep "(java|openjdk) version" | awk '{print $3}' | tr -d \")
  if test $? -ne 0 || test -z "${JAVA_VERSION}"; then
    echo "No Java JRE 1.8 found in machine. This is required for Android artifacts."
    echo "No Java JDK 17 found in machine. This is required for Android artifacts."
  else
    JAVA_MAJOR_VERSION=$(echo ${JAVA_VERSION} | awk '{split($0, array, ".")} END{print array[1]}')
    JAVA_MINOR_VERSION=$(echo ${JAVA_VERSION} | awk '{split($0, array, ".")} END{print array[2]}')
    if ! test "${JAVA_MAJOR_VERSION}" == "1" || ! test "${JAVA_MINOR_VERSION}" == "8"; then
      echo "ERROR: Require a Java JRE in version 1.8, but found ${JAVA_VERSION}. You can override your default JAVA_HOME in '.local/env.sh'."
    if test ${JAVA_MAJOR_VERSION} -ne 17; then
      echo "ERROR: Require a Java JDK in version 17.0, but found ${JAVA_MAJOR_VERSION}.${JAVA_MINOR_VERSION} - You can override your default JAVA_HOME in '.local/env.sh'."
      #exit 1
    fi
  fi
fi
@@ -83,18 +92,18 @@ if test -z "${ANDROID_SDK_ROOT}" || ! test -d "${ANDROID_SDK_ROOT}"; then
  fi
fi


# Add Java, Android SDK tools to path
PATH=${ANDROID_SDK_TOOLS_ROOT}/bin:${GRADLE_HOME}/bin:${JAVA_HOME}/bin$:$PATH
PATH=${ANDROID_SDK_CLI_ROOT}/bin:${GRADLE_HOME}/bin:${JAVA_HOME}/bin$:$PATH

# Export useful variables
export PATH \
  PROJECT_DIR \
  JAVA_HOME \
  ANDROID_SDK_ROOT \
  ANDROID_SDK_TOOLS_ROOT \
  ANDROID_SDK_CLI_ROOT \
  CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL


# Node JS
export NVM_DIR="$HOME/.nvm"
if test -d "${NVM_DIR}"; then
@@ -103,26 +112,32 @@ if test -d "${NVM_DIR}"; then
    . "${NVM_DIR}/nvm.sh"

    # Switch to expected version
    nvm use ${NODEJS_VERSION}
    nvm use ${NODE_VERSION}

    # Or install it
    if test $? -ne 0; then
        nvm install ${NODEJS_VERSION}
        nvm install ${NODE_VERSION}
    fi
else
    echo "nvm (Node version manager) not found (directory ${NVM_DIR} not found). Please install, and retry"
fi

# Checking if some global dependencies are missing
GLOBAL_TOOLS="yarn gulp ionic cordova web-ext cordova-res native-run"
MISSING_GLOBAL_TOOLS=
for GLOBAL_TOOL in ${GLOBAL_TOOLS}
do
  GLOBAL_TOOL_PATH=$(which ${GLOBAL_TOOL})
  if test -z "${GLOBAL_TOOL_PATH}"; then
    echo "- Missing global dependency: ${GLOBAL_TOOL}"
    MISSING_GLOBAL_TOOLS="${GLOBAL_TOOL} ${MISSING_GLOBAL_TOOLS}"
  fi
done

# Install global dependencies
YARN_PATH=`which yarn`
IONIC_PATH=`which ionic`
CORDOVA_PATH=`which cordova`
CORDOVA_RES_PATH=`which cordova-res`
NATIVE_RUN_PATH=`which native-run`
WEB_EXT_PATH=`which web-ext`
if test -z "${YARN_PATH}" || test -z "${IONIC_PATH}" || test -z "${CORDOVA_PATH}" || test -z "${CORDOVA_RES_PATH}" || test -z "${NATIVE_RUN_PATH}" || test -z "${WEB_EXT_PATH}"; then
if ! test -z "${MISSING_GLOBAL_TOOLS}"; then
  echo "Installing global dependencies..."
  npm install -g yarn cordova cordova-res @ionic/cli web-ext native-run
  npm install -g yarn gulp cordova @ionic/cli@$IONIC_CLI_VERSION web-ext cordova-res native-run
  if ! test $? == 0; then
    echo "ERROR: Unable to install global dependencies"
    #exit 1
@@ -134,26 +149,44 @@ fi

# Install project dependencies
if ! test -d "${PROJECT_DIR}/node_modules"; then
    echo "Installing project dependencies..."
    cd "${PROJECT_DIR}"
    echo "--- Installing project dependencies..."
    cd ${PROJECT_DIR}
    yarn install
fi

# Install project submodules
if ! test -d "${PROJECT_DIR}/platforms/android" || ! test -d "${PROJECT_DIR}/dist/desktop"; then
  #echo "Installing project submodules..."
  #cd "${PROJECT_DIR}"
  #git submodule init && git submodule sync && git submodule update --remote --merge
# Install platform Android
if ! test -d "${PROJECT_DIR}/platforms/android"; then
  echo "-- Installing platform Android..."
  cd ${PROJECT_DIR}
  ionic cordova platform add android
  if ! test $? == 0; then
    echo "ERROR: Unable to install Android platform. Will not be able to build Android artifacts!"
    #exit 1
  fi
fi

if ! test -d "${PROJECT_DIR}/dist/desktop"; then
  echo "-- Checkout submodules (dist/desktop) ..."
  cd "${PROJECT_DIR}"
  git submodule init && git submodule sync && git submodule update --remote --merge
  if ! test $? == 0; then
    echo "ERROR: Unable to sync git submodule. Will not be able to build android and desktop artifacts!"
    echo "ERROR: Unable to sync git submodule. Will not be able to build desktop artifacts!"
    #exit 1
  fi
fi


export PROJECT_DIR PROJECT_NAME REPO REPO_API_URL REPO_PUBLIC_URL NODEJS_VERSION \
  ANDROID_NDK_VERSION ANDROID_SDK_VERSION ANDROID_SDK_TOOLS_VERSION ANDROID_SDK_ROOT ANDROID_ALTERNATIVE_SDK_ROOT \
  ANDROID_SDK_TOOLS_ROOT ANDROID_OUTPUT_APK ANDROID_OUTPUT_APK_DEBUG ANDROID_OUTPUT_APK_RELEASE DIST_WEB \
  DIST_ANDROID WEB_EXT_ID
export PATH \
  PROJECT_DIR PROJECT_NAME \
  REPO REPO_API_URL REPO_PUBLIC_URL \
  NODE_VERSION \
  JAVA_HOME \
  ANDROID_NDK_VERSION ANDROID_SDK_VERSION ANDROID_SDK_CLI_VERSION \
  ANDROID_SDK_ROOT ANDROID_SDK_ROOT ANDROID_ALTERNATIVE_SDK_ROOT ANDROID_SDK_CLI_ROOT \
  ANDROID_OUTPUT_APK ANDROID_OUTPUT_APK_DEBUG ANDROID_OUTPUT_APK_RELEASE \
  CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL \
  GRADLE_HOME GRADLE_OPTS \
  DIST_WEB DIST_ANDROID \
  WEB_EXT_ID

echo "Project environment is ready!"
Original line number Diff line number Diff line
#!/bin/bash
#!/bin/bash -e

# Load global variables
. "$(dirname $0)/env-global.sh"
@@ -8,28 +8,34 @@ if [[ "_" == "_${ANDROID_SDK_ROOT}" ]]; then
  echo "Please set env variable ANDROID_SDK_ROOT"
  exit 1
fi
if [[ "_" == "_${ANDROID_SDK_TOOLS_ROOT}" ]]; then
  echo "Please set env variable ANDROID_SDK_TOOLS_ROOT"
if [[ "_" == "_${ANDROID_SDK_CLI_ROOT}" ]]; then
  echo "Please set env variable ANDROID_SDK_CLI_ROOT"
  exit 1
fi

if [[ ! -d "${ANDROID_SDK_TOOLS_ROOT}/bin" ]]; then
  echo "Installing Android SDK tools... ${ANDROID_SDK_TOOLS_ROOT}"
  test -e "sdk-tools-linux-${ANDROID_SDK_TOOLS_VERSION}.zip" || wget -kL https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS_VERSION}.zip
  # Get parent folder
  ANDROID_SDK_TOOLS_PARENT=$(dirname $ANDROID_SDK_ROOT)
  test -e "${ANDROID_SDK_TOOLS_PARENT}" || mkdir -p "${ANDROID_SDK_TOOLS_PARENT}"
  test -e "${ANDROID_SDK_TOOLS_ROOT}" || unzip -qq sdk-tools-linux-${ANDROID_SDK_TOOLS_VERSION}.zip -d "${ANDROID_SDK_TOOLS_PARENT}"
  test -e "${ANDROID_SDK_TOOLS_ROOT}" && rm "sdk-tools-linux-${ANDROID_SDK_TOOLS_VERSION}.zip"
if [[ ! -d "${ANDROID_SDK_CLI_ROOT}/bin" ]]; then
  echo "-------------------------------------------"
  echo "Installing Android SDK CLI... ${ANDROID_SDK_CLI_ROOT}"
  mkdir -vp "${ANDROID_SDK_CLI_ROOT}"
  ANDROID_SDK_CLI_FILE="commandlinetools-linux-${ANDROID_SDK_CLI_VERSION}_latest.zip"
  test -e "${ANDROID_SDK_CLI_FILE}" || wget -kL https://dl.google.com/android/repository/${ANDROID_SDK_CLI_FILE}
  test -e "${ANDROID_SDK_CLI_ROOT}" || sudo mkdir -p "${ANDROID_SDK_CLI_ROOT}"
  test -e "/tmp/cmdline-tools" && sudo rm -rf /tmp/cmdline-tools
  test -e "${ANDROID_SDK_CLI_ROOT}" && sudo unzip -qq ${ANDROID_SDK_CLI_FILE} -d /tmp
  test -e "/tmp/cmdline-tools" && sudo mv /tmp/cmdline-tools/* "${ANDROID_SDK_CLI_ROOT}"
  test -e "${ANDROID_SDK_CLI_FILE}" && sudo rm "${ANDROID_SDK_CLI_FILE}"
fi

export PATH=${ANDROID_SDK_TOOLS_ROOT}/bin:$PATH
if [[ ! -d "${ANDROID_SDK_CLI_ROOT}/bin" ]]; then
  echo "Failed to install Android SDK CLI. If you are not root, try with \`sudo -E ./install-android-sdk-tools.sh\`"
  exit 1
fi

mkdir -p ${ANDROID_SDK_ROOT}/licenses
echo 8933bad161af4178b1185d1a37fbf41ea5269c55 > ${ANDROID_SDK_ROOT}/licenses/android-sdk-license
echo 601085b94cd77f0b54ff86406957099ebe79c4d6 > ${ANDROID_SDK_ROOT}/licenses/android-googletv-license
echo 33b6a2b64607f11b759f320ef9dff4ae5c47d97a > ${ANDROID_SDK_ROOT}/licenses/google-gdk-license
yes | sdkmanager --licenses
yes | sdkmanager --licenses "--sdk_root=${ANDROID_SDK_ROOT}"

mkdir -p ~/.android
touch ~/.android/repositories.cfg
@@ -37,21 +43,30 @@ touch ~/.android/repositories.cfg
echo y | sdkmanager "platform-tools" "--sdk_root=${ANDROID_SDK_ROOT}" | tee sdkmanager.log
echo y | sdkmanager "extras;android;m2repository" "--sdk_root=${ANDROID_SDK_ROOT}" | tee -a sdkmanager.log
echo y | sdkmanager "extras;google;m2repository" "--sdk_root=${ANDROID_SDK_ROOT}" | tee -a sdkmanager.log
echo y | sdkmanager "cmdline-tools;latest" "--sdk_root=${ANDROID_SDK_ROOT}" | tee sdkmanager.log

# Install build tools
echo y | sdkmanager "build-tools;23.0.2" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log
echo y | sdkmanager "build-tools;23.0.3" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log
echo y | sdkmanager "build-tools;25.0.2" --sdk_root=${ANDROID_SDK_ROOT}  | tee -a sdkmanager.log
echo y | sdkmanager "build-tools;27.0.3" --sdk_root=${ANDROID_SDK_ROOT}  | tee -a sdkmanager.log
echo y | sdkmanager "build-tools;28.0.3" --sdk_root=${ANDROID_SDK_ROOT}  | tee -a sdkmanager.log
echo y | sdkmanager "build-tools;29.0.2" --sdk_root=${ANDROID_SDK_ROOT}  | tee -a sdkmanager.log
echo ""
echo "-------------------------------------------"
echo "--- Installing Android build-tools ${ANDROID_SDK_VERSION}..."
echo y | sdkmanager "build-tools;${ANDROID_SDK_VERSION}" --sdk_root=${ANDROID_SDK_ROOT}  | tee -a sdkmanager.log
[[ $? -ne 0 ]] && exit 1

# Install platforms
echo y | sdkmanager "platforms;android-16" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log
echo y | sdkmanager "platforms;android-21" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log
echo y | sdkmanager "platforms;android-23" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log
echo y | sdkmanager "platforms;android-24" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log
echo y | sdkmanager "platforms;android-25" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log
echo y | sdkmanager "platforms;android-27" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log
echo y | sdkmanager "platforms;android-28" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log
echo y | sdkmanager "platforms;android-29" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log
TARGET_VERSIONS="22 23 24 25 26 27 28 29 30 31 32 33 34 35"
for TARGET_VERSION in $TARGET_VERSIONS
do
  echo "-------------------------------------------"
  echo "--- Installing Android target ${TARGET_VERSION}..."
  echo y | sdkmanager "platforms;android-${TARGET_VERSION}" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log
  [[ $? -ne 0 ]] && exit 1
done

# Install NDK
echo "-------------------------------------------"
echo "--- Installing Android NDK..."
echo y | sdkmanager "ndk;22.0.7026061" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log
#echo y | sdkmanager "ndk;25.2.9519653" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log
echo y | sdkmanager "ndk;${ANDROID_NDK_VERSION}" --sdk_root=${ANDROID_SDK_ROOT} | tee -a sdkmanager.log

echo "--- Installing Android [OK]"
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ async function lintFolder(dir) {

function lintFile(file) {
  return new Promise((resolve, reject) => {
    log(colors.grey('Processing file ./' + file + '...'));
    log(colors.grey('Processing file ' + file + '...'));
    fs.readFile(file, (err, data) => {
      if(err) {
        log(colors.red('Error: ' + err));
+17 −0
Original line number Diff line number Diff line
## Chat GPT prompt for translations

I need translations for the following messages in a web application, in these languages/locales: en, en-GB, de-DE, eo-EO, es-CT, es-ES, it-IT, nl-NL, pt-PT. Please follow these constraints: maintain the input JSON format, indentation, and message keys; preserve HTML tags and case; and keep proper nouns untranslated (e.g., "Duniter" and "Cesium"). Here is the source message in French:
```json
"ORIGINAL_KEY_UNCHANGED": "<your_translation>"
```

Please provide the translations for each language/locale in this format:

- <language_code> (e.g., en, en-GB, ...):
```json
{
"ORIGINAL_KEY_UNCHANGED": "<your_translation>"
}
```

If you have any questions before starting, please ask for clarifications to avoid mistakes.
 No newline at end of file
Original line number Diff line number Diff line
@@ -7,54 +7,75 @@ if [[ "_" == "_${PROJECT_DIR}" ]]; then
  export PROJECT_DIR
fi;

# Default env (can be override in file <PROJECT>/.local/env.sh)
# Default env variables (can be override in '.local/env.sh' file)
KEYSTORE_FILE=${PROJECT_DIR}/.local/android/Cesium.keystore
KEY_ALIAS=Cesium
KEYSTORE_PWD=
APK_RELEASE_DIR=${PROJECT_DIR}/platforms/android/app/build/outputs/apk/release
APK_UNSIGNED_FILE=${APK_RELEASE_DIR}/app-release-unsigned.apk
APK_SIGNED_FILE=${APK_RELEASE_DIR}/app-release.apk


# Preparing Android environment
. ${PROJECT_DIR}/scripts/env-android.sh
[[ $? -ne 0 ]] && exit 1

APK_SIGNED_FILE=${APK_SIGNED_FILE:-"${ANDROID_OUTPUT_APK_RELEASE}/${ANDROID_OUTPUT_APK_PREFIX}-release-signed.apk"}
APK_UNSIGNED_FILE=${ANDROID_OUTPUT_APK_RELEASE}/${ANDROID_OUTPUT_APK_PREFIX}-release-unsigned.apk
APK_UNSIGNED_FILE_ALTERNATIVE=${ANDROID_OUTPUT_APK_RELEASE}/${ANDROID_OUTPUT_APK_PREFIX}-release.apk

cd ${PROJECT_DIR}

# Sign files
echo "Signing APK file..."
if [[ ! -f "${APK_UNSIGNED_FILE}" ]]; then
  echo "APK file not found: ${APK_UNSIGNED_FILE}"

# Checking files
if [[ ! -f "${KEYSTORE_FILE}" ]]; then
  echo "ERROR: Keystore file not found: ${KEYSTORE_FILE}"
  exit 1
fi
if [[ ! -f "${KEYSTORE_FILE}" ]]; then
  echo "Keystore file not found: ${KEYSTORE_FILE}"
if [[ ! -f "${APK_UNSIGNED_FILE}" ]]; then
  # Check in an alternative path (e.g. Android default signed file)
  if [[ ! -f "${APK_UNSIGNED_FILE_ALTERNATIVE}" ]]; then
    echo "ERROR: Unsigned APK file not found: ${APK_UNSIGNED_FILE}"
    exit 1
  fi
  APK_UNSIGNED_FILE=${APK_UNSIGNED_FILE_ALTERNATIVE}
fi

echo "--- Signing Android APK..."
echo ""

# Remove previous version
# Remove previous version (only if unsigned exists)
if [[ -f "${APK_SIGNED_FILE}" ]]; then
  echo "Delete previous signed APK file: ${APK_SIGNED_FILE}"
  rm -f ${APK_SIGNED_FILE}
  rm -f ${APK_SIGNED_FILE}*
fi

echo "Executing jarsigner..."
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ${KEYSTORE_FILE} ${APK_UNSIGNED_FILE} Cesium
[[ $? -ne 0 ]] && exit 1
echo "Executing jarsigner [OK]"
#echo "Executing jarsigner..."
#jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -storepass ${KEYSTORE_PWD} -keystore ${KEYSTORE_FILE} ${APK_UNSIGNED_FILE} ${KEY_ALIAS}
#[[ $? -ne 0 ]] && exit 1
#echo "Executing jarsigner [OK]"

BUILD_TOOLS_DIR="${ANDROID_SDK_ROOT}/build-tools/28.*/"
cd ${BUILD_TOOLS_DIR}
cd ${ANDROID_BUILD_TOOLS_ROOT}
[[ $? -ne 0 ]] && exit 1

echo "Executing zipalign..."
./zipalign -v 4 ${APK_UNSIGNED_FILE} ${APK_SIGNED_FILE}
[[ $? -ne 0 ]] && exit 1
echo "Executing zipalign [OK]"
echo ""

echo "Executing apksigner..."
./apksigner sign --ks ${KEYSTORE_FILE} --ks-pass "pass:${KEYSTORE_PWD}" --ks-key-alias ${KEY_ALIAS} \
  --min-sdk-version ${ANDROID_OUTPUT_MIN_SDK_VERSION} \
  --max-sdk-version ${ANDROID_OUTPUT_MAX_SDK_VERSION} \
  ${APK_SIGNED_FILE}

[[ $? -ne 0 ]] && exit 1
echo "Executing apksigner [OK]"
echo ""

echo "Verify APK signature..."
./apksigner verify ${APK_SIGNED_FILE}
./apksigner verify --verbose --print-certs ${APK_SIGNED_FILE}
[[ $? -ne 0 ]] && exit 1
echo "Verify APK signature [OK]"
echo ""

echo "Successfully generated signed APK at: ${APK_SIGNED_FILE}"
export APK_SIGNED_FILE
echo "--- Successfully generated signed APK at: ${APK_SIGNED_FILE}"
exit 0
Original line number Diff line number Diff line
@@ -7,22 +7,58 @@ if [[ "_" == "_${PROJECT_DIR}" ]]; then
  export PROJECT_DIR
fi;


### Get version to release
cd ${PROJECT_DIR}
current=$(grep -m1 -P "version\": \"\d+.\d+.\d+(-\w+[-0-9]*)?\"" package.json | grep -oP "\d+.\d+.\d+(-\w+[-0-9]*)?")
if [[ "_$current" == "_" ]]; then
  echo " - Make sure the file 'package.json' exists and is readable."
  echo " - Check version format is: x.y.z (x and y should be an integer)"
  exit 1
fi

# Preparing the environment
source ${PROJECT_DIR}/scripts/env-global.sh
[[ $? -ne 0 ]] && exit 1

# Commit android project
cd ${PROJECT_DIR}/platforms/android || exit 1
git reset HEAD
# Make sure to checkout the source project
if ! test -d "${SOURCES_ANDROID}"; then
  echo "-- Checkout submodules (dist/android/sources) ..."
  cd "${PROJECT_DIR}"
  git submodule init && git submodule sync && git submodule update --remote --merge
  if ! test $? == 0; then
    echo "ERROR: Unable to sync git submodule. Will not be able commit android sources !"
    #exit 1
  else
    echo "-- Checkout submodules (dist/android/sources) [OK]"
  fi
fi

if test -d "${SOURCES_ANDROID}"; then

  # Revert changes in the Android sources project
  cd ${SOURCES_ANDROID} || exit 1
  git fetch && git reset --hard --merge HEAD

  # Update sources, from platforms/android
  echo "--- Copy Android sources from 'platforms/android' to '${SOURCES_ANDROID}' ..."
  rsync -rlptgocq --exclude=.* --exclude=build --exclude=release-signing.* --exclude=*.keystore --delete --force "${PROJECT_DIR}/platforms/android/" "${SOURCES_ANDROID}/"

  echo "--- Copy Android sources [OK] ..."
  echo ""

  echo "--- Git push Android sources, and tag as 'v$current'..."
  cd ${SOURCES_ANDROID} || exit 1
  git add -A
git commit -m "v$1"
git tag -f -a "v$1" -m "Release v$1"
  git commit -a -m "v$current"
  git tag -f -a "v$current" -m "Release v$current"
  # Push the tag
git push -f origin "v$1"
  git push -f origin "v$current"
  # Push the master branch
  git push -f origin
  if [[ $? -ne 0 ]]; then
  echo "ERROR: cannot push platform/android project ! Continue anyway..."
    echo "ERROR: cannot push Android sources at '${SOURCES_ANDROID}' ! Continue anyway..."
  else
    echo "--- Git push Android sources, and tag [OK]"
  fi
fi
Original line number Diff line number Diff line
@@ -7,58 +7,57 @@ if [[ "_" == "_${PROJECT_DIR}" ]]; then
  export PROJECT_DIR
fi;

# Preparing Android environment
source ${PROJECT_DIR}/scripts/env-android.sh
[[ $? -ne 0 ]] && exit 1

cd ${PROJECT_DIR}

# Run the build
echo "Running cordova build..."
ionic cordova build android --warning-mode=none --color --prod --release
[[ $? -ne 0 ]] && exit 1

# Signature
# Default env variables (can be override in '.local/env.sh' file)
KEYSTORE_FILE=${PROJECT_DIR}/.local/Cesium.keystore
KEY_ALIAS=Cesium
KEY_PWD=
APK_DIR=${PROJECT_DIR}/platforms/android/build/outputs/apk/release
APK_UNSIGNED_FILE=${APK_DIR}/android-release.apk
BUILD_TOOLS_DIR="${ANDROID_SDK_ROOT}/build-tools/28.*/"

if [[ ! -f "${APK_UNSIGNED_FILE}" ]]; then
  echo "APK file not found at: ${APK_UNSIGNED_FILE}"
  exit 1
fi
# Preparing Android environment
cd ${PROJECT_DIR}
source scripts/env-android.sh
[[ $? -ne 0 ]] && exit 1

# Check if signed
cd ${BUILD_TOOLS_DIR}
./apksigner verify ${APK_UNSIGNED_FILE}
APK_SIGNED_FILE=${ANDROID_OUTPUT_APK_RELEASE}/${ANDROID_OUTPUT_APK_PREFIX}-release-signed.apk
APK_UNSIGNED_FILE=${ANDROID_OUTPUT_APK_RELEASE}/${ANDROID_OUTPUT_APK_PREFIX}-release-unsigned.apk

# Not signed ? Do it !
if [[ $? -ne 0 ]]; then
  echo "It seems that the APK file ${APK_UNSIGNED_FILE} is not signed !"
  if [[ ! -f "${KEYSTORE_FILE}" ]]; then
    echo "ERROR: Unable to sign: no keystore file found at ${KEYSTORE_FILE} !"
    exit 1
  fi
echo "--- Cleaning previous Android APK ..."
rm -f ${ANDROID_OUTPUT_APK_RELEASE}/*.apk*
echo "--- Cleaning previous Android APK [OK]"
echo ""

  echo "Signing APK file ${APK_UNSIGNED_FILE}..."
  APK_SIGNED_FILE=${APK_DIR}/android-release-signed.apk
# Run the build
echo "--- Building Android APK..."
echo ""
yarn run build:android
[[ $? -ne 0 ]] && exit 1

  jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ${KEYSTORE_FILE} ${APK_UNSIGNED_FILE} Cesium
echo "--- Building Android APK [OK]"
echo ""

  BUILD_TOOLS_DIR="${ANDROID_SDK_ROOT}/build-tools/28.*/"
  cd ${BUILD_TOOLS_DIR}
  ./zipalign -v 4 ${APK_UNSIGNED_FILE} ${APK_SIGNED_FILE}
# Sign APK file
cd ${PROJECT_DIR}/scripts
./release-android-sign.sh

  ./apksigner verify ${APK_SIGNED_FILE}
  if [[ $? -ne 0 ]]; then
    echo "Signing failed !"
# Check signed APK exists
if [[ ! -f "${APK_SIGNED_FILE}" ]]; then
  echo "Missing signed APK file at: ${APK_SIGNED_FILE}"
  exit 1
fi

  # Do file replacement
  rm ${APK_UNSIGNED_FILE}
  mv ${APK_SIGNED_FILE} ${APK_UNSIGNED_FILE}
# Get current version
cd ${PROJECT_DIR}
current=$(grep -m 1 -oP "version\": \"\d+.\d+.\d+(-\w+[-0-9]*)?\"" package.json | grep -m 1 -oP "\d+.\d+.\d+(-\w+[-0-9]*)?")
if [[ "_$current" == "_" ]]; then
  echo "Unable to read the current version in 'package.json'. Please check version format is: x.y.z (x and y should be an integer)."
  exit 1;
fi

# Copy signed APK to 'dist/android/build'
echo ""
echo "--- Copying Android APK to '${APK_FINAL_FILE}'..."
APK_BASENAME="${PROJECT_NAME}-v${current}-android.apk"
APK_FINAL_FILE="${DIST_ANDROID}/${APK_BASENAME}"
mkdir -p "${DIST_ANDROID}"
cp -f "${APK_SIGNED_FILE}" "${APK_FINAL_FILE}"
echo "--- Copying Android APK [OK]"
echo ""
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ then
fi

### Get version to release
current=$(grep -P "version\": \"\d+.\d+.\d+(\w*)" package.json | grep -m 1 -oP "\d+.\d+.\d+(\w*)")
current=$(grep -P "version\": \"\d+.\d+.\d+(-\w+[-0-9]*)?\"" package.json | grep -m 1 -oP "\d+.\d+.\d+(-\w+[-0-9]*)?")
if [[ "_$current" == "_" ]]; then
  echo "Unable to read the current version in 'package.json'. Please check version format is: x.y.z (x and y should be an integer)."
  exit 1;
@@ -57,7 +57,8 @@ if [[ "${DESKTOP_ASSETS}" == "linux" ]]; then

  echo "Skipping windows assets, because DESKTOP_ASSETS env was set to 'linux'."
  EXPECTED_ASSETS="${PROJECT_NAME}-desktop-v$current-linux-x64.deb
${PROJECT_NAME}-desktop-v$current-linux-x64.tar.gz"
${PROJECT_NAME}-desktop-v$current-linux-x64.tar.gz
${PROJECT_NAME}-desktop-v$current-linux-x64.AppImage"
fi

# Build desktop assets
Original line number Diff line number Diff line
@@ -9,12 +9,7 @@ fi;

# Preparing Android environment
cd ${PROJECT_DIR}
source ${PROJECT_DIR}/scripts/env-global.sh

XPI_BASENAME=${PROJECT_NAME}-$current-an+fx.xpi
XPI_FILE=${PROJECT_DIR}/dist/web/build/${XPI_BASENAME}
XPI_FINAL_BASENAME=${PROJECT_NAME}-v$current-extension-firefox.xpi
XPI_FINAL_FILE=${PROJECT_DIR}/dist/web/build/${XPI_FINAL_BASENAME}
source scripts/env-global.sh

### Control that the script is run on `dev` branch
branch=$(git rev-parse --abbrev-ref HEAD)
@@ -25,25 +20,37 @@ then
fi

### Get version to release
current=$(grep -P "version\": \"\d+.\d+.\d+(\w*)" package.json | grep -m 1 -oP "\d+.\d+.\d+(\w*)")
current=$(grep -m 1 -oP "version\": \"\d+.\d+.\d+(-\w+[-0-9]*)?\"" package.json | grep -m 1 -oP "\d+.\d+.\d+(-\w+[-0-9]*)?")
if [[ "_$current" == "_" ]]; then
  echo "Unable to read the current version in 'package.json'. Please check version format is: x.y.z (x and y should be an integer)."
  exit 1;
fi
echo "Sending v$current extension for Mozilla..."

XPI_BASENAME=${PROJECT_NAME}-$current-an+fx.xpi
XPI_FILE=${PROJECT_DIR}/dist/web/build/${XPI_BASENAME}
XPI_FINAL_BASENAME=${PROJECT_NAME}-v$current-extension-firefox.xpi
XPI_FINAL_FILE=${PROJECT_DIR}/dist/web/build/${XPI_FINAL_BASENAME}

### Check AMO account
if [[ "_" == "_${AMO_JWT_ISSUER}" || "_" == "_${AMO_JWT_SECRET}" ]]; then
    echo "ERROR: Unable to find Addons Modzilla account: "
    echo "ERROR: Unable to find Addons Mozilla account: "
    echo " - Please add environment variables 'AMO_JWT_ISSUER' or 'AMO_JWT_SECRET', then retry."
    echo " - You can use the file './local/env.sh'."
    exit 1
fi

nvm use 20

webExtVersion=$(web-ext --version)
echo "Web-Ext version: ${webExtVersion}"

### Sign extension
case "$1" in
  pre)
      web-ext sign "--api-key=${AMO_JWT_ISSUER}" "--api-secret=${AMO_JWT_SECRET}" "--source-dir=${PROJECT_DIR}/dist/web/ext" "--artifacts-dir=${PROJECT_DIR}/dist/web/build"  --id=${WEB_EXT_ID} --channel=unlisted
      #echo "web-ext sign \"--api-key=${AMO_JWT_ISSUER}\" \"--api-secret=${AMO_JWT_SECRET}\" \"--source-dir=${PROJECT_DIR}/dist/web/ext\" \"--artifacts-dir=${PROJECT_DIR}/dist/web/build\" --channel=unlisted"
      npx web-ext sign --upload-source-code "--api-key=${AMO_JWT_ISSUER}" "--api-secret=${AMO_JWT_SECRET}" "--source-dir=${PROJECT_DIR}/dist/web/ext" "--artifacts-dir=${PROJECT_DIR}/dist/web/build" --channel=unlisted

      if [[ $? -ne 0 ]]; then
        if [[ -f "${XPI_FILE}" || -f "${XPI_FINAL_FILE}" ]]; then
          echo "WARN: web-ext failed! Continue anyway, because output file exists"
@@ -53,7 +60,8 @@ case "$1" in
      fi
    ;;
  rel)
      web-ext sign "--api-key=${AMO_JWT_ISSUER}" "--api-secret=${AMO_JWT_SECRET}" "--source-dir=${PROJECT_DIR}/dist/web/ext" "--artifacts-dir=${PROJECT_DIR}/dist/web/build"  --id=${WEB_EXT_ID} --channel=listed
      web-ext sign --no-config-discovery --upload-source-code "--api-key=${AMO_JWT_ISSUER}" "--api-secret=${AMO_JWT_SECRET}" "--source-dir=${PROJECT_DIR}/dist/web/ext" "--artifacts-dir=${PROJECT_DIR}/dist/web/build" --channel=listed

      # Comment out, because always failed with message:
      #   "Your add-on has been submitted for review. It passed validation but could not be automatically signed because this is a listed add-on."
      #if [[ $? -ne 0 ]]; then
Original line number Diff line number Diff line
@@ -20,21 +20,25 @@ then
fi

### Get version to release
current=$(grep -P "version\": \"\d+.\d+.\d+(\w*)" package.json | grep -m 1 -oP "\d+.\d+.\d+(\w*)")
current=$(grep -m1 -P "version\": \"\d+.\d+.\d+(-\w+[-0-9]*)?\"" package.json | grep -oP "\d+.\d+.\d+(-\w+[-0-9]*)?")
if [[ "_$current" == "_" ]]; then
  echo "Unable to read the current version in 'package.json'. Please check version format is: x.y.z (x and y should be an integer)."
  exit 1;
  echo " - Make sure the file 'package.json' exists and is readable."
  echo " - Check version format is: x.y.z (x and y should be an integer)"
  exit 1
fi
echo "Sending v$current extension to Github..."

###  get auth token
if [[ "_${GITHUB_TOKEN}" == "_" ]]; then
  # Get it from user config dir
  GITHUB_TOKEN=$(cat ~/.config/${PROJECT_NAME}/.github)
if [[ "_$GITHUB_TOKEN" != "_" ]]; then
    GITHUT_AUTH="Authorization: token $GITHUB_TOKEN"
fi
if [[ "_${GITHUB_TOKEN}" != "_" ]]; then
    GITHUT_AUTH="Authorization: token ${GITHUB_TOKEN}"
else
    echo "ERROR: Unable to find github authentication token file: "
    echo " - You can create such a token at https://github.com/settings/tokens > 'Generate a new token'."
    echo " - Then copy the token and paste it in the file '~/.config/${PROJECT_NAME}/.github' using a valid token."
    echo " - [if CI] Add a pipeline variable named 'GITHUB_TOKEN';"
    echo " - [else] Or copy/paste the token into the file '~/.config/${PROJECT_NAME}/.github'."
    exit 1
fi

@@ -44,20 +48,20 @@ case "$1" in
    result=$(curl -i "$REPO_API_URL/releases/tags/v$current")
    release_url=$(echo "$result" | grep -P "\"url\": \"[^\"]+"  | grep -oP "$REPO_API_URL/releases/\d+")
    if [[ $release_url != "" ]]; then
        echo "Deleting existing release..."
        curl -H 'Authorization: token $GITHUB_TOKEN'  -XDELETE $release_url
        echo "--- Deleting existing release..."
        curl -H ''"$GITHUT_AUTH"''  -XDELETE $release_url
    fi
    exit 0;
  ;;

  pre)
    prerelease="true"
    echo "Creating new pre-release v$current..."
    echo "--- Creating new pre-release v$current..."
    ;;

  rel)
    prerelease="false"
    echo "Creating new release v$current..."
    echo "--- Creating new release v$current..."
    ;;
  *)
    echo "No task given, or wrong arguments"
@@ -79,7 +83,7 @@ fi
result=$(curl -s -H ''"$GITHUT_AUTH"'' "$REPO_API_URL/releases/tags/v$current")
release_url=$(echo "$result" | grep -P "\"url\": \"[^\"]+" | grep -oP "https://[A-Za-z0-9/.-]+/releases/\d+")
if [[ "_$release_url" != "_" ]]; then
  echo "Deleting existing release... $release_url"
  echo "--- Deleting existing release... $release_url"
  result=$(curl -H ''"$GITHUT_AUTH"'' -s -XDELETE $release_url)
  if [[ "_$result" != "_" ]]; then
      error_message=$(echo "$result" | grep -P "\"message\": \"[^\"]+" | grep -oP ": \"[^\"]+\"")
@@ -90,9 +94,14 @@ else
  echo "Release not exists yet on github."
fi

### Create the release
result=$(curl -H ''"$GITHUT_AUTH"'' -s $REPO_API_URL/releases -d '{"tag_name": "v'"$current"'","target_commitish": "master","name": "'"$current"'","body": "'"$description"'","draft": false,"prerelease": '"$prerelease"'}')
#echo "DEBUG - $result"
echo "--- Clean previous SHA256 files..."
rm -rf ${PROJECT_DIR}/dist/**/*.sha256
echo ""

echo "--- Creating new release..."
echo " - tag: v$current"
echo " - description: $description"
result=$(curl -X POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" -H ''"$GITHUT_AUTH"'' -s $REPO_API_URL/releases -d '{"tag_name": "v'"$current"'","target_commitish": "master","name": "'"$current"'","body": "'"$description"'","draft": false,"prerelease": '"$prerelease"'}')
upload_url=$(echo "$result" | grep -P "\"upload_url\": \"[^\"]+"  | grep -oP "https://[A-Za-z0-9/.-]+")
if [[ "_$upload_url" = "_" ]]; then
  echo "Failed to create new release for repo $REPO."
@@ -101,8 +110,8 @@ if [[ "_$upload_url" = "_" ]]; then
  exit 1
fi

### Send files
echo "Uploading artifacts to ${upload_url} ..."
### Sending files
echo "--- Uploading files to ${upload_url} ..."

# Upload web file
WEB_BASENAME="${PROJECT_NAME}-v$current-web.zip"
@@ -111,9 +120,12 @@ if [[ -f "${WEB_FILE}" ]]; then
  result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: application/zip' -T "${WEB_FILE}" "${upload_url}?name=${WEB_BASENAME}")
  browser_download_url=$(echo "$result" | grep -P "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "\"browser_download_url\":[ ]?\"[^\"]+"  | grep -oP "https://[A-Za-z0-9/.-]+")
  WEB_SHA256=$(cd ${DIST_WEB} && sha256sum "${WEB_BASENAME}")
  echo " - ${browser_download_url}  | Checksum: ${WEB_SHA256}"
  echo " - ${browser_download_url}  | SHA256 Checksum: ${WEB_SHA256}"
  echo "${WEB_SHA256}  ${WEB_BASENAME}" > "${WEB_FILE}.sha256"
  result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: text/plain' -T "${WEB_FILE}.sha256" "${upload_url}?name=${WEB_BASENAME}.sha256")
else
  echo " - ERROR: Web artifact (ZIP) not found! Skipping."
  echo " - ERROR: Web release (ZIP) not found! Skipping."
  missing_file=true
fi

# Upload web extension (ZIP) file
@@ -124,8 +136,11 @@ if [[ -f "${WEB_EXT_ZIP_FILE}" ]]; then
  browser_download_url=$(echo "$result" | grep -P "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "\"browser_download_url\":[ ]?\"[^\"]+"  | grep -oP "https://[A-Za-z0-9/.-]+")
  WEB_EXT_ZIP_SHA256=$(cd ${DIST_WEB} && sha256sum "${WEB_EXT_ZIP_BASENAME}")
  echo " - ${browser_download_url}  | Checksum: ${WEB_EXT_ZIP_SHA256}"
  echo "${WEB_EXT_ZIP_SHA256}  ${WEB_EXT_ZIP_BASENAME}" > "${WEB_EXT_ZIP_FILE}.sha256"
  result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: text/plain' -T "${WEB_EXT_ZIP_FILE}.sha256" "${upload_url}?name=${WEB_EXT_ZIP_BASENAME}.sha256")
else
  echo " - ERROR: Web extension artifact (ZIP) not found! Skipping."
  missing_file=true
fi

# Upload web extension (XPI) file
@@ -136,8 +151,27 @@ if [[ -f "${WEB_EXT_XPI_FILE}" ]]; then
  browser_download_url=$(echo "$result" | grep -P "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "\"browser_download_url\":[ ]?\"[^\"]+"  | grep -oP "https://[A-Za-z0-9/.-]+")
  WEB_EXT_XPI_SHA256=$(cd ${DIST_WEB} && sha256sum "${WEB_EXT_XPI_BASENAME}")
  echo " - ${browser_download_url}  | Checksum: ${WEB_EXT_XPI_SHA256}"
  echo "${WEB_EXT_XPI_SHA256}  ${WEB_EXT_XPI_BASENAME}" > "${WEB_EXT_XPI_FILE}.sha256"
  result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: text/plain' -T "${WEB_EXT_XPI_FILE}.sha256" "${upload_url}?name=${WEB_EXT_XPI_BASENAME}.sha256")
else
  echo " - ERROR: Web signed extension artifact (XPI) not found! Skipping."
  missing_file=true
fi


# Upload chrome extension (XPI) file
CHROME_EXT_BASENAME="${PROJECT_NAME}-v$current-extension-chrome.zip"
CHROME_EXT_FILE="${DIST_WEB}/${CHROME_EXT_BASENAME}"
if [[ -f "${CHROME_EXT_FILE}" ]]; then
  result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: application/zip' -T "${CHROME_EXT_FILE}" "${upload_url}?name=${CHROME_EXT_BASENAME}")
  browser_download_url=$(echo "$result" | grep -P "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "\"browser_download_url\":[ ]?\"[^\"]+"  | grep -oP "https://[A-Za-z0-9/.-]+")
  CHROME_EXT_SHA256=$(cd ${DIST_WEB} && sha256sum "${CHROME_EXT_BASENAME}")
  echo " - ${browser_download_url}  | Checksum: ${CHROME_EXT_SHA256}"
  echo "${CHROME_EXT_SHA256}  ${CHROME_EXT_BASENAME}" > "${CHROME_EXT_FILE}.sha256"
  result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: text/plain' -T "${CHROME_EXT_FILE}.sha256" "${upload_url}?name=${CHROME_EXT_BASENAME}.sha256")
else
  echo " - ERROR: Chrome signed extension artifact not found! Skipping."
  missing_file=true
fi

# Upload Android APK file
@@ -146,20 +180,24 @@ APK_FILE="${DIST_ANDROID}/${APK_BASENAME}"
if [[ -f "${APK_FILE}" ]]; then
  result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: application/vnd.android.package-archive' -T "${APK_FILE}" "${upload_url}?name=${APK_BASENAME}")
  browser_download_url=$(echo "$result" | grep -P "\"browser_download_url\":[ ]?\"[^\"]+" | grep -oP "\"browser_download_url\":[ ]?\"[^\"]+"  | grep -oP "https://[A-Za-z0-9/.-]+")
  APK_SHA256=$(cd ${DIST_ANDROID} && sha256sum "${APK_BASENAME}")
  echo " - ${browser_download_url}  | Checksum: ${APK_SHA256}"
  APK_SHA256=$(sha256sum "${APK_FILE}" | sed 's/ /\n/gi' | head -n 1)
  echo " - ${browser_download_url}  | SHA256 Checksum: ${APK_SHA256}"
  echo "${APK_SHA256}  ${APK_BASENAME}" > "${APK_FILE}.sha256"
  result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: text/plain' -T "${APK_FILE}.sha256" "${upload_url}?name=${APK_BASENAME}.sha256")
else
  echo "- ERROR: Android artifact (APK) not found! Skipping."
  echo "- ERROR: Android release (APK) not found! Skipping."
  missing_file=true
fi

# Upload sha256 file (checksum)
SHA_BASENAME=${PROJECT_NAME}-v$current.sha256
SHA_FILE=${PROJECT_DIR}/dist/${SHA_BASENAME}
echo "${WEB_SHA256}" > ${SHA_FILE}
echo "${WEB_EXT_ZIP_SHA256}" >> ${SHA_FILE}
echo "${APK_SHA256}" >> ${SHA_FILE}
echo "${WEB_EXT_XPI_SHA256}" >> ${SHA_FILE}
result=$(curl -s -H ''"$GITHUT_AUTH"'' -H 'Content-Type: text/plain' -T "${SHA_FILE}" "${upload_url}?name=${SHA_BASENAME}")

### Success message
echo "Successfully uploaded files to: ${REPO_PUBLIC_URL}/releases/tag/v${current}"
echo ""
if [[ ${missing_file} == true ]]; then
  echo "-------------------------------------------"
  echo "ERROR: missing some artifacts (see logs)"
  echo " -> Release url: ${REPO_PUBLIC_URL}/releases/tag/${version}"
  exit 1
else
  echo "-------------------------------------------"
  echo "Successfully uploading files !"
  echo " -> Release url: ${REPO_PUBLIC_URL}/releases/tag/${version}"