Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Develop

See merge request papers/airgap/airgap-vault!200
  • Loading branch information
godenzim committed Nov 6, 2020
2 parents 6b5aec1 + c9affd5 commit 32c980c
Show file tree
Hide file tree
Showing 310 changed files with 3,635 additions and 13,648 deletions.
60 changes: 29 additions & 31 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.134.1/containers/typescript-node/.devcontainer/base.Dockerfile
ARG VARIANT="14"
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}

FROM node:12
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# The node image includes a non-root user with sudo access. Use the "remoteUser"
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
# will be updated to match your local UID/GID (when using the dockerFile property).
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=node
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
#
# Verify git and needed tools are installed
&& apt-get -y install git iproute2 procps \
#
# Install zsh
RUN apt-get update \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y zsh \
&& wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true \
#
# Install ionic
&& npm install -g ionic \
# install libraries
&& apt-get install -yyq libappindicator1 libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
# tools
&& apt-get install -yyq gconf-service lsb-release wget xdg-utils \
# and fonts
&& apt-get install -yyq fonts-liberation \
# We install Chrome to get all the OS level dependencies, but Chrome itself
# is not actually used as it's packaged in the node puppeteer library.
# Alternatively, we could could include the entire dep list ourselves
# (https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix)
# but that seems too easy to get out of date.
&& apt-get install -y google-chrome-stable \
&& rm -rf /var/lib/apt/lists/* \
&& wget --quiet https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -O /usr/sbin/wait-for-it.sh \
&& chmod +x /usr/sbin/wait-for-it.sh \
#
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog
# [Optional] Uncomment if you want to install more global node packages
RUN sudo -u node npm install -g @ionic/cli
43 changes: 28 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/javascript-node-12
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.134.1/containers/typescript-node
{
"name": "Node.js 12 - Ionic",
"dockerFile": "Dockerfile",
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"name": "Node.js 14 & TypeScript",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 10, 12, 14
"args": { "VARIANT": "14" }
},
//
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/zsh"
},
// Use 'appPort' to create a container with published ports. If the port isn't working, be sure
// your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost.
//
"appPort": ["8100:8100"],
// Uncomment the next line to run commands after the container is created.
//
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint",
"ms-vscode.vscode-typescript-tslint-plugin",
"angular.ng-template",
"esbenp.prettier-vscode",
"eamodio.gitlens"
]
//
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
//
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Uncomment the next line to have VS Code connect as an existing non-root user in the container.
// On Linux, by default, the container user's UID/GID will be updated to match your local user. See
// https://aka.ms/vscode-remote/containers/non-root for details on adding a non-root user if none exist.
// "remoteUser": "node",
// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": ["dbaeumer.vscode-eslint", "angular.ng-template", "esbenp.prettier-vscode", "ms-vscode.vscode-typescript-tslint-plugin"]
//
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "node"
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ plugins/
plugins/android.json
plugins/ios.json
$RECYCLE.BIN/
*.xcarchive

.DS_Store
Thumbs.db
Expand Down
64 changes: 33 additions & 31 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ variables:
stages:
- build
- test
- native_build
- qa
- native_build

build_ionic:
stage: build
Expand Down Expand Up @@ -41,45 +41,21 @@ build_android:
when: manual
tags:
- docker
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
variables:
LOCAL_ANDROID: 'android-$CI_PIPELINE_ID'
script:
- sed -i -e "s/versionName \"0.0.0\"/versionName \"$VERSION\"/g" android/app/build.gradle
- docker build -f build/android/Dockerfile -t $GOOGLE_TAG_ANDROID_CURRENT --build-arg BUILD_NR="$CI_PIPELINE_ID" --build-arg VERSION="$VERSION" .
- docker run --name $CI_PIPELINE_ID $GOOGLE_TAG_ANDROID_CURRENT echo "container ran."
- docker cp $CI_PIPELINE_ID:/app/android-release-unsigned.apk airgap-vault-release-unsigned-$CI_PIPELINE_ID.apk
- docker cp $CI_PIPELINE_ID:/app/android-debug.apk airgap-vault-debug-$CI_PIPELINE_ID.apk
- docker run --name $LOCAL_ANDROID $GOOGLE_TAG_ANDROID_CURRENT echo "container ran."
- docker cp $LOCAL_ANDROID:/app/android-release-unsigned.apk airgap-vault-release-unsigned-$CI_PIPELINE_ID.apk
- docker cp $LOCAL_ANDROID:/app/android-debug.apk airgap-vault-debug-$CI_PIPELINE_ID.apk
after_script:
- docker rm -f $CI_PIPELINE_ID || true
- docker rm -f $LOCAL_ANDROID || true
artifacts:
paths:
- airgap-vault-release-unsigned-$CI_PIPELINE_ID.apk
- airgap-vault-debug-$CI_PIPELINE_ID.apk

build_ios:
stage: native_build
when: manual
before_script:
- echo "$IOS_BUILD_JSON" > build.json
- echo "$IOS_EXPORT_OPTIONS" > exportOptions.plist
script:
- export DEVELOPER_DIR=$XCODE_PATH
- nvm use v10.13.0
- npm install
- npm run disable-pure-getters
- npm run configure-mangle
- npm run apply-diagnostic-modules # manually remove unused cordova-diagnostic-plugin modules
- ionic build --prod
- npx cap sync ios
- xcodebuild -workspace ios/App/App.xcworkspace -scheme "App" -destination generic/platform=iOS -configuration Release archive -archivePath ios/AirGap\ Vault.xcarchive MARKETING_VERSION=$VERSION CURRENT_PROJECT_VERSION=1.0.$CI_PIPELINE_ID -allowProvisioningUpdates
- xcodebuild -exportArchive -archivePath ios/AirGap\ Vault.xcarchive -exportOptionsPlist exportOptions.plist -exportPath ios/ -allowProvisioningUpdates
- xcrun altool --upload-app -f ios/App.ipa -u $IOS_USERNAME -p $IOS_PASSWORD
artifacts:
paths:
- ios/App.ipa
tags:
- ios

qa:
stage: qa
script:
Expand All @@ -103,3 +79,29 @@ qa:
- docker rm -f qa-$CI_PIPELINE_ID || true
tags:
- docker

build_ios:
stage: native_build
when: manual
before_script:
- echo "$IOS_BUILD_JSON" > build.json
- echo "$IOS_EXPORT_OPTIONS" > exportOptions.plist
script:
- export DEVELOPER_DIR=$XCODE_PATH
- nvm use 14
- npm install
- npm run disable-pure-getters
- npm run configure-mangle
- npm run apply-diagnostic-modules # manually remove unused cordova-diagnostic-plugin modules
- npx ionic info
- npx ionic build --prod
- npx cap sync ios
- xcodebuild -workspace ios/App/App.xcworkspace -scheme "App" -destination generic/platform=iOS -configuration Release archive -archivePath ios/App.xcarchive MARKETING_VERSION=$VERSION CURRENT_PROJECT_VERSION=$CI_PIPELINE_ID -allowProvisioningUpdates
- xcodebuild -exportArchive -archivePath ios/App.xcarchive -exportOptionsPlist exportOptions.plist -exportPath ios/ -allowProvisioningUpdates
- xcrun altool --upload-app -f ios/App.ipa -u $IOS_USERNAME -p $IOS_PASSWORD
artifacts:
paths:
- ios/App.ipa
- ios/App.xcarchive
tags:
- ios
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10
FROM node:14

# See https://crbug.com/795759
RUN apt-get update && apt-get install -yq libgconf-2-4 bzip2 build-essential libxtst6
Expand Down
13 changes: 5 additions & 8 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,10 @@ dependencies {
implementation 'com.scottyab:rootbeer-lib:0.0.7'
}


apply from: 'capacitor.build.gradle'

try {
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
}
} catch(Exception e) {
logger.warn("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}
configurations.all {
exclude group: 'com.google.firebase', module: ''
exclude group: 'com.google.android.gms', module: ''
}
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ class SecurityUtils : Plugin() {
* Secure Screen
*/

@PluginMethod
fun waitForOverlayDismiss(call: PluginCall) {
call.resolve()
}

@PluginMethod
fun setWindowSecureFlag(call: PluginCall) {
with (activity) {
Expand Down
Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Tue Jan 30 13:14:22 CST 2018
#Tue Sep 22 11:57:34 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionSha256Sum=10065868c78f1207afb3a92176f99a37d753a513dff453abb6b5cceda4058cda
Loading

0 comments on commit 32c980c

Please sign in to comment.