Skip to content

Commit

Permalink
Merge branch 'master' into cl/v1.10.7-fdroid
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/android/app/src/main/AndroidManifest.xml
#	app/lib/page-encointer/meetup/scan_claim_qr_code.dart
#	app/lib/page/qr_scan/qr_scan_page.dart
#	app/pubspec.lock
#	app/pubspec.yaml
  • Loading branch information
clangenb committed Oct 2, 2023
2 parents c5a6db7 + d4d689c commit 7165a34
Show file tree
Hide file tree
Showing 1,680 changed files with 18,076 additions and 21,039 deletions.
2 changes: 1 addition & 1 deletion .flutter
Submodule .flutter updated 3961 files
2 changes: 1 addition & 1 deletion .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [master, f-droid]

env:
NODE_VERSION: 16.13.1
NODE_VERSION: 18.14.2
JAVA_VERSION: 12.x

jobs:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/android_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [master, f-droid]

env:
NODE_VERSION: 16.13.1
NODE_VERSION: 18.14.2
JAVA_VERSION: 12.x
ARTIFACT_PATH: ./screenshots

Expand All @@ -29,7 +29,7 @@ jobs:
# lower api-levels would be supported but the webView that is pre-installed on these images does not.
api-level: [29] # 30 is broken for now, 29 is way too flaky
include:
- os: macos-latest
- os: macos-13
# needs to be the `id` from the devices given by `avdmanager list device`
device: "pixel_3a"
# disable for now. it takes ages to build and launch the app and the upper limit of
Expand Down Expand Up @@ -88,6 +88,7 @@ jobs:
- name: Start colima a docker runtime for MacOs
run: |
brew install docker
brew install colima
colima start
- name: Run encointer-node
Expand Down
51 changes: 37 additions & 14 deletions .github/workflows/ios_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ name: IOS CI

on:
push:
branches: [master, f-droid]
branches: [ master, f-droid ]
tags:
- "*"
pull_request:
branches: [master, f-droid]
branches: [ master, f-droid ]

env:
NODE_VERSION: 16.13.1
NODE_VERSION: 18.14.2
JAVA_VERSION: 12.x
ARTIFACT_PATH: ./screenshots

Expand All @@ -21,19 +23,26 @@ jobs:
access_token: ${{ secrets.GITHUB_TOKEN }}

ios_device_test:
runs-on: macos-latest
runs-on: macos-13
timeout-minutes: 60
strategy:
matrix:
# See up to date screenshots specifications for Appstores:
# https://developer.apple.com/help/app-store-connect/reference/screenshot-specifications/
include:
- device: "iPhone 11 Pro Max"
- device: "iPhone 14 Pro Max"
record_video: true
# With this flag we can run the CI against different node versions to check compatibility.
docker_tag: "1.5.1"
- device: "iPhone 8 Plus"
record_video: false
- device: "iPad Pro (12.9-inch) (3rd generation)"
docker_tag: "1.5.1"
- device: "iPad Pro (12.9-inch) (6th generation)"
record_video: false
docker_tag: "1.5.1"
- device: "iPad Pro (12.9-inch) (2nd generation)"
record_video: false
docker_tag: "1.5.1"
fail-fast: false
steps:
# Setup Environment
Expand All @@ -53,11 +62,17 @@ jobs:

- name: "Create Simulator if iPad Pro 2nd gen"
if: ${{ matrix.device == 'iPad Pro (12.9-inch) (2nd generation)' }}
run: xcrun simctl create "iPad Pro (12.9-inch) (2nd generation)" "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-" "com.apple.CoreSimulator.SimRuntime.iOS-16-2"
# Unfortunately it is not deterministic if the 16.2 or the 16.4 runtime is available
run: |
xcrun simctl create "iPad Pro (12.9-inch) (2nd generation)" "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-" "com.apple.CoreSimulator.SimRuntime.iOS-16-4" || \
xcrun simctl create "iPad Pro (12.9-inch) (2nd generation)" "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-" "com.apple.CoreSimulator.SimRuntime.iOS-16-2"
- name: "Create Simulator if iPad Pro 3rd gen"
if: ${{ matrix.device == 'iPad Pro (12.9-inch) (3rd generation)' }}
run: xcrun simctl create "iPad Pro (12.9-inch) (3rd generation)" "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---3rd-generation-" "com.apple.CoreSimulator.SimRuntime.iOS-16-2"
- name: "Create Simulator if iPad 8 Plus"
if: ${{ matrix.device == 'iPhone 8 Plus' }}
# Unfortunately it is not deterministic if the 16.2 or the 16.4 runtime is available
run: |
xcrun simctl create "iPhone 8 Plus" "com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus" "com.apple.CoreSimulator.SimRuntime.iOS-16-4" || \
xcrun simctl create "iPhone 8 Plus" "com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus" "com.apple.CoreSimulator.SimRuntime.iOS-16-2"
# JS Stuff
- uses: actions/setup-node@v3
Expand All @@ -76,22 +91,30 @@ jobs:
- name: Start colima a docker runtime for MacOs
run: |
brew install docker
brew install colima
colima start
- name: Run encointer-node
run: ./scripts/docker_run_encointer_node_notee.sh &
run: ./scripts/docker_run_encointer_node_notee.sh ${{ matrix.docker_tag }} &

- name: Bootstrap Demo Community
run: ./scripts/docker_run_encointer_client_bootstrap_demo_community.sh
run: ./scripts/docker_run_encointer_client_bootstrap_demo_community.sh ${{ matrix.docker_tag }}

- name: "Start Simulator"
working-directory: ./scripts
env:
DEVICE_ID: ${{ matrix.device }}
run: source ./ios_emulator.sh

# Run Tests
- name: "Flutter driver test and record video"
- name: Run integration tests with printscreens in all languages
if: startsWith(github.ref, 'refs/tags/')
run: ./scripts/multi_language_screenshot_ci_test.sh
env:
TEMP_DIR: ${{ env.ARTIFACT_PATH }}
RECORD: ${{ matrix.record_video }}

- name: Run integration tests with printscreens in en only
if: startsWith(github.ref , 'refs/tags/') != true
run: ./scripts/ios_integration_test.sh
env:
TEMP_DIR: ${{ env.ARTIFACT_PATH }}
Expand Down
33 changes: 30 additions & 3 deletions .github/workflows/js_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ on:
branches: [master, f-droid]

env:
NODE_VERSION: 16.13.1
NODE_VERSION: 18.14.2
JAVA_VERSION: 12.x

jobs:
integration-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
docker_tag: [ "1.5.1" ]
steps:
# Setup Environment
- uses: actions/checkout@v3
Expand All @@ -24,10 +27,10 @@ jobs:
node-version: ${{ env.NODE_VERSION }}

- name: Run encointer-node
run: ./scripts/docker_run_encointer_node_notee.sh &
run: ./scripts/docker_run_encointer_node_notee.sh ${{ matrix.docker_tag }} &

- name: Bootstrap Demo Community
run: ./scripts/docker_run_encointer_client_bootstrap_demo_community.sh
run: ./scripts/docker_run_encointer_client_bootstrap_demo_community.sh ${{ matrix.docker_tag }}

- name: Test JS
# We don't really have unit tests in the JS part. Most tests need a local node running.
Expand All @@ -36,6 +39,30 @@ jobs:
yarn install
yarn test
build-js:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
# Setup Environment
- uses: actions/checkout@v3

# JS Stuff
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Build JS
run: |
cd app/js_service_encointer
yarn install
yarn build
- name: "Upload JS binary"
uses: actions/upload-artifact@v3
with:
name: main.js
path: ./app/js_service_encointer/dist/main.js

e2e-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
- name: "Analyze Code"
run: ./flutterw pub global run melos analyze-check

- name: "Check translations"
run: |
cd app && ./../flutterw gen-l10n && cd ..
./scripts/check_translations.sh ./app/.untranslated-messages.txt
- name: "Run unit tests Encointer"
run: ./flutterw pub global run melos unit-test-app-exclude-encointer-node-e2e

Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,7 @@ app/android/fastlane/metadata/android/en-US/images/phoneScreenshots/
/source

# printscreens generated in tests
/screenshots
/screenshots

# Contains missing translations if any, otherwise it is an empty json: '{}'
app/.untranslated-messages.txt
8 changes: 7 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"version": "0.2.0",
"configurations": [
{
"name": "encointer-wallet-flutter",
"name": "encointer-wallet-flutter: Android",
"request": "launch",
"type": "dart",
"program": "app/lib/main.dart",
Expand All @@ -18,6 +18,12 @@
"lib/main.dart"
],
},
{
"name": "encointer-wallet-flutter: iOS",
"request": "launch",
"type": "dart",
"program": "app/lib/main.dart",
},
{
"name": "encointer-wallet-flutter (profile mode)",
"request": "launch",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"dart.flutterSdkPath": ".flutter",
"dart.lineLength": 120,
"git.ignoreLimitWarning": true,
"explorer.autoReveal": false,
"explorer.autoReveal": true,
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Encointer wallet and client for mobile phones
</p>

### Requirements
- Dart sdk: ">=2.19.0 <3.0.0"
- Flutter: "3.7.3"
- Dart sdk: ">=3.0.1 <3.0.0"
- Flutter: "3.13.0"
- Android: minSdkVersion 17
- iOS: --ios-language swift, Xcode version >= 14.0.0

Expand Down
12 changes: 12 additions & 0 deletions app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ android {
ndkVersion flutter.ndkVersion

compileOptions {
// Flag to enable support for the new language API, see #1165.
coreLibraryDesugaringEnabled true
// Older androids ( < API 26) use Java 7
// Sets Java compatibility to Java 8
// Needed to run JAVA 8 for backwards compatibility with Androids older than API 26, see #1165.
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Expand All @@ -43,6 +48,7 @@ android {
}

defaultConfig {
multiDexEnabled true
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "org.encointer.wallet"
// You can update the following values to match your application needs.
Expand Down Expand Up @@ -95,4 +101,10 @@ flutter {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.jakewharton.threetenabp:threetenabp:1.4.6'
// Fixes bug for newer ( > API 26) android versions
// Bug: Failed to transform window-java-1.0.0-beta04.jar (androidx.window:window-java:1.0.0-beta04)
implementation 'androidx.window:window:1.0.0'
implementation 'androidx.window:window-java:1.0.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}
7 changes: 6 additions & 1 deletion app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
android:icon="@mipmap/launcher_icon"
android:allowBackup="false"
android:usesCleartextTraffic="true">
<!-- android:name=".MainActivity": Android is run from MainActivity.kt file
We need MainActivity.kt to initialize AndroidThreeTen for older versions of android
-->
<activity
android:name="io.flutter.embedding.android.FlutterActivity"
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTask"
android:theme="@style/LaunchTheme"
Expand Down Expand Up @@ -41,6 +44,8 @@
android:value="2" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<!-- local_auth -->
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.encointer.wallet

import androidx.annotation.NonNull
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
import com.jakewharton.threetenabp.AndroidThreeTen

class MainActivity: FlutterFragmentActivity() {
// You do not need to override onCreate() in order to invoke
// GeneratedPluginRegistrant. Flutter now does that on your behalf.
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
// Initialize AndroidThreeTen for older versions of android instead
// of java.time, in API 26 or newer versions java.time is used
// older versions will use AndroidThreeTen
AndroidThreeTen.init(this);
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item>
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/android/app/src/main/res/drawable/app_icon.png
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 4 additions & 7 deletions app/android/app/src/main/res/drawable/launch_background.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />

<!-- You can insert your own image assets here -->
<item>
<bitmap
android:gravity="center"
android:src="@drawable/launcher_icon" />
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item>
</layer-list>
Binary file not shown.
22 changes: 22 additions & 0 deletions app/android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
Loading

0 comments on commit 7165a34

Please sign in to comment.