Skip to content

Commit 325477d

Browse files
committed
v1.1.0: Android 34, minor UI improvements and null-safety migration
1 parent 90b5341 commit 325477d

33 files changed

+1559
-1324
lines changed

.gitattributes

-6
This file was deleted.

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
.buildlog/
99
.history
1010
.svn/
11+
.fvm/
1112

1213
# IntelliJ related
1314
*.iml
@@ -43,4 +44,8 @@ app.*.map.json
4344
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
4445
android/key.properties
4546

46-
*.keystore
47+
*.keystore
48+
49+
*.bat
50+
*.old
51+
*.so

.vscode/settings.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"dart.flutterSdkPath": ".fvm/flutter_sdk",
3+
"dart.flutterSdkPaths": ["E:/SDK/fvm/versions"],
4+
"search.exclude": {
5+
"**/.fvm": true
6+
},
7+
// Remove from file watching
8+
"files.watcherExclude": {
9+
"**/.fvm": true
10+
},
11+
"dart.sdkPath": ".fvm/flutter_sdk",
12+
}

.vscode/tasks.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"label": "Generate Moor Database schema",
88
"type": "shell",
9-
"command": "flutter packages pub run build_runner build"
9+
"command": "fvm flutter packages pub run build_runner build"
1010
},
1111

1212
]

README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ Developped by [*Maxime BEASSE*](https://twitter.com/maxime_beasse) and [*Quentin
1313

1414
In partnership with [FrenchKey](https://intrusion.eu/en/home/) and [CNS](https://www.esiea.fr/expertise-confiance-numerique-securite/) from [ESIEA](https://www.esiea.fr/).
1515

16-
Powered by [Flutter](https://flutter.dev) and [OpenCV (4.3.0)](https://opencv.org/)
16+
Powered by [Flutter (3.13.6)](https://flutter.dev) and [OpenCV (4.3.0)](https://opencv.org/)
1717

1818
<p align="center">
1919
<img src="https://lh3.googleusercontent.com/A_Xf4iP53YZ1-LiREhA-F8Zc60vKMGVieNlORz-UP--VNtGgTxQK03jlxDfWUi2SqHc">
2020
</p>
2121

2222
# Summary
2323

24-
<!--ts-->
24+
<!-- ts -->
2525
* [KeyDecoder](#keydecoder)
2626
* [Summary](#summary)
2727
* [Disclamer](#disclamer)
@@ -71,11 +71,12 @@ If you want to protect yourself from having your keys duplicated without your co
7171

7272
## Build
7373

74-
* Download [Flutter SDK](https://flutter.dev/docs/get-started/install)
74+
* To install Flutter, it is recommended to use [fvm](https://fvm.app/), a Flutter Version Management tool. But you can also use the official [Flutter installation guide](https://flutter.dev/docs/get-started/install).
75+
* The project is built using Flutter `v3.13.6`
7576

7677
### Android
7778

78-
* Download [OpenCV v4.3.0](https://sourceforge.net/projects/opencvlibrary/)
79+
* Download [OpenCV-Android-SDK v4.3.0](https://sourceforge.net/projects/opencvlibrary/files/4.3.0/opencv-4.3.0-android-sdk.zip) and extract it to a directory of your choice. (eg. `C:\SDK\OpenCV-android-sdk`)
7980
* Create the `local.properties` file under `android/`, providing the following settings :
8081
```sdk.dir=<Android SDK path>
8182
flutter.sdk=<Flutter SDK path>
@@ -84,7 +85,8 @@ flutter.versionName=1.0.0
8485
flutter.versionCode=1
8586
opencv.sdk=<OpenCV Android SDK path>
8687
```
87-
* Build the project using `flutter build apk`
88+
* Copy the subdirectories in `C:\...\OpenCV-android-sdk\sdk\native\libs` to the directory `C:\...\keydecoder\android\app\src\main\jniLibs`
89+
* Build the project using `fvm flutter build apk`
8890

8991
### IOS
9092

android/app/build.gradle

+10-7
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ apply plugin: 'kotlin-android'
3434
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
3535

3636
android {
37-
compileSdkVersion 29
37+
namespace "com.keydecoder"
38+
compileSdkVersion 34
39+
ndkVersion flutter.ndkVersion
3840

3941
sourceSets {
4042
main.java.srcDirs += 'src/main/kotlin'
@@ -45,10 +47,9 @@ android {
4547
}
4648

4749
defaultConfig {
48-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4950
applicationId "com.keydecoder"
50-
minSdkVersion 21
51-
targetSdkVersion 29
51+
minSdkVersion flutter.minSdkVersion
52+
targetSdkVersion flutter.targetSdkVersion
5253
versionCode flutterVersionCode.toInteger()
5354
versionName flutterVersionName
5455

@@ -69,7 +70,7 @@ android {
6970
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
7071
storePassword keystoreProperties['storePassword']
7172
}
72-
}
73+
}
7374

7475
buildTypes {
7576
release {
@@ -84,13 +85,15 @@ android {
8485
path file('../../native_cv/CMakeLists.txt')
8586
}
8687
}
88+
89+
packagingOptions {
90+
pickFirst '**/libopencv_java4.so'
91+
}
8792
}
8893

8994
flutter {
9095
source '../..'
9196
}
9297

9398
dependencies {
94-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
95-
9699
}

android/app/src/main/AndroidManifest.xml

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<activity
1616
android:name="io.flutter.embedding.android.FlutterActivity"
1717
android:launchMode="singleTop"
18+
android:exported="true"
1819
android:theme="@style/LaunchTheme"
1920
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
2021
android:hardwareAccelerated="true"
@@ -48,4 +49,13 @@
4849
android:name="flutterEmbedding"
4950
android:value="2" />
5051
</application>
52+
53+
<queries>
54+
<intent>
55+
<action android:name="android.intent.action.VIEW" />
56+
<category android:name="android.intent.category.BROWSABLE" />
57+
<data android:scheme="https" />
58+
</intent>
59+
</queries>
60+
5161
</manifest>

android/app/src/main/jniLibs/arm64-v8a/libopencv_java4.so

-3
This file was deleted.

android/app/src/main/jniLibs/armeabi-v7a/libopencv_java4.so

-3
This file was deleted.

android/app/src/main/jniLibs/x86/libopencv_java4.so

-3
This file was deleted.

android/app/src/main/jniLibs/x86_64/libopencv_java4.so

-3
This file was deleted.

android/build.gradle

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.3.50'
2+
ext.kotlin_version = '1.8.10'
33
repositories {
44
google()
55
jcenter()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.5.0'
9+
classpath 'com.android.tools.build:gradle:7.1.2'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}
@@ -21,11 +21,9 @@ allprojects {
2121
rootProject.buildDir = '../build'
2222
subprojects {
2323
project.buildDir = "${rootProject.buildDir}/${project.name}"
24-
}
25-
subprojects {
2624
project.evaluationDependsOn(':app')
2725
}
2826

29-
task clean(type: Delete) {
27+
tasks.register("clean", Delete) {
3028
delete rootProject.buildDir
3129
}

android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip

0 commit comments

Comments
 (0)