Commit 189d8a36 authored by CLOUARD Regis's avatar CLOUARD Regis
Browse files

Merge branch 'release3.0.0-ios' into 'master'

Release3.0.0 ios

See merge request rclouard/vikazimut-flutter!51
parents ba8052c7 71d49641
......@@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>9.0</string>
</dict>
</plist>
......@@ -368,7 +368,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
......@@ -383,6 +383,7 @@
PROVISIONING_PROFILE_SPECIFIER = "Vikazimut Provisioning Profile";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
......@@ -513,7 +514,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
......@@ -529,6 +530,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
......@@ -550,7 +552,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
......@@ -565,6 +567,7 @@
PROVISIONING_PROFILE_SPECIFIER = "Vikazimut Provisioning Profile";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Vikazimut</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Vikazimut</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NFCReaderUsageDescription</key>
<string>The NFC reader is used to validate a checkpoint when the checkpoint is equipped</string>
<key>NSCameraUsageDescription</key>
<string>The camera is used to validate a checkpoint from QR Code when the checkpoint is equipped</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Vikazimut needs access to location when in the background to validate checkpoint from location, record the GPS track, and perform route control even during a phone call or use of another apps.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location is used to automatically validate a checkpoint, display the track on map interactively or afterwards, and compute some statistics on your route.</string>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIStatusBarHidden</key>
<false/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>io.flutter.embedded_views_preview</key>
<true/>
</dict>
</plist>
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Vikazimut</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Vikazimut</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NFCReaderUsageDescription</key>
<string>The NFC reader is used to validate a checkpoint when the checkpoint is equipped</string>
<key>NSCameraUsageDescription</key>
<string>The camera is used to validate a checkpoint from QR Code when the checkpoint is equipped</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Vikazimut needs access to location when in the background to continue controlling the correct sequence of checkpoint visits and recording the GPS track even during a phone call or use of another apps.</string>
<key>NSLocationUsageDescription</key>
<string>Your location is used to check if you visited the correct sequence of checkpoints, show your live position on the map in the walk mode, and record the route you took to display at the end of the course the resulted track and some performance statistics.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location is used to check if you visited the correct sequence of checkpoints, show your live position on the map in the walk mode, and record the route you took to display at the end of the course the resulted track and some performance statistics.</string>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIStatusBarHidden</key>
<false/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>io.flutter.embedded_views_preview</key>
<true/>
</dict>
</plist>
\ No newline at end of file
......@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>NDEF</string>
......
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:math';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:archive/archive.dart';
import 'package:encrypt/encrypt.dart' as encrypt;
import 'package:flutter/material.dart';
import 'package:vikazimut/keys.dart';
import 'package:vikazimut/map/geodesic_point.dart';
import 'package:vikazimut/map/lat_lon_box.dart';
import 'layer.dart';
import 'map_scale_view.dart';
import 'read_encrypt_image.dart';
class MapView extends StatefulWidget {
final ui.Image _image;
......@@ -36,33 +32,8 @@ class MapView extends StatefulWidget {
return _state!;
}
// TODO Récupérer les sources de archive Apache 2.0 (LICENSE)
// TODO Récupérer les sources de encrypt BSD (LICENSE)
static Future<ui.Image> loadImage(File gzipFile) async {
final String data = await unarchive(gzipFile);
Uint8List imageData = await decryptFile(data);
final Completer<ui.Image> completer = Completer();
ui.decodeImageFromList(imageData, (ui.Image image) {
completer.complete(image);
});
return completer.future;
}
static Future<String> unarchive(File zippedFile) async {
final Uint8List bytes = zippedFile.readAsBytesSync();
try {
return String.fromCharCodes(GZipDecoder().decodeBytes(bytes));
} catch (e) {
throw new Exception("Bad image contents");
}
}
static Future<Uint8List> decryptFile(String encryptedBase64EncodedString) async {
var decoded = base64.decode(encryptedBase64EncodedString);
final key = encrypt.Key.fromBase64(Secret.key);
final iv = encrypt.IV.fromBase64(Secret.initializationVector);
final encrypter = encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.cbc));
return Uint8List.fromList(encrypter.decryptBytes(encrypt.Encrypted(decoded), iv: iv));
static Future<ui.Image> loadImage(File file) async {
return loadEncryptImage(file);
}
void onResume() {
......
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:archive/archive.dart';
import 'package:encrypt/encrypt.dart' as encrypt;
import 'package:vikazimut/keys.dart';
Future<ui.Image> loadEncryptImage(File gzipFile) async {
final String data = await _unarchive(gzipFile);
Uint8List imageData = await _decryptFile(data);
final Completer<ui.Image> completer = Completer();
ui.decodeImageFromList(imageData, (ui.Image image) {
completer.complete(image);
});
return completer.future;
}
Future<String> _unarchive(File zippedFile) async {
final Uint8List bytes = zippedFile.readAsBytesSync();
try {
return String.fromCharCodes(GZipDecoder().decodeBytes(bytes));
} catch (e) {
throw new Exception("Bad image contents");
}
}
Future<Uint8List> _decryptFile(String encryptedBase64EncodedString) async {
var decoded = base64.decode(encryptedBase64EncodedString);
final key = encrypt.Key.fromBase64(Secret.key);
final iv = encrypt.IV.fromBase64(Secret.initializationVector);
final encrypter = encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.cbc));
return Uint8List.fromList(encrypter.decryptBytes(encrypt.Encrypted(decoded), iv: iv));
}
......@@ -238,7 +238,7 @@ packages:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.1"
version: "6.1.2"
fixnum:
dependency: transitive
description:
......@@ -489,7 +489,7 @@ packages:
name: node_preamble
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.1"
package_config:
dependency: transitive
description:
......
......@@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 3.0.0+87
version: 3.0.0+88
environment:
sdk: ">=2.12.0 <3.0.0"
......@@ -39,6 +39,7 @@ dependencies:
xml: ^5.1.1
http: ^0.13.3
url_launcher: ^6.0.4
archive: ^3.1.2
encrypt: ^5.0.0
......@@ -50,7 +51,7 @@ dependencies:
focus_detector: ^2.0.0
badges: ^2.0.1
location: ^4.3.0
geolocator: ^7.1.0
flutter_compass: ^0.6.1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment