Skip to content

Commit

Permalink
v1.1.0: Android 34, minor UI improvements and null-safety migration
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximeBeasse committed Feb 4, 2024
1 parent 90b5341 commit 325477d
Show file tree
Hide file tree
Showing 33 changed files with 1,559 additions and 1,324 deletions.
6 changes: 0 additions & 6 deletions .gitattributes

This file was deleted.

7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.buildlog/
.history
.svn/
.fvm/

# IntelliJ related
*.iml
Expand Down Expand Up @@ -43,4 +44,8 @@ app.*.map.json
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
android/key.properties

*.keystore
*.keystore

*.bat
*.old
*.so
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"dart.flutterSdkPath": ".fvm/flutter_sdk",
"dart.flutterSdkPaths": ["E:/SDK/fvm/versions"],
"search.exclude": {
"**/.fvm": true
},
// Remove from file watching
"files.watcherExclude": {
"**/.fvm": true
},
"dart.sdkPath": ".fvm/flutter_sdk",
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"label": "Generate Moor Database schema",
"type": "shell",
"command": "flutter packages pub run build_runner build"
"command": "fvm flutter packages pub run build_runner build"
},

]
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ Developped by [*Maxime BEASSE*](https://twitter.com/maxime_beasse) and [*Quentin

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/).

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

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

# Summary

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

## Build

* Download [Flutter SDK](https://flutter.dev/docs/get-started/install)
* 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).
* The project is built using Flutter `v3.13.6`

### Android

* Download [OpenCV v4.3.0](https://sourceforge.net/projects/opencvlibrary/)
* 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`)
* Create the `local.properties` file under `android/`, providing the following settings :
```sdk.dir=<Android SDK path>
flutter.sdk=<Flutter SDK path>
Expand All @@ -84,7 +85,8 @@ flutter.versionName=1.0.0
flutter.versionCode=1
opencv.sdk=<OpenCV Android SDK path>
```
* Build the project using `flutter build apk`
* Copy the subdirectories in `C:\...\OpenCV-android-sdk\sdk\native\libs` to the directory `C:\...\keydecoder\android\app\src\main\jniLibs`
* Build the project using `fvm flutter build apk`

### IOS

Expand Down
17 changes: 10 additions & 7 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 29
namespace "com.keydecoder"
compileSdkVersion 34
ndkVersion flutter.ndkVersion

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -45,10 +47,9 @@ android {
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.keydecoder"
minSdkVersion 21
targetSdkVersion 29
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName

Expand All @@ -69,7 +70,7 @@ android {
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
}

buildTypes {
release {
Expand All @@ -84,13 +85,15 @@ android {
path file('../../native_cv/CMakeLists.txt')
}
}

packagingOptions {
pickFirst '**/libopencv_java4.so'
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

}
10 changes: 10 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<activity
android:name="io.flutter.embedding.android.FlutterActivity"
android:launchMode="singleTop"
android:exported="true"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
Expand Down Expand Up @@ -48,4 +49,13 @@
android:name="flutterEmbedding"
android:value="2" />
</application>

<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
</queries>

</manifest>
3 changes: 0 additions & 3 deletions android/app/src/main/jniLibs/arm64-v8a/libopencv_java4.so

This file was deleted.

3 changes: 0 additions & 3 deletions android/app/src/main/jniLibs/armeabi-v7a/libopencv_java4.so

This file was deleted.

3 changes: 0 additions & 3 deletions android/app/src/main/jniLibs/x86/libopencv_java4.so

This file was deleted.

3 changes: 0 additions & 3 deletions android/app/src/main/jniLibs/x86_64/libopencv_java4.so

This file was deleted.

8 changes: 3 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.8.10'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -21,11 +21,9 @@ allprojects {
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
Loading

0 comments on commit 325477d

Please sign in to comment.