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!302
  • Loading branch information
godenzim committed Nov 19, 2021
2 parents abbed94 + 73198e9 commit cb039b5
Show file tree
Hide file tree
Showing 25 changed files with 353 additions and 222 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ jobs:

strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest']
os: ['ubuntu-latest']

steps:
- uses: actions/checkout@v2

- name: 🔧 Installation of dependencies
run: npm run install-test-dependencies && npm ci
run: yarn run install-test-dependencies && yarn install # This is only for tests, so no frozen lockfile needed

- name: 🧪 Test CI
run: npm run test-ci
run: yarn run test-ci

- name: 🧪 Lint CI
run: npm run lint-ci
run: yarn run lint-ci

- name: 📦 Upload Artifact
uses: actions/upload-artifact@v2
Expand All @@ -70,17 +70,17 @@ jobs:

strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest']
os: ['ubuntu-latest']

steps:
- uses: actions/checkout@v2

- name: 🔧 Installation of dependencies
run: npm run install-build-dependencies && npm ci
run: yarn run install-build-dependencies && yarn install --frozen-lockfile

- name: 🔧 Installation of electron dependencies
working-directory: ${{ env.electron_folder }}
run: npm ci
run: yarn install --frozen-lockfile

- name: 🌀 Updating android version
run: sed -i -e 's/versionName "0.0.0"/versionName "${{ needs.environment.outputs.package_version }}"/g' android/app/build.gradle
Expand All @@ -103,7 +103,7 @@ jobs:

strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest']
os: ['ubuntu-latest']

steps:
- name: 🧠 Using prebuild cache
Expand All @@ -114,7 +114,7 @@ jobs:
key: prebuild-${{ runner.os }}-${{ github.sha }}

- name: 🏗️ Build
run: npm run build:electron:prod
run: yarn run build:electron:prod

- name: 🔄 Copy to Electron
run: npx cap sync electron
Expand All @@ -140,13 +140,13 @@ jobs:
key: prebuild-${{ runner.os }}-${{ github.sha }}

- name: 🔧 Disable pure getters
run: npm run disable-pure-getters
run: yarn run disable-pure-getters

- name: 🔧 Configure mangle
run: npm run configure-mangle
run: yarn run configure-mangle

- name: 🔧 Apply diagnostic modules
run: npm run apply-diagnostic-modules
run: yarn run apply-diagnostic-modules

- name: 🏗️ Build
run: npx ionic build --prod
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
- name: 🏗️ Build Windows
working-directory: ${{ env.electron_folder }}
run: npm run build:windows
run: yarn run build:windows

- name: 📦 Upload Artifact
uses: actions/upload-artifact@v2
Expand All @@ -213,11 +213,11 @@ jobs:
id: build-electron-cache
with:
path: ./*
key: electron-${{ runner.os }}-${{ github.sha }}
key: electron-Linux-${{ github.sha }}

- name: 🏗️ Build Mac
working-directory: ${{ env.electron_folder }}
run: npm run build:mac
run: yarn run build:mac

- name: 📦 Upload Artifact
uses: actions/upload-artifact@v2
Expand All @@ -242,7 +242,7 @@ jobs:

- name: 🏗️ Build Linux
working-directory: ${{ env.electron_folder }}
run: npm run build:linux
run: yarn run build:linux

- name: 📦 Upload Artifact
uses: actions/upload-artifact@v2
Expand All @@ -268,7 +268,7 @@ jobs:
- name: ⚙️ Setup Java
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: '11'

- name: 🔨 Clean Project
run: android/gradlew --project-dir android clean build
Expand Down Expand Up @@ -300,7 +300,7 @@ jobs:
id: build-angular-cache
with:
path: ./*
key: ionic-${{ runner.os }}-${{ github.sha }}
key: ionic-Linux-${{ github.sha }}
# - name: 🔨 Xcode Task
# run: xcodebuild -workspace ios/App/App.xcworkspace -scheme "App" -destination generic/platform=iOS -configuration Release archive -archivePath ios/App.xcarchive MARKETING_VERSION=${{ needs.environment.outputs.package_version }} CURRENT_PROJECT_VERSION=${{ needs.environment.outputs.package_version }} -allowProvisioningUpdates
# - name: 🔨 Xcode Task
Expand Down
31 changes: 4 additions & 27 deletions .github/workflows/netflify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,46 +16,23 @@ jobs:
with:
node-version: ${{ env.node_version }}

test:
name: 🧪 Test
runs-on: ubuntu-latest
needs: environment

steps:
- uses: actions/checkout@v2

- name: 🔧 Installation of dependencies
run: npm run install-test-dependencies && npm ci

- name: 🧪 Test CI
run: npm run test-ci

- name: 🧪 Lint CI
run: npm run lint-ci

- name: 📦 Upload Artifact
uses: actions/upload-artifact@v2
with:
name: '${{ runner.os }} - Lint Report'
path: ./lintReport.json

build:
runs-on: ubuntu-latest
needs: [environment, test]
needs: [environment]

steps:
# Checkout repo
- uses: actions/checkout@v2

- name: Prepare
run: npm ci
run: yarn install --frozen-lockfile

- name: Install Netlify
run: npm install netlify-cli
run: yarn add netlify-cli

# We use the "no-sapling" build so the 50 MB parameters file isn't downloaded
- name: Build site
run: npm run build:no-sapling
run: yarn run build:no-sapling

# Deploy the site with netlify-cli
- name: Deploy Site
Expand Down
1 change: 1 addition & 0 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies {
implementation project(':capacitor-app')
implementation project(':capacitor-app-launcher')
implementation project(':capacitor-clipboard')
implementation project(':capacitor-filesystem')
implementation project(':capacitor-splash-screen')
implementation project(':capacitor-status-bar')
implementation "com.android.support:support-v4:26.+"
Expand Down
4 changes: 4 additions & 0 deletions android/app/src/main/assets/capacitor.plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"pkg": "@capacitor/clipboard",
"classpath": "com.capacitorjs.plugins.clipboard.ClipboardPlugin"
},
{
"pkg": "@capacitor/filesystem",
"classpath": "com.capacitorjs.plugins.filesystem.FilesystemPlugin"
},
{
"pkg": "@capacitor/splash-screen",
"classpath": "com.capacitorjs.plugins.splashscreen.SplashScreenPlugin"
Expand Down
3 changes: 3 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ project(':capacitor-app-launcher').projectDir = new File('../node_modules/@capac
include ':capacitor-clipboard'
project(':capacitor-clipboard').projectDir = new File('../node_modules/@capacitor/clipboard/android')

include ':capacitor-filesystem'
project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android')

include ':capacitor-splash-screen'
project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capacitor/splash-screen/android')

Expand Down
66 changes: 19 additions & 47 deletions build/android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,15 @@ ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
RUN mkdir /app
WORKDIR /app

RUN yarn global add [email protected] @capacitor/[email protected] @capacitor/[email protected]
RUN yarn cache clean --force
RUN yarn global add n
RUN n 15.14.0
RUN yarn global add [email protected] @capacitor/[email protected] @capacitor/[email protected] && yarn cache clean --force && yarn global add n && n 15.14.0

# Install app dependencies, using wildcard if package-lock exists
COPY package.json /app/package.json
COPY yarn.lock /app/yarn.lock
# Install app dependencies, using wildcard if package-lock exists and copy capacitor configs and ionic configs
COPY package.json yarn.lock apply-diagnostic-modules.js capacitor.config.ts ionic.config.json /app
COPY config /app/config
COPY apply-diagnostic-modules.js /app

# install dependencies
RUN yarn install --frozen-lockfile

# copy capacitor configs and ionic configs
COPY capacitor.config.ts /app/capacitor.config.ts
COPY ionic.config.json /app/ionic.config.json

RUN mkdir www

# run ionic android build
RUN ionic info
RUN yarn install --frozen-lockfile && mkdir www && ionic info

# Bundle app source
COPY . /app
Expand All @@ -48,45 +35,30 @@ ARG BUILD_NR
RUN sed -i -e "s/versionCode 1/versionCode $BUILD_NR/g" /app/android/app/build.gradle

# disable pure getters due to https://github.com/angular/angular-cli/issues/11439
RUN yarn disable-pure-getters

# configure mangle (keep_fnames) for bitcoinjs https://github.com/bitcoinjs/bitcoinjs-lib/issues/959
RUN yarn configure-mangle

# remove unused cordova-diagnostic-plugin features
RUN yarn apply-diagnostic-modules

# jetify dependencies
RUN yarn jetifier

# build ionic
RUN ionic build --prod

# copy ionic build
RUN cap sync android

# accept licenses
RUN echo y | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --update

# clean project
RUN /app/android/gradlew --project-dir /app/android clean

# build apk
RUN /app/android/gradlew --project-dir /app/android build

# copy release-apk
RUN cp /app/android/app/build/outputs/apk/release/app-release-unsigned.apk android-release-unsigned.apk
# this has nothing to do with debug!!!:
RUN cp android-release-unsigned.apk android-debug.apk

# copy release-apk
RUN cp /app/android/app/build/outputs/apk/appium/app-appium-unsigned.apk android-appium-unsigned.apk

RUN cp android-appium-unsigned.apk android-appium.apk


# sign using debug key
RUN jarsigner -verbose -keystore ./build/android/debug.keystore -storepass android -keypass android android-debug.apk androiddebugkey

# sign using debug key
RUN jarsigner -verbose -keystore ./build/android/debug.keystore -storepass android -keypass android android-appium.apk androiddebugkey
RUN yarn disable-pure-getters \
&& yarn configure-mangle \
&& yarn apply-diagnostic-modules \
&& yarn jetifier \
&& ionic build --prod \
&& cap sync android \
&& echo y | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --update \
&& /app/android/gradlew --project-dir /app/android clean \
&& /app/android/gradlew --project-dir /app/android build \
&& cp /app/android/app/build/outputs/apk/release/app-release-unsigned.apk android-release-unsigned.apk \
&& cp android-release-unsigned.apk android-debug.apk \
&& cp /app/android/app/build/outputs/apk/appium/app-appium-unsigned.apk android-appium-unsigned.apk \
&& cp android-appium-unsigned.apk android-appium.apk \
&& jarsigner -verbose -keystore ./build/android/debug.keystore -storepass android -keypass android android-debug.apk androiddebugkey \
&& jarsigner -verbose -keystore ./build/android/debug.keystore -storepass android -keypass android android-appium.apk androiddebugkey
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"apply-diagnostic-modules": "node apply-diagnostic-modules.js"
},
"dependencies": {
"@airgap/angular-core": "0.0.20",
"@airgap/angular-ngrx": "0.0.20",
"@airgap/coinlib-core": "0.12.2",
"@airgap/angular-core": "0.0.21",
"@airgap/angular-ngrx": "0.0.21",
"@airgap/coinlib-core": "0.12.3",
"@airgap/sapling-wasm": "0.0.6",
"@angular/common": "^11.2.9",
"@angular/core": "^11.2.9",
Expand All @@ -52,6 +52,7 @@
"@capacitor/app-launcher": "^1.0.6",
"@capacitor/clipboard": "^1.0.5",
"@capacitor/core": "^3.2.5",
"@capacitor/filesystem": "1.0.6",
"@capacitor/ios": "^3.2.5",
"@capacitor/splash-screen": "^1.1.5",
"@capacitor/status-bar": "^1.0.5",
Expand Down
4 changes: 4 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ const routes: Routes = [
path: 'secret-generate-coin-flip',
loadChildren: () =>
import('./pages/secret-generate-coin-flip/secret-generate-coin-flip.module').then((m) => m.SecretGenerateCoinFlipPageModule)
},
{
path: 'error-history',
loadChildren: () => import('./pages/error-history/error-history.module').then((m) => m.ErrorHistoryPageModule)
}
]

Expand Down
5 changes: 4 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
SerializerService,
SPLASH_SCREEN_PLUGIN,
STATUS_BAR_PLUGIN,
FILESYSTEM_PLUGIN,
UiEventService
} from '@airgap/angular-core'
import { AirGapAngularNgRxModule } from '@airgap/angular-ngrx'
Expand Down Expand Up @@ -62,6 +63,7 @@ import { SecureStorageService } from './services/secure-storage/secure-storage.s
import { ShareUrlService } from './services/share-url/share-url.service'
import { StartupChecksService } from './services/startup-checks/startup-checks.service'
import { VaultStorageService } from './services/storage/storage.service'
import { Filesystem } from '@capacitor/filesystem'

export function createTranslateLoader(http: HttpClient): AirGapTranslateLoader {
return new AirGapTranslateLoader(http, { prefix: './assets/i18n/', suffix: '.json' })
Expand Down Expand Up @@ -108,6 +110,7 @@ export function createTranslateLoader(http: HttpClient): AirGapTranslateLoader {
{ provide: APP_LAUNCHER_PLUGIN, useValue: AppLauncher },
{ provide: CAMERA_PREVIEW_PLUGIN, useValue: CameraPreview },
{ provide: CLIPBOARD_PLUGIN, useValue: Clipboard },
{ provide: FILESYSTEM_PLUGIN, useValue: Filesystem },
{ provide: SAPLING_PLUGIN, useValue: SaplingNative },
{ provide: SECURITY_UTILS_PLUGIN, useValue: SecurityUtils },
{ provide: SPLASH_SCREEN_PLUGIN, useValue: SplashScreen },
Expand Down Expand Up @@ -162,4 +165,4 @@ export function createTranslateLoader(http: HttpClient): AirGapTranslateLoader {
],
bootstrap: [AppComponent]
})
export class AppModule {}
export class AppModule { }
Loading

0 comments on commit cb039b5

Please sign in to comment.